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=2005-09-25-1334
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"
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"
50 CFLAGS="$WARNINGS -O2 -g -pg $CFLAGS"
51 CXXFLAGS="$WARNINGS -O2 -g -pg $CXXFLAGS"
52 LDFLAGS="-g -pg $LIBS"
54 else if test "x$OPTIMIZE" '!=' "x"; then
55 CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS"
56 CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS"
58 CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS"
59 CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS"
63 #if test "x$OLDGCC" '!=' "x";then
64 # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic"
65 # #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic"
66 # CFLAGS="$CFLAGS -ansi -pendantic"
67 # CXXFLAGS="$CXXFLAGS -ansi -pendantic"
70 export PACKAGE VERSION CFLAGS CXXFLAGS
72 dnl Checks for programs.
82 CXXFLAGS="$CXXFLAGS -fno-rtti"
84 # Use fink packages if available.
85 #if test -d /sw/include && test -d /sw/lib; then
86 # CPPFLAGS="${CPPFLAGS} -I/sw/include"
87 # LDFLAGS="${LDFLAGS} -L/sw/lib"
94 dnl Checks for programs.
98 if test "x$CHECKMEM" '!=' "x";then
103 #unset ac_cv_prog_CXX
114 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
116 dnl Checks for system services
122 if test "x$EXEEXT" = "x.exe";then
132 if test "x${MINGW}" != "xyes"; then
134 AC_DEFINE_UNQUOTED(O_BINARY, 0)
142 # The following tries to make use of includes and libraries in
143 # /usr/local, too. Notice: A -I/usr/local/include might break
144 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
145 # especially on systems which link /usr/local to /usr, so it has yet
146 # to be seen how useful this is.
147 if test -d /usr/local/lib; then
148 LDFLAGS="$LDFLAGS -L/usr/local/lib"
150 if test -d /usr/local/include; then
151 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
152 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
155 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
156 # if the user has a special prefix (like /opt), there might also be $prefix/lib
157 # and $prefix/include, which should be included in our search paths for libraries
159 LDFLAGS="$LDFLAGS -L${libdir}"
160 CPPFLAGS="$CPPFLAGS -I${includedir}"
161 # TODO- test whether gcc still works after this
165 #LDFLAGS "-L/sw/lib" ; CPPFLAGS "-I/sw/include -I/sw/include/lame"
168 # this must be done after (I believe) AC_PROG_MAKE_SET
169 if test "x$DEBUG" '!=' "x";then
170 STRIP="@echo debug enabled, not stripping "
175 dnl Checks for libraries.
176 AC_CHECK_LIB(m, sin,,
177 echo "Error: Math library not found.";
180 AC_CHECK_LIB(z, deflate,, ZLIBMISSING=true)
181 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true)
182 AC_CHECK_LIB(t1, T1_LoadFont,, T1LIBMISSING=true)
183 AC_CHECK_LIB(ungif, DGifOpen,, UNGIFMISSING=true)
186 AC_SUBST(WORDS_BIGENDIAN)
187 RFX_CHECK_SYSTEM_BACKTICKS
188 AC_SUBST(SYSTEM_BACKTICKS)
192 dnl Checks for header files.
193 AC_CONFIG_HEADER(config.h)
196 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)
198 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
199 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
203 AC_SUBST(HAVE_UNISTD_H)
206 dnl Checks for typedefs, structures, and compiler characteristics.
212 AC_CHECK_TYPE(boolean,int) #needed for jpeglib
213 dnl AC_CHECK_TYPE(bool,char)
214 dnl AC_CHECK_TYPE(uchar,unsigned char)
215 dnl AC_CHECK_TYPE(schar,signed char)
216 dnl AC_CHECK_TYPE(word,unsigned short int)
217 dnl AC_CHECK_TYPE(sword,unsigned short int)
218 dnl AC_CHECK_TYPE(uint,unsigned long int)
220 dnl Checks for library functions.
221 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
223 # ------------------------------------------------------------------
229 # ------------------------------------------------------------------
233 if test "x${DISABLE_LAME}" = "xtrue"; then
234 echo "*" Disabling lame support...
236 # old lame code at lib/lame
237 if test -f lib/lame/Makefile.in; then
238 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)"
239 lame_makefile="lib/lame/Makefile"
240 CPPFLAGS="$CPPFLAGS -Ilame"
241 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
243 if test -d /usr/include/lame; then
244 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
246 if test -d /usr/local/include/lame; then
247 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
250 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
251 AC_CHECK_HEADERS(lame.h)
252 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
253 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
257 AC_SUBST(lame_objects)
259 # ------------------------------------------------------------------
262 if test "x${AVIFILE}" = "xtrue"; then
263 VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS"
264 VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS"
265 AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1)
268 if test "x${WIN32}" != "x"; then
269 #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true)
270 #if test "x${AVIFIL32}" != "x"; then
271 # VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
273 VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
278 AC_SUBST(VIDEO_CFLAGS)
279 # ------------------------------------------------------------------
281 if test "x${UNCOMPRESS}" = "xgzip"; then
282 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
286 # ------------------------------------------------------------------
290 if test "x$PYTHON_OK" '!=' "xyes";then
291 echo all install uninstall clean: > lib/python/Makefile
292 # fail silently- the most users won't have any need for the
293 # python interface anyway
295 pythonrfxswf="lib/python/Makefile"
298 # ------------------------------------------------------------------
300 AC_MSG_CHECKING([for missing libraries])
302 if test "x$ZLIBMISSING" = "xtrue";then
303 MISSINGLIBS="${MISSINGLIBS} zlib"
307 if test "x$JPEGLIBMISSING" = "xtrue";then
308 MISSINGLIBS="${MISSINGLIBS} jpeglib"
313 if test "x$T1LIBMISSING" = "xtrue";then
314 MISSINGLIBS="${MISSINGLIBS} t1lib"
316 if test "x$UNGIFMISSING" = "xtrue";then
318 MISSINGLIBS="${MISSINGLIBS} ungif"
322 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
324 DISABLEJPEG2SWF=true;
325 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
328 if test "x$HAVE_FREETYPE" '!=' "x1"; then
330 MISSINGLIBS="${MISSINGLIBS} freetype"
333 if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
334 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
336 if test "x${ac_cv_header_gif_lib_h}" '!=' "xyes"; then
338 MISSINGLIBS="${MISSINGLIBS} gif_lib.h"
341 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
343 MISSINGLIBS="${MISSINGLIBS} zlib.h"
346 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
347 MISSINGLIBS="${MISSINGLIBS} avifile"
351 AC_MSG_RESULT(${MISSINGLIBS})
353 # ------------------------------------------------------------------
355 if test "x${MISSINGLIBS}" '!=' "x"; then
356 echo "***************************************************"
357 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
360 avi2swf="avi2swf/Makefile"
361 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
362 echo "* Disabling avi2swf tool..."
363 echo all install uninstall clean: > avi2swf/Makefile
367 pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile"
368 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
369 echo "* Disabling pdf2swf tool..."
370 rm -f pdf2swf/Makefile
371 echo all install uninstall clean: > pdf2swf/Makefile
375 if test "x${ZLIBMISSING}" = "xtrue"; then
377 echo "* Warning! Without zlib, you will not be able to read"
378 echo "* or write compressed Flash MX files!"
381 JPEG2SWF='jpeg2swf$(E)'
382 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
383 echo "* Disabling jpeg2swf tool..."
389 GIF2SWF='gif2swf$(E)'
390 if test "x${DISABLEGIF2SWF}" = "xtrue"; then
391 echo "* Disabling gif2swf tool..."
397 PNG2SWF='png2swf$(E)'
398 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
399 echo "* Disabling png2swf tool..."
405 if test "x${MISSINGLIBS}" '!=' "x"; then
406 if test "x${PARTIAL}" '=' "x"; then
407 echo "* (never mind)"
409 echo "***************************************************"
412 # ------------------------------------------------------------------
414 if test -f "release.in"; then release_in="./release"; fi
415 FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile} lib/art/Makefile"
421 dnl AC_CONFIG_FILES([${FILES}])
425 # On development trees, create snapshots of config.status
427 if test -f snapshot -a "x$CHECKMEM" = "x" -a "x$PROFILING" = "x";then
428 if test "x${MINGW}" = "xyes"; then
429 echo cp config.status config.status.win32
430 cp config.status config.status.win32
432 if test "x$DEBUG" '=' "x" -a "x$OPTIMIZE" '=' "x";then
433 echo cp config.status config.status.linux
434 cp config.status config.status.linux
436 if test "x$DEBUG" '!=' "x" -a "x$OPTIMIZE" '=' "x";then
437 echo cp config.status config.status.debug
438 cp config.status config.status.debug
440 if test "x$DEBUG" = "x" -a "x$OPTIMIZE" '!=' "x"; then
441 echo cp config.status config.status.optimize
442 cp config.status config.status.optimize