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([--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 # check if mjpegtools has 3 arguements for y4m_write_frame_header
113 # Note: this test came from transcode...
114 save_CFLAGS="$CFLAGS"
116 CFLAGS="$CFLAGS $MJPEG_CFLAGS"
117 LIBS="$LIBS $MJPEG_LIBS"
120 #include <mjpegtools/yuv4mpeg.h>
121 #include <mjpegtools/mpegconsts.h>
123 [y4m_write_frame_header(1,NULL,NULL)],
126 [MJPEGTOOLS_Y4M_WRITE_FRAME_HEADER__3ARGS],
128 [using mjpegtool's y4m_write_frame_header with 3 arguments]
130 mjpeg_version_info="3 arguments (new versions)"
131 ],[mjpeg_version_info="assuming 2 arguments (older versions)"])
132 AC_MSG_CHECKING([for number of arguments to mjpegtool's y4m_write_frame_header])
133 AC_MSG_RESULT($mjpeg_version_info)
134 CFLAGS="$save_CFLAGS"
137 ############## END MJPEGTOOLS
139 ############## MISC LIBRARIES
140 AC_CHECK_HEADERS(uuid/uuid.h)
141 AC_CHECK_LIB(uuid, uuid_clear, :,[AC_MSG_WARN([libuuid not found])
142 NOT_FOUND="$NOT_FOUND libuuid"])
144 AC_CHECK_HEADERS(fftw3.h)
145 AC_CHECK_LIB(fftw3, fftw_free, :,[AC_MSG_WARN([libfftw3 not found])
146 NOT_FOUND="$NOT_FOUND libfftw3"])
147 ############## END OF MISC LIBRARIES
149 ############## END OF MISC LIBRARIES
151 LARGEFILE_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
152 AC_SUBST(LARGEFILE_CFLAGS)
154 ############## A52DEC
155 AC_CHECK_LIB(a52, a52_init,
156 [AC_CHECK_HEADER(a52dec/a52.h, [HAVE_A52DEC=yes])],
157 [AC_MSG_WARN([liba52 not found])])
159 if test "x$HAVE_A52DEC" = xyes; then
163 NOT_FOUND="$NOT_FOUND a52dec"
165 AC_SUBST(A52DEC_CFLAGS)
166 AC_SUBST(A52DEC_LDFLAGS)
167 ############## END OF A52DEC
170 # Just test to see if we have lame installed.
171 AC_CHECK_HEADERS(lame/lame.h)
172 #AC_CHECK_LIB(mp3lame, lame_init, :,[AC_MSG_WARN([libmp3lame not found])
173 # NOT_FOUND="$NOT_FOUND libmp3lame"])
176 ############## LIBSNDFILE
177 AC_CHECK_LIB(sndfile, sf_open,
178 [AC_CHECK_HEADERS(sndfile.h, [HAVE_SNDFILE=yes])],[AC_MSG_WARN([libsndfile not found])])
179 if test "x$HAVE_SNDFILE" = xyes; then :; else
180 NOT_FOUND="$NOT_FOUND libsndfile"
182 ############## END OF LIBSNDFILE
184 ############## OpenEXR
185 PKG_CHECK_MODULES(OPENEXR, OpenEXR)
186 AC_SUBST(OPENEXR_CFLAGS)
187 AC_SUBST(OPENEXR_LIBS)
188 ############## END OF OpenEXR
190 ############## LIBFAAD
191 AC_CHECK_LIB(faad, faacDecInit,
192 [AC_CHECK_HEADER(faad.h, [HAVE_FAAD=yes])],
193 [AC_CHECK_LIB(faad, NeAACDecInit, [AC_CHECK_HEADER(faad.h, [HAVE_FAAD=yes])],[AC_MSG_WARN([libfaad not found])])])
194 if test "x$HAVE_FAAD" = xyes; then
198 NOT_FOUND="$NOT_FOUND libfaad,2"
200 AC_SUBST(FAAD_CFLAGS)
202 ############## END OF LIBFAAD
204 ############## FIREWIRE
205 # firewire settings are propagated through FIREWIRE_CFLAGS and FIREWIRE_LDFLAGS
206 AC_ARG_ENABLE(firewire,
207 AC_HELP_STRING([--disable-firewire], [disable support for firewire (default=enabled)]),
208 [ enable_firewire=$enableval ],
209 [ enable_firewire=yes ])
211 if test "x$enable_firewire" = "xyes"; then
212 PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.0)
213 PKG_CHECK_MODULES(LIBIEC61883, libiec61883)
215 AC_CHECK_LIB(avc1394, avc1394_send_command, :,[AC_MSG_WARN([libavc1394 not found])
216 NOT_FOUND="$NOT_FOUND libavc1394"
217 FIREWIRE="no"],$LIBRAW1394_LIBS)
219 AC_CHECK_LIB(rom1394, rom1394_get_bus_id, :,[AC_MSG_WARN([librom1394 not found])
220 NOT_FOUND="$NOT_FOUND librom1394"
221 FIREWIRE="no"],$LIBRAW1394_LIBS)
223 if test "$FIREWIRE" = "no"; then
227 FIREWIRE_CFLAGS="-DHAVE_FIREWIRE $LIBIEC61883_CFLAGS $LIBRAW1394_CFLAGS"
228 FIREWIRE_LDFLAGS="-lavc1394 -lrom1394 $LIBIEC61883_LIBS $LIBRAW1394_LIBS"
231 AC_SUBST(FIREWIRE_CFLAGS)
232 AC_SUBST(FIREWIRE_LDFLAGS)
233 ############## END OF FIREWIRE
235 ############## AVIFILE SUPPORT
236 dnl if test "x$enable_avifile" = "xyes"; then
237 dnl AM_PATH_AVIFILE(0.7.0)
238 dnl if test "x$HAVE_AVIFILE" = "xyes"; then
239 dnl AVIFILE_CXXFLAGS="-DUSE_AVIFILE $AVIFILE_CXXFLAGS"
242 dnl AC_ARG_ENABLE(avifile, [ --enable-avifile enable support for avifile [default=no]])
243 ############## END OF AVIFILE SUPPORT
245 ############# CSS SUPPORT IN LIBMPEG3
246 if test "x$enable_css" = "xyes"; then
247 CSS_CFLAGS="-DHAVE_CSS"
251 AC_HELP_STRING([--disable-css], [disable support for css in libmpeg3 (default=enabled)]),,
252 [ enable_css=$enableval ],
254 ############## END OF CSS SUPPORT IN LIBMPEG3
257 # MPEG2ENC declarations
264 ############## libx264
266 AC_CHECK_LIB(x264, x264_encoder_open,
267 [AC_CHECK_HEADERS(x264.h, [HAVE_LIBX264=yes])],[AC_MSG_WARN([libx264 not found])])
268 if test "x$HAVE_LIBX264" = xyes; then :; else
269 NOT_FOUND="$NOT_FOUND libx264"
273 ############## MMX / 3DNOW POWERPC / ALTIVEC
276 AC_HELP_STRING([--enable-mmx], [enables support for mmx (default is disabled)]),
277 [ enable_mmx=$enableval ],
280 AC_HELP_STRING([--enable-3dnow], [enables support for 3dnow (default is disabled)]),
281 [ enable_3dnow=$enableval ],
284 AC_ARG_ENABLE(altivec,
285 AC_HELP_STRING([--enable-altivec], [enables altivec support (default is disabled)]),
286 [ enable_altivec=$enableval ],
287 [ enable_altivec=no ])
294 case "$target_cpu" in
298 CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
301 if test "x$enable_mmx" = "xyes"; then
302 CPU_CFLAGS="-DHAVE_MMX -DUSE_MMX $CPU_CFLAGS" # -D_MMX_ doesn't work
305 if test "x$enable_3dnow" = "xyes"; then
306 CPU_CFLAGS="-DHAVE_3Dnow $CPU_CFLAGS" # -DUSE_3DNOW --> don't use, not compilin
310 CPU_CFLAGS="-mcpu=powerpc $CPU_CFLAGS"
311 if test "x$enable_altivec" = "xyes"; then
312 CPU_CFLAGS="-maltivec -mabi=altivec $CPU_CFLAGS"
318 AM_CONDITIONAL(USEMMX, test "x$enable_mmx" = "xyes")
319 AM_CONDITIONAL(TARGET_BUILTIN_VECTOR,test "x$enable_mmx" = "xyes")
320 AM_CONDITIONAL(USE3DNOW, test "x$enable_3dnow" = "xyes")
321 AM_CONDITIONAL(TARGET_ARCH_POWERPC, test "x$enable_powerpc" = "xyes")
322 AM_CONDITIONAL(TARGET_ALTIVEC, test "x$enable_altivec" = "xyes")
323 AC_SUBST(LIBDECORE_LIBADD)
327 ############## END OF MMX / 3DNOW
330 PKG_CHECK_MODULES(XIPH,ogg >= 1.1 vorbis vorbisenc vorbisfile theora)
331 AC_SUBST(XIPH_CFLAGS)
334 PKG_CHECK_MODULES(VORBIS,ogg >= 1.1 vorbis vorbisenc vorbisfile)
335 AC_SUBST(VORBIS_CFLAGS)
336 AC_SUBST(VORBIS_LIBS)
337 ############## END OF XIPH
339 ############## .png TO .o CONVERSION
341 AC_CHECK_TOOL(OBJCOPY, objcopy)
342 if test "x$OBJCOPY" = "x"; then
343 AC_MSG_ERROR("objcopy from GNU binutils >= 2.11.90 not found")
345 AC_CHECK_TOOL(OBJDUMP, objdump)
346 dnl extract target and architecture if objdump was found
347 if test "x$OBJDUMP" = "x"; then :; else
348 AC_MSG_CHECKING(for object target)
349 octarget=`$OBJDUMP --info | sed -ne '2p'` # extract first target
350 AC_MSG_RESULT($octarget)
351 AC_MSG_CHECKING(for object architecture)
352 ocarch=`$OBJDUMP --info | sed -ne '4p'` # extract corresponding arch
353 AC_MSG_RESULT($ocarch)
355 AC_SUBST(OBJCOPYTARGET, $octarget)
356 AC_SUBST(OBJCOPYARCH, $ocarch)
358 ############## END of .png TO .o CONVERSION
360 AC_OUTPUT(Makefile cinelerra-cvs-current.spec po/Makefile.in \
362 libmpeg3/Makefile libmpeg3/video/Makefile libmpeg3/audio/Makefile \
364 quicktime/encore50/Makefile \
365 quicktime/ffmpeg/Makefile \
366 quicktime/ffmpeg/libavcodec/Makefile \
367 quicktime/ffmpeg/libavcodec/i386/Makefile \
368 mpeg2enc/Makefile toolame-02l/Makefile \
369 guicast/Makefile cinelerra/Makefile \
370 cinelerra/data/Makefile \
372 plugins/colors/Makefile \
373 plugins/libfourier/Makefile \
374 plugins/libeffecttv/Makefile \
375 plugins/Makefile plugins/1080to480/Makefile \
376 plugins/histogram/Makefile \
377 plugins/720to480/Makefile \
378 plugins/denoisemjpeg/Makefile \
379 plugins/motion/Makefile \
380 plugins/bandslide/Makefile \
381 plugins/bandwipe/Makefile plugins/blur/Makefile plugins/brightness/Makefile \
382 plugins/burn/Makefile plugins/parametric/Makefile plugins/aging/Makefile \
383 plugins/cdripper/Makefile plugins/chromakey/Makefile plugins/colorbalance/Makefile \
384 plugins/compressor/Makefile \
385 plugins/crossfade/Makefile \
386 plugins/decimate/Makefile \
387 plugins/deinterlace/Makefile plugins/delayaudio/Makefile plugins/delayvideo/Makefile \
388 plugins/denoise/Makefile plugins/denoisefft/Makefile plugins/denoisevideo/Makefile \
389 plugins/despike/Makefile plugins/dissolve/Makefile plugins/dot/Makefile \
390 plugins/fieldframe/Makefile plugins/flip/Makefile plugins/framefield/Makefile \
391 plugins/freeverb/Makefile plugins/freezeframe/Makefile plugins/gain/Makefile \
392 plugins/holo/Makefile plugins/huesaturation/Makefile \
393 plugins/interpolateaudio/Makefile \
394 plugins/interpolatevideo/Makefile \
395 plugins/invertaudio/Makefile plugins/invertvideo/Makefile plugins/irissquare/Makefile \
396 plugins/ivtc/Makefile \
397 plugins/linearize/Makefile \
398 plugins/loopaudio/Makefile \
399 plugins/loopvideo/Makefile \
400 plugins/normalize/Makefile \
401 plugins/oilpainting/Makefile \
402 plugins/overlay/Makefile \
403 plugins/pitch/Makefile \
404 plugins/polar/Makefile \
405 plugins/reframert/Makefile
406 plugins/reframe/Makefile plugins/resample/Makefile plugins/reverb/Makefile \
407 plugins/reverseaudio/Makefile plugins/reversevideo/Makefile plugins/rgb601/Makefile \
408 plugins/rotate/Makefile \
409 plugins/scale/Makefile \
410 plugins/seltempavg/Makefile \
411 plugins/shapewipe/Makefile \
412 plugins/sharpen/Makefile \
413 plugins/shiftinterlace/Makefile plugins/slide/Makefile plugins/spectrogram/Makefile \
414 plugins/suv/Makefile \
415 plugins/suv/data/Makefile \
416 plugins/defaulttheme/Makefile \
417 plugins/defaulttheme/data/Makefile \
418 plugins/swapchannels/Makefile \
419 plugins/synthesizer/Makefile \
420 plugins/threshold/Makefile \
421 plugins/timeavg/Makefile \
422 plugins/timestretch/Makefile plugins/titler/Makefile plugins/translate/Makefile \
423 plugins/unsharp/Makefile \
424 plugins/videoscope/Makefile plugins/wave/Makefile plugins/whirl/Makefile \
425 plugins/wipe/Makefile \
426 plugins/yuv/Makefile \
427 plugins/downsample/Makefile plugins/flash/Makefile plugins/gradient/Makefile \
428 plugins/level/Makefile plugins/linearblur/Makefile \
429 plugins/perspective/Makefile plugins/radialblur/Makefile plugins/zoomblur/Makefile \
430 plugins/svg/Makefile \
431 plugins/diffkey/Makefile \
432 plugins/fonts/Makefile \
435 if test "$NOT_FOUND" = ""; then
436 AC_MSG_NOTICE([All required libraries were found.])
438 AC_MSG_WARN([The following libraries were not found:])
439 for i in $NOT_FOUND; do
440 l=`echo $i | sed -e 's/,/ /'`
443 AC_MSG_WARN([Compilation may fail! Remember, you need the developer])
444 AC_MSG_WARN([packages too, not just the runtime libraries!])
448 AC_MSG_WARN([Use ./configure OPENEXR=/path/to/OpenEXR to specify])
449 AC_MSG_WARN([the directory that contains the OpenEXR include files])
450 AC_MSG_WARN([(default is \$prefix/include/OpenEXR).]) ;;
452 AC_MSG_WARN([mjpegtools is needed for YUV4MPEG export to tools])
453 AC_MSG_WARN([like mpeg2enc. See http://mjpeg.sourceforge.net/]) ;;