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-13-2026
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
111 if test "x$EXEEXT" = "x.exe";then
119 if test "x${MINGW}" != "xyes"; then
121 AC_DEFINE_UNQUOTED(O_BINARY, 0)
129 # The following tries to make use of includes and libraries in
130 # /usr/local, too. Notice: A -I/usr/local/include might break
131 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
132 # especially on systems which link /usr/local to /usr, so it has yet
133 # to be seen how useful this is.
134 if test -d /usr/local/lib; then
135 LDFLAGS="$LDFLAGS -L/usr/local/lib"
137 if test -d /usr/local/include; then
138 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
139 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
142 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
143 # if the user has a special prefix (like /opt), there might also be $prefix/lib
144 # and $prefix/include, which should be included in our search paths for libraries
146 LDFLAGS="$LDFLAGS -L${libdir}"
147 CPPFLAGS="$CPPFLAGS -I${includedir}"
148 # TODO- test whether gcc still works after this
151 # this must be done after (I believe) AC_PROG_MAKE_SET
152 if test "x$DEBUG" '!=' "x";then
153 STRIP="@echo debug enabled, not stripping "
158 dnl Checks for libraries.
159 AC_CHECK_LIB(m, sin,,
160 echo "Error: Math library not found.";
163 AC_CHECK_LIB(z, deflate,, ZLIBMISSING=true)
164 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true)
165 AC_CHECK_LIB(t1, T1_LoadFont,, T1LIBMISSING=true)
168 AC_SUBST(WORDS_BIGENDIAN)
169 RFX_CHECK_SYSTEM_BACKTICKS
170 AC_SUBST(SYSTEM_BACKTICKS)
174 dnl Checks for header files.
175 AC_CONFIG_HEADER(config.h)
178 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)
180 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
181 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
185 AC_SUBST(HAVE_UNISTD_H)
188 dnl Checks for typedefs, structures, and compiler characteristics.
194 AC_CHECK_TYPE(boolean,int) #needed for jpeglib
195 dnl AC_CHECK_TYPE(bool,char)
196 dnl AC_CHECK_TYPE(uchar,unsigned char)
197 dnl AC_CHECK_TYPE(schar,signed char)
198 dnl AC_CHECK_TYPE(word,unsigned short int)
199 dnl AC_CHECK_TYPE(sword,unsigned short int)
200 dnl AC_CHECK_TYPE(uint,unsigned long int)
202 dnl Checks for library functions.
203 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
205 # ------------------------------------------------------------------
211 # ------------------------------------------------------------------
215 if test "x${DISABLE_LAME}" = "xtrue"; then
216 echo "*" Disabling lame support...
218 # old lame code at lib/lame
219 if test -f lib/lame/Makefile.in; then
220 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)"
221 lame_makefile="lib/lame/Makefile"
222 CPPFLAGS="$CPPFLAGS -Ilame"
223 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
225 if test -d /usr/include/lame; then
226 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
228 if test -d /usr/local/include/lame; then
229 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
232 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
233 AC_CHECK_HEADERS(lame.h)
234 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
235 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
239 AC_SUBST(lame_objects)
241 # ------------------------------------------------------------------
244 if test "x${AVIFILE}" = "xtrue"; then
245 VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS"
246 VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS"
247 AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1)
250 if test "x${WIN32}" != "x"; then
251 #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true)
252 #if test "x${AVIFIL32}" != "x"; then
253 # VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
255 VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
260 AC_SUBST(VIDEO_CFLAGS)
261 # ------------------------------------------------------------------
263 if test "x${UNCOMPRESS}" = "xgzip"; then
264 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
268 # ------------------------------------------------------------------
272 if test "x$PYTHON_OK" '!=' "xyes";then
273 echo all install uninstall clean: > lib/python/Makefile
274 # fail silently- the most users won't have any need for the
275 # python interface anyway
277 pythonrfxswf="lib/python/Makefile"
280 # ------------------------------------------------------------------
282 AC_MSG_CHECKING([for missing libraries])
284 if test "x$ZLIBMISSING" = "xtrue";then
285 MISSINGLIBS="${MISSINGLIBS} zlib"
289 if test "x$JPEGLIBMISSING" = "xtrue";then
290 MISSINGLIBS="${MISSINGLIBS} jpeglib"
295 if test "x$T1LIBMISSING" = "xtrue";then
296 MISSINGLIBS="${MISSINGLIBS} t1lib"
299 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
301 DISABLEJPEG2SWF=true;
302 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
305 if test "x$HAVE_FREETYPE" '!=' "x1"; then
307 MISSINGLIBS="${MISSINGLIBS} freetype"
310 if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
311 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
313 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
315 MISSINGLIBS="${MISSINGLIBS} zlib.h"
318 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
319 MISSINGLIBS="${MISSINGLIBS} avifile"
323 AC_MSG_RESULT(${MISSINGLIBS})
325 # ------------------------------------------------------------------
327 if test "x${MISSINGLIBS}" '!=' "x"; then
328 echo "***************************************************"
329 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
332 avi2swf="avi2swf/Makefile"
333 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
334 echo "* Disabling avi2swf tool..."
335 echo all install uninstall clean: > avi2swf/Makefile
339 pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile"
340 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
341 echo "* Disabling pdf2swf tool..."
342 rm -f pdf2swf/Makefile
343 echo all install uninstall clean: > pdf2swf/Makefile
347 if test "x${ZLIBMISSING}" = "xtrue"; then
349 echo "* Warning! Without zlib, you will not be able to read"
350 echo "* or write compressed Flash MX files!"
353 JPEG2SWF='jpeg2swf$(E)'
354 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
355 echo "* Disabling jpeg2swf tool..."
361 PNG2SWF='png2swf$(E)'
362 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
363 echo "* Disabling png2swf tool..."
369 if test "x${MISSINGLIBS}" '!=' "x"; then
370 if test "x${PARTIAL}" '=' "x"; then
371 echo "* (never mind)"
373 echo "***************************************************"
376 # ------------------------------------------------------------------
378 if test -f "release.in"; then release_in="./release"; fi
379 FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
381 dnl AC_OUTPUT(${FILES}) old autoconf
382 AC_CONFIG_FILES([${FILES}])