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
89 if test "x${MINGW}" != "xyes"; then
90 AC_DEFINE_UNQUOTED(O_BINARY, 0)
92 # The following tries to make use of includes and libraries in
93 # /usr/local, too. Notice: A -I/usr/local/include might break
94 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
95 # especially on systems which link /usr/local to /usr, so it has yet
96 # to be seen how useful this is.
97 if test -d /usr/local/lib; then
98 LDFLAGS="$LDFLAGS -L/usr/local/lib"
100 if test -d /usr/local/include; then
101 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
102 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
105 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
106 # if the user has a special prefix (like /opt), there might also be $prefix/lib
107 # and $prefix/include, which should be included in our search paths for libraries
109 LDFLAGS="$LDFLAGS -L${libdir}"
110 CPPFLAGS="$CPPFLAGS -I${includedir}"
111 # TODO- test whether gcc still works after this
114 # this must be done after (I believe) AC_PROG_MAKE_SET
115 if test "x$DEBUG" '!=' "x";then
116 STRIP="@echo debug enabled, not stripping "
121 dnl Checks for libraries.
122 AC_CHECK_LIB(m, sin,,
123 echo "Error: Math library not found.";
126 AC_CHECK_LIB(z, deflate,,
128 MISSINGLIBS="${MISSINGLIBS} zlib"
131 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
133 DISABLEJPEG2SWF=true;
134 MISSINGLIBS="${MISSINGLIBS} jpeglib"
136 AC_CHECK_LIB(t1, T1_LoadFont,,
138 MISSINGLIBS="${MISSINGLIBS} t1lib"
144 AC_SUBST(WORDS_BIGENDIAN)
145 RFX_CHECK_SYSTEM_BACKTICKS
146 AC_SUBST(SYSTEM_BACKTICKS)
150 dnl Checks for header files.
151 AC_CONFIG_HEADER(config.h)
154 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)
156 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
158 DISABLEJPEG2SWF=true;
159 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
161 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
163 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
165 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
167 MISSINGLIBS="${MISSINGLIBS} zlib.h"
171 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
172 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
176 AC_SUBST(HAVE_UNISTD_H)
179 dnl Checks for typedefs, structures, and compiler characteristics.
185 AC_CHECK_TYPE(boolean,int)
186 AC_CHECK_TYPE(bool,char)
187 dnl AC_CHECK_TYPE(uchar,unsigned char)
188 dnl AC_CHECK_TYPE(schar,signed char)
189 dnl AC_CHECK_TYPE(word,unsigned short int)
190 dnl AC_CHECK_TYPE(sword,unsigned short int)
191 dnl AC_CHECK_TYPE(uint,unsigned long int)
193 dnl Checks for library functions.
194 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
197 avi2swf="avi2swf/Makefile"
198 if test "x${AVIFILE}" != "xtrue"; then
199 echo "* Couldn't compile the avifile test program."
200 echo "* Disabling avi2swf tool..."
201 echo all install uninstall clean: > avi2swf/Makefile
205 if test "x${DISABLE_LAME}" = "xtrue"; then
206 echo "*" Disabling lame support...
209 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
210 lame_objects='$(lame_objects_2)'
212 AC_SUBST(lame_objects)
214 if test "x${UNCOMPRESS}" = "xgzip"; then
215 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
219 JPEG2SWF='jpeg2swf$(E)'
221 PNG2SWF='png2swf$(E)'
224 if test "x" = "x"; then
225 pythonrfxswf="lib/python/Makefile"
227 echo all install uninstall clean: > lib/python/Makefile
230 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
231 echo "***************************************************"
232 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
233 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
234 echo "Disabling pdf2swf tool..."
235 rm -f pdf2swf/Makefile
236 echo all install uninstall clean: > pdf2swf/Makefile
238 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
239 echo "Disabling jpeg2swf tool..."
243 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
244 echo "Disabling png2swf tool..."
248 if test "x${ZLIBMISSING}" = "xtrue"; then
250 echo "Warning! Without zlib, you will not be able to read"
251 echo "or write compressed Flash MX files!"
253 echo "***************************************************"
254 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile ${pythonrfxswf}"
256 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}"
261 dnl AC_OUTPUT(${FILES}) old autoconf
262 AC_CONFIG_FILES([${FILES}])
265 if test "x${srcdir}" != "x."; then
266 echo "Warning: --srcdir is not supported"