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-23-2234
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$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)
177 AC_SUBST(WORDS_BIGENDIAN)
178 RFX_CHECK_SYSTEM_BACKTICKS
179 AC_SUBST(SYSTEM_BACKTICKS)
183 dnl Checks for header files.
184 AC_CONFIG_HEADER(config.h)
187 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)
189 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
190 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
194 AC_SUBST(HAVE_UNISTD_H)
197 dnl Checks for typedefs, structures, and compiler characteristics.
203 AC_CHECK_TYPE(boolean,int) #needed for jpeglib
204 dnl AC_CHECK_TYPE(bool,char)
205 dnl AC_CHECK_TYPE(uchar,unsigned char)
206 dnl AC_CHECK_TYPE(schar,signed char)
207 dnl AC_CHECK_TYPE(word,unsigned short int)
208 dnl AC_CHECK_TYPE(sword,unsigned short int)
209 dnl AC_CHECK_TYPE(uint,unsigned long int)
211 dnl Checks for library functions.
212 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
214 # ------------------------------------------------------------------
220 # ------------------------------------------------------------------
224 if test "x${DISABLE_LAME}" = "xtrue"; then
225 echo "*" Disabling lame support...
227 # old lame code at lib/lame
228 if test -f lib/lame/Makefile.in; then
229 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)"
230 lame_makefile="lib/lame/Makefile"
231 CPPFLAGS="$CPPFLAGS -Ilame"
232 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
234 if test -d /usr/include/lame; then
235 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
237 if test -d /usr/local/include/lame; then
238 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
241 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
242 AC_CHECK_HEADERS(lame.h)
243 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
244 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
248 AC_SUBST(lame_objects)
250 # ------------------------------------------------------------------
253 if test "x${AVIFILE}" = "xtrue"; then
254 VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS"
255 VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS"
256 AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1)
259 if test "x${WIN32}" != "x"; then
260 #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true)
261 #if test "x${AVIFIL32}" != "x"; then
262 # VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
264 VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
269 AC_SUBST(VIDEO_CFLAGS)
270 # ------------------------------------------------------------------
272 if test "x${UNCOMPRESS}" = "xgzip"; then
273 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
277 # ------------------------------------------------------------------
281 if test "x$PYTHON_OK" '!=' "xyes";then
282 echo all install uninstall clean: > lib/python/Makefile
283 # fail silently- the most users won't have any need for the
284 # python interface anyway
286 pythonrfxswf="lib/python/Makefile"
289 # ------------------------------------------------------------------
291 AC_MSG_CHECKING([for missing libraries])
293 if test "x$ZLIBMISSING" = "xtrue";then
294 MISSINGLIBS="${MISSINGLIBS} zlib"
298 if test "x$JPEGLIBMISSING" = "xtrue";then
299 MISSINGLIBS="${MISSINGLIBS} jpeglib"
304 if test "x$T1LIBMISSING" = "xtrue";then
305 MISSINGLIBS="${MISSINGLIBS} t1lib"
308 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
310 DISABLEJPEG2SWF=true;
311 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
314 if test "x$HAVE_FREETYPE" '!=' "x1"; then
316 MISSINGLIBS="${MISSINGLIBS} freetype"
319 if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
320 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
322 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
324 MISSINGLIBS="${MISSINGLIBS} zlib.h"
327 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
328 MISSINGLIBS="${MISSINGLIBS} avifile"
332 AC_MSG_RESULT(${MISSINGLIBS})
334 # ------------------------------------------------------------------
336 if test "x${MISSINGLIBS}" '!=' "x"; then
337 echo "***************************************************"
338 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
341 avi2swf="avi2swf/Makefile"
342 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
343 echo "* Disabling avi2swf tool..."
344 echo all install uninstall clean: > avi2swf/Makefile
348 pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile"
349 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
350 echo "* Disabling pdf2swf tool..."
351 rm -f pdf2swf/Makefile
352 echo all install uninstall clean: > pdf2swf/Makefile
356 if test "x${ZLIBMISSING}" = "xtrue"; then
358 echo "* Warning! Without zlib, you will not be able to read"
359 echo "* or write compressed Flash MX files!"
362 JPEG2SWF='jpeg2swf$(E)'
363 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
364 echo "* Disabling jpeg2swf tool..."
370 PNG2SWF='png2swf$(E)'
371 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
372 echo "* Disabling png2swf tool..."
378 if test "x${MISSINGLIBS}" '!=' "x"; then
379 if test "x${PARTIAL}" '=' "x"; then
380 echo "* (never mind)"
382 echo "***************************************************"
385 # ------------------------------------------------------------------
387 if test -f "release.in"; then release_in="./release"; fi
388 FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
390 dnl AC_OUTPUT(${FILES}) old autoconf
391 AC_CONFIG_FILES([${FILES}])