r289: Merged the official release 1.2.0.
[cinelerra_cv.git] / configure.in
blob814bf384160f2c9fdf97ce6f795fc627871ecfb4
1 AC_INIT(Cinelerra, 1.2.0)
3 AC_CANONICAL_SYSTEM
5 # Test for minimal version of autoconf
6 AC_PREREQ(2.57)
8 # Test for minimal versions of and automake
10 if test `automake --version | grep "automake (GNU automake)" | cut -b 25-27` = "1.7"; then
11         echo "Checking for automake 1.7 ... found"
12 else
13         echo "Checking for automake 1.7 ... not found"
14         echo "You are using a version of automake older than 1.7. That will not work."
15         echo " See README.BUILD for further instructions"
16         exit
19 AM_INIT_AUTOMAKE
20 AM_CONFIG_HEADER(config.h)
21 AM_GNU_GETTEXT([external])
22 AM_GNU_GETTEXT_VERSION(0.12.1)
24 AC_LANG_CPLUSPLUS
25 AC_LANG_C
26 AC_PROG_CXX
28 AC_ENABLE_SHARED
29 AC_DISABLE_STATIC
30 AC_PROG_LIBTOOL
32 # hack for libtool 1.5 -- this is ugly and probably wrong, but works
33 if test `libtool --version | grep ltmain.sh | cut -b 25-27` = "1.5"; then
34    LTC_FLAGS="--tag=CC"
35    LTCXX_FLAGS="--tag=CXX"
37 AC_SUBST(LTC_FLAGS)
38 AC_SUBST(LTCXX_FLAGS)
41 # hack for using nasm for .S files
42 CCAS="\$(top_srcdir)/admin/nasm"
43 AC_SUBST(CCAS)
44 AC_SUBST(CCASFLAGS)
47 ############## SPECIAL DIRECTORIES
48 AC_ARG_WITH(plugindir,
49                                                 AC_HELP_STRING([--with-plugindir], [sets the directory where the plugins should be installed]),
50                                                 [ plugindir=$withval ],
51                                                 [ plugindir="\${exec_prefix}/lib/cinelerra" ])
52 AC_SUBST(plugindir)
54 AC_ARG_WITH(fontsdir,
55                                                 AC_HELP_STRING([--with-fontsdir], [sets the directory where the fonts should be installed]),
56                                                 [ fontsdir=$withval ],
57                                                 [ fontsdir="\${plugindir}/fonts" ])
58 AC_SUBST(fontsdir)
59 ############## END OF SPECIAL DIRECTORIES
61 ############## XLIB
62 LDFLAGS="$LDFLAGS -L/usr/X11R6/lib"
63 AC_CHECK_HEADERS(X11/Xlib.h)
64 AC_CHECK_LIB(X11, XOpenDisplay, ,[
65         echo "Xlib-dev was not found. In order to build Cinelerra,"
66         echo "xlib-dev must be installed. Please install xlib-dev and"
67         echo "run configure again."
68         exit
69         ])
70 ############## END XLIB
72 ############## MISC LIBRARIES
73 AC_CHECK_HEADERS(uuid/uuid.h)
74 AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_NOTICE([libuuid not found])
75         NOT_FOUND="$NOT_FOUND libuuid,"])
77 AC_PATH_XTRA
78 ############## END OF MISC LIBRARIES
80 LARGEFILE_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
81 CFLAGS="-D_REENTRANT -DHAVE_LIBXXF86VM $LARGEFILE_CFLAGS $CFLAGS"
82 CXXFLAGS="-D_REENTRANT -DHAVE_LIBXXF86VM $LARGEFILE_CFLAGS $CXXFLAGS"
84 # A52DEC
85 AC_CHECK_HEADERS(a52dec/a52.h)
86 AC_CHECK_LIB(a52, a52_init, true ,[AC_MSG_NOTICE([a52dec not found])
87         NOT_FOUND="$NOT_FOUND a52dec,"])
88 #END A52DEC
90 ############## LAME
91 # Just test to see if we have lame installed.
92 AC_CHECK_HEADERS(lame/lame.h)
93 #AC_CHECK_LIB(-lmp3lame, lame_init, ,[AC_MSG_NOTICE([libmp3lame not found])
94 #       NOT_FOUND="$NOT_FOUND libmp3lame,"])
95 # END LAME
97 ############## LIBSNDFILE
98 # Use the provided libsndfile, which will be renamed to libsndfilehv
99 AC_CONFIG_SUBDIRS(libsndfile)
101 ############## LIBAVCODEC
102 AC_CHECK_HEADERS(ffmpeg/avcodec.h)
103 AC_CHECK_LIB(avcodec, avcodec_init,[AC_MSG_NOTICE([libavcodec found])] ,[AC_MSG_NOTICE([libavcodec not found])
104         NOT_FOUND="$NOT_FOUND libavcodec"])
105 # END LIBAVCODEC
107 ############## LIBXVIDCORE
108 AC_CHECK_HEADERS(xvid.h)
109 AC_CHECK_LIB(xvidcore, xvid_init, ,[AC_MSG_NOTICE([libxvidcore not found])
110         NOT_FOUND="$NOT_FOUND libxvidcore,"])
111 # END LIBXVIDCORE
113 ############## FIREWIRE
114 # firewire settings are propagated through FIREWIRE_CFLAGS and FIREWIRE_LDFLAGS
115 AC_ARG_ENABLE(firewire, 
116                                                         AC_HELP_STRING([--disable-firewire], [disable support for firewire (default=enabled)]),
117                                                         [ enable_firewire=$enableval ],
118                                                         [ enable_firewire=yes ])
120 if test "x$enable_firewire" = "xyes"; then
121         AC_CHECK_LIB(raw1394, raw1394_new_handle, ,[AC_MSG_NOTICE([libraw1394 not found])
122         NOT_FOUND="$NOT_FOUND libraw1394,"
123         FIREWIRE="no"])
125         AC_CHECK_LIB(avc1394, avc1394_send_command, ,[AC_MSG_NOTICE([libavc1394 not found])
126         NOT_FOUND="$NOT_FOUND libavc1394,"
127         FIREWIRE="no"])
129         AC_CHECK_LIB(rom1394, rom1394_get_bus_id, ,[AC_MSG_NOTICE([librom1394 not found])
130         NOT_FOUND="$NOT_FOUND librom1394,"
131         FIREWIRE="no"])
133         if test "$FIREWIRE" = "no"; then
134                 FIREWIRE_CFLAGS=""
135                 FIREWIRE_LDFLAGS=""
136         else
137                 FIREWIRE_CFLAGS="-DHAVE_FIREWIRE"
138 #               FIREWIRE_LDFLAGS="-lraw1394 -lavc1394 -lrom1394"
139         fi
141 AC_SUBST(FIREWIRE_CFLAGS)
142 AC_SUBST(FIREWIRE_LDFLAGS)
143 ############## END OF FIREWIRE
145 ############## AVIFILE SUPPORT
146 dnl if test "x$enable_avifile" = "xyes"; then
147 dnl     AM_PATH_AVIFILE(0.7.0)
148 dnl     if test "x$HAVE_AVIFILE" = "xyes"; then
149 dnl             AVIFILE_CXXFLAGS="-DUSE_AVIFILE $AVIFILE_CXXFLAGS"
150 dnl     fi
151 dnl fi
152 dnl AC_ARG_ENABLE(avifile, [  --enable-avifile  enable support for avifile [default=no]])
153 ############## END OF AVIFILE SUPPORT
155 ############# CSS SUPPORT IN LIBMPEG3
156 if test "x$enable_css" = "xyes"; then
157         CSS_CFLAGS="-DHAVE_CSS"
159 AC_SUBST(CSS_CFLAGS)
160 AC_ARG_ENABLE(css, 
161                                                         AC_HELP_STRING([--disable-css], [disable support for css in libmpeg3 (default=enabled)]),,
162                                                         [ enable_css=$enableval ],
163                                                         [ enable_css=yes ])
164 ############## END OF CSS SUPPORT IN LIBMPEG3
167 ############## SOUND
168 # the sound options are propagated by SOUND_CFLAGS and SOUND_LDFLAGS
169 AC_ARG_ENABLE(oss, 
170                                                         AC_HELP_STRING([--disable-oss], [disable support for oss (default=enabled)]))
171 AC_ARG_ENABLE(alsa, 
172                                                         AC_HELP_STRING([--enable-alsa], [enable support for alsa (default=autodetect)]),
173                                                         [ enable_alsa=$enableval ],
174                                                         [ enable_alsa=default ])
175 AC_ARG_ENABLE(esd, 
176                                                         AC_HELP_STRING([--disable-esound], [disable support for esound (default=enabled)]))
178 if test "x$enable_oss" = "xyes" || test "x$enable_oss" = "x"; then
179         SOUND_CFLAGS="-DHAVE_OSS $SOUND_CFLAGS"
181 if test "x$enable_alsa" = "xdefault" || test "x$enable_alsa" = "xyes"; then
182         AM_PATH_ALSA(0.9.0,
183                 [ SOUND_CFLAGS="$ALSA_CFLAGS -DHAVE_ALSA $SOUND_CFLAGS"
184                 SOUND_LDFLAGS="$ALSA_LIBS $SOUND_LDFLAGS" ],
185                 [ if test "x$enable_alsa" = "xyes"; then
186                                 AC_MSG_NOTICE( [ alsa library >= 0.9.0 not found ] )
187                                 NOT_FOUND="$NOT_FOUND alsa library >= 0.9.0,"
188                         fi ])
191 if test "x$enable_esd" = "xyes" || test "x$enable_esd" = "x"; then
192         AM_PATH_ESD
193         SOUND_CFLAGS="$ESD_CFLAGS -DHAVE_ESOUND $SOUND_CFLAGS"
194         SOUND_LDFLAGS="$ESD_LIBS $SOUND_LDFLAGS"
196 AC_SUBST(SOUND_CFLAGS)
197 AC_SUBST(SOUND_LDFLAGS)
198 ############### END OF SOUND
200 # MPEG2ENC declarations
201 have_asm_mmx=false
202 have_asm_sse=false
203 have_asm_nasm=false
204 have_x86cpu=false
206 ############## MMX / 3DNOW
208 AC_ARG_ENABLE(x86, 
209                                                         AC_HELP_STRING([--enable-x86], [enables x86 specific features autodetection in libmpeg3 and mpeg2enc (default is disabled)]),
210                                                         [ enable_x86=$enableval ],
211                                                         [ enable_x86=no ])
212 AC_ARG_ENABLE(mmx, 
213                                                         AC_HELP_STRING([--enable-mmx], [enables support for mmx (default is disabled)]), 
214                                                         [ enable_mmx=$enableval ],
215                                                         [ enable_mmx=no ])
216 AC_ARG_ENABLE(3dnow, 
217                                                         AC_HELP_STRING([--enable-3dnow], [enables support for 3dnow (default is disabled)]),
218                                                         [ enable_3dnow=$enableval ],
219                                                         [ enable_3dnow=no ])
220 if test "x$enable_x86" = "xyes"; then
221         CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
222         have_x86cpu=true
225 if test "x$enable_mmx" = "xyes"; then
226         CPU_CFLAGS="-DHAVE_MMX -DMMX -DUSE_MMX $CPU_CFLAGS" # -D_MMX_ doesn't work
227         have_asm_mmx=true
229 AM_CONDITIONAL(USEMMX, test "x$enable_mmx" = "xyes")
231 if test "x$enable_3dnow" = "xyes"; then
232         CPU_CFLAGS="-DHAVE_3Dnow $CPU_CFLAGS" # -DUSE_3DNOW --> don't use, not compiling
234 AM_CONDITIONAL(USE3DNOW, test "x$enable_3dnow" = "xyes")
235 AC_SUBST(LIBDECORE_LIBADD)
236 AC_SUBST(CPU_CFLAGS)
237 ############## END OF MMX / 3DNOW
239 ############## FFMPEG
240 dnl AM_CONDITIONAL(FFMPEG_AC3, true)
241 dnl AM_CONDITIONAL(FFMPEG_A52BIN, false)
242 dnl AM_CONDITIONAL(FFMPEG_MP3LAME, true)
243 dnl AM_CONDITIONAL(FFMPEG_VORBIS, true)
244 dnl AM_CONDITIONAL(FFMPEG_HAVE_MLIB, false)
245 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_ARMV4L, false)
246 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_ALPHA, false)
247 dnl AM_CONDITIONAL(FFMPEG_TARGET_ARCH_POWERPC, false)
248 dnl AM_CONDITIONAL(FFMPEG_TARGET_MMI, false)
249 dnl AM_CONDITIONAL(FFMPEG_TARGET_ALTIVEC, false)
250 dnl 
251 LIBAVCODEC_CFLAGS=-I/usr/include/ffmpeg
252 LIBAVCODEC_LIBS=-lavcodec
253 AC_SUBST(LIBAVCODEC_CFLAGS)
254 AC_SUBST(LIBAVCODEC_LIBS)
256 ############## END OF FFMPEG
258 ############## .png TO .o CONVERSION
260 AC_CHECK_TOOL(OBJCOPY, objcopy)
261 if test "x$OBJCOPY" = "x"; then
262         AC_MSG_ERROR("objcopy from GNU binutils >= 2.11.90 not found")
264 AC_MSG_CHECKING(for object target)
265 dnl extract target and architecture
266 octarget=`objcopy --info | head -2 | tail -1`
267 AC_MSG_RESULT($octarget)
268 AC_MSG_CHECKING(for object architecture)
269 ocarch=`objcopy --info | grep '^  ' | head -1`
270 AC_MSG_RESULT($ocarch)
271 AC_SUBST(OBJCOPYTARGET, $octarget)
272 AC_SUBST(OBJCOPYARCH, $ocarch)
274 ############## END of .png TO .o CONVERSION
276 AC_OUTPUT(Makefile po/Makefile.in \
277         m4/Makefile \
278                                         libmpeg3/Makefile libmpeg3/video/Makefile libmpeg3/audio/Makefile \
279                                         quicktime/Makefile \
280                                         quicktime/encore50/Makefile \
281                                         mpeg2enc/Makefile toolame-02l/Makefile\
282                                         guicast/Makefile cinelerra/Makefile \
283         cinelerra/data/Makefile \
284                                         mplexhi/Makefile mplexlo/Makefile \
285                                         plugins/defaulttheme/Makefile \
286         plugins/defaulttheme/data/Makefile \
287                                         plugins/microtheme/Makefile \
288         plugins/microtheme/data/Makefile \
289                                         plugins/colors/Makefile \
290                                         plugins/libfourier/Makefile \
291                                         plugins/libeffecttv/Makefile \
292                                         plugins/Makefile plugins/1080to480/Makefile \
293                                         plugins/histogram/Makefile \
294                                         plugins/720to480/Makefile \
295                                         plugins/denoisemjpeg/Makefile \
296                                         plugins/motion/Makefile \
297                                         plugins/bandslide/Makefile \
298                                         plugins/bandwipe/Makefile plugins/blur/Makefile plugins/brightness/Makefile \
299                                         plugins/burn/Makefile plugins/parametric/Makefile plugins/aging/Makefile \
300                                         plugins/cdripper/Makefile plugins/chromakey/Makefile plugins/colorbalance/Makefile \
301                                         plugins/compressor/Makefile \
302                                         plugins/crossfade/Makefile \
303                                         plugins/decimate/Makefile \
304                                         plugins/deinterlace/Makefile plugins/delayaudio/Makefile plugins/delayvideo/Makefile \
305                                         plugins/denoise/Makefile plugins/denoisefft/Makefile plugins/denoisevideo/Makefile \
306                                         plugins/despike/Makefile plugins/dissolve/Makefile plugins/dot/Makefile \
307                                         plugins/fieldframe/Makefile plugins/flip/Makefile plugins/framefield/Makefile \
308                                         plugins/freeverb/Makefile plugins/freezeframe/Makefile plugins/gain/Makefile \
309                                         plugins/holo/Makefile plugins/huesaturation/Makefile plugins/interpolateall/Makefile \
310                                         plugins/interpolateaudio/Makefile \
311                                         plugins/interpolatevideo/Makefile \
312                                         plugins/invertaudio/Makefile plugins/invertvideo/Makefile plugins/irissquare/Makefile \
313                                         plugins/ivtc/Makefile \
314                                         plugins/loopaudio/Makefile \
315                                         plugins/loopvideo/Makefile \
316                                         plugins/normalize/Makefile \
317                                         plugins/oilpainting/Makefile \
318                                         plugins/overlay/Makefile \
319                                         plugins/pitch/Makefile \
320                                         plugins/polar/Makefile \
321                                         plugins/reframe/Makefile plugins/resample/Makefile plugins/reverb/Makefile \
322                                         plugins/reverseaudio/Makefile plugins/reversevideo/Makefile plugins/rgb601/Makefile \
323                                         plugins/rotate/Makefile plugins/scale/Makefile plugins/sharpen/Makefile \
324                                         plugins/shiftinterlace/Makefile plugins/slide/Makefile plugins/spectrogram/Makefile \
325                                         plugins/swapchannels/Makefile plugins/synthesizer/Makefile plugins/timeavg/Makefile \
326                                         plugins/timestretch/Makefile plugins/titler/Makefile plugins/translate/Makefile \
327                                         plugins/videoscope/Makefile plugins/wave/Makefile plugins/whirl/Makefile \
328                                         plugins/wipe/Makefile \
329                                         plugins/yuv/Makefile \
330                                         plugins/downsample/Makefile plugins/flash/Makefile plugins/gradient/Makefile \
331                                         plugins/level/Makefile plugins/linearblur/Makefile \
332                                         plugins/perspective/Makefile plugins/radialblur/Makefile plugins/zoomblur/Makefile \
333                                         plugins/svg/Makefile \
334                                         plugins/diffkey/Makefile \
335                                         plugins/fonts/Makefile)
337 if test "$NOT_FOUND" = ""; then
338         AC_MSG_NOTICE([Configure found all libraries successfully.])
339 else
340         AC_MSG_NOTICE([Configure could not find$NOT_FOUND compilation may fail!])