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)
18 WARNINGS="-Wparentheses -Wimplicit -Wreturn-type"
19 if test "x$ENABLE_WARNINGS" '!=' "x";then
20 WARNINGS="-Wall -Wno-unused -Wno-format"
23 if test "x$CHECKMEM" '!=' "x";then
26 if test "x$DEBUG" '!=' "x";then
27 CFLAGS="$WARNINGS -g $CFLAGS"
28 CXXFLAGS="$WARNINGS -g $CXXFLAGS"
29 STRIP="@echo debug enabled, not stripping "
32 else if test "x$OPTIMIZE" '!=' "x"; then
33 CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS"
34 CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS"
36 CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS"
37 CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS"
41 #if test "x$OLDGCC" '!=' "x";then
42 # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic"
43 # #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic"
44 # CFLAGS="$CFLAGS -ansi -pendantic"
45 # CXXFLAGS="$CXXFLAGS -ansi -pendantic"
48 export PACKAGE VERSION CFLAGS CXXFLAGS
50 dnl Checks for programs.
56 CFLAGS="$CFLAGS -fno-rtti"
57 CXXFLAGS="$CXXFLAGS -fno-rtti"
60 dnl Checks for programs.
64 if test "x$CHECKMEM" '!=' "x";then
80 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
82 dnl Checks for system services
87 if test "x${MINGW}" != "xyes"; then
88 AC_DEFINE_UNQUOTED(O_BINARY, 0)
90 # The following tries to make use of includes and libraries in
91 # /usr/local, too. Notice: A -I/usr/local/include might break
92 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
93 # especially on systems which link /usr/local to /usr, so it has yet
94 # to be seen how useful this is.
95 if test -d /usr/local/lib; then
96 LDFLAGS="$LDFLAGS -L/usr/local/lib"
98 if test -d /usr/local/include; then
99 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
100 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
103 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
104 # if the user has a special prefix (like /opt), there might also be $prefix/lib
105 # and $prefix/include, which should be included in our search paths for libraries
107 LDFLAGS="$LDFLAGS -L${libdir}"
108 CPPFLAGS="$CPPFLAGS -I${includedir}"
109 # TODO- test whether gcc still works after this
112 dnl Checks for libraries.
113 AC_CHECK_LIB(m, sin,,
114 echo "Error: Math library not found.";
117 AC_CHECK_LIB(z, deflate,,
119 MISSINGLIBS="${MISSINGLIBS} zlib"
122 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
124 DISABLEJPEG2SWF=true;
125 MISSINGLIBS="${MISSINGLIBS} jpeglib"
127 AC_CHECK_LIB(t1, T1_LoadFont,,
129 MISSINGLIBS="${MISSINGLIBS} t1lib"
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 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
163 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
167 AC_SUBST(HAVE_UNISTD_H)
170 dnl Checks for typedefs, structures, and compiler characteristics.
176 AC_CHECK_TYPE(boolean,int)
177 AC_CHECK_TYPE(bool,char)
178 dnl AC_CHECK_TYPE(uchar,unsigned char)
179 dnl AC_CHECK_TYPE(schar,signed char)
180 dnl AC_CHECK_TYPE(word,unsigned short int)
181 dnl AC_CHECK_TYPE(sword,unsigned short int)
182 dnl AC_CHECK_TYPE(uint,unsigned long int)
184 dnl Checks for library functions.
185 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero)
188 avi2swf="avi2swf/Makefile"
189 if test "x${AVIFILE}" != "xtrue"; then
190 echo "* Couldn't compile the avifile test program."
191 echo "* Disabling avi2swf tool..."
192 echo all install uninstall clean: > avi2swf/Makefile
196 if test "x${DISABLE_LAME}" = "xtrue"; then
197 echo "*" Disabling lame support...
200 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
201 lame_objects='$(lame_objects_2)'
203 AC_SUBST(lame_objects)
205 if test "x${UNCOMPRESS}" = "xgzip"; then
206 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
210 JPEG2SWF='jpeg2swf$(E)'
212 PNG2SWF='png2swf$(E)'
214 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
215 echo "***************************************************"
216 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
217 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
218 echo "Disabling pdf2swf tool..."
219 rm -f pdf2swf/Makefile
220 echo all install uninstall clean: > pdf2swf/Makefile
222 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
223 echo "Disabling jpeg2swf tool..."
227 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
228 echo "Disabling png2swf tool..."
232 if test "x${ZLIBMISSING}" = "xtrue"; then
234 echo "Warning! Without zlib, you will not be able to read"
235 echo "or write compressed Flash MX files!"
237 echo "***************************************************"
238 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile"
240 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"
247 if test "x${srcdir}" != "x."; then
248 echo "Warning: --srcdir is not supported"