1 dnl Process this file with autoconf to produce a configure script.
8 dnl AC_CONFIG_SRCDIR([src/])
10 AC_ARG_ENABLE(checkmem,
11 [ --enable-checkmem turn on ccmalloc debugging], CHECKMEM=true)
13 [ --enable-debug turn on debugging], DEBUG=true)
14 AC_ARG_ENABLE(profiling,
15 [ --enable-profiling turn on profiling], PROFILING=true)
16 AC_ARG_ENABLE(warnings,
17 [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true)
18 AC_ARG_ENABLE(optimizations,
19 [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true)
21 [ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true)
24 VERSION=2007-12-11-1640
27 # ------------------------------------------------------------------
29 if test "x${srcdir}" != "x."; then
30 echo "--srcdir is not supported"
34 WARNINGS="-Wparentheses -Wimplicit -Wreturn-type"
35 if test "x$ENABLE_WARNINGS" '!=' "x";then
36 WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls -D_FORTIFY_SOURCE=2 "
39 if test "x$CHECKMEM" '!=' "x";then
42 if test "x$PROFILING" '!=' "x";then
45 if test "x$DEBUG" '!=' "x";then
46 if test "x$PROFILING" = "x";then
47 CFLAGS="$WARNINGS -O2 -g $CFLAGS"
48 CXXFLAGS="$WARNINGS -O2 -g $CXXFLAGS"
51 CFLAGS="$WARNINGS -O2 -g -pg $CFLAGS"
52 CXXFLAGS="$WARNINGS -O2 -g -pg $CXXFLAGS"
53 LDFLAGS="-g -pg $LIBS"
55 else if test "x$OPTIMIZE" '!=' "x"; then
56 CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS"
57 CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS"
59 CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS"
60 CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS"
64 CFLAGS="-fPIC $CFLAGS"
65 CXXFLAGS="-fPIC $CFLAGS"
68 #if test "x$OLDGCC" '!=' "x";then
69 # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic"
70 # #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic"
71 # CFLAGS="$CFLAGS -ansi -pendantic"
72 # CXXFLAGS="$CXXFLAGS -ansi -pendantic"
75 export PACKAGE VERSION CFLAGS CXXFLAGS
77 dnl Checks for programs.
87 CXXFLAGS="$CXXFLAGS -fno-rtti"
89 # Use fink packages if available.
90 #if test -d /sw/include && test -d /sw/lib; then
91 # CPPFLAGS="${CPPFLAGS} -I/sw/include"
92 # LDFLAGS="${LDFLAGS} -L/sw/lib"
99 dnl Checks for programs.
106 if test "x$GCC_IS_OK" '=' "x";then
107 echo "***************************************************"
108 echo "* Your gcc is too old to compile this!"
110 echo "* The last version compilable by this compiler is "
111 echo "* swftools 0.7.0, which you can download from "
112 echo "* http://www.swftools.org/swftools-0.7.0.tar.gz "
114 echo "* Newer versions require at least gcc 3.0.0 "
115 echo "***************************************************"
119 if test "x$CHECKMEM" '!=' "x";then
124 #unset ac_cv_prog_CXX
134 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
136 dnl Checks for system services
143 if test "x$EXEEXT" = "x.exe";then
154 if test "x${MINGW}" != "xyes"; then
156 AC_DEFINE_UNQUOTED(O_BINARY, 0)
166 # The following tries to make use of includes and libraries in
167 # /usr/local, too. Notice: A -I/usr/local/include might break
168 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
169 # especially on systems which link /usr/local to /usr, so it has yet
170 # to be seen how useful this is.
171 if test -d /usr/local/lib; then
172 LDFLAGS="$LDFLAGS -L/usr/local/lib"
174 if test -d /usr/local/include; then
175 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
176 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
179 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
180 # if the user has a special prefix (like /opt), there might also be $prefix/lib
181 # and $prefix/include, which should be included in our search paths for libraries
183 LDFLAGS="$LDFLAGS -L${libdir}"
184 CPPFLAGS="$CPPFLAGS -I${includedir}"
185 # TODO- test whether gcc still works after this
189 #LDFLAGS "-L/sw/lib" ; CPPFLAGS "-I/sw/include -I/sw/include/lame"
192 # this must be done after (I believe) AC_PROG_MAKE_SET
193 if test "x$DEBUG" '!=' "x" -o "x$STRIP" = "x";then
194 STRIP="@echo debug enabled, not stripping "
199 dnl Checks for libraries.
200 AC_CHECK_LIB(m, sin,,
201 echo "Error: Math library not found.";
204 AC_CHECK_LIB(z, deflate,, ZLIBMISSING=true)
206 if test "x$ZLIBMISSING" = "xtrue";then
209 echo "You need zlib to compile swftools"
214 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true)
215 AC_CHECK_LIB(ungif, DGifOpen,, UNGIFMISSING=true)
216 if test "$UNGIFMISSING";then
218 AC_CHECK_LIB(gif, DGifOpen,, UNGIFMISSING=true)
222 AC_SUBST(WORDS_BIGENDIAN)
223 RFX_CHECK_SYSTEM_BACKTICKS
224 AC_SUBST(SYSTEM_BACKTICKS)
228 dnl Checks for header files.
229 AC_CONFIG_HEADER(config.h)
232 AC_CHECK_HEADERS(zlib.h gif_lib.h io.h jpeglib.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)
234 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
235 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
239 AC_SUBST(HAVE_UNISTD_H)
242 dnl Checks for typedefs, structures, and compiler characteristics.
248 AC_CHECK_TYPE(boolean,int) #needed for jpeglib
249 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
251 AC_CHECK_SIZEOF([signed])
252 AC_CHECK_SIZEOF([unsigned])
253 AC_CHECK_SIZEOF([signed long])
254 AC_CHECK_SIZEOF([unsigned long])
255 AC_CHECK_SIZEOF([signed long long])
256 AC_CHECK_SIZEOF([unsigned long long])
260 #RFX_CHECK_FONTCONFIG
264 if test "x${DISABLE_LAME}" = "xtrue"; then
265 echo "*" Disabling lame support...
267 # old lame code at lib/lame
268 if test -f lib/lame/Makefile.in; then
269 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)"
270 lame_makefile="lib/lame/Makefile"
271 CPPFLAGS="$CPPFLAGS -Ilame"
272 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
274 if test -d /usr/include/lame; then
275 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
277 if test -d /usr/local/include/lame; then
278 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
281 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
282 AC_CHECK_HEADERS(lame.h)
283 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
284 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
288 AC_SUBST(lame_objects)
290 # ------------------------------------------------------------------
293 if test "x${AVIFILE}" = "xtrue"; then
294 VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS"
295 VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS"
296 AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1)
299 if test "x${WIN32}" != "x"; then
300 #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true)
301 #if test "x${AVIFIL32}" != "x"; then
302 # VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
304 VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
309 AC_SUBST(VIDEO_CFLAGS)
310 # ------------------------------------------------------------------
312 if test "x${UNCOMPRESS}" = "xgzip"; then
313 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
317 # ------------------------------------------------------------------
321 if test "x$PYTHON_OK" '!=' "xyes";then
322 echo all install uninstall clean: > lib/python/Makefile
323 # fail silently- the most users won't have any need for the
324 # python interface anyway
326 pythonrfxswf="lib/python/Makefile"
329 # ------------------------------------------------------------------
331 AC_MSG_CHECKING([for missing libraries])
333 if test "x$ZLIBMISSING" = "xtrue";then
334 MISSINGLIBS="${MISSINGLIBS} zlib"
338 if test "x$JPEGLIBMISSING" = "xtrue";then
339 MISSINGLIBS="${MISSINGLIBS} jpeglib"
344 #if test "x$T1LIBMISSING" = "xtrue";then
345 # MISSINGLIBS="${MISSINGLIBS} t1lib"
347 if test "x$UNGIFMISSING" = "xtrue";then
349 MISSINGLIBS="${MISSINGLIBS} ungif"
353 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
355 DISABLEJPEG2SWF=true;
356 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
359 if test "x$HAVE_FREETYPE" '!=' "x1"; then
361 MISSINGLIBS="${MISSINGLIBS} freetype"
364 #if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
365 # MISSINGLIBS="${MISSINGLIBS} t1lib.h"
367 if test "x${ac_cv_header_gif_lib_h}" '!=' "xyes"; then
369 MISSINGLIBS="${MISSINGLIBS} gif_lib.h"
372 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
374 MISSINGLIBS="${MISSINGLIBS} zlib.h"
377 #if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
378 # MISSINGLIBS="${MISSINGLIBS} avifile"
381 AC_MSG_RESULT(${MISSINGLIBS})
383 # ------------------------------------------------------------------
385 if test "x${MISSINGLIBS}" '!=' "x"; then
386 echo "***************************************************"
387 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
390 avi2swf="avi2swf/Makefile"
391 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
392 #don't whine, avi2swf is outdated anyway
393 #echo "* Disabling avi2swf tool..."
394 echo all install uninstall clean: > avi2swf/Makefile
398 pdf2swf_makefile="lib/pdf/Makefile"
399 PDF2SWF='pdf2swf$(E)'
402 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
403 echo "* Disabling pdf2swf tool..."
404 rm -f lib/pdf/Makefile
405 echo all install uninstall clean: > lib/pdf/Makefile
413 if test "x${ZLIBMISSING}" = "xtrue"; then
415 echo "* Warning! Without zlib, you will not be able to read"
416 echo "* or write compressed Flash MX files!"
419 JPEG2SWF='jpeg2swf$(E)'
420 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
421 echo "* Disabling jpeg2swf tool..."
427 GIF2SWF='gif2swf$(E)'
428 if test "x${DISABLEGIF2SWF}" = "xtrue"; then
429 echo "* Disabling gif2swf tool..."
435 PNG2SWF='png2swf$(E)'
436 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
437 echo "* Disabling png2swf tool..."
443 if test "x${MISSINGLIBS}" '!=' "x"; then
444 if test "x${PARTIAL}" '=' "x"; then
445 echo "* (never mind)"
447 echo "***************************************************"
450 # ------------------------------------------------------------------
452 if test -f "release.in"; then release_in="./release"; fi
453 if test -f "wx/Makefile.in"; then wx_in="wx/Makefile"; fi
454 FILES="$release_in $wx_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile pdf2swf/fonts/Makefile ${pythonrfxswf} ${lame_makefile} lib/art/Makefile lib/swf/Makefile"
458 dnl AC_CONFIG_FILES([${FILES}])
462 # On development trees, create snapshots of config.status
464 if test -f snapshot -a "x$CHECKMEM" = "x" -a "x$PROFILING" = "x";then
465 if test "x${MINGW}" = "xyes"; then
466 echo cp config.status config.status.win32
467 cp config.status config.status.win32
469 if test "x$DEBUG" '=' "x" -a "x$OPTIMIZE" '=' "x";then
470 echo cp config.status config.status.linux
471 cp config.status config.status.linux
473 if test "x$DEBUG" '!=' "x" -a "x$OPTIMIZE" '=' "x";then
474 echo cp config.status config.status.debug
475 cp config.status config.status.debug
477 if test "x$DEBUG" = "x" -a "x$OPTIMIZE" '!=' "x"; then
478 echo cp config.status config.status.optimize
479 cp config.status config.status.optimize