r371: This commit was generated by cvs2svn to compensate for changes in r370,
[cinelerra_cv/ct.git] / configure.in
blob975ab4b203e86c19d32b386ef525fd962d272d08
1 AC_INIT(Cinelerra, 1.2.0)
3 AC_CANONICAL_SYSTEM
5 # Test for minimal version of autoconf
6 AC_PREREQ(2.57)
8 AM_INIT_AUTOMAKE
9 AM_CONFIG_HEADER(config.h)
10 AM_GNU_GETTEXT([external])
11 AM_GNU_GETTEXT_VERSION(0.12.1)
13 AC_LANG_CPLUSPLUS
14 AC_LANG_C
15 AC_PROG_CXX
17 AC_ENABLE_SHARED
18 AC_DISABLE_STATIC
19 AC_PROG_LIBTOOL
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
23    LTC_FLAGS="--tag=CC"
24    LTCXX_FLAGS="--tag=CXX"
26 AC_SUBST(LTC_FLAGS)
27 AC_SUBST(LTCXX_FLAGS)
30 # hack for using nasm for .S files
31 CCAS="\$(top_srcdir)/admin/nasm"
32 AC_SUBST(CCAS)
33 AC_SUBST(CCASFLAGS)
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" ])
47 AC_SUBST(plugindir)
49 AC_ARG_WITH(fontsdir,
50                                                 AC_HELP_STRING([--with-fontsdir], [sets the directory where the fonts should be installed]),
51                                                 [ fontsdir=$withval ],
52                                                 [ fontsdir="\${plugindir}/fonts" ])
53 AC_SUBST(fontsdir)
54 ############## END OF SPECIAL DIRECTORIES
56 ############## XLIB
57 LDFLAGS="$LDFLAGS -L/usr/X11R6/lib"
58 AC_CHECK_HEADERS(X11/Xlib.h)
59 AC_CHECK_LIB(X11, XOpenDisplay, ,[
60         echo "Xlib-dev was not found. In order to build Cinelerra,"
61         echo "xlib-dev must be installed. Please install xlib-dev and"
62         echo "run configure again."
63         exit
64         ])
65 ############## END XLIB
67 ############## MISC LIBRARIES
68 AC_CHECK_HEADERS(uuid/uuid.h)
69 AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_WARN([libuuid not found])
70         NOT_FOUND="$NOT_FOUND libuuid"])
72 AC_PATH_XTRA
73 ############## END OF MISC LIBRARIES
75 LARGEFILE_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
76 CFLAGS="-D_REENTRANT -DHAVE_LIBXXF86VM $LARGEFILE_CFLAGS $CFLAGS"
77 CXXFLAGS="-D_REENTRANT -DHAVE_LIBXXF86VM $LARGEFILE_CFLAGS $CXXFLAGS"
79 # A52DEC
80 AC_CHECK_HEADERS(a52dec/a52.h)
81 AC_CHECK_LIB(a52, a52_init, true ,[AC_MSG_WARN([a52dec not found])
82         NOT_FOUND="$NOT_FOUND a52dec"])
83 #END A52DEC
85 ############## LAME
86 # Just test to see if we have lame installed.
87 AC_CHECK_HEADERS(lame/lame.h)
88 #AC_CHECK_LIB(mp3lame, lame_init, ,[AC_MSG_WARN([libmp3lame not found])
89 #       NOT_FOUND="$NOT_FOUND libmp3lame"])
90 # END LAME
92 ############## LIBSNDFILE
93 # Use the provided libsndfile, which will be renamed to libsndfilehv
94 AC_CONFIG_SUBDIRS(libsndfile)
96 ############## LIBAVCODEC
97 AC_CHECK_HEADERS(ffmpeg/avcodec.h)
98 AC_CHECK_LIB(avcodec, avcodec_init, ,[AC_MSG_WARN([libavcodec not found])
99         NOT_FOUND="$NOT_FOUND libavcodec"])
100 # END LIBAVCODEC
102 ############## LIBFAAD
103 AC_CHECK_HEADERS(faad.h)
104 AC_CHECK_LIB(faad, faacDecInit, ,[AC_MSG_WARN([libfaad not found])
105         NOT_FOUND="$NOT_FOUND libfaad,2"])
106 # END LIBFAAD
108 ############## LIBXVIDCORE
109 AC_CHECK_HEADERS(xvid.h)
110 AC_CHECK_LIB(xvidcore, xvid_global, ,[AC_MSG_WARN([libxvidcore not found])
111         NOT_FOUND="$NOT_FOUND libxvidcore"])
112 # END LIBXVIDCORE
114 ############## FIREWIRE
115 # firewire settings are propagated through FIREWIRE_CFLAGS and FIREWIRE_LDFLAGS
116 AC_ARG_ENABLE(firewire, 
117                                                         AC_HELP_STRING([--disable-firewire], [disable support for firewire (default=enabled)]),
118                                                         [ enable_firewire=$enableval ],
119                                                         [ enable_firewire=yes ])
121 if test "x$enable_firewire" = "xyes"; then
122         AC_CHECK_LIB(raw1394, raw1394_new_handle, ,[AC_MSG_WARN([libraw1394 not found])
123         NOT_FOUND="$NOT_FOUND libraw1394"
124         FIREWIRE="no"])
126         AC_CHECK_LIB(avc1394, avc1394_send_command, ,[AC_MSG_WARN([libavc1394 not found])
127         NOT_FOUND="$NOT_FOUND libavc1394"
128         FIREWIRE="no"])
130         AC_CHECK_LIB(rom1394, rom1394_get_bus_id, ,[AC_MSG_WARN([librom1394 not found])
131         NOT_FOUND="$NOT_FOUND librom1394"
132         FIREWIRE="no"])
134         if test "$FIREWIRE" = "no"; then
135                 FIREWIRE_CFLAGS=""
136                 FIREWIRE_LDFLAGS=""
137         else
138                 FIREWIRE_CFLAGS="-DHAVE_FIREWIRE"
139 #               FIREWIRE_LDFLAGS="-lraw1394 -lavc1394 -lrom1394"
140         fi
142 AC_SUBST(FIREWIRE_CFLAGS)
143 AC_SUBST(FIREWIRE_LDFLAGS)
144 ############## END OF FIREWIRE
146 ############## AVIFILE SUPPORT
147 dnl if test "x$enable_avifile" = "xyes"; then
148 dnl     AM_PATH_AVIFILE(0.7.0)
149 dnl     if test "x$HAVE_AVIFILE" = "xyes"; then
150 dnl             AVIFILE_CXXFLAGS="-DUSE_AVIFILE $AVIFILE_CXXFLAGS"
151 dnl     fi
152 dnl fi
153 dnl AC_ARG_ENABLE(avifile, [  --enable-avifile  enable support for avifile [default=no]])
154 ############## END OF AVIFILE SUPPORT
156 ############# CSS SUPPORT IN LIBMPEG3
157 if test "x$enable_css" = "xyes"; then
158         CSS_CFLAGS="-DHAVE_CSS"
160 AC_SUBST(CSS_CFLAGS)
161 AC_ARG_ENABLE(css, 
162                                                         AC_HELP_STRING([--disable-css], [disable support for css in libmpeg3 (default=enabled)]),,
163                                                         [ enable_css=$enableval ],
164                                                         [ enable_css=yes ])
165 ############## END OF CSS SUPPORT IN LIBMPEG3
168 ############## SOUND
169 # the sound options are propagated by SOUND_CFLAGS and SOUND_LDFLAGS
170 AC_ARG_ENABLE(oss, 
171                                                         AC_HELP_STRING([--disable-oss], [disable support for oss (default=enabled)]))
172 AC_ARG_ENABLE(alsa, 
173                                                         AC_HELP_STRING([--enable-alsa], [enable support for alsa (default=autodetect)]),
174                                                         [ enable_alsa=$enableval ],
175                                                         [ enable_alsa=default ])
176 AC_ARG_ENABLE(esd, 
177                                                         AC_HELP_STRING([--disable-esound], [disable support for esound (default=enabled)]))
179 if test "x$enable_oss" = "xyes" || test "x$enable_oss" = "x"; then
180         SOUND_CFLAGS="-DHAVE_OSS $SOUND_CFLAGS"
182 if test "x$enable_alsa" = "xdefault" || test "x$enable_alsa" = "xyes"; then
183         AM_PATH_ALSA(0.9.0,
184                 [ SOUND_CFLAGS="$ALSA_CFLAGS -DHAVE_ALSA $SOUND_CFLAGS"
185                 SOUND_LDFLAGS="$ALSA_LIBS $SOUND_LDFLAGS" ],
186                 [ if test "x$enable_alsa" = "xyes"; then
187                                 AC_MSG_WARN([alsa library >= 0.9.0 not found])
188                                 NOT_FOUND="$NOT_FOUND alsa,library,>=,0.9.0"
189                         fi ])
192 if test "x$enable_esd" = "xyes" || test "x$enable_esd" = "x"; then
193         AM_PATH_ESD
194         SOUND_CFLAGS="$ESD_CFLAGS -DHAVE_ESOUND $SOUND_CFLAGS"
195         SOUND_LDFLAGS="$ESD_LIBS $SOUND_LDFLAGS"
197 AC_SUBST(SOUND_CFLAGS)
198 AC_SUBST(SOUND_LDFLAGS)
199 ############### END OF SOUND
201 # MPEG2ENC declarations
202 have_asm_mmx=false
203 have_asm_sse=false
204 have_asm_nasm=false
205 have_x86cpu=false
207 ############## MMX / 3DNOW
209 AC_ARG_ENABLE(x86, 
210                                                         AC_HELP_STRING([--enable-x86], [enables x86 specific features autodetection in libmpeg3 and mpeg2enc (default is disabled)]),
211                                                         [ enable_x86=$enableval ],
212                                                         [ enable_x86=no ])
213 AC_ARG_ENABLE(mmx, 
214                                                         AC_HELP_STRING([--enable-mmx], [enables support for mmx (default is disabled)]), 
215                                                         [ enable_mmx=$enableval ],
216                                                         [ enable_mmx=no ])
217 AC_ARG_ENABLE(3dnow, 
218                                                         AC_HELP_STRING([--enable-3dnow], [enables support for 3dnow (default is disabled)]),
219                                                         [ enable_3dnow=$enableval ],
220                                                         [ enable_3dnow=no ])
221 if test "x$enable_x86" = "xyes"; then
222         CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
223         have_x86cpu=true
226 if test "x$enable_mmx" = "xyes"; then
227         CPU_CFLAGS="-DHAVE_MMX -DMMX -DUSE_MMX $CPU_CFLAGS" # -D_MMX_ doesn't work
228         have_asm_mmx=true
230 AM_CONDITIONAL(USEMMX, test "x$enable_mmx" = "xyes")
232 if test "x$enable_3dnow" = "xyes"; then
233         CPU_CFLAGS="-DHAVE_3Dnow $CPU_CFLAGS" # -DUSE_3DNOW --> don't use, not compiling
235 AM_CONDITIONAL(USE3DNOW, test "x$enable_3dnow" = "xyes")
236 AC_SUBST(LIBDECORE_LIBADD)
237 AC_SUBST(CPU_CFLAGS)
238 ############## END OF MMX / 3DNOW
240 ############## FFMPEG
241 dnl AM_CONDITIONAL(FFMPEG_AC3, true)
242 dnl AM_CONDITIONAL(FFMPEG_A52BIN, false)
243 dnl AM_CONDITIONAL(FFMPEG_MP3LAME, true)
244 dnl AM_CONDITIONAL(FFMPEG_VORBIS, true)
245 dnl AM_CONDITIONAL(FFMPEG_HAVE_MLIB, false)
246 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_ARMV4L, false)
247 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_ALPHA, false)
248 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_POWERPC, false)
249 dnl AM_CONDITIONAL(FFMPEG_TARGET_MMI, false)
250 dnl AM_CONDITIONAL(FFMPEG_TARGET_ALTIVEC, false)
251 dnl 
252 LIBAVCODEC_CFLAGS=-I/usr/include/ffmpeg
253 LIBAVCODEC_LIBS=-lavcodec
254 AC_SUBST(LIBAVCODEC_CFLAGS)
255 AC_SUBST(LIBAVCODEC_LIBS)
257 ############## END OF FFMPEG
259 ############## .png TO .o CONVERSION
261 AC_CHECK_TOOL(OBJCOPY, objcopy)
262 if test "x$OBJCOPY" = "x"; then
263         AC_MSG_ERROR("objcopy from GNU binutils >= 2.11.90 not found")
265 AC_CHECK_TOOL(OBJDUMP, objdump)
266 dnl extract target and architecture if objdump was found
267 if test "x$OBJDUMP" = "x"; then :; else
268   AC_MSG_CHECKING(for object target)
269   octarget=`$OBJDUMP --info | sed -ne '2p'` # extract first target
270   AC_MSG_RESULT($octarget)
271   AC_MSG_CHECKING(for object architecture)
272   ocarch=`$OBJDUMP --info | sed -ne '4p'` # extract corresponding arch
273   AC_MSG_RESULT($ocarch)
275 AC_SUBST(OBJCOPYTARGET, $octarget)
276 AC_SUBST(OBJCOPYARCH, $ocarch)
278 ############## END of .png TO .o CONVERSION
280 AC_OUTPUT(Makefile cinelerra-cvs-current.spec po/Makefile.in \
281         m4/Makefile \
282                                         libmpeg3/Makefile libmpeg3/video/Makefile libmpeg3/audio/Makefile \
283                                         quicktime/Makefile \
284                                         quicktime/encore50/Makefile \
285                                         mpeg2enc/Makefile toolame-02l/Makefile \
286                                         guicast/Makefile cinelerra/Makefile \
287         cinelerra/data/Makefile \
288                                         mplexhi/Makefile mplexlo/Makefile \
289                                         plugins/defaulttheme/Makefile \
290         plugins/defaulttheme/data/Makefile \
291                                         plugins/bluedottheme/Makefile \
292         plugins/bluedottheme/data/Makefile \
293                                         plugins/microtheme/Makefile \
294         plugins/microtheme/data/Makefile \
295                                         plugins/colors/Makefile \
296                                         plugins/libfourier/Makefile \
297                                         plugins/libeffecttv/Makefile \
298                                         plugins/Makefile plugins/1080to480/Makefile \
299                                         plugins/histogram/Makefile \
300                                         plugins/720to480/Makefile \
301                                         plugins/denoisemjpeg/Makefile \
302                                         plugins/motion/Makefile \
303                                         plugins/bandslide/Makefile \
304                                         plugins/bandwipe/Makefile plugins/blur/Makefile plugins/brightness/Makefile \
305                                         plugins/burn/Makefile plugins/parametric/Makefile plugins/aging/Makefile \
306                                         plugins/cdripper/Makefile plugins/chromakey/Makefile plugins/colorbalance/Makefile \
307                                         plugins/compressor/Makefile \
308                                         plugins/crossfade/Makefile \
309                                         plugins/decimate/Makefile \
310                                         plugins/deinterlace/Makefile plugins/delayaudio/Makefile plugins/delayvideo/Makefile \
311                                         plugins/denoise/Makefile plugins/denoisefft/Makefile plugins/denoisevideo/Makefile \
312                                         plugins/despike/Makefile plugins/dissolve/Makefile plugins/dot/Makefile \
313                                         plugins/fieldframe/Makefile plugins/flip/Makefile plugins/framefield/Makefile \
314                                         plugins/freeverb/Makefile plugins/freezeframe/Makefile plugins/gain/Makefile \
315                                         plugins/holo/Makefile plugins/huesaturation/Makefile plugins/interpolateall/Makefile \
316                                         plugins/interpolateaudio/Makefile \
317                                         plugins/interpolatevideo/Makefile \
318                                         plugins/invertaudio/Makefile plugins/invertvideo/Makefile plugins/irissquare/Makefile \
319                                         plugins/ivtc/Makefile \
320                                         plugins/loopaudio/Makefile \
321                                         plugins/loopvideo/Makefile \
322                                         plugins/normalize/Makefile \
323                                         plugins/oilpainting/Makefile \
324                                         plugins/overlay/Makefile \
325                                         plugins/pitch/Makefile \
326                                         plugins/polar/Makefile \
327                                         plugins/reframe/Makefile plugins/resample/Makefile plugins/reverb/Makefile \
328                                         plugins/reverseaudio/Makefile plugins/reversevideo/Makefile plugins/rgb601/Makefile \
329                                         plugins/rotate/Makefile plugins/scale/Makefile plugins/sharpen/Makefile \
330                                         plugins/shiftinterlace/Makefile plugins/slide/Makefile plugins/spectrogram/Makefile \
331                                         plugins/swapchannels/Makefile plugins/synthesizer/Makefile plugins/timeavg/Makefile \
332                                         plugins/timestretch/Makefile plugins/titler/Makefile plugins/translate/Makefile \
333                                         plugins/videoscope/Makefile plugins/wave/Makefile plugins/whirl/Makefile \
334                                         plugins/wipe/Makefile \
335                                         plugins/yuv/Makefile \
336                                         plugins/downsample/Makefile plugins/flash/Makefile plugins/gradient/Makefile \
337                                         plugins/level/Makefile plugins/linearblur/Makefile \
338                                         plugins/perspective/Makefile plugins/radialblur/Makefile plugins/zoomblur/Makefile \
339                                         plugins/svg/Makefile \
340                                         plugins/diffkey/Makefile \
341                                         plugins/fonts/Makefile)
343 if test "$NOT_FOUND" = ""; then
344         AC_MSG_NOTICE([All required libraries were found.])
345 else
346         AC_MSG_WARN([The following libraries were not found:])
347         for i in $NOT_FOUND; do
348                 l=`echo $i | sed -e 's/,/ /'`
349                 AC_MSG_WARN([   $l])
350         done
351         AC_MSG_WARN([Compilation may fail!])