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'
76 lcldir=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
77 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
78 eval "dir=\"$localedir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
80 usrdat=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
81 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
82 eval "dir=\"$datadir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
84 usrlib=`test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"; \
85 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
86 eval "dir=\"$libdir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
88 test "x$usrlib" = "x/lib" -o "x$usrlib" = "x/usr/lib" -o \
89 "x$usrlib" = "x/usr/local/lib" -a -e "/usr/lib64" && \
90 test ! -e "/usr/lib" -o `ls -1 /usr/lib64 | wc -l` -gt `ls -1 /usr/lib | wc -l` && \
92 WANT_LOCALE_DIR="$lcldir"
93 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR="$usrdat/$WANT_CIN"
94 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR="$usrlib/$WANT_CIN"
95 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR="$WANT_CINLIB_DIR/plugins"
96 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR="$WANT_CINLIB_DIR/ladspa"
103 if test "x$WANT_JOBS" = "xauto"; then
104 CPUS=`grep -c "^proc" /proc/cpuinfo`
105 WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
117 AC_HELP_STRING([--enable-$1],[build $1 ($2)]),
118 [PKG_$1=$enableval], [PKG_$1=$2])
119 PKG_DEF([$1],[$3],[$4],[$5])
124 PKG_3RD([a52dec],[yes],
126 [ liba52/.libs/liba52.a ],
129 PKG_3RD([djbfft],[yes],
134 PKG_3RD([audiofile],[no],
136 [ libaudiofile/.libs/libaudiofile.a \
137 libaudiofile/modules/.libs/libmodules.a \
138 libaudiofile/alac/.libs/libalac.a ],
141 PKG_3RD([encore],[no],
143 [ \$(OBJDIR)/libencore.a ],
146 PKG_3RD([esound],[no],
152 PKG_3RD([fdk],[auto],
154 [ .libs/libfdk-aac.a ],
155 [ libAACdec/include libAACenc/include libSYS/include ])
157 PKG_3RD([ffmpeg],[yes],
159 [ libavutil/libavutil.a \
160 libavcodec/libavcodec.a \
161 libpostproc/libpostproc.a \
162 libavdevice/libavdevice.a \
163 libavformat/libavformat.a \
164 libswscale/libswscale.a \
165 libavfilter/libavfilter.a \
166 libswresample/libswresample.a ],
169 if test "x$WANT_GIT_FFMPEG" != "xno" ; then
170 ver_ffmpeg="ffmpeg.git"
173 PKG_3RD([fftw],[auto],
176 libbench2/libbench2.a \
177 rdft/scalar/r2cb/.libs/librdft_scalar_r2cb.a \
178 rdft/scalar/r2r/.libs/librdft_scalar_r2r.a \
179 rdft/scalar/.libs/librdft_scalar.a \
180 rdft/scalar/r2cf/.libs/librdft_scalar_r2cf.a \
181 rdft/.libs/librdft.a \
183 reodft/.libs/libreodft.a \
184 dft/scalar/codelets/.libs/libdft_scalar_codelets.a \
185 dft/scalar/.libs/libdft_scalar.a \
187 kernel/.libs/libkernel.a \
188 simd-support/.libs/libsimd_support.a ],
191 PKG_3RD([flac],[auto],
193 [ src/libFLAC/.libs/libFLAC.a \
194 src/libFLAC++/.libs/libFLAC++.a \
195 src/share/replaygain_analysis/.libs/libreplaygain_analysis.a \
196 src/share/replaygain_synthesis/.libs/libreplaygain_synthesis.a \
197 src/share/grabbag/.libs/libgrabbag.a \
198 src/share/utf8/.libs/libutf8.a \
199 src/test_libs_common/.libs/libtest_libs_common.a ],
202 PKG_3RD([giflib],[yes],
204 [ lib/.libs/libgif.a \
208 PKG_3RD([ilmbase],[auto],
210 [ Iex/.libs/libIex.a \
211 IexMath/.libs/libIexMath.a \
212 Half/.libs/libHalf.a \
213 Imath/.libs/libImath.a \
214 IlmThread/.libs/libIlmThread.a ],
215 [ Iex Half Imath config IlmThread ])
217 PKG_DEF([ladspa], [ladspa-0.4.17], [], [])
219 PKG_3RD([lame],[auto],
221 [ libmp3lame/.libs/libmp3lame.a \
222 mpglib/.libs/libmpgdecoder.a ],
225 PKG_3RD([libavc1394],[auto],
227 [ libavc1394/.libs/libavc1394.a \
228 librom1394/.libs/librom1394.a \
229 common/.libs/libraw1394util.a ],
232 PKG_3RD([libraw1394],[auto],
234 [ src/.libs/libraw1394.a ],
237 PKG_3RD([libiec61883],[auto],
239 [ src/.libs/libiec61883.a ],
242 PKG_3RD([libdv],[auto],
244 [ libdv/.libs/libdv.a ],
247 PKG_3RD([libjpeg],[auto],
248 [libjpeg-turbo-1.5.1],
250 .libs/libturbojpeg.a \
251 simd/.libs/libsimd.a ],
254 PKG_3RD([opus],[auto],
259 PKG_3RD([openjpeg],[auto],
261 [ bin/libopenjp2.a ],
264 PKG_3RD([libogg],[auto],
266 [ src/.libs/libogg.a ],
269 PKG_3RD([libsndfile],[auto],
271 [ src/.libs/libsndfile.a \
272 src/.libs/libcommon.a \
273 src/G72x/.libs/libg72x.a \
274 src/GSM610/.libs/libgsm.a ],
277 PKG_3RD([libtheora],[auto],
279 [ lib/.libs/libtheora.a \
280 lib/.libs/libtheoradec.a \
281 lib/.libs/libtheoraenc.a ],
284 PKG_3RD([libuuid],[yes],
289 PKG_3RD([libvorbis],[auto],
291 [ lib/.libs/libvorbis.a \
292 lib/.libs/libvorbisenc.a \
293 lib/.libs/libvorbisfile.a ],
296 PKG_3RD([mjpegtools],[yes],
298 [ utils/mmxsse/.libs/libmmxsse.a \
299 utils/.libs/libmjpegutils.a \
300 lavtools/.libs/liblavfile.a \
301 lavtools/.libs/liblavjpeg.a \
302 mplex/.libs/libmplex2.a \
303 yuvfilters/.libs/libyuvfilters.a \
304 mpeg2enc/.libs/libmpeg2encpp.a ],
305 [ . lavtools utils ])
307 PKG_3RD([openexr],[auto],
309 [ IlmImf/.libs/libIlmImf.a \
310 IlmImfUtil/.libs/libIlmImfUtil.a ],
313 #PKG_3RD([festival],[no],
317 #PKG_3RD(speech_tools,[no],
322 PKG_3RD([tiff],[auto],
324 [ libtiff/.libs/libtiff.a \
325 libtiff/.libs/libtiffxx.a \
326 port/.libs/libport.a ],[
329 PKG_3RD([twolame],[auto],
331 [ libtwolame/.libs/libtwolame.a ],
334 PKG_3RD([x264],[auto],
335 [x264-snapshot-20180118-2245],
339 PKG_3RD([x265],[auto],
344 PKG_3RD([libvpx],[auto],
349 PKG_3RD([lv2],[auto],
352 [ usr/local/include usr/local/lib64/lv2 usr/local/lib/lv2 ])
354 PKG_3RD([sratom],[auto],
356 [ usr/local/lib/libsratom-0.a ],
357 [ usr/local/include ])
359 PKG_3RD([serd],[auto],
361 [ usr/local/lib/libserd-0.a ],
362 [ usr/local/include ])
364 PKG_3RD([sord],[auto],
366 [ usr/local/lib/libsord-0.a ],
367 [ usr/local/include ])
369 PKG_3RD([lilv],[auto],
371 [ usr/local/lib/liblilv-0.a ],
372 [ usr/local/include ])
374 PKG_3RD([suil],[auto],
376 [ usr/local/lib/libsuil-0.a ],
377 [ usr/local/include ])
379 AC_SUBST(STATIC_PKGS)
381 AC_DEFUN([CHECK_ENABLE], [
383 AC_HELP_STRING([--enable-[$1]], [$3 ([$4])]),
384 [WANT_$2=$enableval], [WANT_$2=[$4]])
387 CHECK_ENABLE([static-build], [STATIC_BUILD], [build static], [auto])
388 CHECK_ENABLE([x264_hidepth], [X264_HIDEPTH], [build x264 10bit], [no])
389 CHECK_ENABLE([x265_hidepth], [X265_HIDEPTH], [build x265 10bit], [no])
391 test "x$WANT_STATIC_BUILD" = "xauto" && WANT_STATIC_BUILD=$WANT_CINBIN_BUILD
393 AC_DEFUN([CHECK_PROG], [
394 AC_CHECK_PROG([PROG_$1], [$2], [yes],[no])
396 AC_DEFUN([REQUIRE_PROG], [
397 CHECK_PROG([$1],[$2])
398 if test "x$PROG_$1" = "xno"; then
399 AC_MSG_WARN([$2 is missing and required.])
404 # Checks for programs.
406 REQUIRE_PROG(NASM, [nasm])
407 REQUIRE_PROG(YASM, [yasm])
408 REQUIRE_PROG(OBJCOPY, [objcopy])
409 if test "x$FATAL_ERROR" != "x"; then
410 AC_MSG_ERROR("fatal eror.")
412 CHECK_PROG(PACTL, [pactl])
413 WANT_PACTL=$PROG_PACTL
416 AC_MSG_CHECKING([nasm x264 compatible])
417 echo "vmovdqa32 [[eax]]{k1}{z}, zmm0" > conftest.asm
418 nasm conftest.asm -o conftest.o > /dev/null 2>&1
419 if test $? != 0 ; then
421 AC_MSG_WARN([libx264 built without assembly code])
422 X264_CFG_PARAMS="$X264_CFG_PARAMS --disable-asm"
426 rm -f conftest.asm conftest.o
428 AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
429 if test "$no_utf" = "yes"; then
430 AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
433 # Checks for headers/libraries.
435 AC_DEFUN([CHECK_HEADERS], [
436 if test "x$HAVE_$1" != "xno"; then
437 AC_CHECK_HEADER(m4_apply([m4_car],m4_split([$3])), [HAVE_$1=yes], [HAVE_$1=no],
438 [m4_foreach([i], m4_split([$3]), [[#include "]i["
441 AC_MSG_CHECKING([$2])
442 AC_MSG_RESULT([$HAVE_$1])
443 if test "x$HAVE_$1" = "xno"; then
444 if test "x$PKG_$1" = "x"; then RESULT=no; fi
449 AC_DEFUN([CHECK_LIB], [
450 if test "x$HAVE_$1" != "xno"; then
451 if test "x$PKG_$1" = "x" -o "x$WANT_STATIC_BUILD" = "xno"; then
452 AC_CHECK_LIB([$2], [$3], [HAVE_$1=yes], [HAVE_$1=no], [$4])
454 if test "x$HAVE_$1" = "xyes"; then
455 if test "x$PKG_$1" = "x"; then
456 SYSTEM_LIBS+=" -l[$2]"
457 for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
460 for lib in [$4]; do SHARED_LIBS+=" $lib"; done
462 elif test "x$PKG_$1" = "x"; then RESULT=no; fi
467 CHECK_LIB([X11], [X11], [XOpenDisplay])
468 CHECK_HEADERS([X11], [X11 headers], [X11/X.h X11/Xlib.h X11/Xutil.h X11/cursorfont.h])
469 CHECK_HEADERS([X11], [X11 headers], [X11/keysym.h X11/Sunkeysym.h X11/Xatom.h X11/XF86keysym.h])
470 CHECK_LIB([XEXT], [Xext], [XShmQueryExtension])
471 CHECK_HEADERS([XEXT], [Xlib XShm extention], [X11/Xlib.h X11/extensions/XShm.h X11/extensions/shape.h])
472 CHECK_LIB([XINERAMA], [Xinerama], [XineramaQueryExtension])
473 CHECK_HEADERS([XINERAMA], [Xinerama headers], [X11/extensions/Xinerama.h])
474 CHECK_LIB([XV], [Xv], [XvQueryExtension])
475 CHECK_HEADERS([XV], [Xlib Xv extention], [X11/Xlib.h X11/extensions/Xvlib.h])
476 CHECK_LIB([XFIXES], [Xfixes], [XFixesQueryVersion])
477 CHECK_LIB([BZ2], [bz2], [BZ2_bzDecompress])
478 CHECK_LIB([FONTCONFIG], [fontconfig], [FcInit])
479 CHECK_LIB([FREETYPE], [freetype], [FT_Init_FreeType])
480 CHECK_LIB([LZMA], [lzma], [lzma_version_number])
481 CHECK_LIB([PNG], [png], [png_read_png])
482 CHECK_LIB([PTHREAD], [pthread], [pthread_create])
483 CHECK_LIB([Z], [z], [gzopen])
484 CHECK_LIB([fftw], [fftw3], [fftw_execute])
485 CHECK_HEADERS([fftw], [fftw headers], [fftw3.h])
486 CHECK_LIB([libuuid], [uuid], [uuid_clear])
487 CHECK_HEADERS([libuuid], [uuid headers], [uuid/uuid.h])
488 CHECK_HEADERS([LINUX_CDROM], [linux cdrom headers], [linux/cdrom.h linux/futex.h])
489 CHECK_HEADERS([LINUX_SYS], [linux sys], [sys/ioctl.h sys/stat.h sys/types.h sys/time.h sys/syscall.h])
490 CHECK_LIB([flac], [FLAC], [FLAC__stream_decoder_new])
491 CHECK_HEADERS([flac], [FLAC headers], [FLAC/stream_decoder.h])
492 CHECK_LIB([lame], [mp3lame], [lame_init])
493 CHECK_HEADERS([lame], [lame headers], [lame/lame.h])
494 CHECK_LIB([libjpeg], [jpeg], [jpeg_start_decompress])
495 CHECK_HEADERS([libjpeg], [jpeg headers], [stdio.h jpeglib.h])
496 CHECK_LIB([libogg], [ogg], [ogg_stream_init])
497 CHECK_HEADERS([libogg], [ogg headers], [ogg/ogg.h])
498 CHECK_LIB([openjpeg], [openjp2], [opj_version])
499 CHECK_HEADERS([openjpeg], [openjpeg headers], [openjpeg.h])
500 CHECK_LIB([libsndfile], [sndfile], [sf_open])
501 CHECK_HEADERS([libsndfile], [sndfile headers], [sndfile.h])
502 CHECK_LIB([ilmbase], [IlmImf], [ImfOpenInputFile])
503 CHECK_HEADERS([ilmbase], [IlmImf headers], [OpenEXR/ImfCRgbaFile.h])
504 CHECK_LIB([libtheora], [theora], [theora_info_init], [-ltheoraenc -ltheoradec -logg])
505 CHECK_HEADERS([libtheora], [threora headers], [theora/theoraenc.h])
506 CHECK_LIB([libvorbis], [vorbisenc], [vorbis_encode_init], [-lvorbis -lvorbisfile -logg])
507 CHECK_HEADERS([libvorbis], [vorbis encoders headers], [vorbis/vorbisenc.h])
508 CHECK_LIB([libvorbis], [vorbisfile], [ov_open])
509 CHECK_HEADERS([libvorbis], [vorbis file headers], [vorbis/vorbisfile.h])
510 CHECK_LIB([libvpx], [vpx], [vpx_codec_decode])
511 CHECK_HEADERS([libvpx], [vpx headers], [vpx/vpx_decoder.h])
512 CHECK_LIB([mjpegtools], [mjpegutils], [mjpeg_info])
513 CHECK_HEADERS([mjpegtools], [mjpegtools headers], [mjpegtools/mjpeg_types.h])
514 CHECK_LIB([tiff], [tiff], [TIFFOpen])
515 CHECK_HEADERS([tiff], [tiff headers], [tiff.h tiffio.h])
516 CHECK_LIB([twolame], [twolame], [twolame_encode_buffer_float32_interleaved])
517 CHECK_HEADERS([twolame], [twolame headers], [twolame.h])
518 CHECK_LIB([x264], [x264], [x264_encoder_encode])
519 CHECK_HEADERS([x264], [x264 headers], [stdint.h x264.h])
520 CHECK_LIB([x265], [x265], [x265_encoder_encode])
521 CHECK_HEADERS([x265], [x265 headers], [x265.h])
522 CHECK_LIB([a52dec], [a52], [a52_init])
523 CHECK_HEADERS([a52dec], [a52 headers], [a52.h])
524 CHECK_LIB([encore], [encore], [encore])
525 CHECK_HEADERS([encore], [encore headers], [encore.h])
526 CHECK_LIB([giflib], [gif], [DGifOpen])
527 CHECK_HEADERS([giflib], [gif lib headers], [gif_lib.h])
528 CHECK_LIB([fdk], [fdk-aac], [faacDecInit])
529 CHECK_HEADERS([fdk], [fdk headers], [fdk-aac/genericStds.h])
530 CHECK_LIB([jbig], [jbig], [jbg_dec_init])
531 CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11])
533 #if test "x$HAVE_mjpegtools" = "xyes"; then
534 #CFG_CFLAGS+=" -I/usr/include/mjpegtools"
537 AC_DEFUN([CHECK_WANT], [
540 if test "x$WANT_$1" != "xyes" -a "x$WANT_$1" != "xno" ; then
541 AC_ARG_WITH(m4_tolower([$1]),
542 AC_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))], [$3] (auto)),
543 [WANT_$1=$withval],[WANT_$1=$2])
545 if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then
546 echo "=== want $1 Failed."
548 elif test "x$WANT_$1" = "xauto" ; then
556 CHECK_WANT([GL], [auto], [use opengl], [
557 CHECK_LIB([GL], [GL], [glUseProgram])
558 CHECK_LIB([GL], [GLU], [gluOrtho2D])
559 CHECK_HEADERS([GL], [opengl headers], [GL/gl.h GL/glext.h GL/glu.h GL/glx.h])])
561 CHECK_WANT([OSS], [auto], [use OSS audio], [
562 CHECK_HEADERS([OSS], [oss headers], [sys/soundcard.h])])
564 CHECK_WANT([XFT], [auto], [use libXft], [
565 CHECK_LIB([XFT], [Xft], [XftInit])
566 CHECK_HEADERS([XFT], [Xft/freetype headers], [X11/Xlib.h X11/Xft/Xft.h])])
568 CHECK_WANT([ALSA], [auto], [use libasound/alsa], [
569 CHECK_LIB([ALSA], [asound], [snd_pcm_open])
570 CHECK_HEADERS([ALSA], [asound headers], [alsa/asoundlib.h])])
572 CHECK_WANT([FIREWIRE], [auto], [use firewire], [
573 CHECK_LIB([libavc1394], [avc1394], [avc1394_init_target])
574 CHECK_HEADERS([libavc1394], [libavc1394 headers], [libavc1394/avc1394.h])
575 CHECK_LIB([libavc1394], [rom1394], [rom1394_get_bus_id])
576 CHECK_HEADERS([libavc1394], [librom1394 headers], [libavc1394/rom1394.h])
577 CHECK_LIB([libiec61883], [iec61883], [iec61883_mpeg2_recv_init])
578 CHECK_HEADERS([libiec61883], [libiec61883 headers], [libiec61883/iec61883.h])
579 CHECK_LIB([libraw1394], [raw1394], [raw1394_iso_recv_init])
580 CHECK_HEADERS([libraw1394], [libraw1394 headers], [libraw1394/raw1394.h])])
582 CHECK_WANT([DV], [auto], [use dv], [
583 CHECK_LIB([libdv], [dv], [dv_init])
584 CHECK_HEADERS([libdv], [libdv headers], [libdv/dv.h])])
586 CHECK_WANT([DVB], [auto], [use dvb], [
587 CHECK_HEADERS([DVB], [dvb device headers], [linux/dvb/dmx.h linux/dvb/frontend.h])])
589 CHECK_WANT([VIDEO4LINUX2], [auto], [use v4l2], [
590 CHECK_HEADERS([VIDEO4LINUX2], [v4l2 system headers], [linux/kernel.h linux/types.h linux/videodev2.h])])
592 CHECK_WANT([XXF86VM], [auto], [use xf86vmode], [
593 CHECK_HEADERS([XXF86VM], [XF86VM headers], [X11/Xlib.h X11/extensions/xf86vmode.h])])
595 CHECK_WANT([ESOUND], [no], [use esd], [
596 CHECK_LIB([esound], [esd], [esd_open_sound])
597 CHECK_HEADERS([esound], [esound headers], [esd.h])
598 CHECK_LIB([audiofile], [audiofile], [afOpenFile])
599 CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
601 CHECK_WANT([OPUS], [auto], [use libopus], [
602 CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
603 CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])])
605 CHECK_WANT([LV2], [auto], [use lv2], [
606 saved_CFLAGS="$CFLAGS"
607 CHECK_LIB([lilv], [lilv-0], [lilv_world_new])
608 CHECK_LIB([sord], [sord-0], [sord_world_new])
609 CHECK_LIB([serd], [serd-0], [serd_reader_new])
610 CHECK_LIB([sratom], [sratom-0], [sratom_new])
611 CFLAGS="-I/usr/include/lilv-0"
612 CHECK_HEADERS([lv2], [lilv headers], [lilv/lilv.h])
613 CHECK_LIB([suil], [suil-0], [suil_instance_new])
614 CFLAGS="-I/usr/include/suil-0"
615 CHECK_HEADERS([lv2], [suil headers], [suil/suil.h])
616 CFLAGS="$saved_CFLAGS"])
618 CHECK_WANT([DL], [auto], [system has libdl], [
619 CHECK_LIB([DL], [dl], [dlopen])])
621 CHECK_WANT([EXR], [auto], [use exr], [])
623 CHECK_WANT([OPENCV], [no], [opencv=sys/sta/dyn,git/tar=url], [
626 CHECK_WANT([NUMA], [auto], [system has libnuma], [
627 CHECK_LIB([NUMA], [numa], [numa_alloc])])
629 CHECK_WANT([OPENEXR], [auto], [use openexr], [
630 AC_MSG_CHECKING([for openexr available])
632 saved_CXXFLAGS="$CXXFLAGS"
634 LIBS=" -lIlmImf -lIlmThread -lIex -lpthread"
635 CXXFLAGS="-I/usr/include/OpenEXR"
637 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
638 #include "ImfChannelList.h"
639 #include "ImfChromaticities.h"
640 #include "ImfCompression.h"
642 #include "ImfInputFile.h"
643 #include "ImfOutputFile.h"
644 #include "ImfPixelType.h"
645 #include "ImfRgbaFile.h"
646 #include "ImfRgbaYca.h"
647 #include "ImfVersion.h"
648 class EXRIStream : public Imf::IStream { public:
649 EXRIStream() : Imf::IStream("mypath") {} };
650 class EXROStream : public Imf::OStream { public:
651 EXROStream() : Imf::OStream("mypath") {} };
652 ]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no])
653 RESULT="$HAVE_OPENEXR"
654 if test "x$RESULT" = "xyes"; then
655 SHARED_openexr="$LIBS"
656 CFG_CFLAGS+=" -I/usr/include/OpenEXR"
659 CXXFLAGS="$saved_CXXFLAGS"
661 AC_MSG_RESULT([$HAVE_OPENEXR])
663 AC_SUBST([HAVE_OPENEXR])
665 # build global_config
669 echo "AC_HELP_STRING([Reason],[Package])"
670 echo "AC_HELP_STRING([------],[-------])"
672 AC_DEFUN([PKG_DISABLED],[
676 echo "AC_HELP_STRING([disabled],[$1])"
678 AC_DEFUN([PKG_SHARED],[
681 SHARED_LIBS+="$SHARED_$1"
682 echo "AC_HELP_STRING([shared],[$1])"
685 AC_DEFUN([PKG_STATIC],[
686 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
691 echo "AC_HELP_STRING([$2],[$1])"
695 AC_DEFUN([PKG_FORCED],[PKG_STATIC([$1],[forced])])
697 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
700 ffmpeg/twolame ffmpeg/lame ffmpeg/openjpeg \
701 ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/x265 ffmpeg/fdk \
702 libiec61883/libraw1394 libavc1394/librom1394 \
703 openexr/ilmbase ilmbase/libogg \
704 libtheora/libogg libtheora/libvorbis ; do
705 lib=`dirname $dep`; needs=`basename $dep`
706 eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs";
707 if test "x$pkg_lib" != "xno"; then
708 eval "PKG_$needs=yes"
713 AC_DEFUN([PKG_PROVIDE],[
714 if test "x$BUILD_$1" = "x" ; then
715 if test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
717 elif test "x$PKG_$1" = "xyes"; then
719 elif test "x$WANT_STATIC_BUILD" = "xyes"; then
720 PKG_STATIC([$1],[static])
721 elif test "x$HAVE_$1" = "xyes"; then
724 PKG_STATIC([$1],[needed])
729 PKG_PROVIDE([a52dec])
730 PKG_PROVIDE([djbfft])
731 PKG_PROVIDE([encore])
732 PKG_PROVIDE([audiofile],[$WANT_ESOUND])
733 PKG_PROVIDE([esound],[$WANT_ESOUND])
735 PKG_PROVIDE([ffmpeg])
738 PKG_PROVIDE([giflib])
739 PKG_PROVIDE([ilmbase], [$WANT_OPENEXR])
740 PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD])
742 PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE])
743 PKG_PROVIDE([libraw1394],[$WANT_FIREWIRE])
744 PKG_PROVIDE([libiec61883],[$WANT_FIREWIRE])
745 PKG_PROVIDE([libdv],[$WANT_DV])
746 PKG_PROVIDE([libjpeg])
747 PKG_PROVIDE([libogg])
748 PKG_PROVIDE([libsndfile])
749 PKG_PROVIDE([libtheora])
750 PKG_PROVIDE([libuuid])
751 PKG_PROVIDE([libvorbis])
752 PKG_PROVIDE([mjpegtools])
753 PKG_PROVIDE([openexr], [$WANT_OPENEXR])
754 PKG_PROVIDE([openjpeg])
756 PKG_PROVIDE([twolame])
759 PKG_PROVIDE([libvpx])
760 PKG_PROVIDE([opus], [$WANT_OPUS])
761 PKG_PROVIDE([lv2], [$WANT_LV2])
762 PKG_PROVIDE([lilv], [$WANT_LV2])
763 PKG_PROVIDE([sratom], [$WANT_LV2])
764 PKG_PROVIDE([serd], [$WANT_LV2])
765 PKG_PROVIDE([sord], [$WANT_LV2])
766 PKG_PROVIDE([suil], [$WANT_LV2])
768 if test "x$WANT_LV2" = "xyes"; then
769 if test "x$HAVE_lv2" = "xyes" -a "x$BUILD_lilv" = "x0"; then
770 CFG_CFLAGS+=' -I/usr/include/lilv-0 -I/usr/include/suil-0'
774 AC_SUBST(STATIC_BLDS)
775 AC_SUBST(SHARED_LIBS)
777 for f in $SYSTEM_LIBS; do
778 echo "AC_HELP_STRING([system],[$f])"
780 AC_SUBST(SYSTEM_LIBS)
783 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
784 CFG_CFLAGS+=" -DHAVE_CIN_3RDPARTY"
786 for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
787 VIDEO4LINUX2 ESOUND PACTL OPENEXR LV2 \
788 COMMERCIAL LIBZMPEG; do
790 if test "x$vv" != "xno"; then
791 CFG_CFLAGS+=" -DHAVE_$v"
796 v=`echo "$v" | tr "A-Z" "a-z"`
797 echo " using: $vv-$v"
800 echo " using: with-jobs = $WANT_JOBS"
801 echo " using: exec-name = $WANT_CIN"
802 echo " using: with-cinlib = $WANT_CINLIB_DIR"
803 echo " using: with-cindat = $WANT_CINDAT_DIR"
804 echo " using: with-config-dir = $WANT_CONFIG_DIR"
805 echo " using: with-browser = $WANT_CIN_BROWSER"
806 echo " using: with-plugin-dir = $WANT_PLUGIN_DIR"
807 echo " using: with-ladspa-dir = $WANT_LADSPA_DIR"
808 echo " using: with-opencv = $WANT_OPENCV"
809 echo " using: with-git-ffmpeg = $WANT_GIT_FFMPEG"
810 echo " using: with-noelision = $WANT_NOELISION"
811 echo " using: with-libzmpeg = $WANT_LIBZMPEG"
812 echo " using: with-commerical = $WANT_COMMERCIAL"
814 echo " using: thirdparty build = $WANT_CIN_3RDPARTY"
815 echo " using: single-user = $WANT_CINBIN_BUILD"
816 echo " using: static-build = $WANT_STATIC_BUILD"
817 echo " using: ladspa-build = $WANT_LADSPA_BUILD"
821 if test "x$HAVE_tiff" = "xyes"; then
822 if test "x$HAVE_jbig" = "xyes"; then
823 EXTRA_LIBS+=' -ljbig'
826 if test "x$HAVE_NUMA" = "xyes"; then
827 EXTRA_LIBS+=' -lnuma'
829 if test "x$HAVE_DL" = "xyes"; then
831 FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
833 if test "x$WANT_OPUS" = "xyes"; then
834 FFMPEG_EXTRA_CFG+=' --enable-libopus'
835 if test "x$HAVE_opus" = "xyes" -a "x$BUILD_opus" = "x0"; then
836 EXTRA_LIBS+=' -lopus'
837 CFG_CFLAGS+=' -I/usr/include/opus'
841 # intel lock elision bugs
842 if test "x$WANT_NOELISION" != "xno"; then
843 CFG_RPATH=`ls -1fd 2> /dev/null \
846 /usr/lib64/noelision \
851 AC_SUBST(WANT_CIN_3RDPARTY)
853 AC_SUBST(FFMPEG_EXTRA_CFG)
854 AC_SUBST(WANT_X264_HIDEPTH)
855 AC_SUBST(WANT_X265_HIDEPTH)
858 AC_SUBST(CFG_CXXFLAGS)
860 AC_CONFIG_FILES([Makefile])
865 echo "SHELL := /bin/bash"
867 echo "WANT_JOBS := $WANT_JOBS"
869 echo "OBJDIR := $OBJDIR"
870 echo "BINDIR := \$(TOPDIR)/bin"
871 echo "CINELERRA := \$(TOPDIR)/cinelerra"
872 echo "GUICAST := \$(TOPDIR)/guicast"
873 echo "LIBZMPEG3 := \$(TOPDIR)/libzmpeg3"
874 echo "MPEG2ENC := \$(TOPDIR)/mpeg2enc"
875 echo "MPLEXLO := \$(TOPDIR)/mplexlo"
876 echo "PLUGINS := \$(TOPDIR)/plugins"
877 echo "TDB := \$(TOPDIR)/db"
878 echo "THIRDPARTY := \$(TOPDIR)/thirdparty"
879 echo "EXTRA_LIBS := $EXTRA_LIBS"
880 echo "FFMPEG_EXTRA_CFG := $FFMPEG_EXTRA_CFG"
881 echo "export OBJDIR BINDIR CINELERRA GUICAST LIBZMPEG3"
882 echo "export MPEG2ENC MPLEXLO PLUGINS TDB"
883 echo "export THIRDPARTY EXTRA_LIBS FFMPEG_EXTRA_CFG"
886 echo "WANT_CIN := $WANT_CIN"
887 CFG_WANTS+=" CIN_3RDPARTY LIBZMPEG COMMERCIAL"
888 for w in $CFG_WANTS; do ww=WANT_$w; echo "WANT_$w := ${!ww}"; done
891 echo "ifndef CFLAGS_"
893 echo "CFLAGS_ := \$(CFLAGS)"
895 echo "CFLAGS_ := ${CFLAGS:--g -O2}"
899 echo "CFLAGS := \$(CFLAGS_)"
900 echo "CFLAGS += '-DCIN=\"\$(WANT_CIN)\"'"
901 echo "CFLAGS += '-DCINLIB_DIR=\"$WANT_CINLIB_DIR\"'"
902 echo "CFLAGS += '-DCINDAT_DIR=\"$WANT_CINDAT_DIR\"'"
903 echo "CFLAGS += '-DCONFIG_DIR=\"$WANT_CONFIG_DIR\"'"
904 echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
905 echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
906 echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
907 echo "CFLAGS += '-DCIN_BROWSER=\"$WANT_CIN_BROWSER\"'"
908 for flg in $CFG_CFLAGS; do echo "CFLAGS += $flg"; done
910 for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
913 if test "x$WANT_X264_HIDEPTH" = "xyes" ; then
914 X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10"
916 if test "x$WANT_X265_HIDEPTH" = "xyes" ; then
917 X265_CFG_PARAMS="$X265_CFG_PARAMS -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON"
920 for pkg in $STATIC_PKGS; do
921 eval pkg_lib="\$PKG_$pkg"
922 if test "x$pkg_lib" = "xno"; then continue; fi;
923 echo "static_pkgs += $pkg"
927 for pkg in $STATIC_BLDS; do
928 echo "static_blds += $pkg"
930 echo "$ver_pkg := \$(THIRDPARTY)/${!ver_pkg}"
932 echo "$inc_pkg := \\"
933 for inc in ${!inc_pkg}; do
934 echo " -I\$($ver_pkg)/$inc \\"
937 echo "static_incs += \$(inc_$pkg)"
939 echo "$lib_pkg := \\"
940 for lib in ${!lib_pkg}; do
941 echo " \$($ver_pkg)/$lib \\"
944 echo "static_libs += \$($lib_pkg)"
949 for lib in $SHARED_LIBS; do echo "shared_libs += $lib"; done
951 for lib in $SYSTEM_LIBS; do echo "system_libs += $lib"; done
952 echo "export static_pkgs static_blds shared_libs system_libs"
955 echo "thirdparty_libraries := \$(static_libs) \$(shared_libs)"
957 if test "x$CFG_RPATH" != "x"; then
958 echo "libraries+= -Wl,-rpath=$CFG_RPATH"
961 echo "libraries += -Wl,--start-group"
962 echo "libraries += \$(thirdparty_libraries)"
963 echo "libraries += \$(system_libs)"
964 echo "libraries += \$(EXTRA_LIBS)"
965 echo "libraries += -Wl,--end-group"
966 # -Wl,--start-group ... -Wl,--end-group does not work on ubuntu
967 echo "libraries += \$(thirdparty_libraries)"
968 echo "libraries += \$(system_libs)"
969 echo "libraries += \$(EXTRA_LIBS)"
971 echo "export thirdparty_libraries libraries"
972 echo "export CFLAGS_ CXXFLAGS_ LDFLAGS_"
973 echo "unexport CFLAGS CXXFLAGS LDFLAGS"
975 if test "x$HAVE_tiff" = "xyes"; then
976 if test "x$HAVE_jbig" != "xyes"; then
977 echo "tiff.cfg_params+= --disable-jbig"
981 if test "x$WANT_GIT_FFMPEG" != "xno"; then
982 echo "ffmpeg.git := $WANT_GIT_FFMPEG"
984 if test "x$WANT_OPUS" = "xyes" -a "x$BUILD_opus" = "x0"; then
985 echo 'ffmpeg.cflags+=" -I/usr/include/opus"'
987 if test "x$X264_CFG_PARAMS" != "x" ; then
988 echo "x264.cfg_params :=$X264_CFG_PARAMS --enable-static --enable-pic"
990 if test "x$X265_CFG_PARAMS" != "x" ; then
991 echo "x265.cfg_params :=$X265_CFG_PARAMS -DENABLE_SHARED=no"