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