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
91 AC_DEFINE_UNQUOTED(O_BINARY, 0)
97 # The following tries to make use of includes and libraries in
98 # /usr/local, too. Notice: A -I/usr/local/include might break
99 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
100 # especially on systems which link /usr/local to /usr, so it has yet
101 # to be seen how useful this is.
102 if test -d /usr/local/lib; then
103 LDFLAGS="$LDFLAGS -L/usr/local/lib"
105 if test -d /usr/local/include; then
106 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
107 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
110 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
111 # if the user has a special prefix (like /opt), there might also be $prefix/lib
112 # and $prefix/include, which should be included in our search paths for libraries
114 LDFLAGS="$LDFLAGS -L${libdir}"
115 CPPFLAGS="$CPPFLAGS -I${includedir}"
116 # TODO- test whether gcc still works after this
119 # this must be done after (I believe) AC_PROG_MAKE_SET
120 if test "x$DEBUG" '!=' "x";then
121 STRIP="@echo debug enabled, not stripping "
126 dnl Checks for libraries.
127 AC_CHECK_LIB(m, sin,,
128 echo "Error: Math library not found.";
131 AC_CHECK_LIB(z, deflate,,
133 MISSINGLIBS="${MISSINGLIBS} zlib"
136 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
138 DISABLEJPEG2SWF=true;
139 MISSINGLIBS="${MISSINGLIBS} jpeglib"
141 AC_CHECK_LIB(t1, T1_LoadFont,,
143 MISSINGLIBS="${MISSINGLIBS} t1lib"
149 AC_SUBST(WORDS_BIGENDIAN)
150 RFX_CHECK_SYSTEM_BACKTICKS
151 AC_SUBST(SYSTEM_BACKTICKS)
155 dnl Checks for header files.
156 AC_CONFIG_HEADER(config.h)
159 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)
161 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
163 DISABLEJPEG2SWF=true;
164 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
166 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
168 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
170 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
172 MISSINGLIBS="${MISSINGLIBS} zlib.h"
176 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
177 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
181 AC_SUBST(HAVE_UNISTD_H)
184 dnl Checks for typedefs, structures, and compiler characteristics.
190 AC_CHECK_TYPE(boolean,int)
191 AC_CHECK_TYPE(bool,char)
192 dnl AC_CHECK_TYPE(uchar,unsigned char)
193 dnl AC_CHECK_TYPE(schar,signed char)
194 dnl AC_CHECK_TYPE(word,unsigned short int)
195 dnl AC_CHECK_TYPE(sword,unsigned short int)
196 dnl AC_CHECK_TYPE(uint,unsigned long int)
198 dnl Checks for library functions.
199 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
202 avi2swf="avi2swf/Makefile"
203 if test "x${AVIFILE}" != "xtrue"; then
204 echo "* Couldn't compile the avifile test program."
205 echo "* Disabling avi2swf tool..."
206 echo all install uninstall clean: > avi2swf/Makefile
210 if test "x${DISABLE_LAME}" = "xtrue"; then
211 echo "*" Disabling lame support...
214 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
215 lame_objects='$(lame_objects_2)'
217 AC_SUBST(lame_objects)
219 if test "x${UNCOMPRESS}" = "xgzip"; then
220 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
224 JPEG2SWF='jpeg2swf$(E)'
226 PNG2SWF='png2swf$(E)'
229 # ------------------------------------------------------------------
231 AC_MSG_CHECKING([for Python.h and PIL])
232 # should we support python versions below 2.2?
233 if test -f "/usr/lib/python2.2/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.2/Python.h";then
236 if test -f "/usr/lib/python2.3/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.3/Python.h";then
239 if test -f "/usr/lib/python2.4/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.4/Python.h";then
243 if test "x$PY_VERSION" "!=" "x"; then
244 pythonrfxswf="lib/python/Makefile"
245 if test "x$PYTHON_LIB" = "x";then
246 PYTHON_LIB="-lpython$PY_VERSION /usr/lib/python$PY_VERSION/site-packages/PIL/_imaging.so"
248 if test "x$PYTHON_INCLUDES" = "x";then
249 PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION"
251 export PYTHON_INCLUDES PYTHON_LIB
253 AC_SUBST(PYTHON_INCLUDES)
256 echo all install uninstall clean: > lib/python/Makefile
257 echo "* No usable python installation found"
258 echo "* Not compiling the python interface"
262 # ------------------------------------------------------------------
264 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
265 echo "***************************************************"
266 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
267 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
268 echo "Disabling pdf2swf tool..."
269 rm -f pdf2swf/Makefile
270 echo all install uninstall clean: > pdf2swf/Makefile
272 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
273 echo "Disabling jpeg2swf tool..."
277 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
278 echo "Disabling png2swf tool..."
282 if test "x${ZLIBMISSING}" = "xtrue"; then
284 echo "Warning! Without zlib, you will not be able to read"
285 echo "or write compressed Flash MX files!"
287 echo "***************************************************"
288 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile ${pythonrfxswf}"
290 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}"
295 dnl AC_OUTPUT(${FILES}) old autoconf
296 AC_CONFIG_FILES([${FILES}])
299 if test "x${srcdir}" != "x."; then
300 echo "Warning: --srcdir is not supported"