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=2003-08-02-1416
20 if test "x$CHECKMEM" '!=' "x";then
23 if test "x$DEBUG" '!=' "x";then
24 CFLAGS="-Wparentheses -Wimplicit -Wreturn-type -g $CFLAGS"
25 CXXFLAGS="-Wparentheses -Wimplicit -Wreturn-type -g $CXXFLAGS"
26 STRIP="@echo debug enabled, not stripping "
29 else if test "x$OPTIMIZE" '!=' "x"; then
30 CFLAGS="-Wparentheses -Wimplicit -Wreturn-type -Winline -O3 -fomit-frame-pointer $CFLAGS"
31 CXXFLAGS="-Wparentheses -Wimplicit -Wreturn-type -Winline -O3 -fomit-frame-pointer $CXXFLAGS"
33 CFLAGS="-Wparentheses -Wimplicit -Wreturn-type -O -fomit-frame-pointer $CFLAGS"
34 CXXFLAGS="-Wparentheses -Wimplicit -Wreturn-type -O -fomit-frame-pointer $CXXFLAGS"
38 export PACKAGE VERSION CFLAGS CXXFLAGS
40 dnl Checks for programs.
46 CFLAGS="$CFLAGS -fno-rtti"
47 CXXFLAGS="$CXXFLAGS -fno-rtti"
50 dnl Checks for programs.
54 if test "x$CHECKMEM" '!=' "x";then
70 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
71 AC_CHECK_PROGS(FREETYPE_CONFIG, freetype-config, )
73 dnl Checks for system services
78 if test "x${MINGW}" != "xyes"; then
79 AC_DEFINE_UNQUOTED(O_BINARY, 0)
81 # The following tries to make use of includes and libraries in
82 # /usr/local, too. Notice: A -I/usr/local/include might break
83 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
84 # especially on systems which link /usr/local to /usr, so it has yet
85 # to be seen how useful this is.
86 if test -d /usr/local/lib; then
87 LDFLAGS="$LDFLAGS -L/usr/local/lib"
89 if test -d /usr/local/include; then
90 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
91 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
94 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
95 # if the user has a special prefix (like /opt), there might also be $prefix/lib
96 # and $prefix/include, which should be included in our search paths for libraries
98 LDFLAGS="$LDFLAGS -L${libdir}"
99 CPPFLAGS="$CPPFLAGS -I${includedir}"
100 # TODO- test whether gcc still works after this
103 dnl Checks for libraries.
104 AC_CHECK_LIB(m, sin,,
105 echo "Error: Math library not found.";
108 AC_CHECK_LIB(z, deflate,,
110 MISSINGLIBS="${MISSINGLIBS} zlib"
113 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
115 DISABLEJPEG2SWF=true;
116 MISSINGLIBS="${MISSINGLIBS} jpeglib"
118 AC_CHECK_LIB(t1, T1_LoadFont,,
120 MISSINGLIBS="${MISSINGLIBS} t1lib"
122 AC_CHECK_LIB(freetype, FT_Init_FreeType,
127 AC_SUBST(WORDS_BIGENDIAN)
128 RFX_CHECK_SYSTEM_BACKTICKS
129 AC_SUBST(SYSTEM_BACKTICKS)
133 dnl Checks for header files.
134 AC_CONFIG_HEADER(config.h)
137 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)
139 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
141 DISABLEJPEG2SWF=true;
142 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
144 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
146 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
148 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
150 MISSINGLIBS="${MISSINGLIBS} zlib.h"
154 if test "x$USE_FREETYPE" != "x"; then
155 AC_DEFINE_UNQUOTED(USE_FREETYPE, "$USE_FREETYPE")
157 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
158 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
162 AC_SUBST(HAVE_UNISTD_H)
165 dnl Checks for typedefs, structures, and compiler characteristics.
171 AC_CHECK_TYPE(boolean,int)
172 AC_CHECK_TYPE(bool,char)
173 dnl AC_CHECK_TYPE(uchar,unsigned char)
174 dnl AC_CHECK_TYPE(schar,signed char)
175 dnl AC_CHECK_TYPE(word,unsigned short int)
176 dnl AC_CHECK_TYPE(sword,unsigned short int)
177 dnl AC_CHECK_TYPE(uint,unsigned long int)
179 dnl Checks for library functions.
180 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand)
183 avi2swf="avi2swf/Makefile"
184 if test "x${AVIFILE}" != "xtrue"; then
185 echo "* Couldn't compile the avifile test program."
186 echo "* Disabling avi2swf tool..."
187 echo all install uninstall clean: > avi2swf/Makefile
191 if test "x${NO_MP3}" == "x"; then
192 AC_DEFINE_UNQUOTED(USE_MP3, 1)
195 if test "x${USE_FREETYPE}" == "xtrue"; then
196 if test "x{$FREETYPE_CONFIG}" != "x"; then
197 ftinclude=`freetype-config --cflags`
198 ftlibs=`freetype-config --libs`
199 CXXFLAGS="$CXXFLAGS $ftinclude"
200 CFLAGS="$CFLAGS $ftinclude"
202 else if test -d /usr/include/freetype2; then
203 CXXFLAGS="$CXXFLAGS -I/usr/include/freetype2"
204 CFLAGS="$CFLAGS -I/usr/include/freetype2"
205 LIBS="$LIBS -lfreetype"
206 else if test -d /usr/local/include/freetype2; then
207 CXXFLAGS="$CXXFLAGS -I/usr/local/include/freetype2"
208 CFLAGS="$CFLAGS -I/usr/local/include/freetype2"
209 LIBS="$LIBS -L /usr/local/lib -lfreetype"
215 if test "x${UNCOMPRESS}" = "xgzip"; then
216 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
220 JPEG2SWF='jpeg2swf$(E)'
222 PNG2SWF='png2swf$(E)'
224 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
225 echo "***************************************************"
226 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
227 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
228 echo "Disabling pdf2swf tool..."
229 rm -f pdf2swf/Makefile
230 echo all install uninstall clean: > pdf2swf/Makefile
232 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
233 echo "Disabling jpeg2swf tool..."
237 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
238 echo "Disabling png2swf tool..."
242 if test "x${ZLIBMISSING}" = "xtrue"; then
244 echo "Warning! Without zlib, you will not be able to read"
245 echo "or write compressed Flash MX files!"
247 echo "***************************************************"
248 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile swfs/Makefile"
250 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile swfs/Makefile"
257 if test "x${srcdir}" != "x."; then
258 echo "Warning: --srcdir is not supported"