minor changes; mostly for new Context Help feature
[goodguy/cinelerra.git] / cinelerra-5.1 / configure.ac
1
2 AC_PREREQ([2.69])
3 AC_INIT([cinelerra], [5.1], [mail@lists.cinelerra-gg.org])
4 AM_INIT_AUTOMAKE([foreign])
5
6 AM_PROG_AS
7 AC_LANG_CPLUSPLUS
8 AC_LANG_C
9 AC_PROG_CXX
10
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 -I/usr/local/include"
26 CFG_CFLAGS+=" -I/usr/include/freetype2 -I/usr/local/include/freetype2"
27 CFG_CFLAGS+=" -I/usr/include/uuid -I/usr/local/include/uuid"
28 CFG_CFLAGS+=" -I/usr/include/mjpegtools -I/usr/local/include/mjpegtools"
29
30 CFG_LDFLAGS+=" -z noexecstack"
31
32 AC_DEFUN([CHECK_WITH], [
33 AC_ARG_WITH([$1],
34   AC_HELP_STRING([--with-[$1]], [$2 ($4)]),
35   [WANT_$3=$withval], [WANT_$3='$4'])
36 AC_SUBST([WANT_$3])
37 ])
38
39 CHECK_WITH([jobs],[parallel build jobs],[JOBS],[auto])
40 CHECK_WITH([exec-name],[binary executable name],[CIN],[cin])
41 CHECK_WITH([single-user],[to install cin in bin],[CINBIN_BUILD],[no])
42 CHECK_WITH([ladspa-build],[build ladspa library],[LADSPA_BUILD],[yes])
43 CHECK_WITH([lv2],[lv2 library support],[LV2],[yes])
44 CHECK_WITH([cinlib],[cinelerra library path],[CINLIB_DIR],[auto])
45 CHECK_WITH([cindat],[cinelerra share path],[CINDAT_DIR],[auto])
46 CHECK_WITH([plugin-dir],[plugin install dir],[PLUGIN_DIR],[auto])
47 CHECK_WITH([ladspa-dir],[ladspa install dir],[LADSPA_DIR],[auto])
48 CHECK_WITH([config-dir],[.bcast config dir],[CONFIG_DIR],[$$HOME/.bcast5])
49 CHECK_WITH([browser],[cin_browser path],[CIN_BROWSER],[firefox])
50 CHECK_WITH([git-ffmpeg],[git ffmpeg using url],[GIT_FFMPEG],[no])
51 CHECK_WITH([noelision],[use noelision/libpthread],[NOELISION],[auto])
52 CHECK_WITH([booby],[window lock trace booby trap],[BOOBY],[no])
53 CHECK_WITH([libzmpeg],[build libzmpeg],[LIBZMPEG],[yes])
54 CHECK_WITH([commercial],[enable commercial capture],[COMMERCIAL],[yes])
55 CHECK_WITH([thirdparty],[use thirdparty build],[CIN_3RDPARTY],[yes])
56 CHECK_WITH([shuttle],[shuttle device],[SHUTTLE],[yes])
57
58 if test "x$WANT_LV2" != "xno"; then
59   GTK2_LIBS=`pkg-config --libs gtk+-2.0`
60   AC_CHECK_LIB([m], [gtk_init], [HAVE_gtk=yes], [HAVE_gtk=no], [$GTK2_LIBS])
61   test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --cflags gtk+-2.0`" && HAVE_gtk=no
62   test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --libs gtk+-2.0`" && HAVE_gtk=no
63   if test "x$HAVE_gtk" = "xno"; then
64     AC_MSG_ERROR([LV2 requires gtk+-2.0 support.])
65   fi
66 fi
67
68 if test "x$WANT_COMMERCIAL" = "xyes" -a "x$WANT_LIBZMPEG" != "xyes" ; then
69   AC_MSG_ERROR([commercial requires libzmpeg support.])
70 fi
71
72 if test "x$WANT_CINBIN_BUILD" = "xyes"; then
73   WANT_LOCALE_DIR='$$CIN_LIB/locale'
74   test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR='$$CIN_PATH'
75   test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR='$$CIN_PATH'
76   test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR='$$CIN_LIB/plugins'
77   test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR='$$CIN_LIB/ladspa'
78 else
79   lcldir=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
80     test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
81     eval "dir=\"$localedir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
82     echo "$dir"`
83   usrdat=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
84     test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
85     eval "dir=\"$datadir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
86     echo "$dir"`
87   usrlib=`test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"; \
88     test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
89     eval "dir=\"$libdir\""; eval "dir=\"$dir\""; eval "dir=\"$dir\""; \
90     echo "$dir"`
91   test "x$usrlib" = "x/lib" -o "x$usrlib" = "x/usr/lib" -o \
92        "x$usrlib" = "x/usr/local/lib" -a -e "/usr/lib64" && \
93   test ! -e "/usr/lib" -o `ls -1 /usr/lib64 | wc -l` -gt `ls -1 /usr/lib | wc -l` && \
94     usrlib+="64"
95   WANT_LOCALE_DIR="$lcldir"
96   test "x$WANT_CINDAT_DIR" = "xauto" && WANT_CINDAT_DIR="$usrdat/$WANT_CIN"
97   test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR="$usrlib/$WANT_CIN"
98   test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR="$WANT_CINLIB_DIR/plugins"
99   test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR="$WANT_CINLIB_DIR/ladspa"
100 fi
101
102 CIN_INSTALLS=""
103 CIN_UNINSTALLS=""
104 if test "x$WANT_LIBZMPEG" = "xyes"; then
105   CIN_INSTALLS+=" zmp_install"
106   CIN_UNINSTALLS+=" zmp_uninstall"
107 fi
108 if test "x$WANT_COMMERCIAL" = "xyes"; then
109   CIN_INSTALLS+=" com_install"
110   CIN_UNINSTALLS+=" com_uninstall"
111 fi
112 if test "x$WANT_LADSPA_BUILD" = "xyes"; then
113   CIN_INSTALLS+=" lad_install "
114   CIN_UNINSTALLS+=" lad_uninstall "
115 fi
116 if test "x$WANT_LV2" = "xyes"; then
117   CIN_INSTALLS+=" lv2_install "
118   CIN_UNINSTALLS+=" lv2_uninstall "
119 fi
120 AC_SUBST(CIN_INSTALLS)
121 AC_SUBST(CIN_UNINSTALLS)
122
123 if test "x$WANT_CINBIN_BUILD" = "xyes"; then
124   MAK_INSTALLS="dvl_install"
125   MAK_UNINSTALLS="dvl_uninstall"
126 else
127   MAK_INSTALLS=" sys_install"
128   MAK_UNINSTALLS="sys_uninstall"
129 fi
130 AC_SUBST(MAK_INSTALLS)
131 AC_SUBST(MAK_UNINSTALLS)
132
133 if test "x$WANT_JOBS" = "xauto"; then
134   CPUS=`grep -c "^proc" /proc/cpuinfo`
135   WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
136 fi
137
138 AC_DEFUN([PKG_DEF],[
139 STATIC_PKGS+=" [$1]"
140 ver_$1="$2"
141 lib_$1="$3"
142 inc_$1="$4"
143 ])
144
145 AC_DEFUN([PKG_3RD],[
146 AC_ARG_ENABLE([$1],
147   AC_HELP_STRING([--enable-$1],[build $1 ($2)]),
148   [PKG_$1=$enableval], [PKG_$1=$2])
149 PKG_DEF([$1],[$3],[$4],[$5])
150 ])
151
152 # thirdparty builds
153
154 PKG_3RD([a52dec],[yes],
155   [a52dec-0.7.4],
156   [ liba52/.libs/liba52.a ],
157   [ include ])
158
159 PKG_3RD([djbfft],[yes],
160   [djbfft-0.76],
161   [ libdjbfft.a ],
162   [ . ])
163
164 PKG_3RD([audiofile],[no],
165   [audiofile-0.3.6],
166   [ libaudiofile/.libs/libaudiofile.a \
167     libaudiofile/modules/.libs/libmodules.a \
168     libaudiofile/alac/.libs/libalac.a ],
169   [ libaudiofile ])
170
171 PKG_3RD([encore],[no],
172   [encore-5.0],
173   [ \$(OBJDIR)/libencore.a ],
174   [ . ])
175
176 PKG_3RD([esound],[no],
177   [esound-0.2.41],
178   [ .libs/libesd.a \
179     .libs/libesddsp.a ],
180   [ . ])
181
182 PKG_3RD([ffmpeg],[yes],
183   [ffmpeg-4.1],
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 ],
192   [ . ])
193
194 if test "x$WANT_GIT_FFMPEG" != "xno" ; then
195   ver_ffmpeg="ffmpeg.git"
196 fi
197
198 PKG_3RD([fftw],[auto],
199   [fftw-3.3.8],
200   [ .libs/libfftw3.a \
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 \
207     api/.libs/libapi.a \
208     reodft/.libs/libreodft.a \
209     dft/scalar/codelets/.libs/libdft_scalar_codelets.a \
210     dft/scalar/.libs/libdft_scalar.a \
211     dft/.libs/libdft.a \
212     kernel/.libs/libkernel.a \
213     simd-support/.libs/libsimd_support.a ],
214   [ api ])
215
216 PKG_3RD([flac],[auto],
217   [flac-1.3.2],
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 ],
225   [ include ])
226
227 PKG_3RD([giflib],[yes],
228   [giflib-5.1.6],
229   [ libgif.a ],
230   [ . ])
231
232 PKG_3RD([ilmbase],[auto],
233   [ilmbase-2.2.1],
234   [ Iex/.libs/libIex.a \
235     IexMath/.libs/libIexMath.a \
236     Half/.libs/libHalf.a \
237     Imath/.libs/libImath.a \
238     IlmThread/.libs/libIlmThread.a ],
239   [ Iex Half Imath config IlmThread ])
240
241 PKG_DEF([ladspa], [ladspa-0.4.17], [], [])
242
243 PKG_3RD([lame],[auto],
244   [lame-3.100],
245   [ libmp3lame/.libs/libmp3lame.a \
246     mpglib/.libs/libmpgdecoder.a ],
247   [ include ])
248
249 PKG_3RD([libavc1394],[auto],
250   [libavc1394-0.5.4],
251   [ libavc1394/.libs/libavc1394.a \
252     librom1394/.libs/librom1394.a \
253     common/.libs/libraw1394util.a ],
254   [ . ])
255
256 PKG_3RD([libraw1394],[auto],
257   [libraw1394-2.1.2],
258   [ src/.libs/libraw1394.a ],
259   [ . ])
260
261 PKG_3RD([libiec61883],[auto],
262   [libiec61883-1.2.0],
263   [ src/.libs/libiec61883.a ],
264   [ src ])
265
266 PKG_3RD([libdv],[auto],
267   [libdv-1.0.0],
268   [ libdv/.libs/libdv.a ],
269   [ . ])
270
271 PKG_3RD([libjpeg],[auto],
272   [libjpeg-turbo-1.5.1],
273   [ .libs/libjpeg.a \
274     .libs/libturbojpeg.a \
275     simd/.libs/libsimd.a ],
276   [ . ])
277
278 PKG_3RD([opus],[auto],
279   [opus-1.3],
280   [ .libs/libopus.a ],
281   [ include ])
282
283 PKG_3RD([openjpeg],[auto],
284   [openjpeg-2.3.0],
285   [ bin/libopenjp2.a ],
286   [ src/lib/openjp2 ])
287
288 PKG_3RD([libogg],[auto],
289   [libogg-1.3.3],
290   [ src/.libs/libogg.a ],
291   [ include ])
292
293 PKG_3RD([libsndfile],[auto],
294   [libsndfile-1.0.28],
295   [ src/.libs/libsndfile.a \
296     src/.libs/libcommon.a \
297     src/G72x/.libs/libg72x.a \
298     src/GSM610/.libs/libgsm.a ],
299   [ . ])
300
301 PKG_3RD([libtheora],[auto],
302   [libtheora-1.1.1],
303   [ lib/.libs/libtheora.a \
304     lib/.libs/libtheoradec.a \
305     lib/.libs/libtheoraenc.a ],
306   [ . ])
307
308 PKG_3RD([libuuid],[yes],
309   [libuuid-1.0.3],
310   [ .libs/libuuid.a ],
311   [ . ])
312
313 PKG_3RD([libvorbis],[auto],
314   [libvorbis-1.3.6],
315   [ lib/.libs/libvorbis.a \
316     lib/.libs/libvorbisenc.a \
317     lib/.libs/libvorbisfile.a ],
318   [ include . ])
319
320 PKG_3RD([mjpegtools],[yes],
321   [mjpegtools-2.1.0],
322   [ utils/mmxsse/.libs/libmmxsse.a \
323     utils/.libs/libmjpegutils.a \
324     lavtools/.libs/liblavfile.a \
325     lavtools/.libs/liblavjpeg.a \
326     mplex/.libs/libmplex2.a \
327     yuvfilters/.libs/libyuvfilters.a \
328     mpeg2enc/.libs/libmpeg2encpp.a ],
329   [ .  lavtools utils ])
330
331 PKG_3RD([openexr],[auto],
332   [openexr-2.2.1],
333   [ IlmImf/.libs/libIlmImf.a \
334     IlmImfUtil/.libs/libIlmImfUtil.a ],
335   [ IlmImf config ])
336
337 #PKG_3RD([festival],[no],
338 #  [festival],
339 #  [],
340 #  [])
341 #PKG_3RD(speech_tools,[no],
342 #  [speech_tools],
343 #  [],
344 #  [])
345 #
346 PKG_3RD([tiff],[auto],
347   [tiff-4.0.10],
348   [ libtiff/.libs/libtiff.a \
349     libtiff/.libs/libtiffxx.a \
350     port/.libs/libport.a ],[
351    . ])
352
353 PKG_3RD([twolame],[auto],
354   [twolame-0.3.13],
355   [ libtwolame/.libs/libtwolame.a ],
356   [  libtwolame ])
357
358 PKG_3RD([x264],[auto],
359   [x264-snapshot-20190117-2245-stable],
360   [ libx264.a ],
361   [ . ])
362
363 PKG_3RD([x265],[auto],
364   [x265_3.0],
365   [ libx265.a ],
366   [ . source ])
367
368 PKG_3RD([libvpx],[auto],
369   [libvpx-1.7.0],
370   [ libvpx.a ],
371   [ . ])
372
373 PKG_3RD([lv2],[auto],
374   [lv2-1.14.0],
375   [ ],
376   [ usr/local/include usr/local/lib64/lv2 usr/local/lib/lv2 ])
377
378 PKG_3RD([sratom],[auto],
379   [sratom-0.6.0],
380   [ usr/local/lib/libsratom-0.a ],
381   [ usr/local/include ])
382
383 PKG_3RD([serd],[auto],
384   [serd-0.28.0],
385   [ usr/local/lib/libserd-0.a ],
386   [ usr/local/include ])
387
388 PKG_3RD([sord],[auto],
389   [sord-0.16.0],
390   [ usr/local/lib/libsord-0.a ],
391   [ usr/local/include ])
392
393 PKG_3RD([lilv],[auto],
394   [lilv-0.24.2],
395   [ usr/local/lib/liblilv-0.a ],
396   [ usr/local/include ])
397
398 PKG_3RD([suil],[auto],
399   [suil-0.8.4],
400   [ usr/local/lib/libsuil-0.a ],
401   [ usr/local/include ])
402
403 PKG_3RD([libaom],[auto],
404   [libaom-v1.0.0],
405   [ usr/local/lib*/libaom*.a ],
406   [ usr/local/include ])
407
408 PKG_3RD([libwebp],[auto],
409   [libwebp-1.0.2],
410   [ usr/local/lib*/libwebp*.a ],
411   [ usr/local/include ])
412
413 AC_SUBST(STATIC_PKGS)
414
415 AC_DEFUN([CHECK_ENABLE], [
416 AC_ARG_ENABLE([$1],
417   AC_HELP_STRING([--enable-[$1]], [$3 ([$4])]),
418   [WANT_$2=$enableval], [WANT_$2=[$4]])
419 ])
420
421 CHECK_ENABLE([static-build], [STATIC_BUILD], [build static], [auto])
422 CHECK_ENABLE([x264_hidepth], [X264_HIDEPTH], [build x264 10bit], [no])
423 CHECK_ENABLE([x265_hidepth], [X265_HIDEPTH], [build x265 10bit], [no])
424
425 test "x$WANT_STATIC_BUILD" = "xauto" && WANT_STATIC_BUILD=$WANT_CINBIN_BUILD
426
427 AC_DEFUN([CHECK_PROG], [
428  AC_CHECK_PROG([PROG_$1], [$2], [yes],[no])
429 ])
430 AC_DEFUN([REQUIRE_PROG], [
431  CHECK_PROG([$1],[$2])
432  if test "x$PROG_$1" = "xno"; then
433    AC_MSG_WARN([$2 is missing and required.])
434    FATAL_ERROR=1
435  fi
436 ])
437
438 ## arch dep tests
439 ARCH=[`uname -m`]
440 I86=[`expr "x$ARCH" : 'xi[346]86.*'`]
441 X86=[`expr "x$ARCH" : 'x..._64*'`]
442
443 if test "x$I86$X86" != "x00" ; then
444   # Checks for ix86 programs.
445   REQUIRE_PROG(NASM, [nasm])
446   # libx264 nasm fix
447   AC_MSG_CHECKING([nasm x264 compatible])
448   echo "vmovdqa32 [[eax]]{k1}{z}, zmm0" > conftest.asm
449   nasm conftest.asm -o conftest.o > /dev/null 2>&1
450   if test $? != 0 ; then
451    AC_MSG_RESULT([no])
452    AC_MSG_WARN([libx264 built without assembly code])
453    X264_CFG_PARAMS="$X264_CFG_PARAMS --disable-asm"
454   else
455    AC_MSG_RESULT([yes])
456   fi
457   rm -f conftest.asm conftest.o
458   REQUIRE_PROG(YASM, [yasm])
459 fi
460 ## end arch dep tests
461
462 REQUIRE_PROG(OBJCOPY, [objcopy])
463 if test "x$FATAL_ERROR" != "x"; then
464  AC_MSG_ERROR("fatal eror.")
465 fi
466 CHECK_PROG(PACTL, [pactl])
467 WANT_PACTL=$PROG_PACTL
468
469 AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
470 if test "$no_utf" = "yes"; then
471   AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
472 fi
473
474 # Checks for headers/libraries.
475
476 AC_DEFUN([CHECK_HEADERS], [
477 if test "x$HAVE_$1" != "xno"; then
478  AC_CHECK_HEADER(m4_apply([m4_car],m4_split([$3])), [HAVE_$1=yes], [HAVE_$1=no],
479   [m4_foreach([i], m4_split([$3]), [[#include "]i["
480 ]])])
481  AC_SUBST([HAVE_$1])
482  AC_MSG_CHECKING([$2])
483  AC_MSG_RESULT([$HAVE_$1])
484  if test "x$HAVE_$1" = "xno"; then
485   if test "x$PKG_$1" = "x"; then RESULT=no; fi
486  fi
487 fi
488 ])
489
490 AC_DEFUN([CHECK_LIB], [
491 if test "x$HAVE_$1" != "xno"; then
492  if test "x$PKG_$1" = "x" -o "x$WANT_STATIC_BUILD" = "xno" -a "x$PKG_$1" = "xauto"; then
493   AC_CHECK_LIB([$2], [$3], [HAVE_$1=yes], [HAVE_$1=no], [$4])
494   AC_SUBST([HAVE_$1])
495   if test "x$HAVE_$1" = "xyes"; then
496    if test "x$PKG_$1" = "x"; then
497     SYSTEM_LIBS+=" -l[$2]"
498     for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
499    else
500     SHARED_$1+=" -l[$2]"
501     for lib in [$4]; do SHARED_LIBS+=" $lib"; done
502    fi
503   elif test "x$PKG_$1" = "x"; then RESULT=no; fi
504  fi
505 fi
506 ])
507
508 CHECK_LIB([X11], [X11], [XOpenDisplay])
509 CHECK_HEADERS([X11], [X11 headers], [X11/X.h X11/Xlib.h X11/Xutil.h X11/cursorfont.h])
510 CHECK_HEADERS([X11], [X11 headers], [X11/keysym.h X11/Sunkeysym.h X11/Xatom.h X11/XF86keysym.h])
511 CHECK_LIB([XEXT], [Xext], [XShmQueryExtension])
512 CHECK_HEADERS([XEXT], [Xlib XShm extention], [X11/Xlib.h X11/extensions/XShm.h X11/extensions/shape.h])
513 CHECK_LIB([XINERAMA], [Xinerama], [XineramaQueryExtension])
514 CHECK_HEADERS([XINERAMA], [Xinerama headers], [X11/extensions/Xinerama.h])
515 CHECK_LIB([XV], [Xv], [XvQueryExtension])
516 CHECK_HEADERS([XV], [Xlib Xv extention], [X11/Xlib.h X11/extensions/Xvlib.h])
517 CHECK_LIB([XFIXES], [Xfixes], [XFixesQueryVersion])
518 CHECK_LIB([BZ2], [bz2], [BZ2_bzDecompress])
519 CHECK_LIB([FONTCONFIG], [fontconfig], [FcInit])
520 CHECK_LIB([FREETYPE], [freetype], [FT_Init_FreeType])
521 CHECK_LIB([LZMA], [lzma], [lzma_version_number])
522 CHECK_LIB([PNG], [png], [png_read_png])
523 CHECK_LIB([PTHREAD], [pthread], [pthread_create])
524 CHECK_LIB([Z], [z], [gzopen])
525 CHECK_LIB([fftw], [fftw3], [fftw_execute])
526 CHECK_HEADERS([fftw], [fftw headers], [fftw3.h])
527 CHECK_LIB([libuuid], [uuid], [uuid_clear])
528 CHECK_HEADERS([libuuid], [uuid headers], [uuid/uuid.h])
529 CHECK_HEADERS([LINUX_CDROM], [linux cdrom headers], [linux/cdrom.h linux/futex.h])
530 CHECK_HEADERS([LINUX_SYS], [linux sys], [sys/ioctl.h sys/stat.h sys/types.h sys/time.h sys/syscall.h])
531 CHECK_LIB([flac], [FLAC], [FLAC__stream_decoder_new])
532 CHECK_HEADERS([flac], [FLAC headers], [FLAC/stream_decoder.h])
533 CHECK_LIB([lame], [mp3lame], [lame_init])
534 CHECK_HEADERS([lame], [lame headers], [lame/lame.h])
535 CHECK_LIB([libjpeg], [jpeg], [jpeg_start_decompress])
536 CHECK_HEADERS([libjpeg], [jpeg headers], [stdio.h jpeglib.h])
537 CHECK_LIB([libogg], [ogg], [ogg_stream_init])
538 CHECK_HEADERS([libogg], [ogg headers], [ogg/ogg.h])
539 CHECK_LIB([openjpeg], [openjp2], [opj_version])
540 CHECK_HEADERS([openjpeg], [openjpeg headers], [openjpeg.h])
541 CHECK_LIB([libsndfile], [sndfile], [sf_open])
542 CHECK_HEADERS([libsndfile], [sndfile headers], [sndfile.h])
543 CHECK_LIB([ilmbase], [IlmImf], [ImfOpenInputFile])
544 CHECK_HEADERS([ilmbase], [IlmImf headers], [OpenEXR/ImfCRgbaFile.h])
545 CHECK_LIB([libtheora], [theora], [theora_info_init], [-ltheoraenc -ltheoradec -logg])
546 CHECK_HEADERS([libtheora], [threora headers], [theora/theoraenc.h])
547 CHECK_LIB([libvorbis], [vorbisenc], [vorbis_encode_init], [-lvorbis -lvorbisfile -logg])
548 CHECK_HEADERS([libvorbis], [vorbis encoders headers], [vorbis/vorbisenc.h])
549 CHECK_LIB([libvorbis], [vorbisfile], [ov_open])
550 CHECK_HEADERS([libvorbis], [vorbis file headers], [vorbis/vorbisfile.h])
551 CHECK_LIB([libvpx], [vpx], [vpx_codec_decode])
552 CHECK_HEADERS([libvpx], [vpx headers], [vpx/vpx_decoder.h])
553 CHECK_LIB([mjpegtools], [mjpegutils], [mjpeg_info])
554 CHECK_HEADERS([mjpegtools], [mjpegtools headers], [mjpegtools/mjpeg_types.h])
555 CHECK_LIB([tiff], [tiff], [TIFFOpen])
556 CHECK_HEADERS([tiff], [tiff headers], [tiff.h tiffio.h])
557 CHECK_LIB([twolame], [twolame], [twolame_encode_buffer_float32_interleaved])
558 CHECK_HEADERS([twolame], [twolame headers], [twolame.h])
559 CHECK_LIB([x264], [x264], [x264_encoder_encode])
560 CHECK_HEADERS([x264], [x264 headers], [stdint.h x264.h])
561 CHECK_LIB([x265], [x265], [x265_encoder_encode])
562 CHECK_HEADERS([x265], [x265 headers], [x265.h])
563 CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
564 CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])
565 CHECK_LIB([libaom], [aom], [aom_codec_version])
566 CHECK_HEADERS([libaom], [libaom headers], [aom/aom.h])
567 CHECK_LIB([libwebp], [webp], [WebPGetEncoderVersion])
568 CHECK_HEADERS([libwebp], [libwebp headers], [webp/encode.h])
569 CHECK_LIB([a52dec], [a52], [a52_init])
570 CHECK_HEADERS([a52dec], [a52 headers], [a52.h])
571 CHECK_LIB([encore], [encore], [encore])
572 CHECK_HEADERS([encore], [encore headers], [encore.h])
573 CHECK_LIB([giflib], [gif], [DGifOpen])
574 CHECK_HEADERS([giflib], [gif lib headers], [gif_lib.h])
575 CHECK_LIB([jbig], [jbig], [jbg_dec_init])
576 CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11])
577
578 #if test "x$HAVE_mjpegtools" = "xyes"; then
579 #CFG_CFLAGS+=" -I/usr/include/mjpegtools -I/usr/local/include/mjpegtools"
580 #fi
581
582 AC_DEFUN([CHECK_WANT], [
583 RESULT=yes
584 # WANT_$1
585 if test "x$WANT_$1" != "xno" ; then
586 AC_ARG_WITH(m4_tolower([$1]),
587  AC_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))], [$3] (auto)),
588   [WANT_$1=$withval],[WANT_$1=$2])
589  m4_quote($4)
590  if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then
591   if test "x$WANT_$1" = "xyes" ; then
592     AC_MSG_ERROR([required for $1 support.])
593   fi
594   echo "=== want $1 Failed."
595   WANT_$1=no
596  elif test "x$WANT_$1" = "xauto" ; then
597   WANT_$1=yes
598  fi
599 fi
600 CFG_WANTS+=" $1"
601 AC_SUBST([WANT_$1])
602 ])
603
604 CHECK_WANT([GL], [auto], [use opengl], [
605  CHECK_LIB([GL], [GL], [glUseProgram])
606  CHECK_LIB([GL], [GLU], [gluOrtho2D])
607  CHECK_HEADERS([GL], [opengl headers], [GL/gl.h GL/glext.h GL/glu.h GL/glx.h])])
608
609 CHECK_WANT([OSS], [auto], [use OSS audio], [
610  CHECK_HEADERS([OSS], [oss headers], [sys/soundcard.h])])
611
612 CHECK_WANT([XFT], [auto], [use libXft], [
613  CHECK_LIB([XFT], [Xft], [XftInit])
614  CHECK_HEADERS([XFT], [Xft/freetype headers], [X11/Xlib.h X11/Xft/Xft.h])])
615
616 CHECK_WANT([ALSA], [auto], [use libasound/alsa], [
617  CHECK_LIB([ALSA], [asound], [snd_pcm_open])
618  CHECK_HEADERS([ALSA], [asound headers], [alsa/asoundlib.h])])
619
620 CHECK_WANT([FIREWIRE], [auto], [use firewire], [
621  CHECK_LIB([libavc1394], [avc1394], [avc1394_init_target])
622  CHECK_HEADERS([libavc1394], [libavc1394 headers], [libavc1394/avc1394.h])
623  CHECK_LIB([libavc1394], [rom1394], [rom1394_get_bus_id])
624  CHECK_HEADERS([libavc1394], [librom1394 headers], [libavc1394/rom1394.h])
625  CHECK_LIB([libiec61883], [iec61883], [iec61883_mpeg2_recv_init])
626  CHECK_HEADERS([libiec61883], [libiec61883 headers], [libiec61883/iec61883.h])
627  CHECK_LIB([libraw1394], [raw1394], [raw1394_iso_recv_init])
628  CHECK_HEADERS([libraw1394], [libraw1394 headers], [libraw1394/raw1394.h])])
629
630 CHECK_WANT([DV], [auto], [use dv], [
631  CHECK_LIB([libdv], [dv], [dv_init])
632  CHECK_HEADERS([libdv], [libdv headers], [libdv/dv.h])])
633
634 CHECK_WANT([DVB], [auto], [use dvb], [
635  CHECK_HEADERS([DVB], [dvb device headers], [linux/dvb/dmx.h linux/dvb/frontend.h])])
636
637 CHECK_WANT([VIDEO4LINUX2], [auto], [use v4l2], [
638  CHECK_HEADERS([VIDEO4LINUX2], [v4l2 system headers], [linux/kernel.h linux/types.h linux/videodev2.h])])
639
640 CHECK_WANT([XXF86VM], [auto], [use xf86vmode], [
641  CHECK_HEADERS([XXF86VM], [XF86VM headers], [X11/Xlib.h X11/extensions/xf86vmode.h])])
642
643 CHECK_WANT([ESOUND], [no], [use esd], [
644  CHECK_LIB([esound], [esd], [esd_open_sound])
645  CHECK_HEADERS([esound], [esound headers], [esd.h])
646  CHECK_LIB([audiofile], [audiofile], [afOpenFile])
647  CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
648
649 CHECK_WANT([SHUTTLE_USB], [yes], [use libusb-1.0], [
650  CHECK_LIB([libusbx], [usb-1.0], [libusb_init])
651  CHECK_HEADERS([libusbx], [libusb headers], [libusb-1.0/libusb.h])])
652
653 CHECK_WANT([LV2], [auto], [use lv2], [
654  saved_CFLAGS="$CFLAGS"
655  CHECK_LIB([lilv], [lilv-0], [lilv_world_new])
656  CHECK_LIB([sord], [sord-0], [sord_world_new])
657  CHECK_LIB([serd], [serd-0], [serd_reader_new])
658  CHECK_LIB([sratom], [sratom-0], [sratom_new])
659  CFLAGS="-I/usr/include/lilv-0 -I/usr/local/include/lilv-0"
660  CHECK_HEADERS([lv2], [lilv headers], [lilv/lilv.h])
661  CHECK_LIB([suil], [suil-0], [suil_instance_new])
662  CFLAGS="-I/usr/include/suil-0 -I/usr/local/include/suil-0"
663  CHECK_HEADERS([lv2], [suil headers], [suil/suil.h])
664  CFLAGS="$saved_CFLAGS"])
665
666 CHECK_WANT([DL], [auto], [system has libdl], [
667  CHECK_LIB([DL], [dl], [dlopen])])
668
669 CHECK_WANT([EXR], [auto], [use exr], [])
670
671 CHECK_WANT([OPENCV], [no], [opencv=sys/sta/dyn,git/tar=url], [
672 ])
673
674 CHECK_WANT([NUMA], [auto], [system has libnuma], [
675  CHECK_LIB([NUMA], [numa], [numa_alloc])])
676
677 CHECK_WANT([OPENEXR], [auto], [use openexr], [
678  AC_MSG_CHECKING([for openexr available])
679  saved_LIBS="$LIBS"
680  saved_CXXFLAGS="$CXXFLAGS"
681  # ilmbase libs
682  LIBS=" -lIlmImf -lIlmThread -lIex -lpthread"
683  CXXFLAGS="-I/usr/include/OpenEXR -I/usr/local/include/OpenEXR"
684  AC_LANG_PUSH(C++)
685  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
686 #include "ImfChannelList.h"
687 #include "ImfChromaticities.h"
688 #include "ImfCompression.h"
689 #include "ImfIO.h"
690 #include "ImfInputFile.h"
691 #include "ImfOutputFile.h"
692 #include "ImfPixelType.h"
693 #include "ImfRgbaFile.h"
694 #include "ImfRgbaYca.h"
695 #include "ImfVersion.h"
696 class EXRIStream : public Imf::IStream { public:
697 EXRIStream() : Imf::IStream("mypath") {} };
698 class EXROStream : public Imf::OStream { public: 
699 EXROStream() : Imf::OStream("mypath") {} };
700 ]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no])
701  RESULT="$HAVE_OPENEXR"
702  if test "x$RESULT" = "xyes"; then
703    SHARED_openexr="$LIBS"
704    CFG_CFLAGS+=" -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR"
705  fi
706  LIBS="$saved_LIBS"
707  CXXFLAGS="$saved_CXXFLAGS"
708  AC_LANG_POP(C++)
709  AC_MSG_RESULT([$HAVE_OPENEXR])
710 ])
711 AC_SUBST([HAVE_OPENEXR])
712
713 # build global_config
714 OBJDIR=`uname -m`
715 AC_SUBST(OBJDIR)
716
717 echo "AC_HELP_STRING([Reason],[Package])"
718 echo "AC_HELP_STRING([------],[-------])"
719
720 AC_DEFUN([PKG_DISABLED],[
721  PKG_$1="no"
722  BUILD_$1=0
723  AC_SUBST(BUILD_$1)
724  echo "AC_HELP_STRING([disabled],[$1])"
725 ])
726 AC_DEFUN([PKG_SHARED],[
727  BUILD_$1=0
728  AC_SUBST(BUILD_$1)
729  SHARED_LIBS+="$SHARED_$1"
730 ])
731
732 AC_DEFUN([PKG_STATIC],[
733  if test "x$WANT_CIN_3RDPARTY" != "xno"; then
734   PKG_$1="yes"
735   BUILD_$1=1
736   AC_SUBST(BUILD_$1)
737   STATIC_BLDS+=" [$1]"
738   echo "AC_HELP_STRING([$2],[$1])"
739  fi
740 ])
741
742 AC_DEFUN([PKG_FORCED],[PKG_STATIC([$1],[forced])])
743
744 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
745 # order matters
746 for dep in \
747         ffmpeg/twolame ffmpeg/lame ffmpeg/openjpeg \
748         ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/x265 \
749         libiec61883/libraw1394 libavc1394/librom1394 \
750         openexr/ilmbase ilmbase/libogg \
751         libtheora/libogg libtheora/libvorbis ; do
752   lib=`dirname $dep`;  needs=`basename $dep`
753   eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs";
754   if test "x$pkg_lib" != "xno"; then
755     eval "PKG_$needs=yes"
756   fi
757 done
758 fi
759
760 AC_DEFUN([PKG_PROVIDE],[
761 if test "x$BUILD_$1" = "x" ; then
762  if test "x$PKG_$1" = "xyes"; then
763   PKG_FORCED([$1])
764  elif test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
765   PKG_DISABLED([$1])
766  elif test "x$WANT_STATIC_BUILD" = "xyes"; then
767   PKG_STATIC([$1],[static])
768  elif test "x$HAVE_$1" = "xyes"; then
769   PKG_SHARED([$1])
770  else
771   PKG_STATIC([$1],[needed])
772  fi
773 fi
774 ])
775
776 PKG_PROVIDE([a52dec])
777 PKG_PROVIDE([djbfft])
778 PKG_PROVIDE([encore])
779 PKG_PROVIDE([audiofile],[$WANT_ESOUND])
780 PKG_PROVIDE([esound],[$WANT_ESOUND])
781 PKG_PROVIDE([ffmpeg])
782 PKG_PROVIDE([fftw])
783 PKG_PROVIDE([flac])
784 PKG_PROVIDE([giflib])
785 PKG_PROVIDE([ilmbase], [$WANT_OPENEXR])
786 PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD])
787 PKG_PROVIDE([lame])
788 PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE])
789 PKG_PROVIDE([libraw1394],[$WANT_FIREWIRE])
790 PKG_PROVIDE([libiec61883],[$WANT_FIREWIRE])
791 PKG_PROVIDE([libdv],[$WANT_DV])
792 PKG_PROVIDE([libjpeg])
793 PKG_PROVIDE([libogg])
794 PKG_PROVIDE([libsndfile])
795 PKG_PROVIDE([libtheora])
796 PKG_PROVIDE([libuuid])
797 PKG_PROVIDE([libvorbis])
798 PKG_PROVIDE([mjpegtools])
799 PKG_PROVIDE([libaom])
800 PKG_PROVIDE([libwebp])
801 PKG_PROVIDE([openexr], [$WANT_OPENEXR])
802 PKG_PROVIDE([openjpeg])
803 PKG_PROVIDE([tiff])
804 PKG_PROVIDE([twolame])
805 PKG_PROVIDE([x264])
806 PKG_PROVIDE([x265])
807 PKG_PROVIDE([libvpx])
808 PKG_PROVIDE([opus])
809 PKG_PROVIDE([lv2], [$WANT_LV2])
810 PKG_PROVIDE([lilv], [$WANT_LV2])
811 PKG_PROVIDE([sratom], [$WANT_LV2])
812 PKG_PROVIDE([serd], [$WANT_LV2])
813 PKG_PROVIDE([sord], [$WANT_LV2])
814 PKG_PROVIDE([suil], [$WANT_LV2])
815
816 if test "x$WANT_LV2" = "xyes"; then
817   if test "x$HAVE_lv2" = "xyes" -a "x$BUILD_lilv" = "x0"; then
818     CFG_CFLAGS+=' -I/usr/include/lilv-0 -I/usr/local/include/lilv-0'
819     CFG_CFLAGS+=' -I/usr/include/suil-0 -I/usr/local/include/suil-0'
820   fi
821 fi
822
823 AC_SUBST(STATIC_BLDS)
824 for f in $SHARED_LIBS; do
825   echo "AC_HELP_STRING([shared],[$f])"
826 done
827 AC_SUBST(SHARED_LIBS)
828 for f in $SYSTEM_LIBS; do
829   echo "AC_HELP_STRING([system],[$f])"
830 done
831 AC_SUBST(SYSTEM_LIBS)
832
833 echo ""
834 if test "x$WANT_CIN_3RDPARTY" != "xno"; then
835   CFG_CFLAGS+=" -DHAVE_CIN_3RDPARTY"
836 fi
837 for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
838          VIDEO4LINUX2 ESOUND PACTL OPENEXR LV2 \
839          COMMERCIAL LIBZMPEG SHUTTLE SHUTTLE_USB; do
840   eval vv="\$WANT_$v"
841   if test "x$vv" != "xno"; then
842     CFG_CFLAGS+=" -DHAVE_$v"
843     vv=with
844   else
845     vv=without
846   fi
847   v=`echo "$v" | tr "A-Z" "a-z"`
848   echo "  using: $vv-$v"
849 done
850
851 echo "  using: with-jobs = $WANT_JOBS"
852 echo "  using: exec-name = $WANT_CIN"
853 echo "  using: with-cinlib = $WANT_CINLIB_DIR"
854 echo "  using: with-cindat = $WANT_CINDAT_DIR"
855 echo "  using: with-config-dir = $WANT_CONFIG_DIR"
856 echo "  using: with-browser = $WANT_CIN_BROWSER"
857 echo "  using: with-plugin-dir = $WANT_PLUGIN_DIR"
858 echo "  using: with-ladspa-dir = $WANT_LADSPA_DIR"
859 echo "  using: with-opencv = $WANT_OPENCV"
860 echo "  using: with-git-ffmpeg = $WANT_GIT_FFMPEG"
861 echo "  using: with-noelision = $WANT_NOELISION"
862 echo "  using: with-booby = $WANT_BOOBY"
863 echo "  using: with-libzmpeg = $WANT_LIBZMPEG"
864 echo "  using: with-commerical = $WANT_COMMERCIAL"
865 echo ""
866 echo "  using: thirdparty build = $WANT_CIN_3RDPARTY"
867 echo "  using: single-user  = $WANT_CINBIN_BUILD"
868 echo "  using: static-build = $WANT_STATIC_BUILD"
869 echo "  using: ladspa-build = $WANT_LADSPA_BUILD"
870 echo ""
871
872 # build extras
873 if test "x$HAVE_tiff" = "xyes"; then
874   if test "x$HAVE_jbig" = "xyes"; then
875     EXTRA_LIBS+=' -ljbig'
876   fi
877 fi
878 if test "x$HAVE_NUMA" = "xyes"; then
879   EXTRA_LIBS+=' -lnuma'
880 fi
881 if test "x$HAVE_DL" = "xyes"; then
882   EXTRA_LIBS+=' -ldl'
883   FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
884 fi
885 if test "x$WANT_BOOBY" != "xno"; then
886   CFG_CFLAGS+=" -DBOOBY"
887 fi
888
889 # intel lock elision bugs
890 if test "x$WANT_NOELISION" != "xno"; then
891   CFG_RPATH=`ls -1fd 2> /dev/null \
892  /usr/lib/noelision \
893  /lib/noelision \
894  /usr/lib64/noelision \
895  /lib64/noelision \
896   | tail -1`
897 fi
898
899 AC_SUBST(WANT_CIN_3RDPARTY)
900 AC_SUBST(EXTRA_LIBS)
901 AC_SUBST(FFMPEG_EXTRA_CFG)
902 AC_SUBST(WANT_X264_HIDEPTH)
903 AC_SUBST(WANT_X265_HIDEPTH)
904
905 AC_SUBST(CFG_CFLAGS)
906 AC_SUBST(CFG_CXXFLAGS)
907
908 AC_CONFIG_FILES([Makefile])
909 AC_OUTPUT
910
911 exec > global_config
912
913 echo "SHELL := /bin/bash"
914 echo "export SHELL"
915 echo "WANT_JOBS := $WANT_JOBS"
916 echo ""
917 echo "OBJDIR := $OBJDIR"
918 echo "BINDIR := \$(TOPDIR)/bin"
919 echo "CINELERRA := \$(TOPDIR)/cinelerra"
920 echo "GUICAST := \$(TOPDIR)/guicast"
921 echo "LIBZMPEG3 := \$(TOPDIR)/libzmpeg3"
922 echo "MPEG2ENC := \$(TOPDIR)/mpeg2enc"
923 echo "MPLEXLO := \$(TOPDIR)/mplexlo"
924 echo "PLUGINS := \$(TOPDIR)/plugins"
925 echo "TDB := \$(TOPDIR)/db"
926 echo "THIRDPARTY := \$(TOPDIR)/thirdparty"
927 echo "EXTRA_LIBS := $EXTRA_LIBS"
928 echo "FFMPEG_EXTRA_CFG := $FFMPEG_EXTRA_CFG"
929 echo "export OBJDIR BINDIR CINELERRA GUICAST LIBZMPEG3"
930 echo "export MPEG2ENC MPLEXLO PLUGINS TDB"
931 echo "export THIRDPARTY EXTRA_LIBS FFMPEG_EXTRA_CFG"
932 echo ""
933
934 echo "WANT_CIN := $WANT_CIN"
935 CFG_WANTS+=" CIN_3RDPARTY LIBZMPEG COMMERCIAL"
936 for w in $CFG_WANTS; do ww=WANT_$w; echo "WANT_$w := ${!ww}"; done
937 echo ""
938
939 echo "ifndef CFLAGS_"
940 echo "ifdef CFLAGS"
941 echo "CFLAGS_ := \$(CFLAGS)"
942 echo "else"
943 echo "CFLAGS_ := ${CFLAGS:--g -O2}"
944 echo "endif"
945 echo "endif"
946 echo "ifndef CXXFLAGS_"
947 echo "ifdef CXXFLAGS"
948 echo "CXXFLAGS_ := \$(CXXFLAGS)"
949 echo "endif"
950 echo "endif"
951 echo "ifndef LDFLAGS_"
952 echo "ifdef LDFLAGS"
953 echo "LDFLAGS_ := \$(LDFLAGS)"
954 echo "endif"
955 echo "endif"
956
957 echo "CFLAGS := \$(CFLAGS_)"
958 echo "CFLAGS += '-DCIN=\"\$(WANT_CIN)\"'"
959 echo "CFLAGS += '-DCINLIB_DIR=\"$WANT_CINLIB_DIR\"'"
960 echo "CFLAGS += '-DCINDAT_DIR=\"$WANT_CINDAT_DIR\"'"
961 echo "CFLAGS += '-DCONFIG_DIR=\"$WANT_CONFIG_DIR\"'"
962 echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
963 echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
964 echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
965 echo "CFLAGS += '-DCIN_BROWSER=\"$WANT_CIN_BROWSER\"'"
966 for flg in $CFG_CFLAGS; do echo "CFLAGS += $flg"; done
967 echo ""
968 if test "x$CFG_CXXFLAGS" != "x"; then
969   for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
970   echo ""
971 fi
972 if test "x$CFG_LDFLAGS" != "x" ; then
973   echo "LDFLAGS +=$CFG_LDFLAGS"
974   echo ""
975 fi
976
977 if test "x$WANT_X264_HIDEPTH" = "xyes" ; then
978   X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10"
979 fi
980 if test "x$WANT_X265_HIDEPTH" = "xyes" ; then
981   X265_CFG_PARAMS="$X265_CFG_PARAMS -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON"
982 fi
983
984 for pkg in $STATIC_PKGS; do
985   eval pkg_lib="\$PKG_$pkg"
986   if test "x$pkg_lib" = "xno"; then continue; fi;
987   echo "static_pkgs += $pkg"
988 done
989 echo ""
990
991 for pkg in $STATIC_BLDS; do
992   echo "static_blds += $pkg"
993   ver_pkg=ver_$pkg
994   echo "$ver_pkg := \$(THIRDPARTY)/${!ver_pkg}"
995   inc_pkg=inc_$pkg
996   echo "$inc_pkg := \\"
997   for inc in ${!inc_pkg}; do
998     echo "  -I\$($ver_pkg)/$inc \\"
999   done
1000   echo ""
1001   echo "static_incs += \$(inc_$pkg)"
1002   lib_pkg=lib_$pkg
1003   echo "$lib_pkg := \\"
1004   for lib in ${!lib_pkg}; do
1005     echo "  \$($ver_pkg)/$lib \\"
1006   done
1007   echo ""
1008   echo "static_libs += \$($lib_pkg)"
1009   echo ""
1010 done
1011 echo ""
1012
1013 for lib in $SHARED_LIBS; do echo "shared_libs += $lib"; done
1014 echo ""
1015 for lib in $SYSTEM_LIBS; do echo "system_libs += $lib"; done
1016 echo "export static_pkgs static_blds shared_libs system_libs"
1017 echo ""
1018
1019 echo "thirdparty_libraries := \$(static_libs) \$(shared_libs)"
1020
1021 if test "x$CFG_RPATH" != "x"; then
1022   echo "libraries+= -Wl,-rpath=$CFG_RPATH"
1023 fi
1024
1025 echo "libraries += -Wl,--start-group"
1026 echo "libraries += \$(thirdparty_libraries)"
1027 echo "libraries += \$(system_libs)"
1028 echo "libraries += \$(EXTRA_LIBS)"
1029 echo "libraries += -Wl,--end-group"
1030 # -Wl,--start-group ... -Wl,--end-group does not work on ubuntu
1031 echo "libraries += \$(thirdparty_libraries)"
1032 echo "libraries += \$(system_libs)"
1033 echo "libraries += \$(EXTRA_LIBS)"
1034 echo ""
1035 echo "export thirdparty_libraries libraries"
1036 echo "export CFLAGS_ CXXFLAGS_ LDFLAGS_"
1037 echo "unexport CFLAGS CXXFLAGS LDFLAGS"
1038
1039 if test "x$HAVE_tiff" = "xyes"; then
1040   if test "x$HAVE_jbig" != "xyes"; then
1041     echo "tiff.cfg_params+= --disable-jbig"
1042   fi
1043 fi
1044
1045 if test "x$WANT_GIT_FFMPEG" != "xno"; then
1046   echo "ffmpeg.git := $WANT_GIT_FFMPEG"
1047 fi
1048 if test "x$X264_CFG_PARAMS" != "x" ; then
1049   echo "x264.cfg_params :=$X264_CFG_PARAMS --enable-static --enable-pic"
1050 fi
1051 if test "x$X265_CFG_PARAMS" != "x" ; then
1052   echo "x265.cfg_params :=$X265_CFG_PARAMS -DENABLE_SHARED=no"
1053 fi