3 AC_INIT([cinelerra], [5.1], [mail@lists.cinelerra-cv.org])
4 AM_INIT_AUTOMAKE([foreign])
11 CFG_CFLAGS+=" -fno-omit-frame-pointer -fno-math-errno -fno-signed-zeros"
12 CFG_CFLAGS+=" -pthread -Wall"
13 # misguided pedantic warnings
14 CFG_CFLAGS+=" -Wno-unknown-warning"
15 CFG_CFLAGS+=" -Wno-unused-result"
16 CFG_CFLAGS+=" -Wno-stringop-overflow"
17 CFG_CFLAGS+=" -Wno-format-truncation"
18 CFG_CFLAGS+=" -Wno-format-overflow"
19 CFG_CFLAGS+=" -Wno-parentheses"
20 CFG_CFLAGS+=" -Wno-stringop-truncation"
21 CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
22 CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
23 CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
24 CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
25 CFG_CFLAGS+=" -I/usr/include/freetype2"
26 CFG_CFLAGS+=" -I/usr/include/uuid"
27 CFG_CFLAGS+=" -I/usr/include/mjpegtools"
29 AC_DEFUN([CHECK_WITH], [
31 AC_HELP_STRING([--with-[$1]], [$2 ($4)]),
32 [WANT_$3=$withval], [WANT_$3='$4'])
36 CHECK_WITH([jobs],[parallel build jobs],[JOBS],[auto])
37 CHECK_WITH([exec-name],[binary executable name],[CIN],[cin])
38 CHECK_WITH([single-user],[to install cin in bin],[CINBIN_BUILD],[no])
39 CHECK_WITH([ladspa-build],[build ladspa library],[LADSPA_BUILD],[yes])
40 CHECK_WITH([lv2],[lv2 library support],[LV2],[yes])
41 CHECK_WITH([cinlib],[cinelerra library path],[CINLIB_DIR],[auto])
42 CHECK_WITH([cindat],[cinelerra share path],[CINDAT_DIR],[auto])
43 CHECK_WITH([plugin-dir],[plugin install dir],[PLUGIN_DIR],[auto])
44 CHECK_WITH([ladspa-dir],[ladspa install dir],[LADSPA_DIR],[auto])
45 CHECK_WITH([config-dir],[.bcast config dir],[CONFIG_DIR],[$$HOME/.bcast5])
46 CHECK_WITH([browser],[cin_browser path],[CIN_BROWSER],[firefox])
47 CHECK_WITH([git-ffmpeg],[git ffmpeg using url],[GIT_FFMPEG],[no])
48 CHECK_WITH([noelision],[use noelision/libpthread],[NOELISION],[auto])
49 CHECK_WITH([libzmpeg],[build libzmpeg],[LIBZMPEG],[yes])
50 CHECK_WITH([commercial],[enable commercial capture],[COMMERCIAL],[yes])
51 CHECK_WITH([thirdparty],[use thirdparty build],[CIN_3RDPARTY],[yes])
53 if test "x$WANT_LV2" != "xno"; then
54 GTK2_LIBS=`pkg-config --libs gtk+-2.0`
55 AC_CHECK_LIB([m], [gtk_init], [HAVE_gtk=yes], [HAVE_gtk=no], [$GTK2_LIBS])
56 test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --cflags gtk+-2.0`" && HAVE_gtk=no
57 test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --libs gtk+-2.0`" && HAVE_gtk=no
58 if test "x$HAVE_gtk" = "xno"; then
59 AC_MSG_ERROR([LV2 requires gtk+-2.0 support.])
63 if test "x$WANT_COMMERCIAL" = "xyes" -a "x$WANT_LIBZMPEG" != "xyes" ; then
64 AC_MSG_ERROR([commercial requires libzmpeg support.])
67 if test "x$WANT_CINBIN_BUILD" = "xyes"; then
68 WANT_LOCALE_DIR='$$CIN_LIB/locale'
69 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR='$$CIN_PATH'
70 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR='$$CIN_PATH'
71 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR='$$CIN_LIB/plugins'
72 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR='$$CIN_LIB/ladspa'
74 lcldir=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
75 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
76 eval "dir=\"$localedir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
78 usrdat=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
79 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
80 eval "dir=\"$datadir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
82 usrlib=`test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"; \
83 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
84 eval "dir=\"$libdir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
86 test "x$usrlib" = "x/lib" -o "x$usrlib" = "x/usr/lib" -o \
87 "x$usrlib" = "x/usr/local/lib" -a -e "/usr/lib64" && \
88 test ! -e "/usr/lib" -o `ls -1 /usr/lib64 | wc -l` -gt `ls -1 /usr/lib | wc -l` && \
90 WANT_LOCALE_DIR="$lcldir"
91 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR="$usrdat/$WANT_CIN"
92 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR="$usrlib/$WANT_CIN"
93 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR="$WANT_CINLIB_DIR/plugins"
94 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR="$WANT_CINLIB_DIR/ladspa"
99 if test "x$WANT_LIBZMPEG" = "xyes"; then
100 CIN_INSTALLS+=" zmp_install"
101 CIN_UNINSTALLS+=" zmp_uninstall"
103 if test "x$WANT_COMMERCIAL" = "xyes"; then
104 CIN_INSTALLS+=" com_install"
105 CIN_UNINSTALLS+=" com_uninstall"
107 if test "x$WANT_LADSPA_BUILD" = "xyes"; then
108 CIN_INSTALLS+=" lad_install "
109 CIN_UNINSTALLS+=" lad_uninstall "
111 if test "x$WANT_LV2" = "xyes"; then
112 CIN_INSTALLS+=" lv2_install "
113 CIN_UNINSTALLS+=" lv2_uninstall "
115 AC_SUBST(CIN_INSTALLS)
116 AC_SUBST(CIN_UNINSTALLS)
118 if test "x$WANT_CINBIN_BUILD" = "xyes"; then
119 MAK_INSTALLS="dvl_install"
120 MAK_UNINSTALLS="dvl_uninstall"
122 MAK_INSTALLS=" sys_install"
123 MAK_UNINSTALLS="sys_uninstall"
125 AC_SUBST(MAK_INSTALLS)
126 AC_SUBST(MAK_UNINSTALLS)
128 if test "x$WANT_JOBS" = "xauto"; then
129 CPUS=`grep -c "^proc" /proc/cpuinfo`
130 WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
142 AC_HELP_STRING([--enable-$1],[build $1 ($2)]),
143 [PKG_$1=$enableval], [PKG_$1=$2])
144 PKG_DEF([$1],[$3],[$4],[$5])
149 PKG_3RD([a52dec],[yes],
151 [ liba52/.libs/liba52.a ],
154 PKG_3RD([djbfft],[yes],
159 PKG_3RD([audiofile],[no],
161 [ libaudiofile/.libs/libaudiofile.a \
162 libaudiofile/modules/.libs/libmodules.a \
163 libaudiofile/alac/.libs/libalac.a ],
166 PKG_3RD([encore],[no],
168 [ \$(OBJDIR)/libencore.a ],
171 PKG_3RD([esound],[no],
177 PKG_3RD([fdk],[auto],
179 [ .libs/libfdk-aac.a ],
180 [ libAACdec/include libAACenc/include libSYS/include ])
182 PKG_3RD([ffmpeg],[yes],
184 [ libavutil/libavutil.a \
185 libavcodec/libavcodec.a \
186 libpostproc/libpostproc.a \
187 libavdevice/libavdevice.a \
188 libavformat/libavformat.a \
189 libswscale/libswscale.a \
190 libavfilter/libavfilter.a \
191 libswresample/libswresample.a ],
194 if test "x$WANT_GIT_FFMPEG" != "xno" ; then
195 ver_ffmpeg="ffmpeg.git"
198 PKG_3RD([fftw],[auto],
201 libbench2/libbench2.a \
202 rdft/scalar/r2cb/.libs/librdft_scalar_r2cb.a \
203 rdft/scalar/r2r/.libs/librdft_scalar_r2r.a \
204 rdft/scalar/.libs/librdft_scalar.a \
205 rdft/scalar/r2cf/.libs/librdft_scalar_r2cf.a \
206 rdft/.libs/librdft.a \
208 reodft/.libs/libreodft.a \
209 dft/scalar/codelets/.libs/libdft_scalar_codelets.a \
210 dft/scalar/.libs/libdft_scalar.a \
212 kernel/.libs/libkernel.a \
213 simd-support/.libs/libsimd_support.a ],
216 PKG_3RD([flac],[auto],
218 [ src/libFLAC/.libs/libFLAC.a \
219 src/libFLAC++/.libs/libFLAC++.a \
220 src/share/replaygain_analysis/.libs/libreplaygain_analysis.a \
221 src/share/replaygain_synthesis/.libs/libreplaygain_synthesis.a \
222 src/share/grabbag/.libs/libgrabbag.a \
223 src/share/utf8/.libs/libutf8.a \
224 src/test_libs_common/.libs/libtest_libs_common.a ],
227 PKG_3RD([giflib],[yes],
229 [ lib/.libs/libgif.a \
233 PKG_3RD([ilmbase],[auto],
235 [ Iex/.libs/libIex.a \
236 IexMath/.libs/libIexMath.a \
237 Half/.libs/libHalf.a \
238 Imath/.libs/libImath.a \
239 IlmThread/.libs/libIlmThread.a ],
240 [ Iex Half Imath config IlmThread ])
242 PKG_DEF([ladspa], [ladspa-0.4.17], [], [])
244 PKG_3RD([lame],[auto],
246 [ libmp3lame/.libs/libmp3lame.a \
247 mpglib/.libs/libmpgdecoder.a ],
250 PKG_3RD([libavc1394],[auto],
252 [ libavc1394/.libs/libavc1394.a \
253 librom1394/.libs/librom1394.a \
254 common/.libs/libraw1394util.a ],
257 PKG_3RD([libraw1394],[auto],
259 [ src/.libs/libraw1394.a ],
262 PKG_3RD([libiec61883],[auto],
264 [ src/.libs/libiec61883.a ],
267 PKG_3RD([libdv],[auto],
269 [ libdv/.libs/libdv.a ],
272 PKG_3RD([libjpeg],[auto],
273 [libjpeg-turbo-1.5.1],
275 .libs/libturbojpeg.a \
276 simd/.libs/libsimd.a ],
279 PKG_3RD([opus],[auto],
284 PKG_3RD([openjpeg],[auto],
286 [ bin/libopenjp2.a ],
289 PKG_3RD([libogg],[auto],
291 [ src/.libs/libogg.a ],
294 PKG_3RD([libsndfile],[auto],
296 [ src/.libs/libsndfile.a \
297 src/.libs/libcommon.a \
298 src/G72x/.libs/libg72x.a \
299 src/GSM610/.libs/libgsm.a ],
302 PKG_3RD([libtheora],[auto],
304 [ lib/.libs/libtheora.a \
305 lib/.libs/libtheoradec.a \
306 lib/.libs/libtheoraenc.a ],
309 PKG_3RD([libuuid],[yes],
314 PKG_3RD([libvorbis],[auto],
316 [ lib/.libs/libvorbis.a \
317 lib/.libs/libvorbisenc.a \
318 lib/.libs/libvorbisfile.a ],
321 PKG_3RD([mjpegtools],[yes],
323 [ utils/mmxsse/.libs/libmmxsse.a \
324 utils/.libs/libmjpegutils.a \
325 lavtools/.libs/liblavfile.a \
326 lavtools/.libs/liblavjpeg.a \
327 mplex/.libs/libmplex2.a \
328 yuvfilters/.libs/libyuvfilters.a \
329 mpeg2enc/.libs/libmpeg2encpp.a ],
330 [ . lavtools utils ])
332 PKG_3RD([openexr],[auto],
334 [ IlmImf/.libs/libIlmImf.a \
335 IlmImfUtil/.libs/libIlmImfUtil.a ],
338 #PKG_3RD([festival],[no],
342 #PKG_3RD(speech_tools,[no],
347 PKG_3RD([tiff],[auto],
349 [ libtiff/.libs/libtiff.a \
350 libtiff/.libs/libtiffxx.a \
351 port/.libs/libport.a ],[
354 PKG_3RD([twolame],[auto],
356 [ libtwolame/.libs/libtwolame.a ],
359 PKG_3RD([x264],[auto],
360 [x264-snapshot-20180118-2245],
364 PKG_3RD([x265],[auto],
369 PKG_3RD([libvpx],[auto],
374 PKG_3RD([lv2],[auto],
377 [ usr/local/include usr/local/lib64/lv2 usr/local/lib/lv2 ])
379 PKG_3RD([sratom],[auto],
381 [ usr/local/lib/libsratom-0.a ],
382 [ usr/local/include ])
384 PKG_3RD([serd],[auto],
386 [ usr/local/lib/libserd-0.a ],
387 [ usr/local/include ])
389 PKG_3RD([sord],[auto],
391 [ usr/local/lib/libsord-0.a ],
392 [ usr/local/include ])
394 PKG_3RD([lilv],[auto],
396 [ usr/local/lib/liblilv-0.a ],
397 [ usr/local/include ])
399 PKG_3RD([suil],[auto],
401 [ usr/local/lib/libsuil-0.a ],
402 [ usr/local/include ])
404 AC_SUBST(STATIC_PKGS)
406 AC_DEFUN([CHECK_ENABLE], [
408 AC_HELP_STRING([--enable-[$1]], [$3 ([$4])]),
409 [WANT_$2=$enableval], [WANT_$2=[$4]])
412 CHECK_ENABLE([static-build], [STATIC_BUILD], [build static], [auto])
413 CHECK_ENABLE([x264_hidepth], [X264_HIDEPTH], [build x264 10bit], [no])
414 CHECK_ENABLE([x265_hidepth], [X265_HIDEPTH], [build x265 10bit], [no])
416 test "x$WANT_STATIC_BUILD" = "xauto" && WANT_STATIC_BUILD=$WANT_CINBIN_BUILD
418 AC_DEFUN([CHECK_PROG], [
419 AC_CHECK_PROG([PROG_$1], [$2], [yes],[no])
421 AC_DEFUN([REQUIRE_PROG], [
422 CHECK_PROG([$1],[$2])
423 if test "x$PROG_$1" = "xno"; then
424 AC_MSG_WARN([$2 is missing and required.])
429 # Checks for programs.
431 REQUIRE_PROG(NASM, [nasm])
432 REQUIRE_PROG(YASM, [yasm])
433 REQUIRE_PROG(OBJCOPY, [objcopy])
434 if test "x$FATAL_ERROR" != "x"; then
435 AC_MSG_ERROR("fatal eror.")
437 CHECK_PROG(PACTL, [pactl])
438 WANT_PACTL=$PROG_PACTL
441 AC_MSG_CHECKING([nasm x264 compatible])
442 echo "vmovdqa32 [[eax]]{k1}{z}, zmm0" > conftest.asm
443 nasm conftest.asm -o conftest.o > /dev/null 2>&1
444 if test $? != 0 ; then
446 AC_MSG_WARN([libx264 built without assembly code])
447 X264_CFG_PARAMS="$X264_CFG_PARAMS --disable-asm"
451 rm -f conftest.asm conftest.o
453 AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
454 if test "$no_utf" = "yes"; then
455 AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
458 # Checks for headers/libraries.
460 AC_DEFUN([CHECK_HEADERS], [
461 if test "x$HAVE_$1" != "xno"; then
462 AC_CHECK_HEADER(m4_apply([m4_car],m4_split([$3])), [HAVE_$1=yes], [HAVE_$1=no],
463 [m4_foreach([i], m4_split([$3]), [[#include "]i["
466 AC_MSG_CHECKING([$2])
467 AC_MSG_RESULT([$HAVE_$1])
468 if test "x$HAVE_$1" = "xno"; then
469 if test "x$PKG_$1" = "x"; then RESULT=no; fi
474 AC_DEFUN([CHECK_LIB], [
475 if test "x$HAVE_$1" != "xno"; then
476 if test "x$PKG_$1" = "x" -o "x$WANT_STATIC_BUILD" = "xno"; then
477 AC_CHECK_LIB([$2], [$3], [HAVE_$1=yes], [HAVE_$1=no], [$4])
479 if test "x$HAVE_$1" = "xyes"; then
480 if test "x$PKG_$1" = "x"; then
481 SYSTEM_LIBS+=" -l[$2]"
482 for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
485 for lib in [$4]; do SHARED_LIBS+=" $lib"; done
487 elif test "x$PKG_$1" = "x"; then RESULT=no; fi
492 CHECK_LIB([X11], [X11], [XOpenDisplay])
493 CHECK_HEADERS([X11], [X11 headers], [X11/X.h X11/Xlib.h X11/Xutil.h X11/cursorfont.h])
494 CHECK_HEADERS([X11], [X11 headers], [X11/keysym.h X11/Sunkeysym.h X11/Xatom.h X11/XF86keysym.h])
495 CHECK_LIB([XEXT], [Xext], [XShmQueryExtension])
496 CHECK_HEADERS([XEXT], [Xlib XShm extention], [X11/Xlib.h X11/extensions/XShm.h X11/extensions/shape.h])
497 CHECK_LIB([XINERAMA], [Xinerama], [XineramaQueryExtension])
498 CHECK_HEADERS([XINERAMA], [Xinerama headers], [X11/extensions/Xinerama.h])
499 CHECK_LIB([XV], [Xv], [XvQueryExtension])
500 CHECK_HEADERS([XV], [Xlib Xv extention], [X11/Xlib.h X11/extensions/Xvlib.h])
501 CHECK_LIB([XFIXES], [Xfixes], [XFixesQueryVersion])
502 CHECK_LIB([BZ2], [bz2], [BZ2_bzDecompress])
503 CHECK_LIB([FONTCONFIG], [fontconfig], [FcInit])
504 CHECK_LIB([FREETYPE], [freetype], [FT_Init_FreeType])
505 CHECK_LIB([LZMA], [lzma], [lzma_version_number])
506 CHECK_LIB([PNG], [png], [png_read_png])
507 CHECK_LIB([PTHREAD], [pthread], [pthread_create])
508 CHECK_LIB([Z], [z], [gzopen])
509 CHECK_LIB([fftw], [fftw3], [fftw_execute])
510 CHECK_HEADERS([fftw], [fftw headers], [fftw3.h])
511 CHECK_LIB([libuuid], [uuid], [uuid_clear])
512 CHECK_HEADERS([libuuid], [uuid headers], [uuid/uuid.h])
513 CHECK_HEADERS([LINUX_CDROM], [linux cdrom headers], [linux/cdrom.h linux/futex.h])
514 CHECK_HEADERS([LINUX_SYS], [linux sys], [sys/ioctl.h sys/stat.h sys/types.h sys/time.h sys/syscall.h])
515 CHECK_LIB([flac], [FLAC], [FLAC__stream_decoder_new])
516 CHECK_HEADERS([flac], [FLAC headers], [FLAC/stream_decoder.h])
517 CHECK_LIB([lame], [mp3lame], [lame_init])
518 CHECK_HEADERS([lame], [lame headers], [lame/lame.h])
519 CHECK_LIB([libjpeg], [jpeg], [jpeg_start_decompress])
520 CHECK_HEADERS([libjpeg], [jpeg headers], [stdio.h jpeglib.h])
521 CHECK_LIB([libogg], [ogg], [ogg_stream_init])
522 CHECK_HEADERS([libogg], [ogg headers], [ogg/ogg.h])
523 CHECK_LIB([openjpeg], [openjp2], [opj_version])
524 CHECK_HEADERS([openjpeg], [openjpeg headers], [openjpeg.h])
525 CHECK_LIB([libsndfile], [sndfile], [sf_open])
526 CHECK_HEADERS([libsndfile], [sndfile headers], [sndfile.h])
527 CHECK_LIB([ilmbase], [IlmImf], [ImfOpenInputFile])
528 CHECK_HEADERS([ilmbase], [IlmImf headers], [OpenEXR/ImfCRgbaFile.h])
529 CHECK_LIB([libtheora], [theora], [theora_info_init], [-ltheoraenc -ltheoradec -logg])
530 CHECK_HEADERS([libtheora], [threora headers], [theora/theoraenc.h])
531 CHECK_LIB([libvorbis], [vorbisenc], [vorbis_encode_init], [-lvorbis -lvorbisfile -logg])
532 CHECK_HEADERS([libvorbis], [vorbis encoders headers], [vorbis/vorbisenc.h])
533 CHECK_LIB([libvorbis], [vorbisfile], [ov_open])
534 CHECK_HEADERS([libvorbis], [vorbis file headers], [vorbis/vorbisfile.h])
535 CHECK_LIB([libvpx], [vpx], [vpx_codec_decode])
536 CHECK_HEADERS([libvpx], [vpx headers], [vpx/vpx_decoder.h])
537 CHECK_LIB([mjpegtools], [mjpegutils], [mjpeg_info])
538 CHECK_HEADERS([mjpegtools], [mjpegtools headers], [mjpegtools/mjpeg_types.h])
539 CHECK_LIB([tiff], [tiff], [TIFFOpen])
540 CHECK_HEADERS([tiff], [tiff headers], [tiff.h tiffio.h])
541 CHECK_LIB([twolame], [twolame], [twolame_encode_buffer_float32_interleaved])
542 CHECK_HEADERS([twolame], [twolame headers], [twolame.h])
543 CHECK_LIB([x264], [x264], [x264_encoder_encode])
544 CHECK_HEADERS([x264], [x264 headers], [stdint.h x264.h])
545 CHECK_LIB([x265], [x265], [x265_encoder_encode])
546 CHECK_HEADERS([x265], [x265 headers], [x265.h])
547 CHECK_LIB([a52dec], [a52], [a52_init])
548 CHECK_HEADERS([a52dec], [a52 headers], [a52.h])
549 CHECK_LIB([encore], [encore], [encore])
550 CHECK_HEADERS([encore], [encore headers], [encore.h])
551 CHECK_LIB([giflib], [gif], [DGifOpen])
552 CHECK_HEADERS([giflib], [gif lib headers], [gif_lib.h])
553 CHECK_LIB([fdk], [fdk-aac], [faacDecInit])
554 CHECK_HEADERS([fdk], [fdk headers], [fdk-aac/genericStds.h])
555 CHECK_LIB([jbig], [jbig], [jbg_dec_init])
556 CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11])
558 #if test "x$HAVE_mjpegtools" = "xyes"; then
559 #CFG_CFLAGS+=" -I/usr/include/mjpegtools"
562 AC_DEFUN([CHECK_WANT], [
565 if test "x$WANT_$1" != "xyes" -a "x$WANT_$1" != "xno" ; then
566 AC_ARG_WITH(m4_tolower([$1]),
567 AC_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))], [$3] (auto)),
568 [WANT_$1=$withval],[WANT_$1=$2])
570 if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then
571 echo "=== want $1 Failed."
573 elif test "x$WANT_$1" = "xauto" ; then
581 CHECK_WANT([GL], [auto], [use opengl], [
582 CHECK_LIB([GL], [GL], [glUseProgram])
583 CHECK_LIB([GL], [GLU], [gluOrtho2D])
584 CHECK_HEADERS([GL], [opengl headers], [GL/gl.h GL/glext.h GL/glu.h GL/glx.h])])
586 CHECK_WANT([OSS], [auto], [use OSS audio], [
587 CHECK_HEADERS([OSS], [oss headers], [sys/soundcard.h])])
589 CHECK_WANT([XFT], [auto], [use libXft], [
590 CHECK_LIB([XFT], [Xft], [XftInit])
591 CHECK_HEADERS([XFT], [Xft/freetype headers], [X11/Xlib.h X11/Xft/Xft.h])])
593 CHECK_WANT([ALSA], [auto], [use libasound/alsa], [
594 CHECK_LIB([ALSA], [asound], [snd_pcm_open])
595 CHECK_HEADERS([ALSA], [asound headers], [alsa/asoundlib.h])])
597 CHECK_WANT([FIREWIRE], [auto], [use firewire], [
598 CHECK_LIB([libavc1394], [avc1394], [avc1394_init_target])
599 CHECK_HEADERS([libavc1394], [libavc1394 headers], [libavc1394/avc1394.h])
600 CHECK_LIB([libavc1394], [rom1394], [rom1394_get_bus_id])
601 CHECK_HEADERS([libavc1394], [librom1394 headers], [libavc1394/rom1394.h])
602 CHECK_LIB([libiec61883], [iec61883], [iec61883_mpeg2_recv_init])
603 CHECK_HEADERS([libiec61883], [libiec61883 headers], [libiec61883/iec61883.h])
604 CHECK_LIB([libraw1394], [raw1394], [raw1394_iso_recv_init])
605 CHECK_HEADERS([libraw1394], [libraw1394 headers], [libraw1394/raw1394.h])])
607 CHECK_WANT([DV], [auto], [use dv], [
608 CHECK_LIB([libdv], [dv], [dv_init])
609 CHECK_HEADERS([libdv], [libdv headers], [libdv/dv.h])])
611 CHECK_WANT([DVB], [auto], [use dvb], [
612 CHECK_HEADERS([DVB], [dvb device headers], [linux/dvb/dmx.h linux/dvb/frontend.h])])
614 CHECK_WANT([VIDEO4LINUX2], [auto], [use v4l2], [
615 CHECK_HEADERS([VIDEO4LINUX2], [v4l2 system headers], [linux/kernel.h linux/types.h linux/videodev2.h])])
617 CHECK_WANT([XXF86VM], [auto], [use xf86vmode], [
618 CHECK_HEADERS([XXF86VM], [XF86VM headers], [X11/Xlib.h X11/extensions/xf86vmode.h])])
620 CHECK_WANT([ESOUND], [no], [use esd], [
621 CHECK_LIB([esound], [esd], [esd_open_sound])
622 CHECK_HEADERS([esound], [esound headers], [esd.h])
623 CHECK_LIB([audiofile], [audiofile], [afOpenFile])
624 CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
626 CHECK_WANT([OPUS], [auto], [use libopus], [
627 CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
628 CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])])
630 CHECK_WANT([LV2], [auto], [use lv2], [
631 saved_CFLAGS="$CFLAGS"
632 CHECK_LIB([lilv], [lilv-0], [lilv_world_new])
633 CHECK_LIB([sord], [sord-0], [sord_world_new])
634 CHECK_LIB([serd], [serd-0], [serd_reader_new])
635 CHECK_LIB([sratom], [sratom-0], [sratom_new])
636 CFLAGS="-I/usr/include/lilv-0"
637 CHECK_HEADERS([lv2], [lilv headers], [lilv/lilv.h])
638 CHECK_LIB([suil], [suil-0], [suil_instance_new])
639 CFLAGS="-I/usr/include/suil-0"
640 CHECK_HEADERS([lv2], [suil headers], [suil/suil.h])
641 CFLAGS="$saved_CFLAGS"])
643 CHECK_WANT([DL], [auto], [system has libdl], [
644 CHECK_LIB([DL], [dl], [dlopen])])
646 CHECK_WANT([EXR], [auto], [use exr], [])
648 CHECK_WANT([OPENCV], [no], [opencv=sys/sta/dyn,git/tar=url], [
651 CHECK_WANT([NUMA], [auto], [system has libnuma], [
652 CHECK_LIB([NUMA], [numa], [numa_alloc])])
654 CHECK_WANT([OPENEXR], [auto], [use openexr], [
655 AC_MSG_CHECKING([for openexr available])
657 saved_CXXFLAGS="$CXXFLAGS"
659 LIBS=" -lIlmImf -lIlmThread -lIex -lpthread"
660 CXXFLAGS="-I/usr/include/OpenEXR"
662 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
663 #include "ImfChannelList.h"
664 #include "ImfChromaticities.h"
665 #include "ImfCompression.h"
667 #include "ImfInputFile.h"
668 #include "ImfOutputFile.h"
669 #include "ImfPixelType.h"
670 #include "ImfRgbaFile.h"
671 #include "ImfRgbaYca.h"
672 #include "ImfVersion.h"
673 class EXRIStream : public Imf::IStream { public:
674 EXRIStream() : Imf::IStream("mypath") {} };
675 class EXROStream : public Imf::OStream { public:
676 EXROStream() : Imf::OStream("mypath") {} };
677 ]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no])
678 RESULT="$HAVE_OPENEXR"
679 if test "x$RESULT" = "xyes"; then
680 SHARED_openexr="$LIBS"
681 CFG_CFLAGS+=" -I/usr/include/OpenEXR"
684 CXXFLAGS="$saved_CXXFLAGS"
686 AC_MSG_RESULT([$HAVE_OPENEXR])
688 AC_SUBST([HAVE_OPENEXR])
690 # build global_config
694 echo "AC_HELP_STRING([Reason],[Package])"
695 echo "AC_HELP_STRING([------],[-------])"
697 AC_DEFUN([PKG_DISABLED],[
701 echo "AC_HELP_STRING([disabled],[$1])"
703 AC_DEFUN([PKG_SHARED],[
706 SHARED_LIBS+="$SHARED_$1"
707 echo "AC_HELP_STRING([shared],[$1])"
710 AC_DEFUN([PKG_STATIC],[
711 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
716 echo "AC_HELP_STRING([$2],[$1])"
720 AC_DEFUN([PKG_FORCED],[PKG_STATIC([$1],[forced])])
722 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
725 ffmpeg/twolame ffmpeg/lame ffmpeg/openjpeg \
726 ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/x265 ffmpeg/fdk \
727 libiec61883/libraw1394 libavc1394/librom1394 \
728 openexr/ilmbase ilmbase/libogg \
729 libtheora/libogg libtheora/libvorbis ; do
730 lib=`dirname $dep`; needs=`basename $dep`
731 eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs";
732 if test "x$pkg_lib" != "xno"; then
733 eval "PKG_$needs=yes"
738 AC_DEFUN([PKG_PROVIDE],[
739 if test "x$BUILD_$1" = "x" ; then
740 if test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
742 elif test "x$PKG_$1" = "xyes"; then
744 elif test "x$WANT_STATIC_BUILD" = "xyes"; then
745 PKG_STATIC([$1],[static])
746 elif test "x$HAVE_$1" = "xyes"; then
749 PKG_STATIC([$1],[needed])
754 PKG_PROVIDE([a52dec])
755 PKG_PROVIDE([djbfft])
756 PKG_PROVIDE([encore])
757 PKG_PROVIDE([audiofile],[$WANT_ESOUND])
758 PKG_PROVIDE([esound],[$WANT_ESOUND])
760 PKG_PROVIDE([ffmpeg])
763 PKG_PROVIDE([giflib])
764 PKG_PROVIDE([ilmbase], [$WANT_OPENEXR])
765 PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD])
767 PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE])
768 PKG_PROVIDE([libraw1394],[$WANT_FIREWIRE])
769 PKG_PROVIDE([libiec61883],[$WANT_FIREWIRE])
770 PKG_PROVIDE([libdv],[$WANT_DV])
771 PKG_PROVIDE([libjpeg])
772 PKG_PROVIDE([libogg])
773 PKG_PROVIDE([libsndfile])
774 PKG_PROVIDE([libtheora])
775 PKG_PROVIDE([libuuid])
776 PKG_PROVIDE([libvorbis])
777 PKG_PROVIDE([mjpegtools])
778 PKG_PROVIDE([openexr], [$WANT_OPENEXR])
779 PKG_PROVIDE([openjpeg])
781 PKG_PROVIDE([twolame])
784 PKG_PROVIDE([libvpx])
785 PKG_PROVIDE([opus], [$WANT_OPUS])
786 PKG_PROVIDE([lv2], [$WANT_LV2])
787 PKG_PROVIDE([lilv], [$WANT_LV2])
788 PKG_PROVIDE([sratom], [$WANT_LV2])
789 PKG_PROVIDE([serd], [$WANT_LV2])
790 PKG_PROVIDE([sord], [$WANT_LV2])
791 PKG_PROVIDE([suil], [$WANT_LV2])
793 if test "x$WANT_LV2" = "xyes"; then
794 if test "x$HAVE_lv2" = "xyes" -a "x$BUILD_lilv" = "x0"; then
795 CFG_CFLAGS+=' -I/usr/include/lilv-0 -I/usr/include/suil-0'
799 AC_SUBST(STATIC_BLDS)
800 AC_SUBST(SHARED_LIBS)
802 for f in $SYSTEM_LIBS; do
803 echo "AC_HELP_STRING([system],[$f])"
805 AC_SUBST(SYSTEM_LIBS)
808 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
809 CFG_CFLAGS+=" -DHAVE_CIN_3RDPARTY"
811 for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
812 VIDEO4LINUX2 ESOUND PACTL OPENEXR LV2 \
813 COMMERCIAL LIBZMPEG; do
815 if test "x$vv" != "xno"; then
816 CFG_CFLAGS+=" -DHAVE_$v"
821 v=`echo "$v" | tr "A-Z" "a-z"`
822 echo " using: $vv-$v"
825 echo " using: with-jobs = $WANT_JOBS"
826 echo " using: exec-name = $WANT_CIN"
827 echo " using: with-cinlib = $WANT_CINLIB_DIR"
828 echo " using: with-cindat = $WANT_CINDAT_DIR"
829 echo " using: with-config-dir = $WANT_CONFIG_DIR"
830 echo " using: with-browser = $WANT_CIN_BROWSER"
831 echo " using: with-plugin-dir = $WANT_PLUGIN_DIR"
832 echo " using: with-ladspa-dir = $WANT_LADSPA_DIR"
833 echo " using: with-opencv = $WANT_OPENCV"
834 echo " using: with-git-ffmpeg = $WANT_GIT_FFMPEG"
835 echo " using: with-noelision = $WANT_NOELISION"
836 echo " using: with-libzmpeg = $WANT_LIBZMPEG"
837 echo " using: with-commerical = $WANT_COMMERCIAL"
839 echo " using: thirdparty build = $WANT_CIN_3RDPARTY"
840 echo " using: single-user = $WANT_CINBIN_BUILD"
841 echo " using: static-build = $WANT_STATIC_BUILD"
842 echo " using: ladspa-build = $WANT_LADSPA_BUILD"
846 if test "x$HAVE_tiff" = "xyes"; then
847 if test "x$HAVE_jbig" = "xyes"; then
848 EXTRA_LIBS+=' -ljbig'
851 if test "x$HAVE_NUMA" = "xyes"; then
852 EXTRA_LIBS+=' -lnuma'
854 if test "x$HAVE_DL" = "xyes"; then
856 FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
858 if test "x$WANT_OPUS" = "xyes"; then
859 FFMPEG_EXTRA_CFG+=' --enable-libopus'
860 if test "x$HAVE_opus" = "xyes" -a "x$BUILD_opus" = "x0"; then
861 EXTRA_LIBS+=' -lopus'
862 CFG_CFLAGS+=' -I/usr/include/opus'
866 # intel lock elision bugs
867 if test "x$WANT_NOELISION" != "xno"; then
868 CFG_RPATH=`ls -1fd 2> /dev/null \
871 /usr/lib64/noelision \
876 AC_SUBST(WANT_CIN_3RDPARTY)
878 AC_SUBST(FFMPEG_EXTRA_CFG)
879 AC_SUBST(WANT_X264_HIDEPTH)
880 AC_SUBST(WANT_X265_HIDEPTH)
883 AC_SUBST(CFG_CXXFLAGS)
885 AC_CONFIG_FILES([Makefile])
890 echo "SHELL := /bin/bash"
892 echo "WANT_JOBS := $WANT_JOBS"
894 echo "OBJDIR := $OBJDIR"
895 echo "BINDIR := \$(TOPDIR)/bin"
896 echo "CINELERRA := \$(TOPDIR)/cinelerra"
897 echo "GUICAST := \$(TOPDIR)/guicast"
898 echo "LIBZMPEG3 := \$(TOPDIR)/libzmpeg3"
899 echo "MPEG2ENC := \$(TOPDIR)/mpeg2enc"
900 echo "MPLEXLO := \$(TOPDIR)/mplexlo"
901 echo "PLUGINS := \$(TOPDIR)/plugins"
902 echo "TDB := \$(TOPDIR)/db"
903 echo "THIRDPARTY := \$(TOPDIR)/thirdparty"
904 echo "EXTRA_LIBS := $EXTRA_LIBS"
905 echo "FFMPEG_EXTRA_CFG := $FFMPEG_EXTRA_CFG"
906 echo "export OBJDIR BINDIR CINELERRA GUICAST LIBZMPEG3"
907 echo "export MPEG2ENC MPLEXLO PLUGINS TDB"
908 echo "export THIRDPARTY EXTRA_LIBS FFMPEG_EXTRA_CFG"
911 echo "WANT_CIN := $WANT_CIN"
912 CFG_WANTS+=" CIN_3RDPARTY LIBZMPEG COMMERCIAL"
913 for w in $CFG_WANTS; do ww=WANT_$w; echo "WANT_$w := ${!ww}"; done
916 echo "ifndef CFLAGS_"
918 echo "CFLAGS_ := \$(CFLAGS)"
920 echo "CFLAGS_ := ${CFLAGS:--g -O2}"
924 echo "CFLAGS := \$(CFLAGS_)"
925 echo "CFLAGS += '-DCIN=\"\$(WANT_CIN)\"'"
926 echo "CFLAGS += '-DCINLIB_DIR=\"$WANT_CINLIB_DIR\"'"
927 echo "CFLAGS += '-DCINDAT_DIR=\"$WANT_CINDAT_DIR\"'"
928 echo "CFLAGS += '-DCONFIG_DIR=\"$WANT_CONFIG_DIR\"'"
929 echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
930 echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
931 echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
932 echo "CFLAGS += '-DCIN_BROWSER=\"$WANT_CIN_BROWSER\"'"
933 for flg in $CFG_CFLAGS; do echo "CFLAGS += $flg"; done
935 for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
938 if test "x$WANT_X264_HIDEPTH" = "xyes" ; then
939 X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10"
941 if test "x$WANT_X265_HIDEPTH" = "xyes" ; then
942 X265_CFG_PARAMS="$X265_CFG_PARAMS -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON"
945 for pkg in $STATIC_PKGS; do
946 eval pkg_lib="\$PKG_$pkg"
947 if test "x$pkg_lib" = "xno"; then continue; fi;
948 echo "static_pkgs += $pkg"
952 for pkg in $STATIC_BLDS; do
953 echo "static_blds += $pkg"
955 echo "$ver_pkg := \$(THIRDPARTY)/${!ver_pkg}"
957 echo "$inc_pkg := \\"
958 for inc in ${!inc_pkg}; do
959 echo " -I\$($ver_pkg)/$inc \\"
962 echo "static_incs += \$(inc_$pkg)"
964 echo "$lib_pkg := \\"
965 for lib in ${!lib_pkg}; do
966 echo " \$($ver_pkg)/$lib \\"
969 echo "static_libs += \$($lib_pkg)"
974 for lib in $SHARED_LIBS; do echo "shared_libs += $lib"; done
976 for lib in $SYSTEM_LIBS; do echo "system_libs += $lib"; done
977 echo "export static_pkgs static_blds shared_libs system_libs"
980 echo "thirdparty_libraries := \$(static_libs) \$(shared_libs)"
982 if test "x$CFG_RPATH" != "x"; then
983 echo "libraries+= -Wl,-rpath=$CFG_RPATH"
986 echo "libraries += -Wl,--start-group"
987 echo "libraries += \$(thirdparty_libraries)"
988 echo "libraries += \$(system_libs)"
989 echo "libraries += \$(EXTRA_LIBS)"
990 echo "libraries += -Wl,--end-group"
991 # -Wl,--start-group ... -Wl,--end-group does not work on ubuntu
992 echo "libraries += \$(thirdparty_libraries)"
993 echo "libraries += \$(system_libs)"
994 echo "libraries += \$(EXTRA_LIBS)"
996 echo "export thirdparty_libraries libraries"
997 echo "export CFLAGS_ CXXFLAGS_ LDFLAGS_"
998 echo "unexport CFLAGS CXXFLAGS LDFLAGS"
1000 if test "x$HAVE_tiff" = "xyes"; then
1001 if test "x$HAVE_jbig" != "xyes"; then
1002 echo "tiff.cfg_params+= --disable-jbig"
1006 if test "x$WANT_GIT_FFMPEG" != "xno"; then
1007 echo "ffmpeg.git := $WANT_GIT_FFMPEG"
1009 if test "x$WANT_OPUS" = "xyes" -a "x$BUILD_opus" = "x0"; then
1010 echo 'ffmpeg.cflags+=" -I/usr/include/opus"'
1012 if test "x$X264_CFG_PARAMS" != "x" ; then
1013 echo "x264.cfg_params :=$X264_CFG_PARAMS --enable-static --enable-pic"
1015 if test "x$X265_CFG_PARAMS" != "x" ; then
1016 echo "x265.cfg_params :=$X265_CFG_PARAMS -DENABLE_SHARED=no"