1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_SRCDIR([src/])
5 AC_ARG_ENABLE(checkmem,
6 [ --enable-checkmem turn on ccmalloc debugging], CHECKMEM=true)
8 [ --enable-debug turn on debugging], DEBUG=true)
9 AC_ARG_ENABLE(warnings,
10 [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true)
11 AC_ARG_ENABLE(optimizations,
12 [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true)
14 [ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true)
20 WARNINGS="-Wparentheses -Wimplicit -Wreturn-type"
21 if test "x$ENABLE_WARNINGS" '!=' "x";then
22 WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls"
25 if test "x$CHECKMEM" '!=' "x";then
28 if test "x$DEBUG" '!=' "x";then
29 CFLAGS="$WARNINGS -g $CFLAGS"
30 CXXFLAGS="$WARNINGS -g $CXXFLAGS"
31 else if test "x$OPTIMIZE" '!=' "x"; then
32 CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS"
33 CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS"
35 CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS"
36 CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS"
40 #if test "x$OLDGCC" '!=' "x";then
41 # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic"
42 # #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic"
43 # CFLAGS="$CFLAGS -ansi -pendantic"
44 # CXXFLAGS="$CXXFLAGS -ansi -pendantic"
47 export PACKAGE VERSION CFLAGS CXXFLAGS
49 dnl Checks for programs.
55 CFLAGS="$CFLAGS -fno-rtti"
56 CXXFLAGS="$CXXFLAGS -fno-rtti"
59 dnl Checks for programs.
63 if test "x$CHECKMEM" '!=' "x";then
79 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
81 dnl Checks for system services
86 if test "x${MINGW}" != "xyes"; then
87 AC_DEFINE_UNQUOTED(O_BINARY, 0)
89 # The following tries to make use of includes and libraries in
90 # /usr/local, too. Notice: A -I/usr/local/include might break
91 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
92 # especially on systems which link /usr/local to /usr, so it has yet
93 # to be seen how useful this is.
94 if test -d /usr/local/lib; then
95 LDFLAGS="$LDFLAGS -L/usr/local/lib"
97 if test -d /usr/local/include; then
98 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
99 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
102 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
103 # if the user has a special prefix (like /opt), there might also be $prefix/lib
104 # and $prefix/include, which should be included in our search paths for libraries
106 LDFLAGS="$LDFLAGS -L${libdir}"
107 CPPFLAGS="$CPPFLAGS -I${includedir}"
108 # TODO- test whether gcc still works after this
111 # this must be done after (I believe) AC_PROG_MAKE_SET
112 if test "x$DEBUG" '!=' "x";then
113 STRIP="@echo debug enabled, not stripping "
118 dnl Checks for libraries.
119 AC_CHECK_LIB(m, sin,,
120 echo "Error: Math library not found.";
123 AC_CHECK_LIB(z, deflate,,
125 MISSINGLIBS="${MISSINGLIBS} zlib"
128 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
130 DISABLEJPEG2SWF=true;
131 MISSINGLIBS="${MISSINGLIBS} jpeglib"
133 AC_CHECK_LIB(t1, T1_LoadFont,,
135 MISSINGLIBS="${MISSINGLIBS} t1lib"
141 AC_SUBST(WORDS_BIGENDIAN)
142 RFX_CHECK_SYSTEM_BACKTICKS
143 AC_SUBST(SYSTEM_BACKTICKS)
147 dnl Checks for header files.
148 AC_CONFIG_HEADER(config.h)
151 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)
153 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
155 DISABLEJPEG2SWF=true;
156 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
158 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
160 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
162 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
164 MISSINGLIBS="${MISSINGLIBS} zlib.h"
168 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
169 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
173 AC_SUBST(HAVE_UNISTD_H)
176 dnl Checks for typedefs, structures, and compiler characteristics.
182 AC_CHECK_TYPE(boolean,int)
183 AC_CHECK_TYPE(bool,char)
184 dnl AC_CHECK_TYPE(uchar,unsigned char)
185 dnl AC_CHECK_TYPE(schar,signed char)
186 dnl AC_CHECK_TYPE(word,unsigned short int)
187 dnl AC_CHECK_TYPE(sword,unsigned short int)
188 dnl AC_CHECK_TYPE(uint,unsigned long int)
190 dnl Checks for library functions.
191 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
194 avi2swf="avi2swf/Makefile"
195 if test "x${AVIFILE}" != "xtrue"; then
196 echo "* Couldn't compile the avifile test program."
197 echo "* Disabling avi2swf tool..."
198 echo all install uninstall clean: > avi2swf/Makefile
202 if test "x${DISABLE_LAME}" = "xtrue"; then
203 echo "*" Disabling lame support...
206 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
207 lame_objects='$(lame_objects_2)'
209 AC_SUBST(lame_objects)
211 if test "x${UNCOMPRESS}" = "xgzip"; then
212 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
216 JPEG2SWF='jpeg2swf$(E)'
218 PNG2SWF='png2swf$(E)'
221 if test "x" = "x"; then
222 pythonrfxswf="lib/python/Makefile"
224 echo all install uninstall clean: > lib/python/Makefile
227 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
228 echo "***************************************************"
229 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
230 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
231 echo "Disabling pdf2swf tool..."
232 rm -f pdf2swf/Makefile
233 echo all install uninstall clean: > pdf2swf/Makefile
235 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
236 echo "Disabling jpeg2swf tool..."
240 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
241 echo "Disabling png2swf tool..."
245 if test "x${ZLIBMISSING}" = "xtrue"; then
247 echo "Warning! Without zlib, you will not be able to read"
248 echo "or write compressed Flash MX files!"
250 echo "***************************************************"
251 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile ${pythonrfxswf}"
253 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}"
258 AC_CONFIG_FILES([${FILES}])
261 if test "x${srcdir}" != "x."; then
262 echo "Warning: --srcdir is not supported"