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-mp3 don't compile any mp3 code in], NO_MP3=true)
14 VERSION=2004-02-01-1614
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, )
79 AC_CHECK_PROGS(FREETYPE_CONFIG, freetype-config, ) # TODO: use this
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 dnl Checks for libraries.
112 AC_CHECK_LIB(m, sin,,
113 echo "Error: Math library not found.";
116 AC_CHECK_LIB(z, deflate,,
118 MISSINGLIBS="${MISSINGLIBS} zlib"
121 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
123 DISABLEJPEG2SWF=true;
124 MISSINGLIBS="${MISSINGLIBS} jpeglib"
126 AC_CHECK_LIB(t1, T1_LoadFont,,
128 MISSINGLIBS="${MISSINGLIBS} t1lib"
130 AC_CHECK_LIB(freetype, FT_Init_FreeType,
135 AC_SUBST(WORDS_BIGENDIAN)
136 RFX_CHECK_SYSTEM_BACKTICKS
137 AC_SUBST(SYSTEM_BACKTICKS)
141 dnl Checks for header files.
142 AC_CONFIG_HEADER(config.h)
145 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)
147 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
149 DISABLEJPEG2SWF=true;
150 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
152 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
154 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
156 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
158 MISSINGLIBS="${MISSINGLIBS} zlib.h"
162 if test "x$USE_FREETYPE" != "x"; then
163 AC_DEFINE_UNQUOTED(USE_FREETYPE, "$USE_FREETYPE")
165 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
166 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
170 AC_SUBST(HAVE_UNISTD_H)
173 dnl Checks for typedefs, structures, and compiler characteristics.
179 AC_CHECK_TYPE(boolean,int)
180 AC_CHECK_TYPE(bool,char)
181 dnl AC_CHECK_TYPE(uchar,unsigned char)
182 dnl AC_CHECK_TYPE(schar,signed char)
183 dnl AC_CHECK_TYPE(word,unsigned short int)
184 dnl AC_CHECK_TYPE(sword,unsigned short int)
185 dnl AC_CHECK_TYPE(uint,unsigned long int)
187 dnl Checks for library functions.
188 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero)
191 avi2swf="avi2swf/Makefile"
192 if test "x${AVIFILE}" != "xtrue"; then
193 echo "* Couldn't compile the avifile test program."
194 echo "* Disabling avi2swf tool..."
195 echo all install uninstall clean: > avi2swf/Makefile
199 if test "x${NO_MP3}" == "x"; then
200 AC_DEFINE_UNQUOTED(USE_MP3, 1)
203 if test "x${USE_FREETYPE}" == "xtrue"; then
204 if test "x{$FREETYPE_CONFIG}" != "x"; then
205 ftinclude=`freetype-config --cflags`
206 ftlibs=`freetype-config --libs`
207 CXXFLAGS="$CXXFLAGS $ftinclude"
208 CFLAGS="$CFLAGS $ftinclude"
210 else if test -d /usr/include/freetype2; then
211 CXXFLAGS="$CXXFLAGS -I/usr/include/freetype2"
212 CFLAGS="$CFLAGS -I/usr/include/freetype2"
213 LIBS="$LIBS -lfreetype"
214 else if test -d /usr/local/include/freetype2; then
215 CXXFLAGS="$CXXFLAGS -I/usr/local/include/freetype2"
216 CFLAGS="$CFLAGS -I/usr/local/include/freetype2"
217 LIBS="$LIBS -L /usr/local/lib -lfreetype"
223 if test "x${UNCOMPRESS}" = "xgzip"; then
224 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
228 JPEG2SWF='jpeg2swf$(E)'
230 PNG2SWF='png2swf$(E)'
232 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
233 echo "***************************************************"
234 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
235 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
236 echo "Disabling pdf2swf tool..."
237 rm -f pdf2swf/Makefile
238 echo all install uninstall clean: > pdf2swf/Makefile
240 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
241 echo "Disabling jpeg2swf tool..."
245 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
246 echo "Disabling png2swf tool..."
250 if test "x${ZLIBMISSING}" = "xtrue"; then
252 echo "Warning! Without zlib, you will not be able to read"
253 echo "or write compressed Flash MX files!"
255 echo "***************************************************"
256 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile"
258 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"
265 if test "x${srcdir}" != "x."; then
266 echo "Warning: --srcdir is not supported"