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)
13 if test "x$CHECKMEM" '!=' "x";then
16 if test "x$DEBUG" '!=' "x";then
17 CFLAGS="-Wparentheses -Wimplicit -Wreturn-type -g $CFLAGS"
18 CXXFLAGS="-Wparentheses -Wimplicit -Wreturn-type -g $CXXFLAGS"
19 STRIP="@echo debug enabled, not stripping "
23 CFLAGS="-Wparentheses -Wimplicit -Wreturn-type -O -fomit-frame-pointer $CFLAGS"
24 CXXFLAGS="-Wparentheses -Wimplicit -Wreturn-type -O -fomit-frame-pointer $CXXFLAGS"
27 export PACKAGE VERSION CFLAGS CXXFLAGS
29 dnl Checks for programs.
35 CFLAGS="$CFLAGS -fno-rtti"
36 CXXFLAGS="$CXXFLAGS -fno-rtti"
39 dnl Checks for programs.
43 if test "x$CHECKMEM" '!=' "x";then
59 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
60 AC_CHECK_PROGS(FREETYPE_CONFIG, freetype-config, )
62 if test "x$FREETYPE_CONFIG" != "x";then
66 dnl Checks for system services
71 if test "x${MINGW}" != "xyes"; then
72 AC_DEFINE_UNQUOTED(O_BINARY, 0)
74 # The following tries to make use of includes and libraries in
75 # /usr/local, too. Notice: A -I/usr/local/include might break
76 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
77 # especially on systems which link /usr/local to /usr, so it has yet
78 # to be seen how useful this is.
79 if test -d /usr/local/lib; then
80 LDFLAGS="$LDFLAGS -L/usr/local/lib"
82 if test -d /usr/local/include; then
83 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
84 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
87 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
88 # if the user has a special prefix (like /opt), there might also be $prefix/lib
89 # and $prefix/include, which should be included in our search paths for libraries
91 LDFLAGS="$LDFLAGS -L${libdir}"
92 CPPFLAGS="$CPPFLAGS -I${includedir}"
93 # TODO- test whether gcc still works after this
96 dnl Checks for libraries.
98 echo "Error: Math library not found.";
101 AC_CHECK_LIB(z, deflate,,
103 MISSINGLIBS="${MISSINGLIBS} zlib"
106 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
108 DISABLEJPEG2SWF=true;
109 MISSINGLIBS="${MISSINGLIBS} jpeglib"
111 AC_CHECK_LIB(t1, T1_LoadFont,,
113 MISSINGLIBS="${MISSINGLIBS} t1lib"
115 AC_CHECK_LIB(freetype, FT_Init_FreeType,
120 AC_SUBST(WORDS_BIGENDIAN)
121 RFX_CHECK_SYSTEM_BACKTICKS
122 AC_SUBST(SYSTEM_BACKTICKS)
126 dnl Checks for header files.
127 AC_CONFIG_HEADER(config.h)
130 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)
132 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
134 DISABLEJPEG2SWF=true;
135 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
137 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
139 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
141 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
143 MISSINGLIBS="${MISSINGLIBS} zlib.h"
147 AC_DEFINE_UNQUOTED(USE_FREETYPE, "$USE_FREETYPE")
148 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
149 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
153 AC_SUBST(HAVE_UNISTD_H)
156 dnl Checks for typedefs, structures, and compiler characteristics.
162 AC_CHECK_TYPE(boolean,int)
163 AC_CHECK_TYPE(bool,char)
164 dnl AC_CHECK_TYPE(uchar,unsigned char)
165 dnl AC_CHECK_TYPE(schar,signed char)
166 dnl AC_CHECK_TYPE(word,unsigned short int)
167 dnl AC_CHECK_TYPE(sword,unsigned short int)
168 dnl AC_CHECK_TYPE(uint,unsigned long int)
170 dnl Checks for library functions.
171 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand)
174 avi2swf="avi2swf/Makefile"
175 if test "x${AVIFILE}" != "xtrue"; then
176 echo "* Couldn't compile the avifile test program."
177 echo "* Disabling avi2swf tool..."
178 echo all install uninstall clean: > avi2swf/Makefile
182 if test "x${USE_FREETYPE}" == "xtrue"; then
183 if test "x{$FREETYPE_CONFIG}" != "x"; then
184 ftinclude=`freetype-config --cflags`
185 ftlibs=`freetype-config --libs`
186 CXXFLAGS="$CXXFLAGS $ftinclude"
187 CFLAGS="$CFLAGS $ftinclude"
189 else if test -d /usr/include/freetype2; then
190 CXXFLAGS="$CXXFLAGS -I/usr/include/freetype2"
191 CFLAGS="$CFLAGS -I/usr/include/freetype2"
192 LIBS="$LIBS -lfreetype"
193 else if test -d /usr/local/include/freetype2; then
194 CXXFLAGS="$CXXFLAGS -I/usr/local/include/freetype2"
195 CFLAGS="$CFLAGS -I/usr/local/include/freetype2"
196 LIBS="$LIBS -L /usr/local/lib -lfreetype"
202 if test "x${UNCOMPRESS}" = "xgzip"; then
203 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
207 JPEG2SWF='jpeg2swf' #$(EXEEXT)
209 PNG2SWF='png2swf' #$(EXEEXT)
211 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
212 echo "***************************************************"
213 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
214 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
215 echo "Disabling pdf2swf tool..."
216 rm -f pdf2swf/Makefile
217 echo all install uninstall clean: > pdf2swf/Makefile
219 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
220 echo "Disabling jpeg2swf tool..."
224 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
225 echo "Disabling png2swf tool..."
229 if test "x${ZLIBMISSING}" = "xtrue"; then
231 echo "Warning! Without zlib, you will not be able to read"
232 echo "or write compressed Flash MX files!"
234 echo "***************************************************"
235 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile swfs/Makefile"
237 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile swfs/Makefile"
244 if test "x${srcdir}" != "x."; then
245 echo "Warning: --srcdir is not supported"