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)
205 avi2swf="avi2swf/Makefile"
206 if test "x${AVIFILE}" != "xtrue"; then
207 echo "* Couldn't compile the avifile test program."
208 echo "* Disabling avi2swf tool..."
209 echo all install uninstall clean: > avi2swf/Makefile
213 if test "x${DISABLE_LAME}" = "xtrue"; then
214 echo "*" Disabling lame support...
217 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
218 lame_objects='$(lame_objects_2)'
220 AC_SUBST(lame_objects)
222 if test "x${UNCOMPRESS}" = "xgzip"; then
223 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
227 JPEG2SWF='jpeg2swf$(E)'
229 PNG2SWF='png2swf$(E)'
232 # ------------------------------------------------------------------
234 AC_MSG_CHECKING([for Python.h and PIL])
235 # should we support python versions below 2.2?
236 if test -f "/usr/lib/python2.2/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.2/Python.h";then
239 if test -f "/usr/lib/python2.3/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.3/Python.h";then
242 if test -f "/usr/lib/python2.4/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.4/Python.h";then
246 if test "x$PY_VERSION" "!=" "x"; then
247 pythonrfxswf="lib/python/Makefile"
248 if test "x$PYTHON_LIB" = "x";then
249 PYTHON_LIB="-lpython$PY_VERSION /usr/lib/python$PY_VERSION/site-packages/PIL/_imaging.so"
251 if test "x$PYTHON_INCLUDES" = "x";then
252 PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION"
254 export PYTHON_INCLUDES PYTHON_LIB
256 AC_SUBST(PYTHON_INCLUDES)
259 echo all install uninstall clean: > lib/python/Makefile
261 echo "* No usable python installation found"
262 echo "* Not compiling the python interface"
265 # ------------------------------------------------------------------
267 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
268 echo "***************************************************"
269 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
270 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
271 echo "Disabling pdf2swf tool..."
272 rm -f pdf2swf/Makefile
273 echo all install uninstall clean: > pdf2swf/Makefile
275 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
276 echo "Disabling jpeg2swf tool..."
280 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
281 echo "Disabling png2swf tool..."
285 if test "x${ZLIBMISSING}" = "xtrue"; then
287 echo "Warning! Without zlib, you will not be able to read"
288 echo "or write compressed Flash MX files!"
290 echo "***************************************************"
291 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile ${pythonrfxswf}"
293 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile swfs/Makefile ${pythonrfxswf}"
298 dnl AC_OUTPUT(${FILES}) old autoconf
299 AC_CONFIG_FILES([${FILES}])
302 if test "x${srcdir}" != "x."; then
303 echo "Warning: --srcdir is not supported"