1 AC_INIT(Cinelerra, 2.0)
5 # Test for minimal version of autoconf
9 AC_CONFIG_HEADER(config.h)
10 AM_GNU_GETTEXT([external])
11 AM_GNU_GETTEXT_VERSION(0.12.1)
21 # hack for libtool 1.5 -- this is ugly and probably wrong, but works
22 if test `libtool --version | grep ltmain.sh | cut -b 25-27` = "1.5"; then
24 LTCXX_FLAGS="--tag=CXX"
30 # hack for using nasm for .S files
31 CCAS="\$(top_srcdir)/admin/nasm"
35 dnl Check for Video4Linux2
36 AH_TEMPLATE(HAVE_VIDEO4LINUX2, [Define to 1 if Video4Linux2 is available.])
37 AC_CHECK_HEADER([linux/videodev2.h],
38 [AC_CHECK_MEMBER(struct v4l2_buffer.index, [AC_DEFINE(HAVE_VIDEO4LINUX2)], [],
39 [#include <linux/time.h>])],
40 [],[#include <linux/time.h>] )
42 ############## SPECIAL DIRECTORIES
43 AC_ARG_WITH(plugindir,
44 AC_HELP_STRING([--with-plugindir], [sets the directory where the plugins should be installed]),
45 [ plugindir=$withval ],
46 [ plugindir="\${exec_prefix}/lib/cinelerra" ])
50 AC_HELP_STRING([--with-fontsdir], [sets the directory where the fonts should be installed]),
51 [ fontsdir=$withval ],
52 [ fontsdir="\${plugindir}/fonts" ])
54 ############## END OF SPECIAL DIRECTORIES
58 if test "$no_x" = yes; then
59 if test "x$have_x" = "xdisabled"; then
60 AC_MSG_WARN([Do not use --without-x or --with-x=no.])
62 AC_MSG_WARN([X Windows development tools were not found.])
63 AC_MSG_WARN([Please install xlib-dev or xorg-x11-devel.])
65 AC_MSG_ERROR([Cinelerra requires X Windows.])
67 AH_TEMPLATE(HAVE_LIBXXF86VM, [Define to 1 if libXxf86vm is available.])
68 AC_DEFINE(HAVE_LIBXXF86VM)
69 ############## END XLIB
72 # the sound options are propagated by SOUND_CFLAGS and SOUND_LDFLAGS
74 AC_HELP_STRING([--disable-oss], [disable support for oss (default=enabled)]))
76 AC_HELP_STRING([--disable-alsa],[disable support for ALSA (default=autodetect)]),
77 [enable_alsa=$enableval],[enable_alsa=yes])
79 AC_HELP_STRING([--disable-esd], [disable support for ESD (default=autodetect)]),
80 [enable_esd=$enableval],[enable_esd=yes])
82 if test "x$enable_oss" = "xyes" || test "x$enable_oss" = "x"; then
83 SOUND_CFLAGS="-DHAVE_OSS $SOUND_CFLAGS"
85 if test "x$enable_alsa" = "xyes"; then
86 AM_PATH_ALSA(1.0.2,[alsa=yes])
87 if test "x$alsa" = "xyes"; then
88 SOUND_CFLAGS="$ALSA_CFLAGS -DHAVE_ALSA $SOUND_CFLAGS"
89 SOUND_LDFLAGS="$ALSA_LIBS $SOUND_LDFLAGS"
92 dnl This added -lasound to LIBS. LIBS is used in every link command.
93 dnl But we do not want to link all shared libraries against -lasound.
94 dnl So we remove it again.
95 LIBS=`echo "$LIBS" | sed -e s/-lasound//g`
98 if test "x$enable_esd" = "xyes"; then
99 AM_PATH_ESD(,[esound=yes])
100 if test "x$esound" = xyes; then
101 SOUND_CFLAGS="$ESD_CFLAGS -DHAVE_ESOUND $SOUND_CFLAGS"
102 SOUND_LDFLAGS="$ESD_LIBS $SOUND_LDFLAGS"
106 AC_SUBST(SOUND_CFLAGS)
107 AC_SUBST(SOUND_LDFLAGS)
108 ############### END OF SOUND
110 ############## MJPEGTOOLS (for YUV4MPEG)
111 PKG_CHECK_MODULES(MJPEG, mjpegtools,[mjpegtools=yes],:)
112 AC_SUBST(MJPEG_CFLAGS)
114 AC_MSG_CHECKING([for number of arguments to y4m_write_frame_header])
115 # check if mjpegtools has 3 arguements for y4m_write_frame_header
116 # Note: this test came from transcode...
117 save_CFLAGS="$CFLAGS"
119 CFLAGS="$CFLAGS $MJPEG_CFLAGS"
120 LIBS="$LIBS $MJPEG_LIBS"
123 #include <mjpegtools/yuv4mpeg.h>
124 #include <mjpegtools/mpegconsts.h>
126 [y4m_write_frame_header(1,NULL,NULL)],
129 [MJPEGTOOLS_Y4M_WRITE_FRAME_HEADER__3ARGS],
131 [using y4m_write_frame_header with 3 arguments]
133 mjpeg_version_info="3 arguments (new versions)"
134 ],[mjpeg_version_info="assuming 2 arguments (older versions)"])
135 AC_MSG_RESULT($mjpeg_version_info)
136 CFLAGS="$save_CFLAGS"
138 ############## END MJPEGTOOLS
140 ############## MISC LIBRARIES
141 AC_CHECK_HEADER(uuid/uuid.h,[libuuidh=yes])
142 AC_CHECK_LIB(uuid, uuid_clear,[libuuid=yes])
144 AC_CHECK_HEADER(fftw3.h,[libfftw3h=yes])
145 AC_CHECK_LIB(fftw3, fftw_free,[libfftw3=yes])
147 PKG_CHECK_MODULES(LIBDV,libdv >= 0.103,[libdv=yes],:)
148 AC_SUBST(LIBDV_CFLAGS)
151 PKG_CHECK_MODULES(PNG,libpng,[libpng=yes],:)
153 AC_CHECK_HEADER(jpeglib.h,[libjpegh=yes])
154 AC_CHECK_LIB(jpeg,jpeg_start_decompress,[libjpeg=yes])
156 PKG_CHECK_MODULES(FREETYPE,freetype2,[freetype2=yes],:)
157 ############## END OF MISC LIBRARIES
159 LARGEFILE_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
160 AC_SUBST(LARGEFILE_CFLAGS)
162 ############## A52DEC
163 AC_CHECK_LIB(a52,a52_init,[liba52=yes])
164 AC_CHECK_HEADER(a52dec/a52.h,[liba52h=yes])
166 if test "x$liba52$liba52h" = "xyesyes"; then
170 AC_SUBST(A52DEC_CFLAGS)
171 AC_SUBST(A52DEC_LDFLAGS)
172 ############## END OF A52DEC
174 ############## LIBSNDFILE
175 AC_CHECK_LIB(sndfile, sf_open,[libsndfile=yes])
176 AC_CHECK_HEADERS(sndfile.h,[libsndfileh=yes])
177 ############## END OF LIBSNDFILE
179 ############## OpenEXR
180 PKG_CHECK_MODULES(OPENEXR, OpenEXR,[libOpenEXR=yes],:)
181 AC_SUBST(OPENEXR_CFLAGS)
182 AC_SUBST(OPENEXR_LIBS)
183 ############## END OF OpenEXR
185 ############## LIBFAAD, LIBFAAC
186 AC_CHECK_LIB(faac, faacEncOpen,[libfaac=yes])
187 AC_CHECK_HEADER(faac.h,[libfaach=yes])
189 AC_CHECK_LIB(faad, faacDecInit,[libfaad=yes],
190 AC_CHECK_LIB(faad, NeAACDecInit,[libfaad=yes]))
191 AC_CHECK_HEADER(faad.h,[libfaadh=yes])
192 if test "x$libfaad$libfaadh" = xyesyes; then
196 AC_SUBST(FAAD_CFLAGS)
198 ############## END OF LIBFAAD, LIBFAAC
200 ############## FIREWIRE
201 # firewire settings are propagated through FIREWIRE_CFLAGS and FIREWIRE_LDFLAGS
202 AC_ARG_ENABLE(firewire,
203 AC_HELP_STRING([--disable-firewire], [disable support for firewire (default=enabled)]),
204 [ enable_firewire=$enableval ],
205 [ enable_firewire=yes ])
207 if test "x$enable_firewire" = "xyes"; then
208 PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.0,[libraw1394=yes],:)
209 PKG_CHECK_MODULES(LIBIEC61883, libiec61883,[libiec61883=yes],:)
211 AC_CHECK_LIB(avc1394, avc1394_send_command,[libavc1394=yes],:,$LIBRAW1394_LIBS)
212 AC_CHECK_HEADER([libavc1394/avc1394.h],[libavc1394h=yes])
213 AC_CHECK_LIB(rom1394, rom1394_get_bus_id,[librom1394=yes],:,$LIBRAW1394_LIBS)
214 AC_CHECK_HEADER([libavc1394/rom1394.h],[librom1394h=yes])
217 if test "x$enable_firewire$libraw1394$libiec61883$libavc1394$libavc1394h$librom1394$librom1394h" = "xyesyesyesyesyesyesyes"; then
218 FIREWIRE_CFLAGS="-DHAVE_FIREWIRE $LIBIEC61883_CFLAGS $LIBRAW1394_CFLAGS"
219 FIREWIRE_LDFLAGS="-lavc1394 -lrom1394 $LIBIEC61883_LIBS $LIBRAW1394_LIBS"
222 AC_SUBST(FIREWIRE_CFLAGS)
223 AC_SUBST(FIREWIRE_LDFLAGS)
224 AM_CONDITIONAL(HAVE_FIREWIRE,test "x$enable_firewire" = "xok")
225 ############## END OF FIREWIRE
227 ############# CSS SUPPORT IN LIBMPEG3
228 if test "x$enable_css" = "xyes"; then
229 CSS_CFLAGS="-DHAVE_CSS"
233 AC_HELP_STRING([--disable-css], [disable support for css in libmpeg3 (default=enabled)]),,
234 [ enable_css=$enableval ],
236 ############## END OF CSS SUPPORT IN LIBMPEG3
239 # MPEG2ENC declarations
246 ############## libx264
247 AC_CHECK_LIB(x264, x264_encoder_open,[libx264=yes],,-lpthread -lm)
248 AC_CHECK_HEADER(x264.h, [libx264h=yes])
251 ############## MMX / 3DNOW POWERPC / ALTIVEC
254 AC_HELP_STRING([--enable-mmx], [enables support for mmx (default is disabled)]),
255 [ enable_mmx=$enableval ],
258 AC_HELP_STRING([--enable-3dnow], [enables support for 3dnow (default is disabled)]),
259 [ enable_3dnow=$enableval ],
262 AC_ARG_ENABLE(altivec,
263 AC_HELP_STRING([--enable-altivec], [enables altivec support (default is disabled)]),
264 [ enable_altivec=$enableval ],
265 [ enable_altivec=no ])
272 case "$target_cpu" in
276 CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
279 if test "x$enable_mmx" = "xyes"; then
280 CPU_CFLAGS="-DHAVE_MMX -DUSE_MMX $CPU_CFLAGS" # -D_MMX_ doesn't work
283 if test "x$enable_3dnow" = "xyes"; then
284 CPU_CFLAGS="-DHAVE_3Dnow $CPU_CFLAGS" # -DUSE_3DNOW --> don't use, not compilin
288 CPU_CFLAGS="-mcpu=powerpc $CPU_CFLAGS"
289 if test "x$enable_altivec" = "xyes"; then
290 CPU_CFLAGS="-maltivec -mabi=altivec $CPU_CFLAGS"
296 AM_CONDITIONAL(USEMMX, test "x$enable_mmx" = "xyes")
297 AM_CONDITIONAL(TARGET_BUILTIN_VECTOR,test "x$enable_mmx" = "xyes")
298 AM_CONDITIONAL(USE3DNOW, test "x$enable_3dnow" = "xyes")
299 AM_CONDITIONAL(TARGET_ARCH_POWERPC, test "x$enable_powerpc" = "xyes")
300 AM_CONDITIONAL(TARGET_ALTIVEC, test "x$enable_altivec" = "xyes")
301 AC_SUBST(LIBDECORE_LIBADD)
305 ############## END OF MMX / 3DNOW
308 PKG_CHECK_MODULES(libogg,ogg >= 1.1,[libogg=yes],:)
309 PKG_CHECK_MODULES(libvorbis,vorbis,[libvorbis=yes],:)
310 PKG_CHECK_MODULES(libvorbisenc,vorbisenc,[libvorbisenc=yes],:)
311 PKG_CHECK_MODULES(libvorbisfile,vorbisfile,[libvorbisfile=yes],:)
312 PKG_CHECK_MODULES(libtheora,theora,[libtheora=yes],:)
313 XIPH_CFLAGS="$libogg_CFLAGS $libvorbis_CFLAGS $libvorbisenc_CFLAGS $libvorbisfile_CFLAGS $libtheora_CFLAGS"
314 XIPH_LIBS="$libogg_LIBS $libvorbis_LIBS $libvorbisenc_LIBS $libvorbisfile_LIBS $libtheora_LIBS"
315 AC_SUBST(XIPH_CFLAGS)
317 ############## END OF XIPH
320 # Just test to see if we have lame installed.
321 AC_CHECK_HEADER(lame/lame.h,[libmp3lameh=yes])
322 AC_CHECK_LIB(mp3lame,lame_init,[libmp3lame=yes],,[$XIPH_LIBS])
325 ############## .png TO .o CONVERSION
327 AC_CHECK_TOOL(OBJCOPY, objcopy)
328 if test "x$OBJCOPY" = "x"; then
329 AC_MSG_ERROR("objcopy from GNU binutils >= 2.11.90 not found")
331 AC_CHECK_TOOL(OBJDUMP, objdump)
332 dnl extract target and architecture if objdump was found
333 if test "x$OBJDUMP" = "x"; then :; else
334 AC_MSG_CHECKING(for object target)
335 octarget=`$OBJDUMP --info | sed -ne '2p'` # extract first target
336 AC_MSG_RESULT($octarget)
337 AC_MSG_CHECKING(for object architecture)
338 ocarch=`$OBJDUMP --info | sed -ne '4p'` # extract corresponding arch
339 AC_MSG_RESULT($ocarch)
341 AC_SUBST(OBJCOPYTARGET, $octarget)
342 AC_SUBST(OBJCOPYARCH, $ocarch)
344 ############## END of .png TO .o CONVERSION
346 AC_SUBST(BUILDDATE, `date`)
348 AC_OUTPUT(Makefile cinelerra-cvs-current.spec po/Makefile.in \
350 libmpeg3/Makefile libmpeg3/video/Makefile libmpeg3/audio/Makefile \
352 quicktime/encore50/Makefile \
353 quicktime/ffmpeg/Makefile \
354 quicktime/ffmpeg/libavcodec/Makefile \
355 quicktime/ffmpeg/libavcodec/i386/Makefile \
356 mpeg2enc/Makefile toolame-02l/Makefile \
357 guicast/Makefile cinelerra/Makefile \
358 cinelerra/builddate.h \
359 cinelerra/data/Makefile \
361 plugins/colors/Makefile \
362 plugins/libfourier/Makefile \
363 plugins/libeffecttv/Makefile \
364 plugins/Makefile plugins/1080to480/Makefile \
365 plugins/histogram/Makefile \
366 plugins/720to480/Makefile \
367 plugins/bandslide/Makefile \
368 plugins/bandwipe/Makefile
369 plugins/blur/Makefile
370 plugins/brightness/Makefile \
371 plugins/burn/Makefile plugins/parametric/Makefile plugins/aging/Makefile \
372 plugins/cdripper/Makefile \
373 plugins/chromakey/Makefile \
374 plugins/chromakey-hsv/Makefile \
375 plugins/colorbalance/Makefile \
376 plugins/compressor/Makefile \
377 plugins/crossfade/Makefile \
378 plugins/decimate/Makefile \
379 plugins/deinterlace/Makefile plugins/delayaudio/Makefile plugins/delayvideo/Makefile \
380 plugins/denoise/Makefile plugins/denoisefft/Makefile plugins/denoisevideo/Makefile \
381 plugins/denoisemjpeg/Makefile \
382 plugins/despike/Makefile plugins/dissolve/Makefile plugins/dot/Makefile \
383 plugins/fieldframe/Makefile plugins/flip/Makefile plugins/framefield/Makefile \
384 plugins/freeverb/Makefile plugins/freezeframe/Makefile plugins/gain/Makefile \
385 plugins/holo/Makefile plugins/huesaturation/Makefile \
386 plugins/interpolateaudio/Makefile \
387 plugins/interpolatevideo/Makefile \
388 plugins/invertaudio/Makefile plugins/invertvideo/Makefile plugins/irissquare/Makefile \
389 plugins/ivtc/Makefile \
390 plugins/linearize/Makefile \
391 plugins/loopaudio/Makefile \
392 plugins/loopvideo/Makefile \
393 plugins/motion/Makefile \
394 plugins/motionblur/Makefile \
395 plugins/normalize/Makefile \
396 plugins/oilpainting/Makefile \
397 plugins/overlay/Makefile \
398 plugins/pitch/Makefile \
399 plugins/polar/Makefile \
400 plugins/reframert/Makefile
401 plugins/reframe/Makefile plugins/resample/Makefile plugins/reverb/Makefile \
402 plugins/reverseaudio/Makefile plugins/reversevideo/Makefile plugins/rgb601/Makefile \
403 plugins/rotate/Makefile \
404 plugins/scale/Makefile \
405 plugins/seltempavg/Makefile \
406 plugins/shapewipe/Makefile \
407 plugins/sharpen/Makefile \
408 plugins/shiftinterlace/Makefile plugins/slide/Makefile plugins/spectrogram/Makefile \
409 plugins/suv/Makefile \
410 plugins/suv/data/Makefile \
411 plugins/defaulttheme/Makefile \
412 plugins/defaulttheme/data/Makefile \
413 plugins/swapchannels/Makefile \
414 plugins/synthesizer/Makefile \
415 plugins/threshold/Makefile \
416 plugins/timeavg/Makefile \
417 plugins/timestretch/Makefile plugins/titler/Makefile plugins/translate/Makefile \
418 plugins/unsharp/Makefile \
419 plugins/videoscope/Makefile plugins/wave/Makefile plugins/whirl/Makefile \
420 plugins/wipe/Makefile \
421 plugins/yuv/Makefile \
422 plugins/downsample/Makefile plugins/flash/Makefile plugins/gradient/Makefile \
423 plugins/level/Makefile plugins/linearblur/Makefile \
424 plugins/perspective/Makefile plugins/radialblur/Makefile plugins/zoomblur/Makefile \
425 plugins/timefront/Makefile \
426 plugins/svg/Makefile \
427 plugins/diffkey/Makefile \
428 plugins/fonts/Makefile \
432 AC_DEFUN([RPT],[if test "x$$1" = "xyes"; then status=found; else status=missing; succeeded=no; fi
433 echo "AC_HELP_STRING($2,$status)"])
436 echo "Summary of mandatory components:"
438 RPT(libvorbis,libvorbis)
439 RPT(libvorbisenc,libvorbisenc)
440 RPT(libvorbisfile,libvorbisfile)
441 RPT(libtheora,libtheora)
442 RPT(libOpenEXR,OpenEXR)
445 RPT(libjpeg,libjpeg libraries)
446 RPT(libjpegh,libjpeg headers)
447 RPT(freetype2,FreeType 2)
448 RPT(libx264,libx264 libraries)
449 RPT(libx264h,libx264 headers)
450 RPT(libuuid,libuuid libraries)
451 RPT(libuuidh,libuuid headers)
452 RPT(mjpegtools,mjpegtools)
453 RPT(libfftw3,libfftw3 libraries)
454 RPT(libfftw3h,libfftw3 headers)
455 RPT(liba52,liba52 libraries)
456 RPT(liba52h,liba52 headers)
457 RPT(libmp3lame,libmp3lame libraries)
458 RPT(libmp3lameh,libmp3lame headers)
459 RPT(libsndfile,libsndfile libraries)
460 RPT(libsndfileh,libsndfile headers)
461 RPT(libfaac,libfaac libraries)
462 RPT(libfaach,libfaac headers)
463 RPT(libfaad,libfaad libraries)
464 RPT(libfaadh,libfaad headers)
465 mandatory="$succeeded"
468 echo "Summary of optional components:"
469 AC_DEFUN([ORPT],[if test "x$$1" = "xno"; then
470 echo "$2 was opted out with $3"
472 if test "x$$1" = "xok"; then component=enabled; else component=disabled; fi
474 echo "$2 is $component"
476 ORPT(enable_esd,ESD (Enlightenment Sound Daemon),--disable-esd,RPT(esound,ESD subsystem))
477 ORPT(enable_alsa,ALSA,--disable-alsa,RPT(alsa,ALSA subsystem))
478 ORPT(enable_firewire,Firewire,--disable-firewire,
479 RPT(libraw1394,libraw1394)
480 RPT(libiec61883,libiec61883)
481 RPT(libavc1394,libavc1394 libraries)
482 RPT(libavc1394h,libavc1394 headers)
483 RPT(librom1394,librom1394 libraries)
484 RPT(librom1394h,librom1394 headers)
487 if test "x$mandatory" = "xno"; then
489 echo "WARNING: Mandatory components are missing; compilation may fail!"
492 echo "Now type"; echo " make"; echo; echo "to start compilation."