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(warnings,
12 [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true)
13 AC_ARG_ENABLE(optimizations,
14 [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true)
16 [ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true)
19 VERSION=2004-05-18-1254
23 WARNINGS="-Wparentheses -Wimplicit -Wreturn-type"
24 if test "x$ENABLE_WARNINGS" '!=' "x";then
25 WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls"
28 if test "x$CHECKMEM" '!=' "x";then
31 if test "x$DEBUG" '!=' "x";then
32 CFLAGS="$WARNINGS -g $CFLAGS"
33 CXXFLAGS="$WARNINGS -g $CXXFLAGS"
34 else if test "x$OPTIMIZE" '!=' "x"; then
35 CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS"
36 CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS"
38 CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS"
39 CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS"
43 #if test "x$OLDGCC" '!=' "x";then
44 # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic"
45 # #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic"
46 # CFLAGS="$CFLAGS -ansi -pendantic"
47 # CXXFLAGS="$CXXFLAGS -ansi -pendantic"
50 export PACKAGE VERSION CFLAGS CXXFLAGS
52 dnl Checks for programs.
58 CFLAGS="$CFLAGS -fno-rtti"
59 CXXFLAGS="$CXXFLAGS -fno-rtti"
62 dnl Checks for programs.
66 if test "x$CHECKMEM" '!=' "x";then
82 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
84 dnl Checks for system services
90 if test "x${MINGW}" != "xyes"; then
92 AC_DEFINE_UNQUOTED(O_BINARY, 0)
100 # The following tries to make use of includes and libraries in
101 # /usr/local, too. Notice: A -I/usr/local/include might break
102 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
103 # especially on systems which link /usr/local to /usr, so it has yet
104 # to be seen how useful this is.
105 if test -d /usr/local/lib; then
106 LDFLAGS="$LDFLAGS -L/usr/local/lib"
108 if test -d /usr/local/include; then
109 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
110 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
113 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
114 # if the user has a special prefix (like /opt), there might also be $prefix/lib
115 # and $prefix/include, which should be included in our search paths for libraries
117 LDFLAGS="$LDFLAGS -L${libdir}"
118 CPPFLAGS="$CPPFLAGS -I${includedir}"
119 # TODO- test whether gcc still works after this
122 # this must be done after (I believe) AC_PROG_MAKE_SET
123 if test "x$DEBUG" '!=' "x";then
124 STRIP="@echo debug enabled, not stripping "
129 dnl Checks for libraries.
130 AC_CHECK_LIB(m, sin,,
131 echo "Error: Math library not found.";
134 AC_CHECK_LIB(z, deflate,,
136 MISSINGLIBS="${MISSINGLIBS} zlib"
139 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
141 DISABLEJPEG2SWF=true;
142 MISSINGLIBS="${MISSINGLIBS} jpeglib"
144 AC_CHECK_LIB(t1, T1_LoadFont,,
146 MISSINGLIBS="${MISSINGLIBS} t1lib"
152 AC_SUBST(WORDS_BIGENDIAN)
153 RFX_CHECK_SYSTEM_BACKTICKS
154 AC_SUBST(SYSTEM_BACKTICKS)
158 dnl Checks for header files.
159 AC_CONFIG_HEADER(config.h)
162 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)
164 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
166 DISABLEJPEG2SWF=true;
167 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
169 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
171 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
173 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
175 MISSINGLIBS="${MISSINGLIBS} zlib.h"
179 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
180 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
184 AC_SUBST(HAVE_UNISTD_H)
187 dnl Checks for typedefs, structures, and compiler characteristics.
193 AC_CHECK_TYPE(boolean,int)
194 AC_CHECK_TYPE(bool,char)
195 dnl AC_CHECK_TYPE(uchar,unsigned char)
196 dnl AC_CHECK_TYPE(schar,signed char)
197 dnl AC_CHECK_TYPE(word,unsigned short int)
198 dnl AC_CHECK_TYPE(sword,unsigned short int)
199 dnl AC_CHECK_TYPE(uint,unsigned long int)
201 dnl Checks for library functions.
202 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
204 # ------------------------------------------------------------------
208 if test "x${DISABLE_LAME}" = "xtrue"; then
209 echo "*" Disabling lame support...
211 # old lame code at lib/lame
212 if test -f lib/lame/Makefile.in; then
213 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"
214 lame_makefile="lib/lame/Makefile"
215 CPPFLAGS="$CPPFLAGS -Ilame"
216 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
218 if test -d /usr/include/lame; then
219 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
221 if test -d /usr/local/include/lame; then
222 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
225 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
226 AC_CHECK_HEADERS(lame.h)
227 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
228 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
232 AC_SUBST(lame_objects)
234 # ------------------------------------------------------------------
238 avi2swf="avi2swf/Makefile"
239 if test "x${AVIFILE}" != "xtrue"; then
240 echo "* Couldn't compile the avifile test program."
241 echo "* Disabling avi2swf tool..."
242 echo all install uninstall clean: > avi2swf/Makefile
246 # ------------------------------------------------------------------
248 if test "x${UNCOMPRESS}" = "xgzip"; then
249 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
253 # ------------------------------------------------------------------
257 if test "x$PYTHON_OK" '!=' "xyes";then
258 echo all install uninstall clean: > lib/python/Makefile
259 echo "* No usable python installation found"
260 echo "* Not compiling the python interface"
263 # ------------------------------------------------------------------
265 JPEG2SWF='jpeg2swf$(E)'
267 PNG2SWF='png2swf$(E)'
270 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
271 echo "***************************************************"
272 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
273 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
274 echo "Disabling pdf2swf tool..."
275 rm -f pdf2swf/Makefile
276 echo all install uninstall clean: > pdf2swf/Makefile
278 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
279 echo "Disabling jpeg2swf tool..."
283 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
284 echo "Disabling png2swf tool..."
288 if test "x${ZLIBMISSING}" = "xtrue"; then
290 echo "Warning! Without zlib, you will not be able to read"
291 echo "or write compressed Flash MX files!"
293 echo "***************************************************"
294 FILES="./release Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
296 FILES="./release Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
301 dnl AC_OUTPUT(${FILES}) old autoconf
302 AC_CONFIG_FILES([${FILES}])
305 if test "x${srcdir}" != "x."; then
306 echo "Warning: --srcdir is not supported"