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.2],
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],
420 [x264-snapshot-20210615-master],
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/include ])
479 PKG_3RD([ffnvcodec],[auto],
484 PKG_3RD([libdpx],[auto],
489 if test [ "$(uname -o)"] = "Android" ; then
491 PKG_3RD([libbthread],[auto],
498 AC_SUBST(STATIC_PKGS)
500 AC_DEFUN([CHECK_ENABLE], [
502 AS_HELP_STRING([--enable-[$1]],[$3 ([$4])]),
503 [WANT_$2=$enableval], [WANT_$2=[$4]])
506 CHECK_ENABLE([static-build], [STATIC_BUILD], [build static], [auto])
507 CHECK_ENABLE([x264_hidepth], [X264_HIDEPTH], [build x264 10bit], [no])
508 CHECK_ENABLE([x265_hidepth], [X265_HIDEPTH], [build x265 10bit], [no])
510 test "x$WANT_STATIC_BUILD" = "xauto" && WANT_STATIC_BUILD=$WANT_CINBIN_BUILD
512 AC_DEFUN([CHECK_PROG], [
513 AC_CHECK_PROG([PROG_$1], [$2], [yes],[no])
515 AC_DEFUN([REQUIRE_PROG], [
516 CHECK_PROG([$1],[$2])
517 if test "x$PROG_$1" = "xno"; then
518 AC_MSG_WARN([$2 is missing and required.])
525 I86=[`expr "x$ARCH" : 'xi[346]86.*'`]
526 X86=[`expr "x$ARCH" : 'x..._64*'`]
528 if test "x$I86$X86" != "x00" ; then
529 # Checks for ix86 programs.
530 REQUIRE_PROG(NASM, [nasm])
532 AC_MSG_CHECKING([nasm x264 compatible])
533 echo "vmovdqa32 [[eax]]{k1}{z}, zmm0" > conftest.asm
534 nasm conftest.asm -o conftest.o > /dev/null 2>&1
535 if test $? != 0 ; then
537 AC_MSG_WARN([libx264 built without assembly code])
538 X264_CFG_PARAMS="$X264_CFG_PARAMS --disable-asm"
542 rm -f conftest.asm conftest.o
543 REQUIRE_PROG(YASM, [yasm])
546 if test "x$I86$X86" == "x00"; then
547 CFG_CFLAGS+=" -DNO_CTX -DNO_GDB -DNO_BTRACE"
550 ## end arch dep tests
552 REQUIRE_PROG(OBJCOPY, [objcopy])
553 if test "x$FATAL_ERROR" != "x"; then
554 AC_MSG_ERROR("fatal eror.")
556 CHECK_PROG(PACTL, [pactl])
557 WANT_PACTL=$PROG_PACTL
559 AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
560 if test "$no_utf" = "yes"; then
561 AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
564 # Checks for headers/libraries.
566 AC_DEFUN([CHECK_HEADERS], [
567 if test "x$HAVE_$1" != "xno"; then
568 AC_CHECK_HEADER(m4_apply([m4_car],m4_split([$3])), [HAVE_$1=yes], [HAVE_$1=no],
569 [m4_foreach([i], m4_split([$3]), [[#include "]i["
572 AC_MSG_CHECKING([$2])
573 AC_MSG_RESULT([$HAVE_$1])
574 if test "x$HAVE_$1" = "xno"; then
575 if test "x$PKG_$1" = "x"; then RESULT=no; fi
580 AC_DEFUN([CHECK_LIB], [
581 if test "x$HAVE_$1" != "xno"; then
582 if test "x$PKG_$1" = "x" -o "x$WANT_STATIC_BUILD" = "xno" -a "x$PKG_$1" != "xno"; then
583 AC_CHECK_LIB([$2], [$3], [HAVE_$1=yes], [HAVE_$1=no], [$4])
585 if test "x$WANT_$1" != "xno"; then
586 if test "x$HAVE_$1" = "xyes"; then
587 if test "x$PKG_$1" = "x"; then
588 SYSTEM_LIBS+=" -l[$2]"
589 for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
592 for lib in [$4]; do SHARED_LIBS+=" $lib"; done
594 elif test "x$PKG_$1" = "x"; then
602 IMMATH_HEADERS=$(pkg-config --cflags Imath 2>/dev/null)
604 CHECK_LIB([X11], [X11], [XOpenDisplay])
605 CHECK_HEADERS([X11], [X11 headers], [X11/X.h X11/Xlib.h X11/Xutil.h X11/cursorfont.h])
606 CHECK_HEADERS([X11], [X11 headers], [X11/keysym.h X11/Sunkeysym.h X11/Xatom.h X11/XF86keysym.h])
607 CHECK_LIB([XEXT], [Xext], [XShmQueryExtension])
608 CHECK_HEADERS([XEXT], [Xlib XShm extention], [X11/Xlib.h X11/extensions/XShm.h X11/extensions/shape.h])
609 CHECK_LIB([XINERAMA], [Xinerama], [XineramaQueryExtension])
610 CHECK_HEADERS([XINERAMA], [Xinerama headers], [X11/extensions/Xinerama.h])
612 if test "x$HAVE_XINERAMA" != "xyes"; then
613 AC_MSG_ERROR([requires Xinerama support.])
616 CHECK_LIB([XFIXES], [Xfixes], [XFixesQueryVersion])
617 if test "x$HAVE_XFIXES" != "xyes"; then
618 AC_MSG_ERROR([requires XFixes support.])
621 CHECK_LIB([BZ2], [bz2], [BZ2_bzDecompress])
622 CHECK_LIB([FONTCONFIG], [fontconfig], [FcInit])
623 CHECK_LIB([FREETYPE], [freetype], [FT_Init_FreeType])
624 CHECK_LIB([LZMA], [lzma], [lzma_version_number])
625 CHECK_LIB([PNG], [png], [png_read_png])
626 CHECK_LIB([PTHREAD], [pthread], [pthread_create])
627 CHECK_LIB([Z], [z], [gzopen])
628 CHECK_LIB([fftw], [fftw3], [fftw_execute])
629 CHECK_HEADERS([fftw], [fftw headers], [fftw3.h])
630 CHECK_LIB([libuuid], [uuid], [uuid_clear])
631 CHECK_HEADERS([libuuid], [uuid headers], [uuid/uuid.h])
632 CHECK_HEADERS([LINUX_CDROM], [linux cdrom headers], [linux/cdrom.h linux/futex.h])
633 CHECK_HEADERS([LINUX_SYS], [linux sys], [sys/ioctl.h sys/stat.h sys/types.h sys/time.h sys/syscall.h])
634 CHECK_LIB([flac], [FLAC], [FLAC__stream_decoder_new])
635 CHECK_HEADERS([flac], [FLAC headers], [FLAC/stream_decoder.h])
636 CHECK_LIB([lame], [mp3lame], [lame_init])
637 CHECK_HEADERS([lame], [lame headers], [lame/lame.h])
638 CHECK_LIB([libjpeg], [jpeg], [jpeg_start_decompress])
639 CHECK_HEADERS([libjpeg], [jpeg headers], [stdio.h jpeglib.h])
640 CHECK_LIB([openjpeg], [openjp2], [opj_version])
641 CHECK_HEADERS([openjpeg], [openjpeg headers], [openjpeg.h])
642 CHECK_LIB([libsndfile], [sndfile], [sf_open])
643 CHECK_HEADERS([libsndfile], [sndfile headers], [sndfile.h])
644 CHECK_LIB([ilmbase], [IlmImf], [ImfOpenInputFile])
645 CHECK_HEADERS([ilmbase], [IlmImf headers], [OpenEXR/ImfCRgbaFile.h])
646 CHECK_LIB([Imath], [Imath], [ImfOpenInputFile])
647 CHECK_LIB([libvpx], [vpx], [vpx_codec_decode])
648 CHECK_HEADERS([libvpx], [vpx headers], [vpx/vpx_decoder.h])
649 CHECK_LIB([mjpegtools], [mjpegutils], [mjpeg_info])
650 CHECK_HEADERS([mjpegtools], [mjpegtools headers], [mjpegtools/mjpeg_types.h])
651 CHECK_LIB([tiff], [tiff], [TIFFOpen])
652 CHECK_HEADERS([tiff], [tiff headers], [tiff.h tiffio.h])
653 CHECK_LIB([twolame], [twolame], [twolame_encode_buffer_float32_interleaved])
654 CHECK_HEADERS([twolame], [twolame headers], [twolame.h])
655 CHECK_LIB([x264], [x264], [x264_encoder_encode])
656 CHECK_HEADERS([x264], [x264 headers], [stdint.h x264.h])
657 CHECK_LIB([x265], [x265], [x265_encoder_encode])
658 CHECK_HEADERS([x265], [x265 headers], [x265.h])
659 CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
660 CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])
661 CHECK_LIB([libaom], [aom], [aom_codec_version])
662 CHECK_HEADERS([libaom], [libaom headers], [aom/aom.h])
663 CHECK_LIB([dav1d], [dav1d], [dav1d_version])
664 CHECK_HEADERS([dav1d], [libdav1d headers], [dav1d/dav1d.h])
665 CHECK_LIB([libwebp], [webp], [WebPGetEncoderVersion])
666 CHECK_HEADERS([libwebp], [libwebp headers], [webp/encode.h])
667 CHECK_LIB([a52dec], [a52], [a52_init])
668 CHECK_HEADERS([a52dec], [a52 headers], [stdint.h a52dec/a52.h])
669 CHECK_LIB([encore], [encore], [encore])
670 CHECK_HEADERS([encore], [encore headers], [encore.h])
671 CHECK_LIB([giflib], [gif], [DGifOpen])
672 CHECK_HEADERS([giflib], [gif lib headers], [gif_lib.h])
673 CHECK_LIB([jbig], [jbig], [jbg_dec_init])
675 CHECK_LIB([VDPAU], [vdpau], [vdp_device_create_x11])
676 if test "x$HAVE_VDPAU" != "xyes" -a "x$WANT_VDPAU" = "xyes"; then
677 AC_MSG_ERROR([requires vdpau support.])
680 CHECK_LIB([VAAPI], [va], [vaInitialize])
681 if test "x$HAVE_VAAPI" = "xyes" -a "x$WANT_VAAPI" != "xno"; then
682 CHECK_HEADERS([vaapi_x11], [va x11 headers], [va/va_x11.h])
683 CHECK_LIB([vaapi_x11], [va-x11], [vaGetDisplay])
684 CHECK_HEADERS([vaapi_drm], [va drm headers], [va/va_drm.h])
685 CHECK_LIB([vaapi_drm], [va-drm], [vaGetDisplayDRM])
687 if test "x$HAVE_VAAPI" != "xyes" -a "x$WANT_VAAPI" = "xyes"; then
688 AC_MSG_ERROR([requires vaapi support.])
691 #CHECK_LIB([NVENC], [nvidia-encode], [NvEncodeAPICreateInstance])
693 #if test "x$HAVE_mjpegtools" = "xyes"; then
694 #CFG_CFLAGS+=" -I/usr/include/mjpegtools -I/usr/local/include/mjpegtools"
697 AC_DEFUN([CHECK_WANT], [
700 AC_ARG_WITH(m4_tolower([$1]),
701 AS_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))],[$3 (auto)]),
702 [WANT_$1=$withval],[WANT_$1=$2])
704 if test "x$WANT_$1" = "xauto" ; then
706 elif test "x$WANT_$1" = "xyes" ; then
707 if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then
708 AC_MSG_ERROR([required for $1 support.])
715 CHECK_WANT([GL], [auto], [use opengl], [
716 CHECK_LIB([GL], [GL], [glUseProgram])
717 CHECK_LIB([GL], [GLU], [gluOrtho2D])
718 CHECK_HEADERS([GL], [opengl headers], [GL/gl.h GL/glext.h GL/glu.h GL/glx.h])])
720 CHECK_WANT([XV], [auto], [use xv], [
721 CHECK_LIB([xv], [Xv], [XvQueryExtension])
722 CHECK_HEADERS([xv], [Xlib Xv extention], [X11/Xlib.h X11/extensions/Xvlib.h])])
724 CHECK_WANT([OSS], [auto], [use OSS audio], [
725 CHECK_HEADERS([OSS], [oss headers], [sys/soundcard.h])])
727 CHECK_WANT([XFT], [auto], [use libXft], [
728 CHECK_LIB([XFT], [Xft], [XftInit])
729 CHECK_HEADERS([XFT], [Xft/freetype headers], [X11/Xlib.h X11/Xft/Xft.h])])
731 CHECK_WANT([ALSA], [auto], [use libasound/alsa], [
732 CHECK_LIB([ALSA], [asound], [snd_pcm_open])
733 CHECK_HEADERS([ALSA], [asound headers], [alsa/asoundlib.h])])
735 CHECK_WANT([OGG], [auto], [use ogg/theora/vorbis], [
736 CHECK_LIB([libogg], [ogg], [ogg_stream_init])
737 CHECK_HEADERS([libogg], [ogg headers], [ogg/ogg.h])
738 CHECK_LIB([libtheora], [theora], [theora_info_init], [-ltheoraenc -ltheoradec -logg])
739 CHECK_HEADERS([libtheora], [threora headers], [theora/theoraenc.h])
740 CHECK_LIB([libvorbis], [vorbisenc], [vorbis_encode_init], [-lvorbis -lvorbisfile -logg])
741 CHECK_HEADERS([libvorbis], [vorbis encoders headers], [vorbis/vorbisenc.h])
742 CHECK_LIB([libvorbis], [vorbisfile], [ov_open])
743 CHECK_HEADERS([libvorbis], [vorbis file headers], [vorbis/vorbisfile.h])])
745 CHECK_WANT([FIREWIRE], [auto], [use firewire], [
746 CHECK_LIB([libavc1394], [avc1394], [avc1394_init_target])
747 CHECK_HEADERS([libavc1394], [libavc1394 headers], [libavc1394/avc1394.h])
748 CHECK_LIB([libavc1394], [rom1394], [rom1394_get_bus_id])
749 CHECK_HEADERS([libavc1394], [librom1394 headers], [libavc1394/rom1394.h])
750 CHECK_LIB([libiec61883], [iec61883], [iec61883_mpeg2_recv_init])
751 CHECK_HEADERS([libiec61883], [libiec61883 headers], [libiec61883/iec61883.h])
752 CHECK_LIB([libraw1394], [raw1394], [raw1394_iso_recv_init])
753 CHECK_HEADERS([libraw1394], [libraw1394 headers], [libraw1394/raw1394.h])])
755 test "x$HAVE_libavc1394" = "xyes" && \
756 test "x$HAVE_libiec61883" = "xyes" && \
757 test "x$HAVE_libraw1394" = "xyes" && \
758 HAVE_FIREWIRE=yes || \
760 HAVE_libiec61883=no \
764 CHECK_WANT([DV], [auto], [use dv], [
765 CHECK_LIB([libdv], [dv], [dv_init])
766 CHECK_HEADERS([libdv], [libdv headers], [libdv/dv.h])])
768 CHECK_WANT([DVB], [auto], [use dvb], [
769 CHECK_HEADERS([DVB], [dvb device headers], [linux/dvb/dmx.h linux/dvb/frontend.h])])
771 CHECK_WANT([VIDEO4LINUX2], [auto], [use v4l2], [
772 CHECK_HEADERS([VIDEO4LINUX2], [v4l2 system headers], [linux/kernel.h linux/types.h linux/videodev2.h])])
774 CHECK_WANT([XXF86VM], [auto], [use xf86vmode], [
775 CHECK_HEADERS([XXF86VM], [XF86VM headers], [X11/Xlib.h X11/extensions/xf86vmode.h])])
777 CHECK_WANT([ESOUND], [no], [use esd], [
778 CHECK_LIB([esound], [esd], [esd_open_sound])
779 CHECK_HEADERS([esound], [esound headers], [esd.h])
780 CHECK_LIB([audiofile], [audiofile], [afOpenFile])
781 CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
783 test "x$HAVE_esound" = "xyes" && \
784 test "x$HAVE_audiofile" = "xyes" && \
790 CHECK_WANT([PULSE], [auto], [use pulseaudio], [
791 CHECK_LIB([pulse_simple], [pulse-simple], [pa_simple_new])
792 CHECK_HEADERS([pulse_simple], [pulse-simple headers], [pulse/simple.h])
793 CHECK_LIB([pulse], [pulse], [pa_context_new])
794 CHECK_HEADERS([pulse], [pulse headers], [pulse/error.h])])
796 CHECK_WANT([ISOFS], [auto], [use isofs], [
797 CHECK_HEADERS([isofs], [isofs headers], [linux/isofs.h])])
799 if test "x$WANT_LADSPA_BUILD" != "xyes" ; then
800 CHECK_WANT([LADSPA], [auto], [ladspa plugin clients], [
801 CHECK_HEADERS([ladspa], [ladspa headers], [ladspa.h])])
806 CHECK_WANT([SHUTTLE], [yes], [shuttle dev support], [
807 CHECK_HEADERS([keysyms], [x11 keysym defs], [X11/keysymdef.h])])
808 if test "x$WANT_SHUTTLE" = "xno"; then
809 WANT_SHUTTLE_USB="no"
811 CHECK_WANT([SHUTTLE_USB], [yes], [use libusb-1.0], [
812 CHECK_LIB([libusbx], [usb-1.0], [libusb_init])
813 CHECK_HEADERS([libusbx], [libusb headers], [libusb-1.0/libusb.h])])
815 CHECK_WANT([LV2], [auto], [use lv2], [
816 AC_MSG_CHECKING([for lv2 availability])
818 saved_CFLAGS="$CFLAGS"
819 LIBS=" $(pkg-config --libs lilv-0 2>/dev/null)"
820 CHECK_LIB([lilv], [lilv-0], [lilv_world_new])
821 CHECK_LIB([sord], [sord-0], [sord_world_new])
822 CHECK_LIB([serd], [serd-0], [serd_reader_new])
823 CHECK_LIB([sratom], [sratom-0], [sratom_new])
824 CFLAGS="-I/usr/include/lilv-0 -I/usr/local/include/lilv-0 `pkg-config --cflags lilv-0 2>/dev/null`"
825 CHECK_HEADERS([lilv], [lilv headers], [lilv/lilv.h])
826 CFLAGS="-I/usr/include/serd-0 -I/usr/local/include/serd-0 `pkg-config --cflags serd-0 2>/dev/null`"
827 CHECK_HEADERS([serd], [serd headers], [serd/serd.h])
828 CFLAGS="-I/usr/include/sord-0 -I/usr/local/include/sord-0 `pkg-config --cflags sord-0 2>/dev/null`"
829 CHECK_HEADERS([sord], [sord headers], [sord/sord.h])
830 CFLAGS="-I/usr/include/sratom-0 -I/usr/local/include/sratom-0 `pkg-config --cflags sratom-0 2>/dev/null`"
831 CHECK_HEADERS([sratom], [sratom headers], [sratom/sratom.h])
832 CHECK_LIB([suil], [suil-0], [suil_instance_new])
833 CFLAGS="-I/usr/include/suil-0 -I/usr/local/include/suil-0 `pkg-config --cflags suil-0 2>/dev/null`"
834 CHECK_HEADERS([suil], [suil headers], [suil/suil.h])
835 CFG_CFLAGS+=" $(pkg-config --cflags lilv-0 2>/dev/null) $(pkg-config --cflags suil-0 2>/dev/null)"
837 CFLAGS="$saved_CFLAGS"])
839 test "x$HAVE_lilv" = "xyes" && \
840 test "x$HAVE_sord" = "xyes" && \
841 test "x$HAVE_serd" = "xyes" && \
842 test "x$HAVE_sratom" = "xyes" && \
843 test "x$HAVE_suil" = "xyes" && \
853 CHECK_WANT([CUDA], [auto], [build cuda plugins], [
854 CHECK_HEADERS([CUDA], [cuda sdk], [${CUDA_PATH:-/usr/local/cuda}/include/cuda.h])])
856 CHECK_WANT([DL], [auto], [system has libdl], [
857 CHECK_LIB([DL], [dl], [dlopen])])
859 CHECK_WANT([OPENCV], [no], [opencv=sys/sta/dyn,git/tar=url], [
862 CHECK_WANT([NUMA], [auto], [system has libnuma], [
863 CHECK_LIB([NUMA], [numa], [numa_alloc])])
865 CHECK_WANT([OPENEXR], [auto], [use openexr], [
866 AC_MSG_CHECKING([for openexr available])
868 saved_CXXFLAGS="$CXXFLAGS"
870 if test "xHAVE_Imath"="xyes"; then
871 LIBS=" -lImath -lIlmThread -lIex -lpthread"
873 LIBS=" -lIlmImf -lIlmThread -lIex -lpthread"
875 CXXFLAGS="-I/usr/include/OpenEXR -I/usr/local/include/OpenEXR"
876 CXXFLAGS+=" $(pkg-config --cflags OpenEXR)"
878 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
879 #include "ImfChannelList.h"
880 #include "ImfChromaticities.h"
881 #include "ImfCompression.h"
883 #include "ImfInputFile.h"
884 #include "ImfOutputFile.h"
885 #include "ImfPixelType.h"
886 #include "ImfRgbaFile.h"
887 #include "ImfRgbaYca.h"
888 #include "ImfVersion.h"
889 class EXRIStream : public Imf::IStream { public:
890 EXRIStream() : Imf::IStream("mypath") {} };
891 class EXROStream : public Imf::OStream { public:
892 EXROStream() : Imf::OStream("mypath") {} };
893 ]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no])
894 if test "x$WANT_OPENEXR" = "xauto"; then
897 if test "x$WANT_OPENEXR" = "xyes" -a "x$HAVE_OPENEXR" = "xyes"; then
898 if test "x$WANT_STATIC_BUILD" = "xno"; then
899 SHARED_openexr="$LIBS"
900 SHARED_LIBS+=" $LIBS"
901 CFG_CFLAGS+=" -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR"
902 CFG_CFLAGS+=" $(pkg-config --cflags OpenEXR)"
903 CFG_CFLAGS+=" $(pkg-config --cflags Imath)"
905 CFG_CFLAGS+=" $(pkg-config --cflags OpenEXR)"
908 CXXFLAGS="$saved_CXXFLAGS"
910 AC_MSG_RESULT([$HAVE_OPENEXR])
913 if test "x$WANT_CIN_3RDPARTY" = "xno"; then
914 if test "x$HAVE_OPENEXR" != "xyes" -a "x$WANT_OPENEXR" = "xyes"; then
915 AC_MSG_ERROR([requires OpenEXR but OpenEXR not found.])
919 AC_SUBST([HAVE_OPENEXR])
921 test "x$HAVE_openexr" = "xyes" && \
922 test "x$HAVE_ilmbase" = "xyes" && \
923 HAVE_OPENEXR=yes || \
928 if test "x$WANT_CIN_3RDPARTY" = "xno"; then
929 if test "x$HAVE_LV2" != "xyes" -a "x$WANT_LV2" = "xyes"; then
930 AC_MSG_ERROR([lv2 requested but no lv2 headers found])
934 # build global_config
938 echo "AS_HELP_STRING([Reason],[Package])"
939 echo "AS_HELP_STRING([------],[-------])"
941 AC_DEFUN([PKG_DISABLED],[
945 echo "AS_HELP_STRING([disabled],[$1])"
947 AC_DEFUN([PKG_SHARED],[
951 SHARED_LIBS+="$SHARED_$1"
954 AC_DEFUN([PKG_STATIC],[
955 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
960 echo "AS_HELP_STRING([$2],[$1])"
964 AC_DEFUN([PKG_FORCED],[PKG_STATIC([$1],[forced])])
966 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
969 ffmpeg/twolame ffmpeg/lame ffmpeg/openjpeg \
970 ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/x265 \
971 libiec61883/libraw1394 libavc1394/librom1394 \
972 openexr/ilmbase ilmbase/libogg \
973 libtheora/libogg libtheora/libvorbis ; do
974 lib=`dirname $dep`; needs=`basename $dep`
975 eval pkg_lib="\$PKG_$lib"
976 if test "x$pkg_lib" != "xno"; then
977 eval "PKG_$needs=yes"
982 AC_DEFUN([PKG_PROVIDE],[
983 if test "x$BUILD_$1" = "x" ; then
984 if test "x$PKG_$1" = "xyes"; then
985 if test "x$WANT_CIN_3RDPARTY" = "xno"; then
990 elif test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
992 elif test "x$WANT_STATIC_BUILD" = "xyes"; then
993 PKG_STATIC([$1],[static])
994 elif test "x$HAVE_$1" = "xyes"; then
997 PKG_STATIC([$1],[needed])
1002 PKG_PROVIDE([libbthread])
1003 PKG_PROVIDE([a52dec])
1004 PKG_PROVIDE([djbfft])
1005 PKG_PROVIDE([encore])
1006 PKG_PROVIDE([audiofile],[$WANT_ESOUND])
1007 PKG_PROVIDE([esound],[$WANT_ESOUND])
1008 PKG_PROVIDE([ffmpeg])
1011 PKG_PROVIDE([giflib], [$WANT_GIFLIB])
1012 PKG_PROVIDE([ilmBase], [$WANT_OPENEXR])
1013 PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD])
1015 PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE])
1016 PKG_PROVIDE([libraw1394],[$WANT_FIREWIRE])
1017 PKG_PROVIDE([libiec61883],[$WANT_FIREWIRE])
1018 PKG_PROVIDE([libdv],[$WANT_DV])
1019 PKG_PROVIDE([libjpeg])
1020 PKG_PROVIDE([libogg])
1021 PKG_PROVIDE([libsndfile])
1022 PKG_PROVIDE([libtheora])
1023 PKG_PROVIDE([libuuid])
1024 PKG_PROVIDE([libvorbis])
1025 PKG_PROVIDE([mjpegtools])
1026 PKG_PROVIDE([libaom])
1027 PKG_PROVIDE([dav1d])
1028 PKG_PROVIDE([libwebp])
1029 PKG_PROVIDE([openExr], [$WANT_OPENEXR])
1030 PKG_PROVIDE([openexr], [$WANT_OPENEXR])
1031 PKG_PROVIDE([openjpeg])
1033 PKG_PROVIDE([twolame])
1036 PKG_PROVIDE([libvpx])
1038 PKG_PROVIDE([lv2], [$WANT_LV2])
1039 PKG_PROVIDE([lilv], [$WANT_LV2])
1040 PKG_PROVIDE([sratom], [$WANT_LV2])
1041 PKG_PROVIDE([serd], [$WANT_LV2])
1042 PKG_PROVIDE([sord], [$WANT_LV2])
1043 PKG_PROVIDE([suil], [$WANT_LV2])
1044 PKG_PROVIDE([ffnvcodec], [$WANT_NV])
1045 PKG_PROVIDE([libdpx])
1047 if test "x$WANT_LV2" = "xyes"; then
1048 if test "x$HAVE_lv2" = "xyes" -a "x$BUILD_lilv" = "x0"; then
1049 CFG_CFLAGS+=' -I/usr/include/lilv-0 -I/usr/local/include/lilv-0'
1050 CFG_CFLAGS+=' -I/usr/include/suil-0 -I/usr/local/include/suil-0'
1054 AC_SUBST(STATIC_BLDS)
1055 for f in $SHARED_LIBS; do
1056 echo "AS_HELP_STRING([shared],[$f])"
1058 AC_SUBST(SHARED_LIBS)
1059 for f in $SYSTEM_LIBS; do
1060 echo "AS_HELP_STRING([system],[$f])"
1062 AC_SUBST(SYSTEM_LIBS)
1065 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
1066 CFG_CFLAGS+=" -DHAVE_CIN_3RDPARTY"
1068 for v in GL XFT XXF86VM OSS ALSA FIREWIRE OGG DV DVB LADSPA \
1069 VIDEO4LINUX2 ESOUND PULSE PACTL OPENEXR LV2 \
1070 COMMERCIAL GIFLIB LIBZMPEG LIBDPX SHUTTLE SHUTTLE_USB XV \
1071 VAAPI VDPAU CUDA NV WINTV X10TV; do
1073 if test "x$vv" != "xno"; then
1074 CFG_CFLAGS+=" -DHAVE_$v"
1079 v=`echo "$v" | tr "A-Z" "a-z"`
1080 echo " using: $vv-$v"
1084 if test "x$WANT_CLANG" = "xyes" ; then
1085 FFMPEG_EXTRA_CFG+=' --cc=clang --cxx=clang++'
1086 CFG_CFLAGS+=" -Wno-unknown-warning-option"
1088 if test "x$HAVE_tiff" = "xyes"; then
1089 if test "x$HAVE_jbig" = "xyes"; then
1090 EXTRA_LIBS+=' -ljbig'
1093 if test "x$HAVE_NUMA" = "xyes"; then
1094 EXTRA_LIBS+=' -lnuma'
1097 FFMPEG_EXTRA_LDFLAGS=""
1098 if test "x$WANT_VAAPI" != "xno" -a "x$HAVE_VAAPI" = "xyes"; then
1099 FFMPEG_EXTRA_LDFLAGS+=' -lva `pkg-config --libs libva`'
1100 EXTRA_LIBS+=' -lva '
1102 if test "x$HAVE_vaapi_x11" = "xyes"; then
1103 FFMPEG_EXTRA_LDFLAGS+=' -lva-x11'
1104 EXTRA_LIBS+=' -lva-x11 `pkg-config --libs x11`'
1106 if test "x$HAVE_vaapi_drm" = "xyes"; then
1107 FFMPEG_EXTRA_LDFLAGS+=' -lva-drm'
1108 EXTRA_LIBS+=' -lva-drm'
1113 if test "x$WANT_VDPAU" != "xno" -a "x$HAVE_VDPAU" = "xyes"; then
1118 if test "x$WANT_NV" != "xno"; then
1123 if test "x$HAVE_DL" = "xyes"; then
1125 FFMPEG_EXTRA_LDFLAGS+=' -ldl'
1127 if test "x$FFMPEG_EXTRA_LDFLAGS" != "x"; then
1128 FFMPEG_EXTRA_CFG+=' --extra-ldflags="'$FFMPEG_EXTRA_LDFLAGS'"'
1131 if test "x$WANT_BOOBY" != "xno"; then
1132 CFG_CFLAGS+=" -DBOOBY"
1135 if test [ "$(uname -o)"] = "Android" ; then
1137 EXTRA_LIBS+=' -liconv -landroid-shmem'
1140 # intel lock elision bugs
1141 if test "x$WANT_NOELISION" != "xno"; then
1142 CFG_RPATH=`ls -1fd 2> /dev/null \
1143 /usr/lib/noelision \
1145 /usr/lib64/noelision \
1150 echo " using: with-jobs = $WANT_JOBS"
1151 echo " using: exec-name = $WANT_CIN"
1152 echo " using: with-cinlib = $WANT_CINLIB_DIR"
1153 echo " using: with-cindat = $WANT_CINDAT_DIR"
1154 echo " using: with-config-dir = $WANT_CONFIG_DIR"
1155 echo " using: with-nested-dir = $WANT_NESTED_DIR"
1156 echo " using: with-snap-dir = $WANT_SNAP_DIR"
1157 echo " using: with-browser = $WANT_CIN_BROWSER"
1158 echo " using: with-plugin-dir = $WANT_PLUGIN_DIR"
1159 echo " using: with-ladspa-dir = $WANT_LADSPA_DIR"
1160 echo " using: with-opencv = $WANT_OPENCV"
1161 echo " using: with-git-ffmpeg = $WANT_GIT_FFMPEG"
1162 echo " using: with-noelision = $WANT_NOELISION"
1163 echo " using: with-booby = $WANT_BOOBY"
1164 echo " using: with-clang = $WANT_CLANG"
1166 echo " using: thirdparty build = $WANT_CIN_3RDPARTY"
1167 echo " using: single-user = $WANT_CINBIN_BUILD"
1168 echo " using: static-build = $WANT_STATIC_BUILD"
1169 echo " using: ladspa-build = $WANT_LADSPA_BUILD"
1172 AC_SUBST(WANT_CIN_3RDPARTY)
1173 AC_SUBST(EXTRA_LIBS)
1174 AC_SUBST(FFMPEG_EXTRA_CFG)
1175 AC_SUBST(WANT_X264_HIDEPTH)
1176 AC_SUBST(WANT_X265_HIDEPTH)
1178 AC_SUBST(CFG_CFLAGS)
1179 AC_SUBST(CFG_CXXFLAGS)
1181 AC_CONFIG_FILES([Makefile])
1184 exec > global_config
1186 echo "SHELL := /bin/bash"
1188 echo "WANT_JOBS := $WANT_JOBS"
1189 if test "x$WANT_CLANG" = "xyes" ; then
1191 echo "CXX = clang++"
1192 echo "export CC CXX"
1195 echo "OBJDIR := $OBJDIR"
1196 echo "BINDIR := \$(TOPDIR)/bin"
1197 echo "CINELERRA := \$(TOPDIR)/cinelerra"
1198 echo "GUICAST := \$(TOPDIR)/guicast"
1199 echo "LIBZMPEG3 := \$(TOPDIR)/libzmpeg3"
1200 echo "MPEG2ENC := \$(TOPDIR)/mpeg2enc"
1201 echo "MPLEXLO := \$(TOPDIR)/mplexlo"
1202 echo "PLUGINS := \$(TOPDIR)/plugins"
1203 echo "TDB := \$(TOPDIR)/db"
1204 echo "THIRDPARTY := \$(TOPDIR)/thirdparty"
1205 echo "EXTRA_LIBS := $EXTRA_LIBS"
1206 echo "FFMPEG_EXTRA_CFG := $FFMPEG_EXTRA_CFG"
1207 echo "export OBJDIR BINDIR CINELERRA GUICAST LIBZMPEG3"
1208 echo "export MPEG2ENC MPLEXLO PLUGINS TDB"
1209 echo "export THIRDPARTY EXTRA_LIBS FFMPEG_EXTRA_CFG"
1212 echo "WANT_CIN := $WANT_CIN"
1213 CFG_WANTS+=" CIN_3RDPARTY LIBZMPEG COMMERCIAL STATIC_BUILD"
1214 for w in $CFG_WANTS; do ww=WANT_$w; echo "WANT_$w := ${!ww}"; done
1217 echo "ifndef CFLAGS_"
1219 echo "CFLAGS_ := \$(CFLAGS)"
1221 echo "CFLAGS_ := ${CFLAGS:--g -O2}"
1224 echo "ifndef CXXFLAGS_"
1225 echo "ifdef CXXFLAGS"
1226 echo "CXXFLAGS_ := \$(CXXFLAGS)"
1229 echo "ifndef LDFLAGS_"
1230 echo "ifdef LDFLAGS"
1231 echo "LDFLAGS_ := \$(LDFLAGS)"
1235 echo "CFLAGS := \$(CFLAGS_)"
1236 echo "CFLAGS += '-DCIN=\"\$(WANT_CIN)\"'"
1237 echo "CFLAGS += '-DCINLIB_DIR=\"$WANT_CINLIB_DIR\"'"
1238 echo "CFLAGS += '-DCINDAT_DIR=\"$WANT_CINDAT_DIR\"'"
1239 echo "CFLAGS += '-DCONFIG_DIR=\"$WANT_CONFIG_DIR\"'"
1240 echo "CFLAGS += '-DNESTED_DIR=\"$WANT_NESTED_DIR\"'"
1241 echo "CFLAGS += '-DSNAP_DIR=\"$WANT_SNAP_DIR\"'"
1242 echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
1243 echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
1244 echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
1245 echo "CFLAGS += '-DCIN_BROWSER=\"$WANT_CIN_BROWSER\"'"
1246 for flg in $CFG_CFLAGS; do echo "CFLAGS += $flg"; done
1248 if test "x$CFG_CXXFLAGS" != "x"; then
1249 for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
1252 if test "x$CFG_LDFLAGS" != "x" ; then
1253 echo "LDFLAGS +=$CFG_LDFLAGS"
1257 if test "x$CYGWIN" != "x" ; then
1258 echo 'FF_PATH ?= /usr/local'
1259 echo 'LDFLAGS += -L$(FF_PATH)/lib'
1260 echo 'CFLAGS += -I$(FF_PATH)/include'
1262 echo "CFLAGS += -DNO_BTRACE"
1263 echo "CFLAGS += -DNO_GDB"
1264 echo "CFLAGS += -DNO_CTX"
1265 echo "CFLAGS += -DNO_PRCTL"
1266 echo "CFLAGS += -DNO_TID"
1267 echo "CFLAGS += -DNO_XSELECT"
1270 LDFLAGS+=" -z noexecstack"
1272 if test "x$BSD" != "x" ; then
1273 echo "CFLAGS += -DNO_PRCTL"
1274 echo "CFLAGS += -DNO_TID"
1275 echo "CFLAGS += -DNO_GDB"
1278 if test [ "$(uname)"] = "NetBSD" ; then
1279 echo "CFLAGS += -DNO_BTRACE"
1280 echo "CFLAGS += -DNO_CTX"
1281 echo "system_libs += -L/usr/pkg/lib/ffmpeg4"
1282 echo "system_libs += -L/usr/pkg/lib/"
1283 echo "system_libs += -lpng16"
1284 echo "system_libs += -lintl"
1285 echo "system_libs += -lossaudio"
1286 echo "CFLAGS += -I/usr/X11R7/include"
1287 echo "CFLAGS += -I/usr/pkg/include/ffmpeg4"
1288 echo "CFLAGS += $(pkg-config --cflags xft)"
1289 echo "CFLAGS += -I/usr/pkg/include"
1290 echo "CFLAGS += -I/usr/pkg/include/uuid"
1294 if test "x$WANT_X264_HIDEPTH" = "xyes" ; then
1295 X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10"
1297 if test "x$WANT_X265_HIDEPTH" = "xyes" ; then
1298 X265_CFG_PARAMS="$X265_CFG_PARAMS -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON"
1301 for pkg in $STATIC_PKGS; do
1302 eval pkg_lib="\$PKG_$pkg"
1303 if test "x$pkg_lib" = "xyes"; then
1304 echo "static_pkgs += $pkg"
1305 elif test "x$pkg_lib" = "xshared"; then
1306 echo "shared_pkgs += $pkg"
1311 for pkg in $STATIC_BLDS; do
1312 echo "static_blds += $pkg"
1314 echo "$ver_pkg := \$(THIRDPARTY)/${!ver_pkg}"
1316 echo "$inc_pkg := \\"
1317 for inc in ${!inc_pkg}; do
1318 echo " -I\$($ver_pkg)/$inc \\"
1321 echo "static_incs += \$(inc_$pkg)"
1323 echo "$lib_pkg := \\"
1324 for lib in ${!lib_pkg}; do
1325 echo " \$($ver_pkg)/$lib \\"
1328 echo "static_libs += \$($lib_pkg)"
1333 for lib in $SHARED_LIBS; do echo "shared_libs += $lib"; done
1335 for lib in $SYSTEM_LIBS; do echo "system_libs += $lib"; done
1336 echo "export static_pkgs shared_pkgs static_blds shared_libs system_libs"
1339 echo "thirdparty_libraries := \$(static_libs) \$(shared_libs)"
1341 if test "x$CFG_RPATH" != "x"; then
1342 echo "libraries+= -Wl,-rpath=$CFG_RPATH"
1345 echo "libraries += -Wl,--start-group"
1346 echo "libraries += \$(thirdparty_libraries)"
1347 echo "libraries += \$(shared_libs)"
1348 echo "libraries += \$(system_libs)"
1349 echo "libraries += \$(EXTRA_LIBS)"
1350 echo "libraries += -Wl,--end-group"
1351 # -Wl,--start-group ... -Wl,--end-group does not work on ubuntu
1352 echo "libraries += \$(thirdparty_libraries)"
1353 echo "libraries += \$(shared_libs)"
1354 echo "libraries += \$(system_libs)"
1355 echo "libraries += \$(EXTRA_LIBS)"
1357 echo "export thirdparty_libraries libraries"
1358 echo "export CFLAGS_ CXXFLAGS_ LDFLAGS_"
1359 echo "unexport CFLAGS CXXFLAGS LDFLAGS"
1361 if test "x$HAVE_tiff" = "xyes"; then
1362 if test "x$HAVE_jbig" != "xyes"; then
1363 echo "tiff.cfg_params+= --disable-jbig"
1367 if test "x$WANT_GIT_FFMPEG" != "xno"; then
1368 echo "ffmpeg.git := $WANT_GIT_FFMPEG"
1370 if test "x$X264_CFG_PARAMS" != "x" ; then
1371 echo "x264.cfg_params :=$X264_CFG_PARAMS --enable-static --enable-pic"
1373 if test "x$X265_CFG_PARAMS" != "x" ; then
1374 echo "x265.cfg_params :=$X265_CFG_PARAMS -DENABLE_SHARED=no"