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 -Wno-format-truncation"
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+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
17 CFG_CFLAGS+=" -I/usr/include/freetype2"
19 AC_DEFUN([CHECK_WITH], [
21 AC_HELP_STRING([--with-[$1]], [$2 ($4)]),
22 [WANT_$3=$withval], [WANT_$3='$4'])
26 CHECK_WITH([jobs],[parallel build jobs],[JOBS],[auto])
27 CHECK_WITH([exec-name],[binary executable name],[CIN],[cin])
28 CHECK_WITH([single-user],[to install cin in bin],[CINBIN_BUILD],[no])
29 CHECK_WITH([ladspa-build],[build ladspa library],[LADSPA_BUILD],[yes])
30 CHECK_WITH([cinlib],[cinelerra library path],[CINLIB_DIR],[auto])
31 CHECK_WITH([cindat],[cinelerra share path],[CINDAT_DIR],[auto])
32 CHECK_WITH([plugin-dir],[plugin install dir],[PLUGIN_DIR],[auto])
33 CHECK_WITH([ladspa-dir],[ladspa install dir],[LADSPA_DIR],[auto])
34 CHECK_WITH([config-dir],[.bcast config dir],[CONFIG_DIR],[$$HOME/.bcast5])
35 CHECK_WITH([browser],[cin_browser path],[CIN_BROWSER],[firefox])
36 CHECK_WITH([git-ffmpeg],[git ffmpeg using url],[GIT_FFMPEG],[no])
38 if test "x$WANT_CINBIN_BUILD" = "xyes"; then
39 WANT_LOCALE_DIR='$$CIN_LIB/locale'
40 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR='$$CIN_PATH'
41 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR='$$CIN_PATH'
42 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR='$$CIN_LIB/plugins'
43 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR='$$CIN_LIB/ladspa'
47 lcldir=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
48 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
49 eval "dir=\"$localedir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
51 usrdat=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
52 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
53 eval "dir=\"$datadir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
55 usrlib=`test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"; \
56 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
57 eval "dir=\"$libdir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
59 test "x$usrlib" = "x/lib" -o "x$usrlib" = "x/usr/lib" -o \
60 "x$usrlib" = "x/usr/local/lib" -a -e "/usr/lib64" && \
61 test ! -e "/usr/lib" -o `ls -1 /usr/lib64 | wc -l` -gt `ls -1 /usr/lib | wc -l` && \
63 WANT_LOCALE_DIR="$lcldir"
64 test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR="$usrdat/$WANT_CIN"
65 test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR="$usrlib/$WANT_CIN"
66 test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR="$WANT_CINLIB_DIR/plugins"
67 test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR="$WANT_CINLIB_DIR/ladspa"
74 if test "x$WANT_JOBS" = "xauto"; then
75 CPUS=`grep -c "^proc" /proc/cpuinfo`
76 WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
88 AC_HELP_STRING([--enable-$1],[build $1 ($2)]),
89 [PKG_$1=$enableval], [PKG_$1=$2])
90 PKG_DEF([$1],[$3],[$4],[$5])
95 PKG_3RD([a52dec],[yes],
97 [ liba52/.libs/liba52.a ],
100 PKG_3RD([djbfft],[yes],
105 PKG_3RD([audiofile],[no],
107 [ libaudiofile/.libs/libaudiofile.a \
108 libaudiofile/modules/.libs/libmodules.a \
109 libaudiofile/alac/.libs/libalac.a ],
112 PKG_3RD([encore],[no],
114 [ \$(OBJDIR)/libencore.a ],
117 PKG_3RD([esound],[no],
123 PKG_3RD([fdk],[auto],
125 [ .libs/libfdk-aac.a ],
126 [ libAACdec/include libAACenc/include libSYS/include ])
128 PKG_3RD([ffmpeg],[yes],
130 [ libavutil/libavutil.a \
131 libavcodec/libavcodec.a \
132 libpostproc/libpostproc.a \
133 libavdevice/libavdevice.a \
134 libavformat/libavformat.a \
135 libswscale/libswscale.a \
136 libavfilter/libavfilter.a \
137 libswresample/libswresample.a ],
140 if test "x$WANT_GIT_FFMPEG" != "xno" ; then
141 ver_ffmpeg="ffmpeg.git"
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-0.4.17], [], [])
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.5.1],
222 .libs/libturbojpeg.a \
223 simd/.libs/libsimd.a ],
226 PKG_3RD([openjpeg],[auto],
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],[auto],
302 [x264-snapshot-20170426-2245],
306 PKG_3RD([x265],[auto],
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])
350 WANT_PACTL=$PROG_PACTL
352 AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
353 if test "$no_utf" = "yes"; then
354 AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
357 # Checks for headers/libraries.
359 AC_DEFUN([CHECK_HEADERS], [
360 if test "x$HAVE_$1" != "xno"; then
361 AC_CHECK_HEADER(m4_apply([m4_car],m4_split([$3])), [HAVE_$1=yes], [HAVE_$1=no],
362 [m4_foreach([i], m4_split([$3]), [[#include "]i["
365 AC_MSG_CHECKING([$2])
366 AC_MSG_RESULT([$HAVE_$1])
367 if test "x$HAVE_$1" = "xno"; then
368 if test "x$PKG_$1" = "x"; then RESULT=no; fi
373 AC_DEFUN([CHECK_LIB], [
374 if test "x$HAVE_$1" != "xno"; then
375 if test "x$PKG_$1" = "x" -o "x$WANT_STATIC_BUILD" = "xno"; then
376 AC_CHECK_LIB([$2], [$3], [HAVE_$1=yes], [HAVE_$1=no], [$4])
378 if test "x$HAVE_$1" = "xyes"; then
379 if test "x$PKG_$1" = "x"; then
380 SYSTEM_LIBS+=" -l[$2]"
381 for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
384 for lib in [$4]; do SHARED_LIBS+=" $lib"; done
386 elif test "x$PKG_$1" = "x"; then RESULT=no; fi
391 CHECK_LIB([X11], [X11], [XOpenDisplay])
392 CHECK_HEADERS([X11], [X11 headers], [X11/X.h X11/Xlib.h X11/Xutil.h X11/cursorfont.h])
393 CHECK_HEADERS([X11], [X11 headers], [X11/keysym.h X11/Sunkeysym.h X11/Xatom.h X11/XF86keysym.h])
394 CHECK_LIB([XEXT], [Xext], [XShmQueryExtension])
395 CHECK_HEADERS([XEXT], [Xlib XShm extention], [X11/Xlib.h X11/extensions/XShm.h X11/extensions/shape.h])
396 CHECK_LIB([XINERAMA], [Xinerama], [XineramaQueryExtension])
397 CHECK_HEADERS([XINERAMA], [Xinerama headers], [X11/extensions/Xinerama.h])
398 CHECK_LIB([XV], [Xv], [XvQueryExtension])
399 CHECK_HEADERS([XV], [Xlib Xv extention], [X11/Xlib.h X11/extensions/Xvlib.h])
400 CHECK_LIB([XFIXES], [Xfixes], [XFixesQueryVersion])
401 CHECK_LIB([BZ2], [bz2], [BZ2_bzDecompress])
402 CHECK_LIB([FONTCONFIG], [fontconfig], [FcInit])
403 CHECK_LIB([FREETYPE], [freetype], [FT_Init_FreeType])
404 CHECK_LIB([LZMA], [lzma], [lzma_version_number])
405 CHECK_LIB([PNG], [png], [png_read_png])
406 CHECK_LIB([PTHREAD], [pthread], [pthread_create])
407 CHECK_LIB([Z], [z], [gzopen])
408 CHECK_LIB([fftw], [fftw3], [fftw_execute])
409 CHECK_HEADERS([fftw], [fftw headers], [fftw3.h])
410 CHECK_LIB([libuuid], [uuid], [uuid_clear])
411 CHECK_HEADERS([libuuid], [uuid headers], [uuid/uuid.h])
412 CHECK_HEADERS([LINUX_CDROM], [linux cdrom headers], [linux/cdrom.h linux/futex.h])
413 CHECK_HEADERS([LINUX_SYS], [linux sys], [sys/ioctl.h sys/stat.h sys/types.h sys/time.h sys/syscall.h])
414 CHECK_LIB([flac], [FLAC], [FLAC__stream_decoder_new])
415 CHECK_HEADERS([flac], [FLAC headers], [FLAC/stream_decoder.h])
416 CHECK_LIB([lame], [mp3lame], [lame_init])
417 CHECK_HEADERS([lame], [lame headers], [lame/lame.h])
418 CHECK_LIB([libjpeg], [jpeg], [jpeg_start_decompress])
419 CHECK_HEADERS([libjpeg], [jpeg headers], [stdio.h jpeglib.h])
420 CHECK_LIB([libogg], [ogg], [ogg_stream_init])
421 CHECK_HEADERS([libogg], [ogg headers], [ogg/ogg.h])
422 CHECK_LIB([openjpeg], [openjp2], [opj_version])
423 CHECK_HEADERS([openjpeg], [openjpeg headers], [openjpeg.h])
424 CHECK_LIB([libsndfile], [sndfile], [sf_open])
425 CHECK_HEADERS([libsndfile], [sndfile headers], [sndfile.h])
426 CHECK_LIB([ilmbase], [IlmImf], [ImfOpenInputFile])
427 CHECK_HEADERS([ilmbase], [IlmImf headers], [OpenEXR/ImfCRgbaFile.h])
428 CHECK_LIB([libtheora], [theora], [theora_info_init], [-ltheoraenc -ltheoradec -logg])
429 CHECK_HEADERS([libtheora], [threora headers], [theora/theoraenc.h])
430 CHECK_LIB([libvorbis], [vorbisenc], [vorbis_encode_init], [-lvorbis -lvorbisfile -logg])
431 CHECK_HEADERS([libvorbis], [vorbis encoders headers], [vorbis/vorbisenc.h])
432 CHECK_LIB([libvorbis], [vorbisfile], [ov_open])
433 CHECK_HEADERS([libvorbis], [vorbis file headers], [vorbis/vorbisfile.h])
434 CHECK_LIB([libvpx], [vpx], [vpx_codec_decode])
435 CHECK_HEADERS([libvpx], [vpx headers], [vpx/vpx_decoder.h])
436 CHECK_LIB([mjpegtools], [mjpegutils], [mjpeg_info])
437 CHECK_HEADERS([mjpegtools], [mjpegtools headers], [mjpegtools/mjpeg_types.h])
438 CHECK_LIB([tiff], [tiff], [TIFFOpen])
439 CHECK_HEADERS([tiff], [tiff headers], [tiff.h tiffio.h])
440 CHECK_LIB([twolame], [twolame], [twolame_encode_buffer_float32_interleaved])
441 CHECK_HEADERS([twolame], [twolame headers], [twolame.h])
442 CHECK_LIB([x264], [x264], [x264_encoder_encode])
443 CHECK_HEADERS([x264], [x264 headers], [stdint.h x264.h])
444 CHECK_LIB([x265], [x265], [x265_encoder_encode])
445 CHECK_HEADERS([x265], [x265 headers], [x265.h])
446 CHECK_LIB([a52dec], [a52], [a52_init])
447 CHECK_HEADERS([a52dec], [a52 headers], [a52.h])
448 CHECK_LIB([encore], [encore], [encore])
449 CHECK_HEADERS([encore], [encore headers], [encore.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])
454 CHECK_LIB([jbig], [jbig], [jbg_dec_init])
455 CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11])
456 CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
457 CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])
459 #if test "x$HAVE_mjpegtools" = "xyes"; then
460 #CFG_CFLAGS+=" -I/usr/include/mjpegtools"
463 AC_DEFUN([CHECK_WANT], [
465 AC_ARG_WITH(m4_tolower([$1]),
466 AC_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))], [$3] (auto)),
467 [WANT_$1=$withval],[WANT_$1=$2])
469 if test "x$WANT_$1" != "xno" ; then
471 if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then
472 echo "=== want $1 Failed."
474 elif test "x$WANT_$1" = "xauto" ; then
482 CHECK_WANT([GL], [auto], [use opengl], [
483 CHECK_LIB([GL], [GL], [glUseProgram])
484 CHECK_LIB([GL], [GLU], [gluOrtho2D])
485 CHECK_HEADERS([GL], [opengl headers], [GL/gl.h GL/glext.h GL/glu.h GL/glx.h])])
487 CHECK_WANT([OSS], [auto], [use OSS audio], [
488 CHECK_HEADERS([OSS], [oss headers], [sys/soundcard.h])])
490 CHECK_WANT([XFT], [auto], [use libXft], [
491 CHECK_LIB([XFT], [Xft], [XftInit])
492 CHECK_HEADERS([XFT], [Xft/freetype headers], [X11/Xlib.h X11/Xft/Xft.h])])
494 CHECK_WANT([ALSA], [auto], [use libasound/alsa], [
495 CHECK_LIB([ALSA], [asound], [snd_pcm_open])
496 CHECK_HEADERS([ALSA], [asound headers], [alsa/asoundlib.h])])
498 CHECK_WANT([FIREWIRE], [auto], [use firewire], [
499 CHECK_LIB([libavc1394], [avc1394], [avc1394_init_target])
500 CHECK_HEADERS([libavc1394], [libavc1394 headers], [libavc1394/avc1394.h])
501 CHECK_LIB([libavc1394], [rom1394], [rom1394_get_bus_id])
502 CHECK_HEADERS([libavc1394], [librom1394 headers], [libavc1394/rom1394.h])
503 CHECK_LIB([libiec61883], [iec61883], [iec61883_mpeg2_recv_init])
504 CHECK_HEADERS([libiec61883], [libiec61883 headers], [libiec61883/iec61883.h])
505 CHECK_LIB([libraw1394], [raw1394], [raw1394_iso_recv_init])
506 CHECK_HEADERS([libraw1394], [libraw1394 headers], [libraw1394/raw1394.h])])
508 CHECK_WANT([DV], [auto], [use dv], [
509 CHECK_LIB([libdv], [dv], [dv_init])
510 CHECK_HEADERS([libdv], [libdv headers], [libdv/dv.h])])
512 CHECK_WANT([DVB], [auto], [use dvb], [
513 CHECK_HEADERS([DVB], [dvb device headers], [linux/dvb/dmx.h linux/dvb/frontend.h])])
515 CHECK_WANT([VIDEO4LINUX2], [auto], [use v4l2], [
516 CHECK_HEADERS([VIDEO4LINUX2], [v4l2 system headers], [linux/kernel.h linux/types.h linux/videodev2.h])])
518 CHECK_WANT([XXF86VM], [auto], [use xf86vmode], [
519 CHECK_HEADERS([XXF86VM], [XF86VM headers], [X11/Xlib.h X11/extensions/xf86vmode.h])])
521 CHECK_WANT([ESOUND], [no], [use esd], [
522 CHECK_LIB([esound], [esd], [esd_open_sound])
523 CHECK_HEADERS([esound], [esound headers], [esd.h])
524 CHECK_LIB([audiofile], [audiofile], [afOpenFile])
525 CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
527 CHECK_WANT([DL], [auto], [system has libdl], [
528 CHECK_LIB([DL], [dl], [dlopen])])
530 CHECK_WANT([EXR], [auto], [use exr], [])
531 CHECK_WANT([OPENCV], [no], [opencv=sys/sta/dyn,git/tar=url], [
532 WANT_OPENCV="$withval"
535 CHECK_WANT([NUMA], [auto], [system has libnuma], [
536 CHECK_LIB([NUMA], [numa], [numa_alloc])])
538 CHECK_WANT([OPENEXR], [auto], [use openexr], [
539 AC_MSG_CHECKING([for openexr available])
541 saved_CXXFLAGS="$CXXFLAGS"
543 LIBS=" -lIlmImf -lIlmThread -lIex"
544 CXXFLAGS="-I/usr/include/OpenEXR"
546 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
547 #include "ImfChannelList.h"
548 #include "ImfChromaticities.h"
549 #include "ImfCompression.h"
551 #include "ImfInputFile.h"
552 #include "ImfOutputFile.h"
553 #include "ImfPixelType.h"
554 #include "ImfRgbaFile.h"
555 #include "ImfRgbaYca.h"
556 #include "ImfVersion.h"
557 class EXRIStream : public Imf::IStream { public:
558 EXRIStream() : Imf::IStream("mypath") {} };
559 class EXROStream : public Imf::OStream { public:
560 EXROStream() : Imf::OStream("mypath") {} };
561 ]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no])
562 RESULT="$HAVE_OPENEXR"
563 if test "x$RESULT" = "xyes"; then
564 SHARED_openexr="$LIBS"
565 CFG_CFLAGS+=" -I/usr/include/OpenEXR"
568 CXXFLAGS="$saved_CXXFLAGS"
570 AC_MSG_RESULT([$HAVE_OPENEXR])
572 AC_SUBST([HAVE_OPENEXR])
574 # build global_config
578 echo "AC_HELP_STRING([Reason],[Package])"
579 echo "AC_HELP_STRING([------],[-------])"
581 AC_DEFUN([PKG_DISABLED],[
585 echo "AC_HELP_STRING([disabled],[$1])"
587 AC_DEFUN([PKG_SHARED],[
590 SHARED_LIBS+="$SHARED_$1"
591 echo "AC_HELP_STRING([shared],[$1])"
593 AC_DEFUN([PKG_STATIC],[
598 echo "AC_HELP_STRING([$2],[$1])"
600 AC_DEFUN([PKG_FORCED],[PKG_STATIC([$1],[forced])])
604 ffmpeg/twolame ffmpeg/lame ffmpeg/openjpeg \
605 ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/x265 ffmpeg/fdk \
606 libiec61883/libraw1394 libavc1394/librom1394 \
607 openexr/ilmbase ilmbase/libogg \
608 libtheora/libogg libtheora/libvorbis ; do
609 lib=`dirname $dep`; needs=`basename $dep`
610 eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs";
611 if test "x$pkg_lib" != "xno"; then
612 eval "PKG_$needs=yes"
616 AC_DEFUN([PKG_PROVIDE],[
617 if test "x$BUILD_$1" = "x" ; then
618 if test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
620 elif test "x$PKG_$1" = "xyes"; then
622 elif test "x$WANT_STATIC_BUILD" = "xyes"; then
623 PKG_STATIC([$1],[static])
624 elif test "x$HAVE_$1" = "xyes"; then
627 PKG_STATIC([$1],[needed])
632 PKG_PROVIDE([a52dec])
633 PKG_PROVIDE([djbfft])
634 PKG_PROVIDE([encore])
635 PKG_PROVIDE([audiofile],[$WANT_ESOUND])
636 PKG_PROVIDE([esound],[$WANT_ESOUND])
638 PKG_PROVIDE([ffmpeg])
641 PKG_PROVIDE([giflib])
642 PKG_PROVIDE([ilmbase], [$WANT_OPENEXR])
643 PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD])
645 PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE])
646 PKG_PROVIDE([libraw1394],[$WANT_FIREWIRE])
647 PKG_PROVIDE([libiec61883],[$WANT_FIREWIRE])
648 PKG_PROVIDE([libdv],[$WANT_DV])
649 PKG_PROVIDE([libjpeg])
650 PKG_PROVIDE([libogg])
651 PKG_PROVIDE([libsndfile])
652 PKG_PROVIDE([libtheora])
653 PKG_PROVIDE([libuuid])
654 PKG_PROVIDE([libvorbis])
655 PKG_PROVIDE([mjpegtools])
656 PKG_PROVIDE([openexr], [$WANT_OPENEXR])
657 PKG_PROVIDE([openjpeg])
659 PKG_PROVIDE([twolame])
662 PKG_PROVIDE([libvpx])
664 AC_SUBST(STATIC_BLDS)
665 AC_SUBST(SHARED_LIBS)
667 for f in $SYSTEM_LIBS; do
668 echo "AC_HELP_STRING([system],[$f])"
670 AC_SUBST(SYSTEM_LIBS)
673 for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
674 VIDEO4LINUX2 ESOUND PACTL OPENEXR; do
676 if test "x$vv" != "xno"; then
677 CFG_CFLAGS+=" -DHAVE_$v"
682 v=`echo "$v" | tr "A-Z" "a-z"`
683 echo " using: $vv-$v"
686 echo " using: with-jobs = $WANT_JOBS"
687 echo " using: exec-name = $WANT_CIN"
688 echo " using: with-cinlib = $WANT_CINLIB_DIR"
689 echo " using: with-cindat = $WANT_CINDAT_DIR"
690 echo " using: with-config-dir = $WANT_CONFIG_DIR"
691 echo " using: with-browser = $WANT_CIN_BROWSER"
692 echo " using: with-plugin-dir = $WANT_PLUGIN_DIR"
693 echo " using: with-ladspa-dir = $WANT_LADSPA_DIR"
694 echo " using: with-opencv = $WANT_OPENCV"
695 echo " using: with-git-ffmpeg = $WANT_GIT_FFMPEG"
697 echo " using: single-user = $WANT_CINBIN_BUILD"
698 echo " using: static-build = $WANT_STATIC_BUILD"
699 echo " using: ladspa-build = $WANT_LADSPA_BUILD"
703 if test "x$HAVE_tiff" = "xyes"; then
704 if test "x$HAVE_jbig" = "xyes"; then
705 EXTRA_LIBS+=' -ljbig'
708 if test "x$HAVE_NUMA" = "xyes"; then
709 EXTRA_LIBS+=' -lnuma'
711 if test "x$HAVE_DL" = "xyes"; then
713 FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
715 if test "x$HAVE_opus" = "xyes"; then
716 EXTRA_LIBS+=' -lopus'
717 CFG_CFLAGS+=' -I/usr/include/opus'
718 FFMPEG_EXTRA_CFG+=' --enable-libopus'
722 AC_SUBST(FFMPEG_EXTRA_CFG)
723 AC_SUBST(WANT_X264_HIDEPTH)
724 AC_SUBST(WANT_X265_HIDEPTH)
727 AC_SUBST(CFG_CXXFLAGS)
729 AC_CONFIG_FILES([Makefile])
734 echo "SHELL := /bin/bash"
736 echo "WANT_JOBS := $WANT_JOBS"
738 echo "OBJDIR := $OBJDIR"
739 echo "BINDIR := \$(TOPDIR)/bin"
740 echo "CINELERRA := \$(TOPDIR)/cinelerra"
741 echo "GUICAST := \$(TOPDIR)/guicast"
742 echo "LIBZMPEG3 := \$(TOPDIR)/libzmpeg3"
743 echo "MPEG2ENC := \$(TOPDIR)/mpeg2enc"
744 echo "MPLEXLO := \$(TOPDIR)/mplexlo"
745 echo "PLUGINS := \$(TOPDIR)/plugins"
746 echo "TDB := \$(TOPDIR)/db"
747 echo "THIRDPARTY := \$(TOPDIR)/thirdparty"
748 echo "EXTRA_LIBS := $EXTRA_LIBS"
749 echo "FFMPEG_EXTRA_CFG := $FFMPEG_EXTRA_CFG"
750 echo "export OBJDIR BINDIR CINELERRA GUICAST LIBZMPEG3"
751 echo "export MPEG2ENC MPLEXLO PLUGINS TDB"
752 echo "export THIRDPARTY EXTRA_LIBS FFMPEG_EXTRA_CFG"
755 echo "WANT_CIN := $WANT_CIN"
756 for w in $CFG_WANTS; do ww=WANT_$w; echo "WANT_$w := ${!ww}"; done
759 echo "ifndef CFLAGS_"
761 echo "CFLAGS_ := \$(CFLAGS)"
763 echo "CFLAGS_ := ${CFLAGS:--g -O2}"
767 echo "CFLAGS := \$(CFLAGS_)"
768 echo "CFLAGS += '-DCIN=\"\$(WANT_CIN)\"'"
769 echo "CFLAGS += '-DCINLIB_DIR=\"$WANT_CINLIB_DIR\"'"
770 echo "CFLAGS += '-DCINDAT_DIR=\"$WANT_CINDAT_DIR\"'"
771 echo "CFLAGS += '-DCONFIG_DIR=\"$WANT_CONFIG_DIR\"'"
772 echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
773 echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
774 echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
775 echo "CFLAGS += '-DCIN_BROWSER=\"$WANT_CIN_BROWSER\"'"
776 for flg in $CFG_CFLAGS; do echo "CFLAGS += $flg"; done
778 for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
781 if test $WANT_X264_HIDEPTH = "yes" ; then
782 echo "x264.cfg_params := --enable-static --bit-depth=10"
784 if test $WANT_X265_HIDEPTH = "yes" ; then
785 echo "x265.cfg_params := -DENABLE_SHARED=no -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON"
788 for pkg in $STATIC_PKGS; do
789 eval pkg_lib="\$PKG_$pkg"
790 if test "x$pkg_lib" = "xno"; then continue; fi;
791 echo "static_pkgs += $pkg"
795 for pkg in $STATIC_BLDS; do
796 echo "static_blds += $pkg"
798 echo "$ver_pkg := \$(THIRDPARTY)/${!ver_pkg}"
800 echo "$inc_pkg := \\"
801 for inc in ${!inc_pkg}; do
802 echo " -I\$($ver_pkg)/$inc \\"
805 echo "static_incs += \$(inc_$pkg)"
807 echo "$lib_pkg := \\"
808 for lib in ${!lib_pkg}; do
809 echo " \$($ver_pkg)/$lib \\"
812 echo "static_libs += \$($lib_pkg)"
817 for lib in $SHARED_LIBS; do echo "shared_libs += $lib"; done
819 for lib in $SYSTEM_LIBS; do echo "system_libs += $lib"; done
820 echo "export static_pkgs static_blds shared_libs system_libs"
823 echo "thirdparty_libraries := \$(static_libs) \$(shared_libs)"
824 echo "libraries += -Wl,--start-group"
825 echo "libraries += \$(thirdparty_libraries)"
826 echo "libraries += \$(system_libs)"
827 echo "libraries += \$(EXTRA_LIBS)"
828 echo "libraries += -Wl,--end-group"
829 # -Wl,--start-group ... -Wl,--end-group does not work on ubuntu
830 echo "libraries += \$(thirdparty_libraries)"
831 echo "libraries += \$(system_libs)"
832 echo "libraries += \$(EXTRA_LIBS)"
834 echo "export thirdparty_libraries libraries"
835 echo "export CFLAGS_ CXXFLAGS_ LDFLAGS_"
836 echo "unexport CFLAGS CXXFLAGS LDFLAGS"
838 if test "x$HAVE_tiff" = "xyes"; then
839 if test "x$HAVE_jbig" != "xyes"; then
840 echo "tiff.cfg_params+= --disable-jbig"
844 if test "x$WANT_GIT_FFMPEG" != "xno"; then
845 echo "ffmpeg.git := $WANT_GIT_FFMPEG"
847 if test "x$HAVE_opus" = "xyes"; then
848 echo 'ffmpeg.cflags+=" -I/usr/include/opus"'