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 -Wno-unused-result"
13 CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
14 CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
15 CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
16 CFG_CFLAGS+=" -I/usr/include/freetype2"
18 AC_DEFUN([CHECK_WITH], [
20 AC_HELP_STRING([--with-[$1]], [$2 ($4)]),
21 [WANT_$3=$withval], [WANT_$3='$4'])
25 CHECK_WITH([jobs],[parallel build jobs],[JOBS],[auto])
26 CHECK_WITH([exec-name],[binary executable name],[CIN],[cin])
27 CHECK_WITH([single-user],[to install cin in bin],[CINBIN_BUILD],[no])
28 CHECK_WITH([ladspa-build],[build ladspa library],[LADSPA_BUILD],[yes])
29 CHECK_WITH([cinlib],[cinelerra library path],[CINLIB_DIR],[auto])
30 CHECK_WITH([cindat],[cinelerra share path],[CINDAT_DIR],[auto])
31 CHECK_WITH([plugin-dir],[plugin install dir],[PLUGIN_DIR],[auto])
32 CHECK_WITH([ladspa-dir],[ladspa install dir],[LADSPA_DIR],[auto])
33 CHECK_WITH([config-dir],[.bcast config dir],[CONFIG_DIR],[$$HOME/.bcast5])
35 if test "x$WANT_CINBIN_BUILD" = "xyes"; then
36 WANT_LOCALE_DIR='$$CIN_LIB/locale'
37 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR='$$CIN_PATH'
38 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR='$$CIN_PATH'
39 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR='$$CIN_LIB/plugins'
40 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR='$$CIN_LIB/ladspa'
44 lcldir=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
45 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
46 eval "dir=\"$localedir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
48 usrdat=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
49 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
50 eval "dir=\"$datadir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
52 usrlib=`test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"; \
53 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
54 eval "dir=\"$libdir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
56 test "x$usrlib" = "x/lib" -o "x$usrlib" = "x/usr/lib" -o \
57 "x$usrlib" = "x/usr/local/lib" -a -e "/usr/lib64" && \
58 test ! -e "/usr/lib" -o `ls -1 /usr/lib64 | wc -l` -gt `ls -1 /usr/lib | wc -l` && \
60 WANT_LOCALE_DIR="$lcldir"
61 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR="$usrdat/$WANT_CIN"
62 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR="$usrlib/$WANT_CIN"
63 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR="$WANT_CINLIB_DIR/plugins"
64 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR="$WANT_CINLIB_DIR/ladspa"
71 if test "x$WANT_JOBS" = "xauto"; then
72 CPUS=`grep -c "^proc" /proc/cpuinfo`
73 WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
85 AC_HELP_STRING([--enable-$1],[build $1 ($2)]),
86 [PKG_$1=$enableval], [PKG_$1=$2])
87 PKG_DEF([$1],[$3],[$4],[$5])
92 PKG_3RD([a52dec],[yes],
94 [ liba52/.libs/liba52.a ],
97 PKG_3RD([audiofile],[auto],
99 [ libaudiofile/.libs/libaudiofile.a \
100 libaudiofile/modules/.libs/libmodules.a \
101 libaudiofile/alac/.libs/libalac.a ],
104 PKG_3RD([encore],[yes],
106 [ \$(OBJDIR)/libencore.a ],
109 PKG_3RD([esound],[auto],
115 PKG_3RD([faac],[auto],
117 [ libfaac/.libs/libfaac.a \
118 common/mp4v2/libmp4v2.a ],
121 PKG_3RD([faad2],[auto],
123 [ libfaad/.libs/libfaad.a \
124 common/mp4ff/libmp4ff.a ],
127 PKG_3RD([fdk],[auto],
129 [ .libs/libfdk-aac.a ],
130 [ libAACdec/include libAACenc/include libSYS/include ])
132 PKG_3RD([ffmpeg],[yes],
134 [ libavutil/libavutil.a \
135 libavcodec/libavcodec.a \
136 libpostproc/libpostproc.a \
137 libavdevice/libavdevice.a \
138 libavformat/libavformat.a \
139 libswscale/libswscale.a \
140 libavfilter/libavfilter.a \
141 libswresample/libswresample.a ],
144 PKG_3RD([fftw],[auto],
147 libbench2/libbench2.a \
148 rdft/scalar/r2cb/.libs/librdft_scalar_r2cb.a \
149 rdft/scalar/r2r/.libs/librdft_scalar_r2r.a \
150 rdft/scalar/.libs/librdft_scalar.a \
151 rdft/scalar/r2cf/.libs/librdft_scalar_r2cf.a \
152 rdft/.libs/librdft.a \
154 reodft/.libs/libreodft.a \
155 dft/scalar/codelets/.libs/libdft_scalar_codelets.a \
156 dft/scalar/.libs/libdft_scalar.a \
158 kernel/.libs/libkernel.a \
159 simd-support/.libs/libsimd_support.a \
160 simd-support/.libs/libsimd_sse2_nonportable.a ],
163 PKG_3RD([flac],[auto],
165 [ src/libFLAC/.libs/libFLAC.a \
166 src/libFLAC++/.libs/libFLAC++.a \
167 src/share/replaygain_analysis/.libs/libreplaygain_analysis.a \
168 src/share/replaygain_synthesis/.libs/libreplaygain_synthesis.a \
169 src/share/grabbag/.libs/libgrabbag.a \
170 src/share/utf8/.libs/libutf8.a \
171 src/test_libs_common/.libs/libtest_libs_common.a ],
174 PKG_3RD([giflib],[yes],
176 [ lib/.libs/libgif.a \
180 PKG_3RD([ilmbase],[auto],
182 [ Iex/.libs/libIex.a \
183 IexMath/.libs/libIexMath.a \
184 Half/.libs/libHalf.a \
185 Imath/.libs/libImath.a \
186 IlmThread/.libs/libIlmThread.a ],
187 [ Iex Half Imath config IlmThread ])
189 PKG_DEF([ladspa], [ladspa-05182015], [], [])
191 PKG_3RD([lame],[auto],
193 [ libmp3lame/.libs/libmp3lame.a \
194 mpglib/.libs/libmpgdecoder.a ],
197 PKG_3RD([libavc1394],[auto],
199 [ libavc1394/.libs/libavc1394.a \
200 librom1394/.libs/librom1394.a \
201 common/.libs/libraw1394util.a ],
204 PKG_3RD([libraw1394],[auto],
206 [ src/.libs/libraw1394.a ],
209 PKG_3RD([libiec61883],[auto],
211 [ src/.libs/libiec61883.a ],
214 PKG_3RD([libdv],[auto],
216 [ libdv/.libs/libdv.a ],
219 PKG_3RD([libjpeg],[auto],
220 [libjpeg-turbo-1.4.0],
222 .libs/libturbojpeg.a \
223 simd/.libs/libsimd.a ],
226 PKG_3RD([openjpeg],[yes],
227 [openjpeg-2.1.0-20160221],
228 [ bin/libopenjp2.a ],
231 PKG_3RD([libogg],[auto],
233 [ src/.libs/libogg.a ],
236 PKG_3RD([libsndfile],[auto],
238 [ src/.libs/libsndfile.a \
239 src/.libs/libcommon.a \
240 src/G72x/.libs/libg72x.a \
241 src/GSM610/.libs/libgsm.a ],
244 PKG_3RD([libtheora],[auto],
246 [ lib/.libs/libtheora.a \
247 lib/.libs/libtheoradec.a \
248 lib/.libs/libtheoraenc.a ],
251 PKG_3RD([libuuid],[yes],
256 PKG_3RD([libvorbis],[auto],
258 [ lib/.libs/libvorbis.a \
259 lib/.libs/libvorbisenc.a \
260 lib/.libs/libvorbisfile.a ],
263 PKG_3RD([mjpegtools],[yes],
265 [ utils/mmxsse/.libs/libmmxsse.a \
266 utils/.libs/libmjpegutils.a \
267 lavtools/.libs/liblavfile.a \
268 lavtools/.libs/liblavjpeg.a \
269 mplex/.libs/libmplex2.a \
270 yuvfilters/.libs/libyuvfilters.a \
271 mpeg2enc/.libs/libmpeg2encpp.a ],
272 [ . lavtools utils ])
274 PKG_3RD([openexr],[auto],
276 [ IlmImf/.libs/libIlmImf.a \
277 IlmImfUtil/.libs/libIlmImfUtil.a ],
280 #PKG_3RD([festival],[no],
284 #PKG_3RD(speech_tools,[no],
289 PKG_3RD([tiff],[auto],
291 [ libtiff/.libs/libtiff.a \
292 libtiff/.libs/libtiffxx.a \
293 port/.libs/libport.a ],[
296 PKG_3RD([twolame],[auto],
298 [ libtwolame/.libs/libtwolame.a ],
301 PKG_3RD([x264],[yes],
302 [x264-snapshot-20160220-2245-stable],
306 PKG_3RD([x265],[yes],
311 PKG_3RD([libvpx],[auto],
316 AC_SUBST(STATIC_PKGS)
318 AC_DEFUN([CHECK_ENABLE], [
320 AC_HELP_STRING([--enable-[$1]], [$3 ([$4])]),
321 [WANT_$2=$enableval], [WANT_$2=[$4]])
324 CHECK_ENABLE([static-build], [STATIC_BUILD], [build static], [auto])
325 CHECK_ENABLE([x264_hidepth], [X264_HIDEPTH], [build x264 10bit], [no])
326 CHECK_ENABLE([x265_hidepth], [X265_HIDEPTH], [build x265 10/12bit], [no])
328 test "x$WANT_STATIC_BUILD" = "xauto" && WANT_STATIC_BUILD=$WANT_CINBIN_BUILD
330 AC_DEFUN([CHECK_PROG], [
331 AC_CHECK_PROG([PROG_$1], [$2], [yes],[no])
333 AC_DEFUN([REQUIRE_PROG], [
334 CHECK_PROG([$1],[$2])
335 if test "x$PROG_$1" = "xno"; then
336 AC_MSG_WARN([$2 is missing and required.])
341 # Checks for programs.
343 REQUIRE_PROG(NASM, [nasm])
344 REQUIRE_PROG(YASM, [yasm])
345 REQUIRE_PROG(OBJCOPY, [objcopy])
346 if test "x$FATAL_ERROR" != "x"; then
347 AC_MSG_ERROR("fatal eror.")
349 CHECK_PROG(PACTL, [pactl])
351 AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
352 if test "$no_utf" = "yes"; then
353 AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
356 # Checks for headers/libraries.
358 AC_DEFUN([CHECK_HEADERS], [
359 if test "x$HAVE_$1" != "xno"; then
360 AC_CHECK_HEADER(m4_apply([m4_car],m4_split([$3])), [HAVE_$1=yes], [HAVE_$1=no],
361 [m4_foreach([i], m4_split([$3]), [[#include "]i["
364 AC_MSG_CHECKING([$2])
365 AC_MSG_RESULT([$HAVE_$1])
366 if test "x$HAVE_$1" = "xno"; then
367 if test "x$PKG_$1" = "x"; then RESULT=no; fi
372 AC_DEFUN([CHECK_LIB], [
373 if test "x$HAVE_$1" != "xno"; then
374 if test "x$PKG_$1" = "x" -o "x$WANT_STATIC_BUILD" = "xno"; then
375 AC_CHECK_LIB([$2], [$3], [HAVE_$1=yes], [HAVE_$1=no], [$4])
377 if test "x$HAVE_$1" = "xyes"; then
378 if test "x$PKG_$1" = "x"; then
379 SYSTEM_LIBS+=" -l[$2]"
380 for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
383 for lib in [$4]; do SHARED_LIBS+=" $lib"; done
385 elif test "x$PKG_$1" = "x"; then RESULT=no; fi
390 CHECK_LIB([X11], [X11], [XOpenDisplay])
391 CHECK_HEADERS([X11], [X11 headers], [X11/X.h X11/Xlib.h X11/Xutil.h X11/cursorfont.h])
392 CHECK_HEADERS([X11], [X11 headers], [X11/keysym.h X11/Sunkeysym.h X11/Xatom.h X11/XF86keysym.h])
393 CHECK_LIB([XEXT], [Xext], [XShmQueryExtension])
394 CHECK_HEADERS([XEXT], [Xlib XShm extention], [X11/Xlib.h X11/extensions/XShm.h X11/extensions/shape.h])
395 CHECK_LIB([XINERAMA], [Xinerama], [XineramaQueryExtension])
396 CHECK_HEADERS([XINERAMA], [Xinerama headers], [X11/extensions/Xinerama.h])
397 CHECK_LIB([XV], [Xv], [XvQueryExtension])
398 CHECK_HEADERS([XV], [Xlib Xv extention], [X11/Xlib.h X11/extensions/Xvlib.h])
399 CHECK_LIB([BZ2], [bz2], [BZ2_bzDecompress])
400 CHECK_LIB([FONTCONFIG], [fontconfig], [FcInit])
401 CHECK_LIB([FREETYPE], [freetype], [FT_Init_FreeType])
402 CHECK_LIB([LZMA], [lzma], [lzma_version_number])
403 CHECK_LIB([PNG], [png], [png_read_png])
404 CHECK_LIB([PTHREAD], [pthread], [pthread_create])
405 CHECK_LIB([Z], [z], [gzopen])
406 CHECK_LIB([fftw], [fftw3], [fftw_execute])
407 CHECK_HEADERS([fftw], [fftw headers], [fftw3.h])
408 CHECK_LIB([libuuid], [uuid], [uuid_clear])
409 CHECK_HEADERS([libuuid], [uuid headers], [uuid/uuid.h])
410 CHECK_HEADERS([LINUX_CDROM], [linux cdrom headers], [linux/cdrom.h linux/futex.h])
411 CHECK_HEADERS([LINUX_SYS], [linux sys], [sys/ioctl.h sys/stat.h sys/types.h sys/time.h sys/syscall.h])
412 CHECK_LIB([flac], [FLAC], [FLAC__stream_decoder_new])
413 CHECK_HEADERS([flac], [FLAC headers], [FLAC/stream_decoder.h])
414 CHECK_LIB([lame], [mp3lame], [lame_init])
415 CHECK_HEADERS([lame], [lame headers], [lame/lame.h])
416 CHECK_LIB([libjpeg], [jpeg], [jpeg_start_decompress])
417 CHECK_HEADERS([libjpeg], [jpeg headers], [stdio.h jpeglib.h])
418 CHECK_LIB([libogg], [ogg], [ogg_stream_init])
419 CHECK_HEADERS([libogg], [ogg headers], [ogg/ogg.h])
420 CHECK_LIB([openjpeg], [openjpeg], [opj_version])
421 CHECK_HEADERS([openjpeg], [openjpeg headers], [openjpeg.h])
422 CHECK_LIB([libsndfile], [sndfile], [sf_open])
423 CHECK_HEADERS([libsndfile], [sndfile headers], [sndfile.h])
424 CHECK_LIB([ilmbase], [IlmImf], [ImfOpenInputFile])
425 CHECK_HEADERS([ilmbase], [IlmImf headers], [OpenEXR/ImfCRgbaFile.h])
426 CHECK_LIB([libtheora], [theora], [theora_info_init], [-ltheoraenc -ltheoradec -logg])
427 CHECK_HEADERS([libtheora], [threora headers], [theora/theoraenc.h])
428 CHECK_LIB([libvorbis], [vorbisenc], [vorbis_encode_init], [-lvorbis -lvorbisfile -logg])
429 CHECK_HEADERS([libvorbis], [vorbis encoders headers], [vorbis/vorbisenc.h])
430 CHECK_LIB([libvorbis], [vorbisfile], [ov_open])
431 CHECK_HEADERS([libvorbis], [vorbis file headers], [vorbis/vorbisfile.h])
432 CHECK_LIB([libvpx], [vpx], [vpx_codec_decode])
433 CHECK_HEADERS([libvpx], [vpx headers], [vpx/vpx_decoder.h])
434 CHECK_LIB([tiff], [tiff], [TIFFOpen])
435 CHECK_HEADERS([tiff], [tiff headers], [tiff.h tiffio.h])
436 CHECK_LIB([twolame], [twolame], [twolame_encode_buffer_float32_interleaved])
437 CHECK_HEADERS([twolame], [twolame headers], [twolame.h])
438 CHECK_LIB([x264], [x264], [x264_encoder_encode])
439 CHECK_HEADERS([x264], [x264 headers], [stdint.h x264.h])
440 CHECK_LIB([x265], [x265], [x265_encoder_encode])
441 CHECK_HEADERS([x265], [x265 headers], [x265.h])
442 CHECK_LIB([a52dec], [a52], [a52_init])
443 CHECK_HEADERS([a52dec], [a52 headers], [a52.h])
444 CHECK_LIB([encore], [encore], [encore])
445 CHECK_HEADERS([encore], [encore headers], [encore.h])
446 CHECK_LIB([faac], [faac], [faacEncOpen])
447 CHECK_HEADERS([faac], [faac headers], [faac.h])
448 CHECK_LIB([faad2], [faad], [faacDecInit])
449 CHECK_HEADERS([faad2], [faad headers], [faad.h])
450 CHECK_LIB([giflib], [gif], [DGifOpen])
451 CHECK_HEADERS([giflib], [gif lib headers], [gif_lib.h])
452 CHECK_LIB([fdk], [fdk-aac], [faacDecInit])
453 CHECK_HEADERS([fdk], [fdk headers], [fdk-aac/genericStds.h])
456 AC_DEFUN([CHECK_WANT], [
458 AC_ARG_WITH(m4_tolower([$1]),
459 AC_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))], [$2] (auto)),
460 [WANT_$1=$withval],[WANT_$1=auto])
462 if test "x$WANT_$1" != "xno" ; then
465 if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then
466 echo "=== want $1 Failed."
475 CHECK_WANT([GL], [use opengl], [
476 CHECK_LIB([GL], [GL], [glUseProgram])
477 CHECK_LIB([GL], [GLU], [gluOrtho2D])
478 CHECK_HEADERS([GL], [opengl headers], [GL/gl.h GL/glext.h GL/glu.h GL/glx.h])])
480 CHECK_WANT([OSS], [use OSS audio], [
481 CHECK_HEADERS([OSS], [oss headers], [sys/soundcard.h])])
483 CHECK_WANT([XFT], [use libXft], [
484 CHECK_LIB([XFT], [Xft], [XftInit])
485 CHECK_HEADERS([XFT], [Xft/freetype headers], [X11/Xlib.h X11/Xft/Xft.h])])
487 CHECK_WANT([ALSA], [use libasound/alsa], [
488 CHECK_LIB([ALSA], [asound], [snd_pcm_open])
489 CHECK_HEADERS([ALSA], [asound headers], [alsa/asoundlib.h])])
491 CHECK_WANT([FIREWIRE], [use firewire], [
492 CHECK_LIB([libavc1394], [avc1394], [avc1394_init_target])
493 CHECK_HEADERS([libavc1394], [libavc1394 headers], [libavc1394/avc1394.h])
494 CHECK_LIB([libavc1394], [rom1394], [rom1394_get_bus_id])
495 CHECK_HEADERS([libavc1394], [librom1394 headers], [libavc1394/rom1394.h])
496 CHECK_LIB([libiec61883], [iec61883], [iec61883_mpeg2_recv_init])
497 CHECK_HEADERS([libiec61883], [libiec61883 headers], [libiec61883/iec61883.h])
498 CHECK_LIB([libraw1394], [raw1394], [raw1394_iso_recv_init])
499 CHECK_HEADERS([libraw1394], [libraw1394 headers], [libraw1394/raw1394.h])])
501 CHECK_WANT([DV], [use dv], [
502 CHECK_LIB([libdv], [dv], [dv_init])
503 CHECK_HEADERS([libdv], [libdv headers], [libdv/dv.h])])
505 CHECK_WANT([DVB], [use dvb], [
506 CHECK_HEADERS([DVB], [dvb device headers], [linux/dvb/dmx.h linux/dvb/frontend.h])])
508 CHECK_WANT([VIDEO4LINUX2], [use v4l2], [
509 CHECK_HEADERS([VIDEO4LINUX2], [v4l2 system headers], [linux/kernel.h linux/types.h linux/videodev2.h])])
511 CHECK_WANT([XXF86VM], [use xf86vmode], [
512 CHECK_HEADERS([XXF86VM], [XF86VM headers], [X11/Xlib.h X11/extensions/xf86vmode.h])])
514 CHECK_WANT([ESOUND], [use esd], [
515 CHECK_LIB([esound], [esd], [esd_open_sound])
516 CHECK_HEADERS([esound], [esound headers], [esd.h])
517 CHECK_LIB([audiofile], [audiofile], [afOpenFile])
518 CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
520 CHECK_WANT([DL], [system has libdl], [
521 CHECK_LIB([DL], [dl], [dlopen])])
523 CHECK_WANT([NUMA], [system has libnuma], [
524 CHECK_LIB([NUMA], [numa], [numa_alloc])])
527 AC_MSG_CHECKING([for openexr available])
529 saved_CXXFLAGS="$CXXFLAGS"
531 LIBS=" -lIlmImf -lIlmThread -lIex"
532 CXXFLAGS="-I/usr/include/OpenEXR"
534 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
535 #include "ImfChannelList.h"
536 #include "ImfChromaticities.h"
537 #include "ImfCompression.h"
539 #include "ImfInputFile.h"
540 #include "ImfOutputFile.h"
541 #include "ImfPixelType.h"
542 #include "ImfRgbaFile.h"
543 #include "ImfRgbaYca.h"
544 #include "ImfVersion.h"
545 class EXRIStream : public Imf::IStream { public:
546 EXRIStream() : Imf::IStream("mypath") {} };
547 class EXROStream : public Imf::OStream { public:
548 EXROStream() : Imf::OStream("mypath") {} };
549 ]])], [HAVE_openexr=yes], [HAVE_openexr=no])
550 if test "x$HAVE_openexr" = "xyes"; then
551 SHARED_openexr="$LIBS"
554 CXXFLAGS="$saved_CXXFLAGS"
556 AC_MSG_RESULT([$HAVE_openexr])
557 AC_SUBST([HAVE_openexr])
559 # build global_config
563 echo "AC_HELP_STRING([Reason],[Package])"
564 echo "AC_HELP_STRING([------],[-------])"
566 AC_DEFUN([PKG_DISABLED],[
569 echo "AC_HELP_STRING([disabled],[$1])"
571 AC_DEFUN([PKG_SHARED],[
574 SHARED_LIBS+="$SHARED_$1"
575 echo "AC_HELP_STRING([shared],[$1])"
577 AC_DEFUN([PKG_STATIC],[
581 echo "AC_HELP_STRING([$2],[$1])"
583 AC_DEFUN([PKG_FORCED],[PKG_STATIC([$1],[forced])])
587 ffmpeg/faac ffmpeg/faad2 ffmpeg/twolame ffmpeg/lame ffmpeg/openjpeg \
588 ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/fdk \
589 libiec61883/libraw1394 libavc1394/librom1394 \
590 openexr/ilmbase ilmbase/libogg \
591 libtheora/libogg libtheora/libvorbis ; do
593 eval pkg_lib="\$PKG_$lib"; eval have_lib="\$HAVE_$lib";
594 if test "x$pkg_lib" != "xno" ; then
595 needs=`basename $dep`
596 eval "PKG_$needs=yes"
600 AC_DEFUN([PKG_PROVIDE],[
601 if test "x$BUILD_$1" = "x" ; then
602 if test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
604 elif test "x$PKG_$1" = "xyes"; then
606 elif test "x$WANT_STATIC_BUILD" = "xyes"; then
607 PKG_STATIC([$1],[static])
608 elif test "x$HAVE_$1" = "xyes"; then
611 PKG_STATIC([$1],[needed])
616 PKG_PROVIDE([a52dec])
617 PKG_PROVIDE([encore])
618 PKG_PROVIDE([audiofile],[$WANT_ESOUND])
619 PKG_PROVIDE([esound],[$WANT_ESOUND])
623 PKG_PROVIDE([ffmpeg])
626 PKG_PROVIDE([giflib])
627 PKG_PROVIDE([ilmbase])
628 PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD])
630 PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE])
631 PKG_PROVIDE([libraw1394],[$WANT_FIREWIRE])
632 PKG_PROVIDE([libiec61883],[$WANT_FIREWIRE])
633 PKG_PROVIDE([libdv],[$WANT_DV])
634 PKG_PROVIDE([libjpeg])
635 PKG_PROVIDE([libogg])
636 PKG_PROVIDE([libsndfile])
637 PKG_PROVIDE([libtheora])
638 PKG_PROVIDE([libuuid])
639 PKG_PROVIDE([libvorbis])
640 PKG_PROVIDE([mjpegtools])
641 PKG_PROVIDE([openexr])
642 PKG_PROVIDE([openjpeg])
644 PKG_PROVIDE([twolame])
647 PKG_PROVIDE([libvpx])
649 AC_SUBST(STATIC_BLDS)
650 AC_SUBST(SHARED_LIBS)
652 for f in $SYSTEM_LIBS; do
653 echo "AC_HELP_STRING([system],[$f])"
655 AC_SUBST(SYSTEM_LIBS)
658 for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
659 VIDEO4LINUX2 ESOUND; do
661 if test "x$vv" != "xno"; then
662 CFG_CFLAGS+=" -DHAVE_$v"
667 v=`echo "$v" | tr "A-Z" "a-z"`
668 echo " using: $vv-$v"
671 echo " using: with-jobs = $WANT_JOBS"
672 echo " using: exec-name = $WANT_CIN"
673 echo " using: with-cinlib = $WANT_CINLIB_DIR"
674 echo " using: with-cindat = $WANT_CINDAT_DIR"
675 echo " using: with-config-dir = $WANT_CONFIG_DIR"
676 echo " using: with-plugin-dir = $WANT_PLUGIN_DIR"
677 echo " using: with-ladspa-dir = $WANT_LADSPA_DIR"
679 echo " using: single-user = $WANT_CINBIN_BUILD"
680 echo " using: static-build = $WANT_STATIC_BUILD"
681 echo " using: ladspa-build = $WANT_LADSPA_BUILD"
685 if test "x$HAVE_NUMA" = "xyes"; then
686 EXTRA_LIBS+=' -lnuma'
688 if test "x$HAVE_DL" = "xyes"; then
690 FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
693 AC_SUBST(FFMPEG_EXTRA_CFG)
694 AC_SUBST(WANT_X264_HIDEPTH)
695 AC_SUBST(WANT_X265_HIDEPTH)
697 if test "x$BUILD_openexr" = "x0"; then
698 CFG_CFLAGS+=" -I/usr/include/OpenEXR"
702 AC_SUBST(CFG_CXXFLAGS)
704 AC_CONFIG_FILES([Makefile])
709 echo "SHELL := /bin/bash"
711 echo "WANT_JOBS := $WANT_JOBS"
713 echo "OBJDIR := $OBJDIR"
714 echo "BINDIR := \$(TOPDIR)/bin"
715 echo "CINELERRA := \$(TOPDIR)/cinelerra"
716 echo "GUICAST := \$(TOPDIR)/guicast"
717 echo "LIBZMPEG3 := \$(TOPDIR)/libzmpeg3"
718 echo "MPEG2ENC := \$(TOPDIR)/mpeg2enc"
719 echo "MPLEXLO := \$(TOPDIR)/mplexlo"
720 echo "PLUGINS := \$(TOPDIR)/plugins"
721 echo "TDB := \$(TOPDIR)/db"
722 echo "THIRDPARTY := \$(TOPDIR)/thirdparty"
723 echo "EXTRA_LIBS := $EXTRA_LIBS"
724 echo "FFMPEG_EXTRA_CFG := $FFMPEG_EXTRA_CFG"
725 echo "export OBJDIR BINDIR CINELERRA GUICAST LIBZMPEG3"
726 echo "export MPEG2ENC MPLEXLO PLUGINS TDB"
727 echo "export THIRDPARTY EXTRA_LIBS FFMPEG_EXTRA_CFG"
730 echo "WANT_CIN := $WANT_CIN"
731 for w in $CFG_WANTS; do ww=WANT_$w; echo "WANT_$w := ${!ww}"; done
734 echo "ifndef CFLAGS_"
736 echo "CFLAGS_ := \$(CFLAGS)"
738 echo "CFLAGS_ := ${CFLAGS:--g -O2}"
742 echo "CFLAGS := \$(CFLAGS_)"
743 echo "CFLAGS += '-DCIN=\"\$(WANT_CIN)\"'"
744 echo "CFLAGS += '-DCINLIB_DIR=\"$WANT_CINLIB_DIR\"'"
745 echo "CFLAGS += '-DCINDAT_DIR=\"$WANT_CINDAT_DIR\"'"
746 echo "CFLAGS += '-DCONFIG_DIR=\"$WANT_CONFIG_DIR\"'"
747 echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
748 echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
749 echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
750 for flg in $CFG_CFLAGS; do echo "CFLAGS += $flg"; done
752 for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
755 if test $WANT_X264_HIDEPTH = "yes" ; then
756 echo "x264.cfg_params := --enable-static --bit-depth=10"
758 if test $WANT_X265_HIDEPTH = "yes" ; then
759 echo "x265.cfg_params := -DENABLE_SHARED=no -DHIGH_BIT_DEPTH:BOOL=ON"
762 for pkg in $STATIC_PKGS; do echo "static_pkgs += $pkg"; done
764 for pkg in $STATIC_BLDS; do
765 echo "static_blds += $pkg"
767 echo "$ver_pkg := \$(THIRDPARTY)/${!ver_pkg}"
769 echo "$inc_pkg := \\"
770 for inc in ${!inc_pkg}; do
771 echo " -I\$($ver_pkg)/$inc \\"
774 echo "static_incs += \$(inc_$pkg)"
776 echo "$lib_pkg := \\"
777 for lib in ${!lib_pkg}; do
778 echo " \$($ver_pkg)/$lib \\"
781 echo "static_libs += \$($lib_pkg)"
786 for lib in $SHARED_LIBS; do echo "shared_libs += $lib"; done
788 for lib in $SYSTEM_LIBS; do echo "system_libs += $lib"; done
789 echo "export static_pkgs static_blds shared_libs system_libs"
792 echo "thirdparty_libraries := \$(static_libs) \$(shared_libs)"
793 echo "libraries += -Wl,--start-group"
794 echo "libraries += \$(thirdparty_libraries)"
795 echo "libraries += \$(system_libs)"
796 echo "libraries += \$(EXTRA_LIBS)"
797 echo "libraries += -Wl,--end-group"
798 # -Wl,--start-group ... -Wl,--end-group does not work on ubuntu
799 echo "libraries += \$(thirdparty_libraries)"
800 echo "libraries += \$(system_libs)"
801 echo "libraries += \$(EXTRA_LIBS)"
803 echo "export thirdparty_libraries libraries"
804 echo "export CFLAGS_ CXXFLAGS_ LDFLAGS_"
805 echo "unexport CFLAGS CXXFLAGS LDFLAGS"