1 dnl Process this file with autoconf to produce a configure script.
4 AC_ARG_ENABLE(checkmem,
5 [ --enable-checkmem turn on ccmalloc debugging], CHECKMEM=true)
7 [ --enable-debug turn on debugging], DEBUG=true)
8 AC_ARG_ENABLE(optimizations,
9 [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true)
11 [ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true)
21 if test "x$CHECKMEM" '!=' "x";then
24 if test "x$DEBUG" '!=' "x";then
25 CFLAGS="-Wparentheses -Wimplicit -Wreturn-type -g $CFLAGS"
26 CXXFLAGS="-Wparentheses -Wimplicit -Wreturn-type -g $CXXFLAGS"
27 STRIP="@echo debug enabled, not stripping "
30 else if test "x$OPTIMIZE" '!=' "x"; then
31 CFLAGS="-Wparentheses -Wimplicit -Wreturn-type -Winline -O3 -fomit-frame-pointer $CFLAGS"
32 CXXFLAGS="-Wparentheses -Wimplicit -Wreturn-type -Winline -O3 -fomit-frame-pointer $CXXFLAGS"
34 CFLAGS="-Wparentheses -Wimplicit -Wreturn-type -O -fomit-frame-pointer $CFLAGS"
35 CXXFLAGS="-Wparentheses -Wimplicit -Wreturn-type -O -fomit-frame-pointer $CXXFLAGS"
39 #if test "x$OLDGCC" '!=' "x";then
40 # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic"
41 # #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic"
42 # CFLAGS="$CFLAGS -ansi -pendantic"
43 # CXXFLAGS="$CXXFLAGS -ansi -pendantic"
46 export PACKAGE VERSION CFLAGS CXXFLAGS
48 dnl Checks for programs.
54 CFLAGS="$CFLAGS -fno-rtti"
55 CXXFLAGS="$CXXFLAGS -fno-rtti"
58 dnl Checks for programs.
62 if test "x$CHECKMEM" '!=' "x";then
78 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
80 dnl Checks for system services
85 if test "x${MINGW}" != "xyes"; then
86 AC_DEFINE_UNQUOTED(O_BINARY, 0)
88 # The following tries to make use of includes and libraries in
89 # /usr/local, too. Notice: A -I/usr/local/include might break
90 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
91 # especially on systems which link /usr/local to /usr, so it has yet
92 # to be seen how useful this is.
93 if test -d /usr/local/lib; then
94 LDFLAGS="$LDFLAGS -L/usr/local/lib"
96 if test -d /usr/local/include; then
97 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
98 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
101 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
102 # if the user has a special prefix (like /opt), there might also be $prefix/lib
103 # and $prefix/include, which should be included in our search paths for libraries
105 LDFLAGS="$LDFLAGS -L${libdir}"
106 CPPFLAGS="$CPPFLAGS -I${includedir}"
107 # TODO- test whether gcc still works after this
110 dnl Checks for libraries.
111 AC_CHECK_LIB(m, sin,,
112 echo "Error: Math library not found.";
115 AC_CHECK_LIB(z, deflate,,
117 MISSINGLIBS="${MISSINGLIBS} zlib"
120 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
122 DISABLEJPEG2SWF=true;
123 MISSINGLIBS="${MISSINGLIBS} jpeglib"
125 AC_CHECK_LIB(t1, T1_LoadFont,,
127 MISSINGLIBS="${MISSINGLIBS} t1lib"
133 AC_SUBST(WORDS_BIGENDIAN)
134 RFX_CHECK_SYSTEM_BACKTICKS
135 AC_SUBST(SYSTEM_BACKTICKS)
139 dnl Checks for header files.
140 AC_CONFIG_HEADER(config.h)
143 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)
145 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
147 DISABLEJPEG2SWF=true;
148 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
150 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
152 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
154 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
156 MISSINGLIBS="${MISSINGLIBS} zlib.h"
160 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
161 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
165 AC_SUBST(HAVE_UNISTD_H)
168 dnl Checks for typedefs, structures, and compiler characteristics.
174 AC_CHECK_TYPE(boolean,int)
175 AC_CHECK_TYPE(bool,char)
176 dnl AC_CHECK_TYPE(uchar,unsigned char)
177 dnl AC_CHECK_TYPE(schar,signed char)
178 dnl AC_CHECK_TYPE(word,unsigned short int)
179 dnl AC_CHECK_TYPE(sword,unsigned short int)
180 dnl AC_CHECK_TYPE(uint,unsigned long int)
182 dnl Checks for library functions.
183 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero)
186 avi2swf="avi2swf/Makefile"
187 if test "x${AVIFILE}" != "xtrue"; then
188 echo "* Couldn't compile the avifile test program."
189 echo "* Disabling avi2swf tool..."
190 echo all install uninstall clean: > avi2swf/Makefile
194 if test "x${DISABLE_LAME}" == "xtrue"; then
195 echo "*" disabling lame support...
198 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
199 lame_objects='$(lame_objects_2)'
201 AC_SUBST(lame_objects)
203 if test "x${UNCOMPRESS}" = "xgzip"; then
204 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
208 JPEG2SWF='jpeg2swf$(E)'
210 PNG2SWF='png2swf$(E)'
212 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
213 echo "***************************************************"
214 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
215 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
216 echo "Disabling pdf2swf tool..."
217 rm -f pdf2swf/Makefile
218 echo all install uninstall clean: > pdf2swf/Makefile
220 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
221 echo "Disabling jpeg2swf tool..."
225 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
226 echo "Disabling png2swf tool..."
230 if test "x${ZLIBMISSING}" = "xtrue"; then
232 echo "Warning! Without zlib, you will not be able to read"
233 echo "or write compressed Flash MX files!"
235 echo "***************************************************"
236 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile"
238 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"
245 if test "x${srcdir}" != "x."; then
246 echo "Warning: --srcdir is not supported"