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)
21 VERSION=2004-11-03-1856
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 -g $CFLAGS"
45 CXXFLAGS="$WARNINGS -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${MINGW}" != "xyes"; then
116 AC_DEFINE_UNQUOTED(O_BINARY, 0)
124 # The following tries to make use of includes and libraries in
125 # /usr/local, too. Notice: A -I/usr/local/include might break
126 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
127 # especially on systems which link /usr/local to /usr, so it has yet
128 # to be seen how useful this is.
129 if test -d /usr/local/lib; then
130 LDFLAGS="$LDFLAGS -L/usr/local/lib"
132 if test -d /usr/local/include; then
133 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
134 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
137 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
138 # if the user has a special prefix (like /opt), there might also be $prefix/lib
139 # and $prefix/include, which should be included in our search paths for libraries
141 LDFLAGS="$LDFLAGS -L${libdir}"
142 CPPFLAGS="$CPPFLAGS -I${includedir}"
143 # TODO- test whether gcc still works after this
146 # this must be done after (I believe) AC_PROG_MAKE_SET
147 if test "x$DEBUG" '!=' "x";then
148 STRIP="@echo debug enabled, not stripping "
153 dnl Checks for libraries.
154 AC_CHECK_LIB(m, sin,,
155 echo "Error: Math library not found.";
158 AC_CHECK_LIB(z, deflate,, ZLIBMISSING=true)
159 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true)
160 AC_CHECK_LIB(t1, T1_LoadFont,, T1LIBMISSING=true)
163 AC_SUBST(WORDS_BIGENDIAN)
164 RFX_CHECK_SYSTEM_BACKTICKS
165 AC_SUBST(SYSTEM_BACKTICKS)
169 dnl Checks for header files.
170 AC_CONFIG_HEADER(config.h)
173 AC_CHECK_HEADERS(zlib.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)
175 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
176 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
180 AC_SUBST(HAVE_UNISTD_H)
183 dnl Checks for typedefs, structures, and compiler characteristics.
189 AC_CHECK_TYPE(boolean,int) #needed for jpeglib
190 dnl AC_CHECK_TYPE(bool,char)
191 dnl AC_CHECK_TYPE(uchar,unsigned char)
192 dnl AC_CHECK_TYPE(schar,signed char)
193 dnl AC_CHECK_TYPE(word,unsigned short int)
194 dnl AC_CHECK_TYPE(sword,unsigned short int)
195 dnl AC_CHECK_TYPE(uint,unsigned long int)
197 dnl Checks for library functions.
198 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
200 # ------------------------------------------------------------------
206 # ------------------------------------------------------------------
210 if test "x${DISABLE_LAME}" = "xtrue"; then
211 echo "*" Disabling lame support...
213 # old lame code at lib/lame
214 if test -f lib/lame/Makefile.in; then
215 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"
216 lame_makefile="lib/lame/Makefile"
217 CPPFLAGS="$CPPFLAGS -Ilame"
218 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
220 if test -d /usr/include/lame; then
221 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
223 if test -d /usr/local/include/lame; then
224 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
227 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
228 AC_CHECK_HEADERS(lame.h)
229 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
230 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
234 AC_SUBST(lame_objects)
236 # ------------------------------------------------------------------
239 if test "x${AVIFILE}" = "xtrue"; then
240 VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS"
241 VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS"
242 AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1)
245 if test "x${WIN32}" != "x"; then
246 #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true)
247 #if test "x${AVIFIL32}" != "x"; then
248 # VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
250 VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
255 AC_SUBST(VIDEO_CFLAGS)
256 # ------------------------------------------------------------------
258 if test "x${UNCOMPRESS}" = "xgzip"; then
259 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
263 # ------------------------------------------------------------------
267 if test "x$PYTHON_OK" '!=' "xyes";then
268 echo all install uninstall clean: > lib/python/Makefile
269 # fail silently- the most users won't have any need for the
270 # python interface anyway
272 pythonrfxswf="lib/python/Makefile"
275 # ------------------------------------------------------------------
277 AC_MSG_CHECKING([for missing libraries])
279 if test "x$ZLIBMISSING" = "xtrue";then
280 MISSINGLIBS="${MISSINGLIBS} zlib"
284 if test "x$JPEGLIBMISSING" = "xtrue";then
285 MISSINGLIBS="${MISSINGLIBS} jpeglib"
290 if test "x$T1LIBMISSING" = "xtrue";then
291 MISSINGLIBS="${MISSINGLIBS} t1lib"
294 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
296 DISABLEJPEG2SWF=true;
297 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
300 if test "x$HAVE_FREETYPE" '!=' "x1"; then
302 MISSINGLIBS="${MISSINGLIBS} freetype"
305 if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
306 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
308 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
310 MISSINGLIBS="${MISSINGLIBS} zlib.h"
313 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
314 MISSINGLIBS="${MISSINGLIBS} avifile"
318 AC_MSG_RESULT(${MISSINGLIBS})
320 # ------------------------------------------------------------------
322 if test "x${MISSINGLIBS}" '!=' "x"; then
323 echo "***************************************************"
324 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
327 avi2swf="avi2swf/Makefile"
328 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
329 echo "* Disabling avi2swf tool..."
330 echo all install uninstall clean: > avi2swf/Makefile
334 pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile"
335 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
336 echo "* Disabling pdf2swf tool..."
337 rm -f pdf2swf/Makefile
338 echo all install uninstall clean: > pdf2swf/Makefile
342 if test "x${ZLIBMISSING}" = "xtrue"; then
344 echo "* Warning! Without zlib, you will not be able to read"
345 echo "* or write compressed Flash MX files!"
348 JPEG2SWF='jpeg2swf$(E)'
349 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
350 echo "* Disabling jpeg2swf tool..."
356 PNG2SWF='png2swf$(E)'
357 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
358 echo "* Disabling png2swf tool..."
364 if test "x${MISSINGLIBS}" '!=' "x"; then
365 if test "x${PARTIAL}" '=' "x"; then
366 echo "* (never mind)"
368 echo "***************************************************"
371 # ------------------------------------------------------------------
373 if test -f "release.in"; then release_in="./release"; fi
374 FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
376 dnl AC_OUTPUT(${FILES}) old autoconf
377 AC_CONFIG_FILES([${FILES}])