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(warnings,
9 [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true)
10 AC_ARG_ENABLE(optimizations,
11 [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true)
13 [ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true)
16 VERSION=2004-02-05-1504
19 WARNINGS="-Wparentheses -Wimplicit -Wreturn-type"
20 if test "x$ENABLE_WARNINGS" '!=' "x";then
21 WARNINGS="-Wall -Wno-unused -Wno-format"
24 if test "x$CHECKMEM" '!=' "x";then
27 if test "x$DEBUG" '!=' "x";then
28 CFLAGS="$WARNINGS -g $CFLAGS"
29 CXXFLAGS="$WARNINGS -g $CXXFLAGS"
30 else if test "x$OPTIMIZE" '!=' "x"; then
31 CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS"
32 CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS"
34 CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS"
35 CXXFLAGS="$WARNINGS -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 # this must be done after (I believe) AC_PROG_MAKE_SET
111 if test "x$DEBUG" '!=' "x";then
112 STRIP="@echo debug enabled, not stripping "
117 dnl Checks for libraries.
118 AC_CHECK_LIB(m, sin,,
119 echo "Error: Math library not found.";
122 AC_CHECK_LIB(z, deflate,,
124 MISSINGLIBS="${MISSINGLIBS} zlib"
127 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
129 DISABLEJPEG2SWF=true;
130 MISSINGLIBS="${MISSINGLIBS} jpeglib"
132 AC_CHECK_LIB(t1, T1_LoadFont,,
134 MISSINGLIBS="${MISSINGLIBS} t1lib"
140 AC_SUBST(WORDS_BIGENDIAN)
141 RFX_CHECK_SYSTEM_BACKTICKS
142 AC_SUBST(SYSTEM_BACKTICKS)
146 dnl Checks for header files.
147 AC_CONFIG_HEADER(config.h)
150 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)
152 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
154 DISABLEJPEG2SWF=true;
155 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
157 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
159 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
161 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
163 MISSINGLIBS="${MISSINGLIBS} zlib.h"
167 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
168 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
172 AC_SUBST(HAVE_UNISTD_H)
175 dnl Checks for typedefs, structures, and compiler characteristics.
181 AC_CHECK_TYPE(boolean,int)
182 AC_CHECK_TYPE(bool,char)
183 dnl AC_CHECK_TYPE(uchar,unsigned char)
184 dnl AC_CHECK_TYPE(schar,signed char)
185 dnl AC_CHECK_TYPE(word,unsigned short int)
186 dnl AC_CHECK_TYPE(sword,unsigned short int)
187 dnl AC_CHECK_TYPE(uint,unsigned long int)
189 dnl Checks for library functions.
190 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero)
193 avi2swf="avi2swf/Makefile"
194 if test "x${AVIFILE}" != "xtrue"; then
195 echo "* Couldn't compile the avifile test program."
196 echo "* Disabling avi2swf tool..."
197 echo all install uninstall clean: > avi2swf/Makefile
201 if test "x${DISABLE_LAME}" = "xtrue"; then
202 echo "*" Disabling lame support...
205 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
206 lame_objects='$(lame_objects_2)'
208 AC_SUBST(lame_objects)
210 if test "x${UNCOMPRESS}" = "xgzip"; then
211 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
215 JPEG2SWF='jpeg2swf$(E)'
217 PNG2SWF='png2swf$(E)'
219 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
220 echo "***************************************************"
221 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
222 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
223 echo "Disabling pdf2swf tool..."
224 rm -f pdf2swf/Makefile
225 echo all install uninstall clean: > pdf2swf/Makefile
227 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
228 echo "Disabling jpeg2swf tool..."
232 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
233 echo "Disabling png2swf tool..."
237 if test "x${ZLIBMISSING}" = "xtrue"; then
239 echo "Warning! Without zlib, you will not be able to read"
240 echo "or write compressed Flash MX files!"
242 echo "***************************************************"
243 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile"
245 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"
252 if test "x${srcdir}" != "x."; then
253 echo "Warning: --srcdir is not supported"