3 AC_INIT([cinelerra],[5.1],[mail@lists.cinelerra-gg.org])
5 # Put autogenerated stuff in subdir m4, which must be created
6 # externally. This macro must be set before calling AC_INIT_AUTOMAKE
8 AM_INIT_AUTOMAKE([foreign])
17 AC_CHECK_PROG(MAKEINFO,[makeinfo],[makeinfo],[no])
18 if test x"$MAKEINFO" == x"no" ; then
19 AC_MSG_ERROR([Please install texinfo])
22 AC_CHECK_PROG(GETTEXT,[gettext],[gettext],[no])
23 if test x"$GETTEXT" == x"no" ; then
24 AC_MSG_ERROR([Please install gettext])
27 AC_CHECK_PROG(LIBTOOL,[libtool],[libtool],[no])
28 if test x"$LIBTOOL" == x"no" ; then
29 AC_MSG_ERROR([Please install libtool])
32 CFG_CFLAGS+=" -fno-omit-frame-pointer -fno-math-errno -fno-signed-zeros"
33 CFG_CFLAGS+=" -pthread -Wall"
34 # misguided pedantic warnings
35 # this is extra work, not a gain...
36 #CFG_CFLAGS+=" -Wno-unknown-warning-option"
37 CFG_CFLAGS+=" -Wno-attributes"
38 CFG_CFLAGS+=" -Wno-unused-result"
39 CFG_CFLAGS+=" -Wno-stringop-overflow"
40 CFG_CFLAGS+=" -Wno-format-truncation"
41 CFG_CFLAGS+=" -Wno-format-overflow"
42 CFG_CFLAGS+=" -Wno-parentheses"
43 CFG_CFLAGS+=" -Wno-stringop-truncation"
44 CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
45 CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
46 CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
47 CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
48 CFG_CFLAGS+=" -I/usr/include -I/usr/local/include"
49 CFG_CFLAGS+=" -I/data/data/com.termux/files/usr/include/a52dec -I/usr/include/a52dec"
50 CFG_CFLAGS+=" -I/usr/include/freetype2 -I/usr/local/include/freetype2"
51 CFG_CFLAGS+=" -I/data/data/com.termux/files/usr/include/freetype2"
52 CFG_CFLAGS+=" -I/usr/include/uuid -I/usr/local/include/uuid"
53 CFG_CFLAGS+=" -I/data/data/com.termux/files/usr/include/uuid -I/usr/local/include/uuid"
54 CFG_CFLAGS+=" -I/usr/include/mjpegtools -I/usr/local/include/mjpegtools"
56 AC_DEFUN([CHECK_WITH], [
58 AS_HELP_STRING([--with-[$1]],[$2 ($4)]),
59 [WANT_$3=$withval], [WANT_$3='$4'])
63 CHECK_WITH([jobs],[parallel build jobs],[JOBS],[auto])
64 CHECK_WITH([exec-name],[binary executable name],[CIN],[cin])
65 CHECK_WITH([single-user],[to install cin in bin],[CINBIN_BUILD],[no])
66 CHECK_WITH([lv2],[lv2 library support],[LV2],[yes])
67 CHECK_WITH([cinlib],[cinelerra library path],[CINLIB_DIR],[auto])
68 CHECK_WITH([cindat],[cinelerra share path],[CINDAT_DIR],[auto])
69 CHECK_WITH([plugin-dir],[plugin install dir],[PLUGIN_DIR],[auto])
70 CHECK_WITH([ladspa-dir],[ladspa install dir],[LADSPA_DIR],[auto])
71 CHECK_WITH([ladspa-build],[build ladspa library],[LADSPA_BUILD],[yes])
72 CHECK_WITH([config-dir],[.bcast config dir],[CONFIG_DIR],[$$HOME/.bcast5])
73 CHECK_WITH([nested-dir],[nested proxy dir],[NESTED_DIR],[$$HOME/Videos])
74 CHECK_WITH([snap-dir],[snapshot/grabshot dir],[SNAP_DIR],[$$HOME/Pictures])
75 CHECK_WITH([browser],[cin_browser path],[CIN_BROWSER],[firefox])
76 CHECK_WITH([git-ffmpeg],[git ffmpeg using url],[GIT_FFMPEG],[no])
77 CHECK_WITH([noelision],[use noelision/libpthread],[NOELISION],[auto])
78 CHECK_WITH([booby],[window lock trace booby trap],[BOOBY],[no])
79 CHECK_WITH([libzmpeg],[build libzmpeg],[LIBZMPEG],[yes])
80 CHECK_WITH([libdpx],[build libdpx],[LIBDPX],[auto])
81 CHECK_WITH([commercial],[enable commercial capture],[COMMERCIAL],[no])
82 CHECK_WITH([thirdparty],[use thirdparty build],[CIN_3RDPARTY],[yes])
83 CHECK_WITH([shuttle],[shuttle device],[SHUTTLE],[yes])
84 CHECK_WITH([wintv],[usb 2040:826d wintv device],[WINTV],[yes])
85 CHECK_WITH([x10tv],[usb 0bc7:0004 X10 remote device],[X10TV],[yes])
86 CHECK_WITH([vaapi],[video acceleration api],[VAAPI],[yes])
87 CHECK_WITH([vdpau],[video decode+presentation api for unix],[VDPAU],[yes])
88 CHECK_WITH([nv],[nvenc/nvdec ffnvcodec api],[NV],[yes])
89 CHECK_WITH([cuda],[nv cuda plugins],[CUDA],[auto])
90 CHECK_WITH([clang],[use clang instead of gcc/g++],[CLANG],[no])
91 CHECK_WITH([filegif],[enable filegif i/o], [GIFLIB],[yes])
93 if test "x$WANT_LV2" != "xno"; then
94 GTK2_LIBS=`pkg-config --libs gtk+-2.0`
95 AC_CHECK_LIB([m], [gtk_init], [HAVE_gtk=yes], [HAVE_gtk=no], [$GTK2_LIBS])
96 test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --cflags gtk+-2.0`" && HAVE_gtk=no
97 test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --libs gtk+-2.0`" && HAVE_gtk=no
98 if test "x$HAVE_gtk" = "xno"; then
99 AC_MSG_ERROR([LV2 requires gtk+-2.0 support.])
103 if test "x$WANT_COMMERCIAL" = "xyes" -a "x$WANT_LIBZMPEG" != "xyes" ; then
104 AC_MSG_ERROR([commercial requires libzmpeg support.])
106 if test "x$WANT_VIDEO4LINUX2" = "xyes" -a "x$WANT_LIBZMPEG" != "xyes" ; then
107 AC_MSG_ERROR([video4linux2 currently requires libzmpeg support.])
109 if test "x$WANT_DVB" = "xyes" -a "x$WANT_LIBZMPEG" != "xyes" ; then
110 AC_MSG_ERROR([dvb currently requires libzmpeg support.])
113 if test "x$WANT_CINBIN_BUILD" = "xyes"; then
114 WANT_LOCALE_DIR='$$CIN_LIB/locale'
115 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR='$$CIN_PATH'
116 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR='$$CIN_PATH'
117 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR='$$CIN_LIB/plugins'
118 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR='$$CIN_LIB/ladspa'
120 lcldir=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
121 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
122 eval "dir=\"$localedir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
124 usrdat=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
125 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
126 eval "dir=\"$datadir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
128 usrlib=`test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"; \
129 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
130 eval "dir=\"$libdir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
132 test "x$usrlib" = "x/lib" -o "x$usrlib" = "x/usr/lib" -o \
133 "x$usrlib" = "x/usr/local/lib" -a -e "/usr/lib64" && \
134 test ! -e "/usr/lib" -o `ls -1 /usr/lib64 | wc -l` -gt `ls -1 /usr/lib | wc -l` && \
136 WANT_LOCALE_DIR="$lcldir"
137 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR="$usrdat/$WANT_CIN"
138 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR="$usrlib/$WANT_CIN"
139 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR="$WANT_CINLIB_DIR/plugins"
140 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR="$WANT_CINLIB_DIR/ladspa"
145 if test "x$WANT_LIBZMPEG" = "xyes"; then
146 CIN_INSTALLS+=" zmp_install"
147 CIN_UNINSTALLS+=" zmp_uninstall"
149 if test "x$WANT_COMMERCIAL" = "xyes"; then
150 CIN_INSTALLS+=" com_install"
151 CIN_UNINSTALLS+=" com_uninstall"
153 if test "x$WANT_LADSPA_BUILD" = "xyes"; then
154 CIN_INSTALLS+=" lad_install "
155 CIN_UNINSTALLS+=" lad_uninstall "
157 if test "x$WANT_LV2" = "xyes"; then
158 CIN_INSTALLS+=" lv2_install "
159 CIN_UNINSTALLS+=" lv2_uninstall "
161 AC_SUBST(CIN_INSTALLS)
162 AC_SUBST(CIN_UNINSTALLS)
164 if test "x$WANT_CINBIN_BUILD" = "xyes"; then
165 MAK_INSTALLS="dvl_install"
166 MAK_UNINSTALLS="dvl_uninstall"
168 MAK_INSTALLS=" sys_install"
169 MAK_UNINSTALLS="sys_uninstall"
171 AC_SUBST(MAK_INSTALLS)
172 AC_SUBST(MAK_UNINSTALLS)
174 if test "x$WANT_JOBS" = "xauto"; then
175 # CPUS=`grep -c "^proc" /proc/cpuinfo`
177 WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
189 AS_HELP_STRING([--enable-$1],[build $1 ($2)]),
190 [PKG_$1=$enableval], [PKG_$1=$2])
191 PKG_DEF([$1],[$3],[$4],[$5])
196 PKG_3RD([a52dec],[yes],
198 [ liba52/.libs/liba52.a ],
201 PKG_3RD([djbfft],[yes],
206 PKG_3RD([audiofile],[no],
208 [ libaudiofile/.libs/libaudiofile.a \
209 libaudiofile/modules/.libs/libmodules.a \
210 libaudiofile/alac/.libs/libalac.a ],
213 PKG_3RD([encore],[no],
215 [ \$(OBJDIR)/libencore.a ],
218 PKG_3RD([esound],[no],
224 PKG_3RD([ffmpeg],[yes],
226 [ libavutil/libavutil.a \
227 libavcodec/libavcodec.a \
228 libpostproc/libpostproc.a \
229 libavformat/libavformat.a \
230 libswscale/libswscale.a \
231 libavfilter/libavfilter.a \
232 libswresample/libswresample.a ],
235 if test "x$WANT_GIT_FFMPEG" != "xno" ; then
236 ver_ffmpeg="ffmpeg.git"
239 PKG_3RD([fftw],[auto],
242 libbench2/libbench2.a \
243 rdft/scalar/r2cb/.libs/librdft_scalar_r2cb.a \
244 rdft/scalar/r2r/.libs/librdft_scalar_r2r.a \
245 rdft/scalar/.libs/librdft_scalar.a \
246 rdft/scalar/r2cf/.libs/librdft_scalar_r2cf.a \
247 rdft/.libs/librdft.a \
249 reodft/.libs/libreodft.a \
250 dft/scalar/codelets/.libs/libdft_scalar_codelets.a \
251 dft/scalar/.libs/libdft_scalar.a \
253 kernel/.libs/libkernel.a \
254 simd-support/.libs/libsimd_support.a ],
257 PKG_3RD([flac],[auto],
259 [ src/libFLAC/.libs/libFLAC.a \
260 src/libFLAC++/.libs/libFLAC++.a \
261 src/share/replaygain_analysis/.libs/libreplaygain_analysis.a \
262 src/share/replaygain_synthesis/.libs/libreplaygain_synthesis.a \
263 src/share/grabbag/.libs/libgrabbag.a \
264 src/share/utf8/.libs/libutf8.a \
265 src/test_libs_common/.libs/libtest_libs_common.a ],
268 PKG_3RD([giflib],[yes],
274 PKG_DEF([ladspa], [ladspa-0.4.17], [], [])
276 PKG_3RD([lame],[auto],
278 [ libmp3lame/.libs/libmp3lame.a \
279 mpglib/.libs/libmpgdecoder.a ],
282 PKG_3RD([libavc1394],[auto],
284 [ libavc1394/.libs/libavc1394.a \
285 librom1394/.libs/librom1394.a \
286 common/.libs/libraw1394util.a ],
289 PKG_3RD([libraw1394],[auto],
291 [ src/.libs/libraw1394.a ],
294 PKG_3RD([libiec61883],[auto],
296 [ src/.libs/libiec61883.a ],
299 PKG_3RD([libdv],[auto],
301 [ libdv/.libs/libdv.a ],
304 PKG_3RD([libjpeg],[auto],
305 [libjpeg-turbo-2.1.5.1],
307 build/libturbojpeg.a ],
308 [ opt/libjpeg-turbo/include ])
310 PKG_3RD([opus],[auto],
315 PKG_3RD([openjpeg],[auto],
317 [ bin/libopenjp2.a ],
320 PKG_3RD([libogg],[auto],
322 [ src/.libs/libogg.a ],
325 PKG_3RD([libsndfile],[auto],
327 [ src/.libs/libsndfile.a \
328 src/.libs/libcommon.a \
329 src/G72x/.libs/libg72x.a \
330 src/GSM610/.libs/libgsm.a ],
333 PKG_3RD([libtheora],[auto],
335 [ lib/.libs/libtheora.a \
336 lib/.libs/libtheoradec.a \
337 lib/.libs/libtheoraenc.a ],
340 PKG_3RD([libuuid],[yes],
345 PKG_3RD([libvorbis],[auto],
347 [ lib/.libs/libvorbis.a \
348 lib/.libs/libvorbisenc.a \
349 lib/.libs/libvorbisfile.a ],
354 I86=[`expr "x$ARCH" : 'xi[346]86.*'`]
355 X86=[`expr "x$ARCH" : 'x..._64*'`]
357 if test "x$I86$X86" != "x00" ; then
359 PKG_3RD([mjpegtools],[yes],
361 [ utils/mmxsse/.libs/libmmxsse.a \
362 utils/.libs/libmjpegutils.a \
363 lavtools/.libs/liblavfile.a \
364 lavtools/.libs/liblavjpeg.a \
365 mplex/.libs/libmplex2.a \
366 yuvfilters/.libs/libyuvfilters.a \
367 mpeg2enc/.libs/libmpeg2encpp.a ],
368 [ . lavtools utils ])
372 PKG_3RD([mjpegtools],[yes],
374 [ utils/.libs/libmjpegutils.a \
375 lavtools/.libs/liblavfile.a \
376 lavtools/.libs/liblavjpeg.a \
377 mplex/.libs/libmplex2.a \
378 yuvfilters/.libs/libyuvfilters.a \
379 mpeg2enc/.libs/libmpeg2encpp.a ],
380 [ . lavtools utils ])
384 PKG_3RD([openexr],[auto],
386 [ usr/local/lib/libHalf.a \
387 usr/local/lib/libIex.a \
388 usr/local/lib/libIexMath.a \
389 usr/local/lib/libIlmThread.a \
390 usr/local/lib/libImath.a \
391 usr/local/lib/libIlmImf.a \
392 usr/local/lib/libIlmImfUtil.a ],
393 [ usr/local/include/OpenEXR ])
395 PKG_3RD([openExr],[auto], [openExr], [] [])
396 PKG_3RD([ilmBase],[auto], [ilmBase], [] [])
398 #PKG_3RD([festival],[no],
402 #PKG_3RD(speech_tools,[no],
407 PKG_3RD([tiff],[auto],
409 [ libtiff/.libs/libtiff.a \
410 libtiff/.libs/libtiffxx.a \
411 port/.libs/libport.a ],[
414 PKG_3RD([twolame],[auto],
416 [ libtwolame/.libs/libtwolame.a ],
419 PKG_3RD([x264],[auto],
424 PKG_3RD([x265],[auto],
429 PKG_3RD([libvpx],[auto],
434 PKG_3RD([lv2],[auto],
437 [ usr/local/include usr/local/lib64/lv2 usr/local/lib/lv2 ])
439 PKG_3RD([sratom],[auto],
441 [ usr/local/lib/libsratom-0.a ],
442 [ usr/local/include ])
444 PKG_3RD([serd],[auto],
446 [ usr/local/lib/libserd-0.a ],
447 [ usr/local/include ])
449 PKG_3RD([sord],[auto],
451 [ usr/local/lib/libsord-0.a ],
452 [ usr/local/include ])
454 PKG_3RD([lilv],[auto],
456 [ usr/local/lib/liblilv-0.a ],
457 [ usr/local/include ])
459 PKG_3RD([suil],[auto],
461 [ usr/local/lib/libsuil-0.a ],
462 [ usr/local/include ])
464 PKG_3RD([libaom],[auto],
466 [ usr/local/lib*/libaom*.a ],
467 [ usr/local/include ])
469 PKG_3RD([dav1d],[auto],
471 [ usr/local/lib*/libdav1d*.a ],
472 [ usr/local/include ])
474 PKG_3RD([libwebp],[auto],
476 [ usr/local/lib*/libwebp*.a \
477 usr/local/lib*/libsharpyuv*.a ],
478 [ usr/local/include/webp \
479 usr/local/include/ ])
481 PKG_3RD([ffnvcodec],[auto],
486 PKG_3RD([libdpx],[auto],
491 if test [ "$(uname -o)"] = "Android" ; then
493 PKG_3RD([libbthread],[auto],
500 AC_SUBST(STATIC_PKGS)
502 AC_DEFUN([CHECK_ENABLE], [
504 AS_HELP_STRING([--enable-[$1]],[$3 ([$4])]),
505 [WANT_$2=$enableval], [WANT_$2=[$4]])
508 CHECK_ENABLE([static-build], [STATIC_BUILD], [build static], [auto])
509 CHECK_ENABLE([x264_hidepth], [X264_HIDEPTH], [build x264 10bit], [no])
510 CHECK_ENABLE([x265_hidepth], [X265_HIDEPTH], [build x265 10bit], [no])
512 test "x$WANT_STATIC_BUILD" = "xauto" && WANT_STATIC_BUILD=$WANT_CINBIN_BUILD
514 AC_DEFUN([CHECK_PROG], [
515 AC_CHECK_PROG([PROG_$1], [$2], [yes],[no])
517 AC_DEFUN([REQUIRE_PROG], [
518 CHECK_PROG([$1],[$2])
519 if test "x$PROG_$1" = "xno"; then
520 AC_MSG_WARN([$2 is missing and required.])
527 I86=[`expr "x$ARCH" : 'xi[346]86.*'`]
528 X86=[`expr "x$ARCH" : 'x..._64*'`]
530 if test "x$I86$X86" != "x00" ; then
531 # Checks for ix86 programs.
532 REQUIRE_PROG(NASM, [nasm])
534 AC_MSG_CHECKING([nasm x264 compatible])
535 echo "vmovdqa32 [[eax]]{k1}{z}, zmm0" > conftest.asm
536 nasm conftest.asm -o conftest.o > /dev/null 2>&1
537 if test $? != 0 ; then
539 AC_MSG_WARN([libx264 built without assembly code])
540 X264_CFG_PARAMS="$X264_CFG_PARAMS --disable-asm"
544 rm -f conftest.asm conftest.o
545 REQUIRE_PROG(YASM, [yasm])
548 if test "x$I86$X86" == "x00"; then
549 CFG_CFLAGS+=" -DNO_CTX -DNO_GDB -DNO_BTRACE"
552 ## end arch dep tests
554 REQUIRE_PROG(OBJCOPY, [objcopy])
555 if test "x$FATAL_ERROR" != "x"; then
556 AC_MSG_ERROR("fatal eror.")
558 CHECK_PROG(PACTL, [pactl])
559 WANT_PACTL=$PROG_PACTL
561 AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
562 if test "$no_utf" = "yes"; then
563 AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
566 # Checks for headers/libraries.
568 AC_DEFUN([CHECK_HEADERS], [
569 if test "x$HAVE_$1" != "xno"; then
570 AC_CHECK_HEADER(m4_apply([m4_car],m4_split([$3])), [HAVE_$1=yes], [HAVE_$1=no],
571 [m4_foreach([i], m4_split([$3]), [[#include "]i["
574 AC_MSG_CHECKING([$2])
575 AC_MSG_RESULT([$HAVE_$1])
576 if test "x$HAVE_$1" = "xno"; then
577 if test "x$PKG_$1" = "x"; then RESULT=no; fi
582 AC_DEFUN([CHECK_LIB], [
583 if test "x$HAVE_$1" != "xno"; then
584 if test "x$PKG_$1" = "x" -o "x$WANT_STATIC_BUILD" = "xno" -a "x$PKG_$1" != "xno"; then
585 AC_CHECK_LIB([$2], [$3], [HAVE_$1=yes], [HAVE_$1=no], [$4])
587 if test "x$WANT_$1" != "xno"; then
588 if test "x$HAVE_$1" = "xyes"; then
589 if test "x$PKG_$1" = "x"; then
590 SYSTEM_LIBS+=" -l[$2]"
591 for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
594 for lib in [$4]; do SHARED_LIBS+=" $lib"; done
596 elif test "x$PKG_$1" = "x"; then
604 IMMATH_HEADERS=$(pkg-config --cflags Imath 2>/dev/null)
606 CHECK_LIB([X11], [X11], [XOpenDisplay])
607 CHECK_HEADERS([X11], [X11 headers], [X11/X.h X11/Xlib.h X11/Xutil.h X11/cursorfont.h])
608 CHECK_HEADERS([X11], [X11 headers], [X11/keysym.h X11/Sunkeysym.h X11/Xatom.h X11/XF86keysym.h])
609 CHECK_LIB([XEXT], [Xext], [XShmQueryExtension])
610 CHECK_HEADERS([XEXT], [Xlib XShm extention], [X11/Xlib.h X11/extensions/XShm.h X11/extensions/shape.h])
611 CHECK_LIB([XINERAMA], [Xinerama], [XineramaQueryExtension])
612 CHECK_HEADERS([XINERAMA], [Xinerama headers], [X11/extensions/Xinerama.h])
614 if test "x$HAVE_XINERAMA" != "xyes"; then
615 AC_MSG_ERROR([requires Xinerama support.])
618 CHECK_LIB([XFIXES], [Xfixes], [XFixesQueryVersion])
619 if test "x$HAVE_XFIXES" != "xyes"; then
620 AC_MSG_ERROR([requires XFixes support.])
623 CHECK_LIB([BZ2], [bz2], [BZ2_bzDecompress])
624 CHECK_LIB([FONTCONFIG], [fontconfig], [FcInit])
625 CHECK_LIB([FREETYPE], [freetype], [FT_Init_FreeType])
626 CHECK_LIB([LZMA], [lzma], [lzma_version_number])
627 CHECK_LIB([PNG], [png], [png_read_png])
628 CHECK_LIB([PTHREAD], [pthread], [pthread_create])
629 CHECK_LIB([Z], [z], [gzopen])
630 CHECK_LIB([fftw], [fftw3], [fftw_execute])
631 CHECK_HEADERS([fftw], [fftw headers], [fftw3.h])
632 CHECK_LIB([libuuid], [uuid], [uuid_clear])
633 CHECK_HEADERS([libuuid], [uuid headers], [uuid/uuid.h])
634 CHECK_HEADERS([LINUX_CDROM], [linux cdrom headers], [linux/cdrom.h linux/futex.h])
635 CHECK_HEADERS([LINUX_SYS], [linux sys], [sys/ioctl.h sys/stat.h sys/types.h sys/time.h sys/syscall.h])
636 CHECK_LIB([flac], [FLAC], [FLAC__stream_decoder_new])
637 CHECK_HEADERS([flac], [FLAC headers], [FLAC/stream_decoder.h])
638 CHECK_LIB([lame], [mp3lame], [lame_init])
639 CHECK_HEADERS([lame], [lame headers], [lame/lame.h])
640 CHECK_LIB([libjpeg], [jpeg], [jpeg_start_decompress])
641 CHECK_HEADERS([libjpeg], [jpeg headers], [stdio.h jpeglib.h])
642 CHECK_LIB([openjpeg], [openjp2], [opj_version])
643 CHECK_HEADERS([openjpeg], [openjpeg headers], [openjpeg.h])
644 CHECK_LIB([libsndfile], [sndfile], [sf_open])
645 CHECK_HEADERS([libsndfile], [sndfile headers], [sndfile.h])
646 CHECK_LIB([ilmbase], [IlmImf], [ImfOpenInputFile])
647 CHECK_HEADERS([ilmbase], [IlmImf headers], [OpenEXR/ImfCRgbaFile.h])
648 CHECK_LIB([Imath], [Imath], [ImfOpenInputFile])
649 CHECK_LIB([libvpx], [vpx], [vpx_codec_decode])
650 CHECK_HEADERS([libvpx], [vpx headers], [vpx/vpx_decoder.h])
651 CHECK_LIB([mjpegtools], [mjpegutils], [mjpeg_info])
652 CHECK_HEADERS([mjpegtools], [mjpegtools headers], [mjpegtools/mjpeg_types.h])
653 CHECK_LIB([tiff], [tiff], [TIFFOpen])
654 CHECK_HEADERS([tiff], [tiff headers], [tiff.h tiffio.h])
655 CHECK_LIB([twolame], [twolame], [twolame_encode_buffer_float32_interleaved])
656 CHECK_HEADERS([twolame], [twolame headers], [twolame.h])
657 CHECK_LIB([x264], [x264], [x264_encoder_encode])
658 CHECK_HEADERS([x264], [x264 headers], [stdint.h x264.h])
659 CHECK_LIB([x265], [x265], [x265_encoder_encode])
660 CHECK_HEADERS([x265], [x265 headers], [x265.h])
661 CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
662 CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])
663 CHECK_LIB([libaom], [aom], [aom_codec_version])
664 CHECK_HEADERS([libaom], [libaom headers], [aom/aom.h])
665 CHECK_LIB([dav1d], [dav1d], [dav1d_version])
666 CHECK_HEADERS([dav1d], [libdav1d headers], [dav1d/dav1d.h])
667 CHECK_LIB([libwebp], [webp], [WebPGetEncoderVersion])
668 CHECK_HEADERS([libwebp], [libwebp headers], [webp/encode.h])
669 CHECK_LIB([a52dec], [a52], [a52_init])
670 CHECK_HEADERS([a52dec], [a52 headers], [stdint.h a52dec/a52.h])
671 CHECK_LIB([encore], [encore], [encore])
672 CHECK_HEADERS([encore], [encore headers], [encore.h])
673 CHECK_LIB([giflib], [gif], [DGifOpen])
674 CHECK_HEADERS([giflib], [gif lib headers], [gif_lib.h])
675 CHECK_LIB([jbig], [jbig], [jbg_dec_init])
677 CHECK_LIB([VDPAU], [vdpau], [vdp_device_create_x11])
678 if test "x$HAVE_VDPAU" != "xyes" -a "x$WANT_VDPAU" = "xyes"; then
679 AC_MSG_ERROR([requires vdpau support.])
682 CHECK_LIB([VAAPI], [va], [vaInitialize])
683 if test "x$HAVE_VAAPI" = "xyes" -a "x$WANT_VAAPI" != "xno"; then
684 CHECK_HEADERS([vaapi_x11], [va x11 headers], [va/va_x11.h])
685 CHECK_LIB([vaapi_x11], [va-x11], [vaGetDisplay])
686 CHECK_HEADERS([vaapi_drm], [va drm headers], [va/va_drm.h])
687 CHECK_LIB([vaapi_drm], [va-drm], [vaGetDisplayDRM])
689 if test "x$HAVE_VAAPI" != "xyes" -a "x$WANT_VAAPI" = "xyes"; then
690 AC_MSG_ERROR([requires vaapi support.])
693 #CHECK_LIB([NVENC], [nvidia-encode], [NvEncodeAPICreateInstance])
695 #if test "x$HAVE_mjpegtools" = "xyes"; then
696 #CFG_CFLAGS+=" -I/usr/include/mjpegtools -I/usr/local/include/mjpegtools"
699 AC_DEFUN([CHECK_WANT], [
702 AC_ARG_WITH(m4_tolower([$1]),
703 AS_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))],[$3 (auto)]),
704 [WANT_$1=$withval],[WANT_$1=$2])
706 if test "x$WANT_$1" = "xauto" ; then
708 elif test "x$WANT_$1" = "xyes" ; then
709 if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then
710 AC_MSG_ERROR([required for $1 support.])
717 CHECK_WANT([GL], [auto], [use opengl], [
718 CHECK_LIB([GL], [GL], [glUseProgram])
719 CHECK_LIB([GL], [GLU], [gluOrtho2D])
720 CHECK_HEADERS([GL], [opengl headers], [GL/gl.h GL/glext.h GL/glu.h GL/glx.h])])
722 CHECK_WANT([XV], [auto], [use xv], [
723 CHECK_LIB([xv], [Xv], [XvQueryExtension])
724 CHECK_HEADERS([xv], [Xlib Xv extention], [X11/Xlib.h X11/extensions/Xvlib.h])])
726 CHECK_WANT([OSS], [auto], [use OSS audio], [
727 CHECK_HEADERS([OSS], [oss headers], [sys/soundcard.h])])
729 CHECK_WANT([XFT], [auto], [use libXft], [
730 CHECK_LIB([XFT], [Xft], [XftInit])
731 CHECK_HEADERS([XFT], [Xft/freetype headers], [X11/Xlib.h X11/Xft/Xft.h])])
733 CHECK_WANT([ALSA], [auto], [use libasound/alsa], [
734 CHECK_LIB([ALSA], [asound], [snd_pcm_open])
735 CHECK_HEADERS([ALSA], [asound headers], [alsa/asoundlib.h])])
737 CHECK_WANT([OGG], [auto], [use ogg/theora/vorbis], [
738 CHECK_LIB([libogg], [ogg], [ogg_stream_init])
739 CHECK_HEADERS([libogg], [ogg headers], [ogg/ogg.h])
740 CHECK_LIB([libtheora], [theora], [theora_info_init], [-ltheoraenc -ltheoradec -logg])
741 CHECK_HEADERS([libtheora], [threora headers], [theora/theoraenc.h])
742 CHECK_LIB([libvorbis], [vorbisenc], [vorbis_encode_init], [-lvorbis -lvorbisfile -logg])
743 CHECK_HEADERS([libvorbis], [vorbis encoders headers], [vorbis/vorbisenc.h])
744 CHECK_LIB([libvorbis], [vorbisfile], [ov_open])
745 CHECK_HEADERS([libvorbis], [vorbis file headers], [vorbis/vorbisfile.h])])
747 CHECK_WANT([FIREWIRE], [auto], [use firewire], [
748 CHECK_LIB([libavc1394], [avc1394], [avc1394_init_target])
749 CHECK_HEADERS([libavc1394], [libavc1394 headers], [libavc1394/avc1394.h])
750 CHECK_LIB([libavc1394], [rom1394], [rom1394_get_bus_id])
751 CHECK_HEADERS([libavc1394], [librom1394 headers], [libavc1394/rom1394.h])
752 CHECK_LIB([libiec61883], [iec61883], [iec61883_mpeg2_recv_init])
753 CHECK_HEADERS([libiec61883], [libiec61883 headers], [libiec61883/iec61883.h])
754 CHECK_LIB([libraw1394], [raw1394], [raw1394_iso_recv_init])
755 CHECK_HEADERS([libraw1394], [libraw1394 headers], [libraw1394/raw1394.h])])
757 test "x$HAVE_libavc1394" = "xyes" && \
758 test "x$HAVE_libiec61883" = "xyes" && \
759 test "x$HAVE_libraw1394" = "xyes" && \
760 HAVE_FIREWIRE=yes || \
762 HAVE_libiec61883=no \
766 CHECK_WANT([DV], [auto], [use dv], [
767 CHECK_LIB([libdv], [dv], [dv_init])
768 CHECK_HEADERS([libdv], [libdv headers], [libdv/dv.h])])
770 CHECK_WANT([DVB], [auto], [use dvb], [
771 CHECK_HEADERS([DVB], [dvb device headers], [linux/dvb/dmx.h linux/dvb/frontend.h])])
773 CHECK_WANT([VIDEO4LINUX2], [auto], [use v4l2], [
774 CHECK_HEADERS([VIDEO4LINUX2], [v4l2 system headers], [linux/kernel.h linux/types.h linux/videodev2.h])])
776 CHECK_WANT([XXF86VM], [auto], [use xf86vmode], [
777 CHECK_HEADERS([XXF86VM], [XF86VM headers], [X11/Xlib.h X11/extensions/xf86vmode.h])])
779 CHECK_WANT([ESOUND], [no], [use esd], [
780 CHECK_LIB([esound], [esd], [esd_open_sound])
781 CHECK_HEADERS([esound], [esound headers], [esd.h])
782 CHECK_LIB([audiofile], [audiofile], [afOpenFile])
783 CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
785 test "x$HAVE_esound" = "xyes" && \
786 test "x$HAVE_audiofile" = "xyes" && \
792 CHECK_WANT([PULSE], [auto], [use pulseaudio], [
793 CHECK_LIB([pulse_simple], [pulse-simple], [pa_simple_new])
794 CHECK_HEADERS([pulse_simple], [pulse-simple headers], [pulse/simple.h])
795 CHECK_LIB([pulse], [pulse], [pa_context_new])
796 CHECK_HEADERS([pulse], [pulse headers], [pulse/error.h])])
798 CHECK_WANT([ISOFS], [auto], [use isofs], [
799 CHECK_HEADERS([isofs], [isofs headers], [linux/isofs.h])])
801 if test "x$WANT_LADSPA_BUILD" != "xyes" ; then
802 CHECK_WANT([LADSPA], [auto], [ladspa plugin clients], [
803 CHECK_HEADERS([ladspa], [ladspa headers], [ladspa.h])])
808 CHECK_WANT([SHUTTLE], [yes], [shuttle dev support], [
809 CHECK_HEADERS([keysyms], [x11 keysym defs], [X11/keysymdef.h])])
810 if test "x$WANT_SHUTTLE" = "xno"; then
811 WANT_SHUTTLE_USB="no"
813 CHECK_WANT([SHUTTLE_USB], [yes], [use libusb-1.0], [
814 CHECK_LIB([libusbx], [usb-1.0], [libusb_init])
815 CHECK_HEADERS([libusbx], [libusb headers], [libusb-1.0/libusb.h])])
817 CHECK_WANT([LV2], [auto], [use lv2], [
818 AC_MSG_CHECKING([for lv2 availability])
820 saved_CFLAGS="$CFLAGS"
821 LIBS=" $(pkg-config --libs lilv-0 2>/dev/null)"
822 CHECK_LIB([lilv], [lilv-0], [lilv_world_new])
823 CHECK_LIB([sord], [sord-0], [sord_world_new])
824 CHECK_LIB([serd], [serd-0], [serd_reader_new])
825 CHECK_LIB([sratom], [sratom-0], [sratom_new])
826 CFLAGS="-I/usr/include/lilv-0 -I/usr/local/include/lilv-0 `pkg-config --cflags lilv-0 2>/dev/null`"
827 CHECK_HEADERS([lilv], [lilv headers], [lilv/lilv.h])
828 CFLAGS="-I/usr/include/serd-0 -I/usr/local/include/serd-0 `pkg-config --cflags serd-0 2>/dev/null`"
829 CHECK_HEADERS([serd], [serd headers], [serd/serd.h])
830 CFLAGS="-I/usr/include/sord-0 -I/usr/local/include/sord-0 `pkg-config --cflags sord-0 2>/dev/null`"
831 CHECK_HEADERS([sord], [sord headers], [sord/sord.h])
832 CFLAGS="-I/usr/include/sratom-0 -I/usr/local/include/sratom-0 `pkg-config --cflags sratom-0 2>/dev/null`"
833 CHECK_HEADERS([sratom], [sratom headers], [sratom/sratom.h])
834 CHECK_LIB([suil], [suil-0], [suil_instance_new])
835 CFLAGS="-I/usr/include/suil-0 -I/usr/local/include/suil-0 `pkg-config --cflags suil-0 2>/dev/null`"
836 CHECK_HEADERS([suil], [suil headers], [suil/suil.h])
837 CFG_CFLAGS+=" $(pkg-config --cflags lilv-0 2>/dev/null) $(pkg-config --cflags suil-0 2>/dev/null)"
839 CFLAGS="$saved_CFLAGS"])
841 test "x$HAVE_lilv" = "xyes" && \
842 test "x$HAVE_sord" = "xyes" && \
843 test "x$HAVE_serd" = "xyes" && \
844 test "x$HAVE_sratom" = "xyes" && \
845 test "x$HAVE_suil" = "xyes" && \
855 CHECK_WANT([CUDA], [auto], [build cuda plugins], [
856 CHECK_HEADERS([CUDA], [cuda sdk], [${CUDA_PATH:-/usr/local/cuda}/include/cuda.h])])
858 CHECK_WANT([DL], [auto], [system has libdl], [
859 CHECK_LIB([DL], [dl], [dlopen])])
861 CHECK_WANT([OPENCV], [no], [opencv=sys/sta/dyn,git/tar=url], [
864 CHECK_WANT([NUMA], [auto], [system has libnuma], [
865 CHECK_LIB([NUMA], [numa], [numa_alloc])])
867 CHECK_WANT([OPENEXR], [auto], [use openexr], [
868 AC_MSG_CHECKING([for openexr available])
870 saved_CXXFLAGS="$CXXFLAGS"
872 if test "xHAVE_Imath"="xyes"; then
873 LIBS=" -lImath -lIlmThread -lIex -lpthread"
875 LIBS=" -lIlmImf -lIlmThread -lIex -lpthread"
877 CXXFLAGS="-I/usr/include/OpenEXR -I/usr/local/include/OpenEXR"
878 CXXFLAGS+=" $(pkg-config --cflags OpenEXR)"
880 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
881 #include "ImfChannelList.h"
882 #include "ImfChromaticities.h"
883 #include "ImfCompression.h"
885 #include "ImfInputFile.h"
886 #include "ImfOutputFile.h"
887 #include "ImfPixelType.h"
888 #include "ImfRgbaFile.h"
889 #include "ImfRgbaYca.h"
890 #include "ImfVersion.h"
891 class EXRIStream : public Imf::IStream { public:
892 EXRIStream() : Imf::IStream("mypath") {} };
893 class EXROStream : public Imf::OStream { public:
894 EXROStream() : Imf::OStream("mypath") {} };
895 ]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no])
896 if test "x$WANT_OPENEXR" = "xauto"; then
899 if test "x$WANT_OPENEXR" = "xyes" -a "x$HAVE_OPENEXR" = "xyes"; then
900 if test "x$WANT_STATIC_BUILD" = "xno"; then
901 SHARED_openexr="$LIBS"
902 SHARED_LIBS+=" $LIBS"
903 CFG_CFLAGS+=" -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR"
904 CFG_CFLAGS+=" $(pkg-config --cflags OpenEXR)"
905 CFG_CFLAGS+=" $(pkg-config --cflags Imath)"
907 CFG_CFLAGS+=" $(pkg-config --cflags OpenEXR)"
910 CXXFLAGS="$saved_CXXFLAGS"
912 AC_MSG_RESULT([$HAVE_OPENEXR])
915 if test "x$WANT_CIN_3RDPARTY" = "xno"; then
916 if test "x$HAVE_OPENEXR" != "xyes" -a "x$WANT_OPENEXR" = "xyes"; then
917 AC_MSG_ERROR([requires OpenEXR but OpenEXR not found.])
921 AC_SUBST([HAVE_OPENEXR])
923 test "x$HAVE_openexr" = "xyes" && \
924 test "x$HAVE_ilmbase" = "xyes" && \
925 HAVE_OPENEXR=yes || \
930 if test "x$WANT_CIN_3RDPARTY" = "xno"; then
931 if test "x$HAVE_LV2" != "xyes" -a "x$WANT_LV2" = "xyes"; then
932 AC_MSG_ERROR([lv2 requested but no lv2 headers found])
936 # build global_config
940 echo "AS_HELP_STRING([Reason],[Package])"
941 echo "AS_HELP_STRING([------],[-------])"
943 AC_DEFUN([PKG_DISABLED],[
947 echo "AS_HELP_STRING([disabled],[$1])"
949 AC_DEFUN([PKG_SHARED],[
953 SHARED_LIBS+="$SHARED_$1"
956 AC_DEFUN([PKG_STATIC],[
957 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
962 echo "AS_HELP_STRING([$2],[$1])"
966 AC_DEFUN([PKG_FORCED],[PKG_STATIC([$1],[forced])])
968 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
971 ffmpeg/twolame ffmpeg/lame ffmpeg/openjpeg \
972 ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/x265 \
973 libiec61883/libraw1394 libavc1394/librom1394 \
974 openexr/ilmbase ilmbase/libogg \
975 libtheora/libogg libtheora/libvorbis ; do
976 lib=`dirname $dep`; needs=`basename $dep`
977 eval pkg_lib="\$PKG_$lib"
978 if test "x$pkg_lib" != "xno"; then
979 eval "PKG_$needs=yes"
984 AC_DEFUN([PKG_PROVIDE],[
985 if test "x$BUILD_$1" = "x" ; then
986 if test "x$PKG_$1" = "xyes"; then
987 if test "x$WANT_CIN_3RDPARTY" = "xno"; then
992 elif test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
994 elif test "x$WANT_STATIC_BUILD" = "xyes"; then
995 PKG_STATIC([$1],[static])
996 elif test "x$HAVE_$1" = "xyes"; then
999 PKG_STATIC([$1],[needed])
1004 PKG_PROVIDE([libbthread])
1005 PKG_PROVIDE([a52dec])
1006 PKG_PROVIDE([djbfft])
1007 PKG_PROVIDE([encore])
1008 PKG_PROVIDE([audiofile],[$WANT_ESOUND])
1009 PKG_PROVIDE([esound],[$WANT_ESOUND])
1010 PKG_PROVIDE([ffmpeg])
1013 PKG_PROVIDE([giflib], [$WANT_GIFLIB])
1014 PKG_PROVIDE([ilmBase], [$WANT_OPENEXR])
1015 PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD])
1017 PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE])
1018 PKG_PROVIDE([libraw1394],[$WANT_FIREWIRE])
1019 PKG_PROVIDE([libiec61883],[$WANT_FIREWIRE])
1020 PKG_PROVIDE([libdv],[$WANT_DV])
1021 PKG_PROVIDE([libjpeg])
1022 PKG_PROVIDE([libogg])
1023 PKG_PROVIDE([libsndfile])
1024 PKG_PROVIDE([libtheora])
1025 PKG_PROVIDE([libuuid])
1026 PKG_PROVIDE([libvorbis])
1027 PKG_PROVIDE([mjpegtools])
1028 PKG_PROVIDE([libaom])
1029 PKG_PROVIDE([dav1d])
1030 PKG_PROVIDE([libwebp])
1031 PKG_PROVIDE([openExr], [$WANT_OPENEXR])
1032 PKG_PROVIDE([openexr], [$WANT_OPENEXR])
1033 PKG_PROVIDE([openjpeg])
1035 PKG_PROVIDE([twolame])
1038 PKG_PROVIDE([libvpx])
1040 PKG_PROVIDE([lv2], [$WANT_LV2])
1041 PKG_PROVIDE([lilv], [$WANT_LV2])
1042 PKG_PROVIDE([sratom], [$WANT_LV2])
1043 PKG_PROVIDE([serd], [$WANT_LV2])
1044 PKG_PROVIDE([sord], [$WANT_LV2])
1045 PKG_PROVIDE([suil], [$WANT_LV2])
1046 PKG_PROVIDE([ffnvcodec], [$WANT_NV])
1047 PKG_PROVIDE([libdpx])
1049 if test "x$WANT_LV2" = "xyes"; then
1050 if test "x$HAVE_lv2" = "xyes" -a "x$BUILD_lilv" = "x0"; then
1051 CFG_CFLAGS+=' -I/usr/include/lilv-0 -I/usr/local/include/lilv-0'
1052 CFG_CFLAGS+=' -I/usr/include/suil-0 -I/usr/local/include/suil-0'
1056 AC_SUBST(STATIC_BLDS)
1057 for f in $SHARED_LIBS; do
1058 echo "AS_HELP_STRING([shared],[$f])"
1060 AC_SUBST(SHARED_LIBS)
1061 for f in $SYSTEM_LIBS; do
1062 echo "AS_HELP_STRING([system],[$f])"
1064 AC_SUBST(SYSTEM_LIBS)
1067 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
1068 CFG_CFLAGS+=" -DHAVE_CIN_3RDPARTY"
1070 for v in GL XFT XXF86VM OSS ALSA FIREWIRE OGG DV DVB LADSPA \
1071 VIDEO4LINUX2 ESOUND PULSE PACTL OPENEXR LV2 \
1072 COMMERCIAL GIFLIB LIBZMPEG LIBDPX SHUTTLE SHUTTLE_USB XV \
1073 VAAPI VDPAU CUDA NV WINTV X10TV; do
1075 if test "x$vv" != "xno"; then
1076 CFG_CFLAGS+=" -DHAVE_$v"
1081 v=`echo "$v" | tr "A-Z" "a-z"`
1082 echo " using: $vv-$v"
1086 if test "x$WANT_CLANG" = "xyes" ; then
1087 FFMPEG_EXTRA_CFG+=' --cc=clang --cxx=clang++'
1088 CFG_CFLAGS+=" -Wno-unknown-warning-option"
1090 if test "x$HAVE_tiff" = "xyes"; then
1091 if test "x$HAVE_jbig" = "xyes"; then
1092 EXTRA_LIBS+=' -ljbig'
1095 if test "x$HAVE_NUMA" = "xyes"; then
1096 EXTRA_LIBS+=' -lnuma'
1099 FFMPEG_EXTRA_LDFLAGS=""
1100 if test "x$WANT_VAAPI" != "xno" -a "x$HAVE_VAAPI" = "xyes"; then
1101 FFMPEG_EXTRA_LDFLAGS+=' -lva `pkg-config --libs libva`'
1102 EXTRA_LIBS+=' -lva '
1104 if test "x$HAVE_vaapi_x11" = "xyes"; then
1105 FFMPEG_EXTRA_LDFLAGS+=' -lva-x11'
1106 EXTRA_LIBS+=' -lva-x11 `pkg-config --libs x11`'
1108 if test "x$HAVE_vaapi_drm" = "xyes"; then
1109 FFMPEG_EXTRA_LDFLAGS+=' -lva-drm'
1110 EXTRA_LIBS+=' -lva-drm'
1115 if test "x$WANT_VDPAU" != "xno" -a "x$HAVE_VDPAU" = "xyes"; then
1120 if test "x$WANT_NV" != "xno"; then
1125 if test "x$HAVE_DL" = "xyes"; then
1127 FFMPEG_EXTRA_LDFLAGS+=' -ldl'
1129 if test "x$FFMPEG_EXTRA_LDFLAGS" != "x"; then
1130 FFMPEG_EXTRA_CFG+=' --extra-ldflags="'$FFMPEG_EXTRA_LDFLAGS'"'
1133 if test "x$WANT_BOOBY" != "xno"; then
1134 CFG_CFLAGS+=" -DBOOBY"
1137 if test [ "$(uname -o)"] = "Android" ; then
1139 EXTRA_LIBS+=' -liconv -landroid-shmem'
1142 # intel lock elision bugs
1143 if test "x$WANT_NOELISION" != "xno"; then
1144 CFG_RPATH=`ls -1fd 2> /dev/null \
1145 /usr/lib/noelision \
1147 /usr/lib64/noelision \
1152 echo " using: with-jobs = $WANT_JOBS"
1153 echo " using: exec-name = $WANT_CIN"
1154 echo " using: with-cinlib = $WANT_CINLIB_DIR"
1155 echo " using: with-cindat = $WANT_CINDAT_DIR"
1156 echo " using: with-config-dir = $WANT_CONFIG_DIR"
1157 echo " using: with-nested-dir = $WANT_NESTED_DIR"
1158 echo " using: with-snap-dir = $WANT_SNAP_DIR"
1159 echo " using: with-browser = $WANT_CIN_BROWSER"
1160 echo " using: with-plugin-dir = $WANT_PLUGIN_DIR"
1161 echo " using: with-ladspa-dir = $WANT_LADSPA_DIR"
1162 echo " using: with-opencv = $WANT_OPENCV"
1163 echo " using: with-git-ffmpeg = $WANT_GIT_FFMPEG"
1164 echo " using: with-noelision = $WANT_NOELISION"
1165 echo " using: with-booby = $WANT_BOOBY"
1166 echo " using: with-clang = $WANT_CLANG"
1168 echo " using: thirdparty build = $WANT_CIN_3RDPARTY"
1169 echo " using: single-user = $WANT_CINBIN_BUILD"
1170 echo " using: static-build = $WANT_STATIC_BUILD"
1171 echo " using: ladspa-build = $WANT_LADSPA_BUILD"
1174 AC_SUBST(WANT_CIN_3RDPARTY)
1175 AC_SUBST(EXTRA_LIBS)
1176 AC_SUBST(FFMPEG_EXTRA_CFG)
1177 AC_SUBST(WANT_X264_HIDEPTH)
1178 AC_SUBST(WANT_X265_HIDEPTH)
1180 AC_SUBST(CFG_CFLAGS)
1181 AC_SUBST(CFG_CXXFLAGS)
1183 AC_CONFIG_FILES([Makefile])
1186 exec > global_config
1188 echo "SHELL := /bin/bash"
1190 echo "WANT_JOBS := $WANT_JOBS"
1191 if test "x$WANT_CLANG" = "xyes" ; then
1193 echo "CXX = clang++"
1194 echo "export CC CXX"
1197 echo "OBJDIR := $OBJDIR"
1198 echo "BINDIR := \$(TOPDIR)/bin"
1199 echo "CINELERRA := \$(TOPDIR)/cinelerra"
1200 echo "GUICAST := \$(TOPDIR)/guicast"
1201 echo "LIBZMPEG3 := \$(TOPDIR)/libzmpeg3"
1202 echo "MPEG2ENC := \$(TOPDIR)/mpeg2enc"
1203 echo "MPLEXLO := \$(TOPDIR)/mplexlo"
1204 echo "PLUGINS := \$(TOPDIR)/plugins"
1205 echo "TDB := \$(TOPDIR)/db"
1206 echo "THIRDPARTY := \$(TOPDIR)/thirdparty"
1207 echo "EXTRA_LIBS := $EXTRA_LIBS"
1208 echo "FFMPEG_EXTRA_CFG := $FFMPEG_EXTRA_CFG"
1209 echo "export OBJDIR BINDIR CINELERRA GUICAST LIBZMPEG3"
1210 echo "export MPEG2ENC MPLEXLO PLUGINS TDB"
1211 echo "export THIRDPARTY EXTRA_LIBS FFMPEG_EXTRA_CFG"
1214 echo "WANT_CIN := $WANT_CIN"
1215 CFG_WANTS+=" CIN_3RDPARTY LIBZMPEG COMMERCIAL STATIC_BUILD"
1216 for w in $CFG_WANTS; do ww=WANT_$w; echo "WANT_$w := ${!ww}"; done
1219 echo "ifndef CFLAGS_"
1221 echo "CFLAGS_ := \$(CFLAGS)"
1223 echo "CFLAGS_ := ${CFLAGS:--g -O2}"
1226 echo "ifndef CXXFLAGS_"
1227 echo "ifdef CXXFLAGS"
1228 echo "CXXFLAGS_ := \$(CXXFLAGS)"
1231 echo "ifndef LDFLAGS_"
1232 echo "ifdef LDFLAGS"
1233 echo "LDFLAGS_ := \$(LDFLAGS)"
1237 echo "CFLAGS := \$(CFLAGS_)"
1238 echo "CFLAGS += '-DCIN=\"\$(WANT_CIN)\"'"
1239 echo "CFLAGS += '-DCINLIB_DIR=\"$WANT_CINLIB_DIR\"'"
1240 echo "CFLAGS += '-DCINDAT_DIR=\"$WANT_CINDAT_DIR\"'"
1241 echo "CFLAGS += '-DCONFIG_DIR=\"$WANT_CONFIG_DIR\"'"
1242 echo "CFLAGS += '-DNESTED_DIR=\"$WANT_NESTED_DIR\"'"
1243 echo "CFLAGS += '-DSNAP_DIR=\"$WANT_SNAP_DIR\"'"
1244 echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
1245 echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
1246 echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
1247 echo "CFLAGS += '-DCIN_BROWSER=\"$WANT_CIN_BROWSER\"'"
1248 for flg in $CFG_CFLAGS; do echo "CFLAGS += $flg"; done
1250 if test "x$CFG_CXXFLAGS" != "x"; then
1251 for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
1254 if test "x$CFG_LDFLAGS" != "x" ; then
1255 echo "LDFLAGS +=$CFG_LDFLAGS"
1259 if test "x$CYGWIN" != "x" ; then
1260 echo 'FF_PATH ?= /usr/local'
1261 echo 'LDFLAGS += -L$(FF_PATH)/lib'
1262 echo 'CFLAGS += -I$(FF_PATH)/include'
1264 echo "CFLAGS += -DNO_BTRACE"
1265 echo "CFLAGS += -DNO_GDB"
1266 echo "CFLAGS += -DNO_CTX"
1267 echo "CFLAGS += -DNO_PRCTL"
1268 echo "CFLAGS += -DNO_TID"
1269 echo "CFLAGS += -DNO_XSELECT"
1272 LDFLAGS+=" -z noexecstack"
1274 if test "x$BSD" != "x" ; then
1275 echo "CFLAGS += -DNO_PRCTL"
1276 echo "CFLAGS += -DNO_TID"
1277 echo "CFLAGS += -DNO_GDB"
1280 if test [ "$(uname)"] = "NetBSD" ; then
1281 echo "CFLAGS += -DNO_BTRACE"
1282 echo "CFLAGS += -DNO_CTX"
1283 echo "system_libs += -L/usr/pkg/lib/ffmpeg4"
1284 echo "system_libs += -L/usr/pkg/lib/"
1285 echo "system_libs += -lpng16"
1286 echo "system_libs += -lintl"
1287 echo "system_libs += -lossaudio"
1288 echo "CFLAGS += -I/usr/X11R7/include"
1289 echo "CFLAGS += -I/usr/pkg/include/ffmpeg4"
1290 echo "CFLAGS += $(pkg-config --cflags xft)"
1291 echo "CFLAGS += -I/usr/pkg/include"
1292 echo "CFLAGS += -I/usr/pkg/include/uuid"
1296 if test "x$WANT_X264_HIDEPTH" = "xyes" ; then
1297 X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10"
1299 if test "x$WANT_X265_HIDEPTH" = "xyes" ; then
1300 X265_CFG_PARAMS="$X265_CFG_PARAMS -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON"
1303 for pkg in $STATIC_PKGS; do
1304 eval pkg_lib="\$PKG_$pkg"
1305 if test "x$pkg_lib" = "xyes"; then
1306 echo "static_pkgs += $pkg"
1307 elif test "x$pkg_lib" = "xshared"; then
1308 echo "shared_pkgs += $pkg"
1313 for pkg in $STATIC_BLDS; do
1314 echo "static_blds += $pkg"
1316 echo "$ver_pkg := \$(THIRDPARTY)/${!ver_pkg}"
1318 echo "$inc_pkg := \\"
1319 for inc in ${!inc_pkg}; do
1320 echo " -I\$($ver_pkg)/$inc \\"
1323 echo "static_incs += \$(inc_$pkg)"
1325 echo "$lib_pkg := \\"
1326 for lib in ${!lib_pkg}; do
1327 echo " \$($ver_pkg)/$lib \\"
1330 echo "static_libs += \$($lib_pkg)"
1335 for lib in $SHARED_LIBS; do echo "shared_libs += $lib"; done
1337 for lib in $SYSTEM_LIBS; do echo "system_libs += $lib"; done
1338 echo "export static_pkgs shared_pkgs static_blds shared_libs system_libs"
1341 echo "thirdparty_libraries := \$(static_libs) \$(shared_libs)"
1343 if test "x$CFG_RPATH" != "x"; then
1344 echo "libraries+= -Wl,-rpath=$CFG_RPATH"
1347 echo "libraries += -Wl,--start-group"
1348 echo "libraries += \$(thirdparty_libraries)"
1349 echo "libraries += \$(shared_libs)"
1350 echo "libraries += \$(system_libs)"
1351 echo "libraries += \$(EXTRA_LIBS)"
1352 echo "libraries += -Wl,--end-group"
1353 # -Wl,--start-group ... -Wl,--end-group does not work on ubuntu
1354 echo "libraries += \$(thirdparty_libraries)"
1355 echo "libraries += \$(shared_libs)"
1356 echo "libraries += \$(system_libs)"
1357 echo "libraries += \$(EXTRA_LIBS)"
1359 echo "export thirdparty_libraries libraries"
1360 echo "export CFLAGS_ CXXFLAGS_ LDFLAGS_"
1361 echo "unexport CFLAGS CXXFLAGS LDFLAGS"
1363 if test "x$HAVE_tiff" = "xyes"; then
1364 if test "x$HAVE_jbig" != "xyes"; then
1365 echo "tiff.cfg_params+= --disable-jbig"
1369 if test "x$WANT_GIT_FFMPEG" != "xno"; then
1370 echo "ffmpeg.git := $WANT_GIT_FFMPEG"
1372 if test "x$X264_CFG_PARAMS" != "x" ; then
1373 echo "x264.cfg_params :=$X264_CFG_PARAMS --enable-static --enable-pic"
1375 if test "x$X265_CFG_PARAMS" != "x" ; then
1376 echo "x265.cfg_params :=$X265_CFG_PARAMS -DENABLE_SHARED=no"