1 AC_INIT(Cinelerra, 1.2.2)
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([--enable-alsa], [enable support for alsa (default=autodetect)]),
77 [ enable_alsa=$enableval ],
78 [ enable_alsa=default ])
80 AC_HELP_STRING([--disable-esound], [disable support for esound (default=enabled)]))
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" = "xdefault" || test "x$enable_alsa" = "xyes"; then
87 [ SOUND_CFLAGS="$ALSA_CFLAGS -DHAVE_ALSA $SOUND_CFLAGS"
88 SOUND_LDFLAGS="$ALSA_LIBS $SOUND_LDFLAGS" ],
89 [ if test "x$enable_alsa" = "xyes"; then
90 AC_MSG_WARN([alsa library >= 1.0.2 not found])
91 NOT_FOUND="$NOT_FOUND alsa,library,>=,1.0.2"
93 dnl This added -lasound to LIBS. LIBS is used in every link command.
94 dnl But we do not want to link all shared libraries against -lasound.
95 dnl So we remove it again.
96 LIBS=`echo "$LIBS" | sed -e s/-lasound//g`
99 if test "x$enable_esd" = "xyes" || test "x$enable_esd" = "x"; then
101 SOUND_CFLAGS="$ESD_CFLAGS -DHAVE_ESOUND $SOUND_CFLAGS"
102 SOUND_LDFLAGS="$ESD_LIBS $SOUND_LDFLAGS"
104 AC_SUBST(SOUND_CFLAGS)
105 AC_SUBST(SOUND_LDFLAGS)
106 ############### END OF SOUND
108 ############## MJPEGTOOLS (for YUV4MPEG)
109 PKG_CHECK_MODULES(MJPEG, mjpegtools)
110 AC_SUBST(MJPEG_CFLAGS)
112 ############## END MJPEGTOOLS
114 ############## MISC LIBRARIES
115 AC_CHECK_HEADERS(uuid/uuid.h)
116 AC_CHECK_LIB(uuid, uuid_clear, :,[AC_MSG_WARN([libuuid not found])
117 NOT_FOUND="$NOT_FOUND libuuid"])
118 ############## END OF MISC LIBRARIES
120 LARGEFILE_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
121 AC_SUBST(LARGEFILE_CFLAGS)
123 ############## A52DEC
124 AC_CHECK_LIB(a52, a52_init,
125 [AC_CHECK_HEADER(a52dec/a52.h, [HAVE_A52DEC=yes])],
126 [AC_MSG_WARN([liba52 not found])])
128 if test "x$HAVE_A52DEC" = xyes; then
132 NOT_FOUND="$NOT_FOUND a52dec"
134 AC_SUBST(A52DEC_CFLAGS)
135 AC_SUBST(A52DEC_LDFLAGS)
136 ############## END OF A52DEC
139 # Just test to see if we have lame installed.
140 AC_CHECK_HEADERS(lame/lame.h)
141 #AC_CHECK_LIB(mp3lame, lame_init, :,[AC_MSG_WARN([libmp3lame not found])
142 # NOT_FOUND="$NOT_FOUND libmp3lame"])
145 ############## LIBSNDFILE
146 # Use the provided libsndfile, which will be renamed to libsndfilehv
147 AC_CONFIG_SUBDIRS(libsndfile)
149 ############## OpenEXR
150 PKG_CHECK_MODULES(OPENEXR, OpenEXR)
151 AC_SUBST(OPENEXR_CFLAGS)
152 AC_SUBST(OPENEXR_LIBS)
153 ############## END OF OpenEXR
155 ############## LIBFAAD
156 AC_CHECK_LIB(faad, faacDecInit,
157 [AC_CHECK_HEADER(faad.h, [HAVE_FAAD=yes])],
158 [AC_CHECK_LIB(faad, NeAACDecInit, [AC_CHECK_HEADER(faad.h, [HAVE_FAAD=yes])],[AC_MSG_WARN([libfaad not found])])])
159 if test "x$HAVE_FAAD" = xyes; then
163 NOT_FOUND="$NOT_FOUND libfaad,2"
165 AC_SUBST(FAAD_CFLAGS)
167 ############## END OF LIBFAAD
169 ############## FIREWIRE
170 # firewire settings are propagated through FIREWIRE_CFLAGS and FIREWIRE_LDFLAGS
171 AC_ARG_ENABLE(firewire,
172 AC_HELP_STRING([--disable-firewire], [disable support for firewire (default=enabled)]),
173 [ enable_firewire=$enableval ],
174 [ enable_firewire=yes ])
176 if test "x$enable_firewire" = "xyes"; then
177 AC_CHECK_LIB(raw1394, raw1394_new_handle, :,[AC_MSG_WARN([libraw1394 not found])
178 NOT_FOUND="$NOT_FOUND libraw1394"
181 AC_CHECK_LIB(avc1394, avc1394_send_command, :,[AC_MSG_WARN([libavc1394 not found])
182 NOT_FOUND="$NOT_FOUND libavc1394"
183 FIREWIRE="no"],-lraw1394)
185 AC_CHECK_LIB(rom1394, rom1394_get_bus_id, :,[AC_MSG_WARN([librom1394 not found])
186 NOT_FOUND="$NOT_FOUND librom1394"
187 FIREWIRE="no"],-lraw1394)
189 if test "$FIREWIRE" = "no"; then
193 FIREWIRE_CFLAGS="-DHAVE_FIREWIRE"
194 FIREWIRE_LDFLAGS="-lavc1394 -lrom1394 -lraw1394"
197 AC_SUBST(FIREWIRE_CFLAGS)
198 AC_SUBST(FIREWIRE_LDFLAGS)
199 ############## END OF FIREWIRE
201 ############## AVIFILE SUPPORT
202 dnl if test "x$enable_avifile" = "xyes"; then
203 dnl AM_PATH_AVIFILE(0.7.0)
204 dnl if test "x$HAVE_AVIFILE" = "xyes"; then
205 dnl AVIFILE_CXXFLAGS="-DUSE_AVIFILE $AVIFILE_CXXFLAGS"
208 dnl AC_ARG_ENABLE(avifile, [ --enable-avifile enable support for avifile [default=no]])
209 ############## END OF AVIFILE SUPPORT
211 ############# CSS SUPPORT IN LIBMPEG3
212 if test "x$enable_css" = "xyes"; then
213 CSS_CFLAGS="-DHAVE_CSS"
217 AC_HELP_STRING([--disable-css], [disable support for css in libmpeg3 (default=enabled)]),,
218 [ enable_css=$enableval ],
220 ############## END OF CSS SUPPORT IN LIBMPEG3
223 # MPEG2ENC declarations
229 ############## MMX / 3DNOW
232 AC_HELP_STRING([--enable-x86], [enables x86 specific features autodetection in libmpeg3 and mpeg2enc (default is disabled)]),
233 [ enable_x86=$enableval ],
236 AC_HELP_STRING([--enable-mmx], [enables support for mmx (default is disabled)]),
237 [ enable_mmx=$enableval ],
240 AC_HELP_STRING([--enable-3dnow], [enables support for 3dnow (default is disabled)]),
241 [ enable_3dnow=$enableval ],
243 if test "x$enable_x86" = "xyes"; then
244 CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
248 if test "x$enable_mmx" = "xyes"; then
249 CPU_CFLAGS="-DHAVE_MMX -DMMX -DUSE_MMX $CPU_CFLAGS" # -D_MMX_ doesn't work
252 AM_CONDITIONAL(USEMMX, test "x$enable_mmx" = "xyes")
254 if test "x$enable_3dnow" = "xyes"; then
255 CPU_CFLAGS="-DHAVE_3Dnow $CPU_CFLAGS" # -DUSE_3DNOW --> don't use, not compiling
257 AM_CONDITIONAL(USE3DNOW, test "x$enable_3dnow" = "xyes")
258 AC_SUBST(LIBDECORE_LIBADD)
260 ############## END OF MMX / 3DNOW
262 ############## FFMPEG
263 dnl AM_CONDITIONAL(FFMPEG_AC3, true)
264 dnl AM_CONDITIONAL(FFMPEG_A52BIN, false)
265 dnl AM_CONDITIONAL(FFMPEG_MP3LAME, true)
266 dnl AM_CONDITIONAL(FFMPEG_VORBIS, true)
267 dnl AM_CONDITIONAL(FFMPEG_HAVE_MLIB, false)
268 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_ARMV4L, false)
269 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_ALPHA, false)
270 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_POWERPC, false)
271 dnl AM_CONDITIONAL(FFMPEG_TARGET_MMI, false)
272 dnl AM_CONDITIONAL(FFMPEG_TARGET_ALTIVEC, false)
275 dnl Check for ffmpeg-config
276 AC_CHECK_PROG(HAVE_FFMPEG_CONFIG, ffmpeg-config, yes, no)
277 if test "x$HAVE_FFMPEG_CONFIG" == xyes; then
278 AC_MSG_CHECKING(LIBAVCODEC_CFLAGS)
279 LIBAVCODEC_CFLAGS=`ffmpeg-config --cflags`
280 AC_MSG_RESULT($LIBAVCODEC_CFLAGS)
282 AC_MSG_CHECKING(LIBAVCODEC_LIBS)
283 LIBAVCODEC_LIBS=`ffmpeg-config --libs avcodec`
284 AC_MSG_RESULT($LIBAVCODEC_LIBS)
286 dnl try to find ffmpeg without ffmpeg-config
288 AC_CHECK_HEADERS(ffmpeg/avcodec.h)
289 AC_CHECK_LIB(avcodec, avcodec_init, [HAVE_FFMPEG=yes],
290 [AC_MSG_WARN([ffmpeg not found])])
292 if test "x$HAVE_FFMPEG" == xyes; then
293 LIBAVCODEC_CFLAGS=-I/usr/include/ffmpeg
294 LIBAVCODEC_LIBS="-lavcodec $FAAD_LIBS $A52DEC_LIBS"
296 AC_CHECK_LIB(dts,dts_init, [
297 AC_CHECK_HEADER(dts.h, [HAVE_DTS=yes])
299 if test "x$HAVE_DTS" = xyes; then
300 LIBAVCODEC_LIBS="$LIBAVCODEC_LIBS -ldts"
303 NOT_FOUND="$NOT_FOUND libavcodec"
307 AC_SUBST(LIBAVCODEC_CFLAGS)
308 AC_SUBST(LIBAVCODEC_LIBS)
310 AH_TEMPLATE([DV_USE_FFMPEG],
311 [Define to 1 to use ffmpeg to decode/encode quicktime DV files])
314 AC_HELP_STRING([--with-ffmpeg],[Use FFMPEG for Quicktime DV encoding/decoding]),
316 AC_DEFINE(DV_USE_FFMPEG)
319 ############## END OF FFMPEG
322 PKG_CHECK_MODULES(XIPH,ogg >= 1.1 vorbis vorbisenc vorbisfile theora)
323 AC_SUBST(XIPH_CFLAGS)
326 PKG_CHECK_MODULES(VORBIS,ogg >= 1.1 vorbis vorbisenc vorbisfile)
327 AC_SUBST(VORBIS_CFLAGS)
328 AC_SUBST(VORBIS_LIBS)
329 ############## END OF XIPH
331 ############## .png TO .o CONVERSION
333 AC_CHECK_TOOL(OBJCOPY, objcopy)
334 if test "x$OBJCOPY" = "x"; then
335 AC_MSG_ERROR("objcopy from GNU binutils >= 2.11.90 not found")
337 AC_CHECK_TOOL(OBJDUMP, objdump)
338 dnl extract target and architecture if objdump was found
339 if test "x$OBJDUMP" = "x"; then :; else
340 AC_MSG_CHECKING(for object target)
341 octarget=`$OBJDUMP --info | sed -ne '2p'` # extract first target
342 AC_MSG_RESULT($octarget)
343 AC_MSG_CHECKING(for object architecture)
344 ocarch=`$OBJDUMP --info | sed -ne '4p'` # extract corresponding arch
345 AC_MSG_RESULT($ocarch)
347 AC_SUBST(OBJCOPYTARGET, $octarget)
348 AC_SUBST(OBJCOPYARCH, $ocarch)
350 ############## END of .png TO .o CONVERSION
352 AC_OUTPUT(Makefile cinelerra-cvs-current.spec po/Makefile.in \
354 libmpeg3/Makefile libmpeg3/video/Makefile libmpeg3/audio/Makefile \
356 quicktime/encore50/Makefile \
357 mpeg2enc/Makefile toolame-02l/Makefile \
358 guicast/Makefile cinelerra/Makefile \
359 cinelerra/data/Makefile \
360 mplexhi/Makefile mplexlo/Makefile \
361 plugins/defaulttheme/Makefile \
362 plugins/defaulttheme/data/Makefile \
363 plugins/bluedottheme/Makefile \
364 plugins/bluedottheme/data/Makefile \
365 plugins/microtheme/Makefile \
366 plugins/microtheme/data/Makefile \
367 plugins/colors/Makefile \
368 plugins/libfourier/Makefile \
369 plugins/libeffecttv/Makefile \
370 plugins/Makefile plugins/1080to480/Makefile \
371 plugins/histogram/Makefile \
372 plugins/720to480/Makefile \
373 plugins/denoisemjpeg/Makefile \
374 plugins/motion/Makefile \
375 plugins/bandslide/Makefile \
376 plugins/bandwipe/Makefile plugins/blur/Makefile plugins/brightness/Makefile \
377 plugins/burn/Makefile plugins/parametric/Makefile plugins/aging/Makefile \
378 plugins/cdripper/Makefile plugins/chromakey/Makefile plugins/colorbalance/Makefile \
379 plugins/compressor/Makefile \
380 plugins/crossfade/Makefile \
381 plugins/decimate/Makefile \
382 plugins/deinterlace/Makefile plugins/delayaudio/Makefile plugins/delayvideo/Makefile \
383 plugins/denoise/Makefile plugins/denoisefft/Makefile plugins/denoisevideo/Makefile \
384 plugins/despike/Makefile plugins/dissolve/Makefile plugins/dot/Makefile \
385 plugins/fieldframe/Makefile plugins/flip/Makefile plugins/framefield/Makefile \
386 plugins/freeverb/Makefile plugins/freezeframe/Makefile plugins/gain/Makefile \
387 plugins/holo/Makefile plugins/huesaturation/Makefile \
388 plugins/interpolateaudio/Makefile \
389 plugins/interpolatevideo/Makefile \
390 plugins/invertaudio/Makefile plugins/invertvideo/Makefile plugins/irissquare/Makefile \
391 plugins/ivtc/Makefile \
392 plugins/loopaudio/Makefile \
393 plugins/loopvideo/Makefile \
394 plugins/normalize/Makefile \
395 plugins/oilpainting/Makefile \
396 plugins/overlay/Makefile \
397 plugins/pitch/Makefile \
398 plugins/polar/Makefile \
399 plugins/reframert/Makefile
400 plugins/reframe/Makefile plugins/resample/Makefile plugins/reverb/Makefile \
401 plugins/reverseaudio/Makefile plugins/reversevideo/Makefile plugins/rgb601/Makefile \
402 plugins/rotate/Makefile \
403 plugins/scale/Makefile \
404 plugins/seltempavg/Makefile \
405 plugins/shapewipe/Makefile \
406 plugins/sharpen/Makefile \
407 plugins/shiftinterlace/Makefile plugins/slide/Makefile plugins/spectrogram/Makefile \
408 plugins/swapchannels/Makefile \
409 plugins/synthesizer/Makefile \
410 plugins/threshold/Makefile \
411 plugins/timeavg/Makefile \
412 plugins/timestretch/Makefile plugins/titler/Makefile plugins/translate/Makefile \
413 plugins/unsharp/Makefile \
414 plugins/videoscope/Makefile plugins/wave/Makefile plugins/whirl/Makefile \
415 plugins/wipe/Makefile \
416 plugins/yuv/Makefile \
417 plugins/downsample/Makefile plugins/flash/Makefile plugins/gradient/Makefile \
418 plugins/level/Makefile plugins/linearblur/Makefile \
419 plugins/perspective/Makefile plugins/radialblur/Makefile plugins/zoomblur/Makefile \
420 plugins/svg/Makefile \
421 plugins/diffkey/Makefile \
422 plugins/fonts/Makefile \
425 if test "$NOT_FOUND" = ""; then
426 AC_MSG_NOTICE([All required libraries were found.])
428 AC_MSG_WARN([The following libraries were not found:])
429 for i in $NOT_FOUND; do
430 l=`echo $i | sed -e 's/,/ /'`
433 AC_MSG_WARN([Compilation may fail! Remember, you need the developer])
434 AC_MSG_WARN([packages too, not just the runtime libraries!])
438 AC_MSG_WARN([Use ./configure OPENEXR=/path/to/OpenEXR to specify])
439 AC_MSG_WARN([the directory that contains the OpenEXR include files])
440 AC_MSG_WARN([(default is \$prefix/include/OpenEXR).]) ;;
442 AC_MSG_WARN([mjpegtools is needed for YUV4MPEG export to tools])
443 AC_MSG_WARN([like mpeg2enc. See http://mjpeg.sourceforge.net/]) ;;