1 dnl Process this file with autoconf to produce a configure script.
3 dnl AC_INIT(src/) # old autoconf
5 AC_CONFIG_SRCDIR([src/])
7 AC_ARG_ENABLE(checkmem,
8 [ --enable-checkmem turn on ccmalloc debugging], CHECKMEM=true)
10 [ --enable-debug turn on debugging], DEBUG=true)
11 AC_ARG_ENABLE(profiling,
12 [ --enable-profiling turn on profiling], PROFILING=true)
13 AC_ARG_ENABLE(warnings,
14 [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true)
15 AC_ARG_ENABLE(optimizations,
16 [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true)
18 [ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true)
24 # ------------------------------------------------------------------
26 if test "x${srcdir}" != "x."; then
27 echo "--srcdir is not supported"
31 WARNINGS="-Wparentheses -Wimplicit -Wreturn-type"
32 if test "x$ENABLE_WARNINGS" '!=' "x";then
33 WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls"
36 if test "x$CHECKMEM" '!=' "x";then
39 if test "x$PROFILING" '!=' "x";then
42 if test "x$DEBUG" '!=' "x";then
43 if test "x$PROFILING" = "x";then
44 CFLAGS="$WARNINGS -O2 -g $CFLAGS"
45 CXXFLAGS="$WARNINGS -O2 -g $CXXFLAGS"
47 CFLAGS="$WARNINGS -O2 -g -pg $CFLAGS"
48 CXXFLAGS="$WARNINGS -O2 -g -pg $CXXFLAGS"
49 LDFLAGS="-g -pg $LIBS"
51 else if test "x$OPTIMIZE" '!=' "x"; then
52 CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS"
53 CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS"
55 CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS"
56 CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS"
60 #if test "x$OLDGCC" '!=' "x";then
61 # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic"
62 # #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic"
63 # CFLAGS="$CFLAGS -ansi -pendantic"
64 # CXXFLAGS="$CXXFLAGS -ansi -pendantic"
67 export PACKAGE VERSION CFLAGS CXXFLAGS
69 dnl Checks for programs.
78 CFLAGS="$CFLAGS -fno-rtti"
79 CXXFLAGS="$CXXFLAGS -fno-rtti"
86 dnl Checks for programs.
90 if test "x$CHECKMEM" '!=' "x";then
106 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
108 dnl Checks for system services
114 if test "x$EXEEXT" = "x.exe";then
124 if test "x${MINGW}" != "xyes"; then
126 AC_DEFINE_UNQUOTED(O_BINARY, 0)
134 # The following tries to make use of includes and libraries in
135 # /usr/local, too. Notice: A -I/usr/local/include might break
136 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
137 # especially on systems which link /usr/local to /usr, so it has yet
138 # to be seen how useful this is.
139 if test -d /usr/local/lib; then
140 LDFLAGS="$LDFLAGS -L/usr/local/lib"
142 if test -d /usr/local/include; then
143 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
144 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
147 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
148 # if the user has a special prefix (like /opt), there might also be $prefix/lib
149 # and $prefix/include, which should be included in our search paths for libraries
151 LDFLAGS="$LDFLAGS -L${libdir}"
152 CPPFLAGS="$CPPFLAGS -I${includedir}"
153 # TODO- test whether gcc still works after this
157 #LDFLAGS "-L/sw/lib" ; CPPFLAGS "-I/sw/include -I/sw/include/lame"
160 # this must be done after (I believe) AC_PROG_MAKE_SET
161 if test "x$DEBUG" '!=' "x";then
162 STRIP="@echo debug enabled, not stripping "
167 dnl Checks for libraries.
168 AC_CHECK_LIB(m, sin,,
169 echo "Error: Math library not found.";
172 AC_CHECK_LIB(z, deflate,, ZLIBMISSING=true)
173 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true)
174 AC_CHECK_LIB(t1, T1_LoadFont,, T1LIBMISSING=true)
175 AC_CHECK_LIB(ungif, DGifOpen,, UNGIFMISSING=true)
178 AC_SUBST(WORDS_BIGENDIAN)
179 RFX_CHECK_SYSTEM_BACKTICKS
180 AC_SUBST(SYSTEM_BACKTICKS)
184 dnl Checks for header files.
185 AC_CONFIG_HEADER(config.h)
188 AC_CHECK_HEADERS(zlib.h gif_lib.h jpeglib.h t1lib.h assert.h signal.h pthread.h sys/stat.h sys/types.h dirent.h sys/bsdtypes.h sys/ndir.h sys/dir.h ndir.h time.h)
190 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
191 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
195 AC_SUBST(HAVE_UNISTD_H)
198 dnl Checks for typedefs, structures, and compiler characteristics.
204 AC_CHECK_TYPE(boolean,int) #needed for jpeglib
205 dnl AC_CHECK_TYPE(bool,char)
206 dnl AC_CHECK_TYPE(uchar,unsigned char)
207 dnl AC_CHECK_TYPE(schar,signed char)
208 dnl AC_CHECK_TYPE(word,unsigned short int)
209 dnl AC_CHECK_TYPE(sword,unsigned short int)
210 dnl AC_CHECK_TYPE(uint,unsigned long int)
212 dnl Checks for library functions.
213 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
215 # ------------------------------------------------------------------
221 # ------------------------------------------------------------------
225 if test "x${DISABLE_LAME}" = "xtrue"; then
226 echo "*" Disabling lame support...
228 # old lame code at lib/lame
229 if test -f lib/lame/Makefile.in; then
230 lame_objects="lame/psymodel.\$(O) lame/fft.\$(O) lame/newmdct.\$(O) lame/quantize.\$(O) lame/takehiro.\$(O) lame/reservoir.\$(O) lame/quantize_pvt.\$(O) lame/vbrquantize.\$(O) lame/encoder.\$(O) lame/id3tag.\$(O) lame/version.\$(O) lame/tables.\$(O) lame/util.\$(O) lame/bitstream.\$(O) lame/set_get.\$(O) lame/VbrTag.\$(O) lame/lame.\$(O)"
231 lame_makefile="lib/lame/Makefile"
232 CPPFLAGS="$CPPFLAGS -Ilame"
233 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
235 if test -d /usr/include/lame; then
236 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
238 if test -d /usr/local/include/lame; then
239 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
242 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
243 AC_CHECK_HEADERS(lame.h)
244 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
245 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
249 AC_SUBST(lame_objects)
251 # ------------------------------------------------------------------
254 if test "x${AVIFILE}" = "xtrue"; then
255 VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS"
256 VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS"
257 AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1)
260 if test "x${WIN32}" != "x"; then
261 #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true)
262 #if test "x${AVIFIL32}" != "x"; then
263 # VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
265 VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
270 AC_SUBST(VIDEO_CFLAGS)
271 # ------------------------------------------------------------------
273 if test "x${UNCOMPRESS}" = "xgzip"; then
274 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
278 # ------------------------------------------------------------------
282 if test "x$PYTHON_OK" '!=' "xyes";then
283 echo all install uninstall clean: > lib/python/Makefile
284 # fail silently- the most users won't have any need for the
285 # python interface anyway
287 pythonrfxswf="lib/python/Makefile"
290 # ------------------------------------------------------------------
292 AC_MSG_CHECKING([for missing libraries])
294 if test "x$ZLIBMISSING" = "xtrue";then
295 MISSINGLIBS="${MISSINGLIBS} zlib"
299 if test "x$JPEGLIBMISSING" = "xtrue";then
300 MISSINGLIBS="${MISSINGLIBS} jpeglib"
305 if test "x$T1LIBMISSING" = "xtrue";then
306 MISSINGLIBS="${MISSINGLIBS} t1lib"
308 if test "x$UNGIFMISSING" = "xtrue";then
310 MISSINGLIBS="${MISSINGLIBS} ungif"
314 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
316 DISABLEJPEG2SWF=true;
317 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
320 if test "x$HAVE_FREETYPE" '!=' "x1"; then
322 MISSINGLIBS="${MISSINGLIBS} freetype"
325 if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
326 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
328 if test "x${ac_cv_header_gif_lib_h}" '!=' "xyes"; then
330 MISSINGLIBS="${MISSINGLIBS} gif_lib.h"
333 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
335 MISSINGLIBS="${MISSINGLIBS} zlib.h"
338 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
339 MISSINGLIBS="${MISSINGLIBS} avifile"
343 AC_MSG_RESULT(${MISSINGLIBS})
345 # ------------------------------------------------------------------
347 if test "x${MISSINGLIBS}" '!=' "x"; then
348 echo "***************************************************"
349 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
352 avi2swf="avi2swf/Makefile"
353 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
354 echo "* Disabling avi2swf tool..."
355 echo all install uninstall clean: > avi2swf/Makefile
359 pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile"
360 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
361 echo "* Disabling pdf2swf tool..."
362 rm -f pdf2swf/Makefile
363 echo all install uninstall clean: > pdf2swf/Makefile
367 if test "x${ZLIBMISSING}" = "xtrue"; then
369 echo "* Warning! Without zlib, you will not be able to read"
370 echo "* or write compressed Flash MX files!"
373 JPEG2SWF='jpeg2swf$(E)'
374 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
375 echo "* Disabling jpeg2swf tool..."
381 GIF2SWF='gif2swf$(E)'
382 if test "x${DISABLEGIF2SWF}" = "xtrue"; then
383 echo "* Disabling gif2swf tool..."
389 PNG2SWF='png2swf$(E)'
390 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
391 echo "* Disabling png2swf tool..."
397 if test "x${MISSINGLIBS}" '!=' "x"; then
398 if test "x${PARTIAL}" '=' "x"; then
399 echo "* (never mind)"
401 echo "***************************************************"
404 # ------------------------------------------------------------------
406 if test -f "release.in"; then release_in="./release"; fi
407 FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
409 dnl AC_OUTPUT(${FILES}) old autoconf
410 AC_CONFIG_FILES([${FILES}])
414 # On development trees, create snapshots of config.status
416 if test -f snapshot -a "x$CHECKMEM" = "x" -a "x$PROFILING" = "x";then
417 if test "x${MINGW}" = "xyes"; then
418 echo cp config.status config.status.win32
419 cp config.status config.status.win32
421 if test "x$DEBUG" '=' "x" -a "x$OPTIMIZE" '=' "x";then
422 echo cp config.status config.status.linux
423 cp config.status config.status.linux
425 if test "x$DEBUG" '!=' "x" -a "x$OPTIMIZE" '=' "x";then
426 echo cp config.status config.status.debug
427 cp config.status config.status.debug
429 if test "x$DEBUG" = "x" -a "x$OPTIMIZE" '!=' "x"; then
430 echo cp config.status config.status.optimize
431 cp config.status config.status.optimize