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, )
61 dnl Checks for system services
66 # The following tries to make use of includes and libraries in
67 # /usr/local, too. Notice: A -I/usr/local/include might break
68 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
69 # especially on systems which link /usr/local to /usr, so it has yet
70 # to be seen how useful this is.
71 if test -d /usr/local/lib; then
72 LDFLAGS="$LDFLAGS -L/usr/local/lib"
74 if test -d /usr/local/include; then
75 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
76 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
79 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
80 # if the user has a special prefix (like /opt), there might also be $prefix/lib
81 # and $prefix/include, which should be included in our search paths for libraries
83 LDFLAGS="$LDFLAGS -L${libdir}"
84 CPPFLAGS="$CPPFLAGS -I${includedir}"
85 # TODO- test whether gcc still works after this
88 dnl Checks for libraries.
90 echo "Error: Math library not found.";
93 AC_CHECK_LIB(z, deflate,,
95 MISSINGLIBS="${MISSINGLIBS} zlib"
98 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
100 DISABLEJPEG2SWF=true;
101 MISSINGLIBS="${MISSINGLIBS} jpeglib"
103 AC_CHECK_LIB(t1, T1_LoadFont,,
105 MISSINGLIBS="${MISSINGLIBS} t1lib"
109 AC_SUBST(WORDS_BIGENDIAN)
110 RFX_CHECK_SYSTEM_BACKTICKS
111 AC_SUBST(SYSTEM_BACKTICKS)
115 dnl Checks for header files.
116 AC_CONFIG_HEADER(config.h)
119 AC_CHECK_HEADERS(zlib.h jpeglib.h t1lib.h sys/stat.h sys/types.h dirent.h sys/bsdtypes.h sys/ndir.h sys/dir.h ndir.h)
121 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
123 DISABLEJPEG2SWF=true;
124 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
126 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
128 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
130 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
132 MISSINGLIBS="${MISSINGLIBS} zlib.h"
136 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
137 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
141 AC_SUBST(HAVE_UNISTD_H)
144 dnl Checks for typedefs, structures, and compiler characteristics.
150 AC_CHECK_TYPE(boolean,int)
151 AC_CHECK_TYPE(bool,char)
152 dnl AC_CHECK_TYPE(uchar,unsigned char)
153 dnl AC_CHECK_TYPE(schar,signed char)
154 dnl AC_CHECK_TYPE(word,unsigned short int)
155 dnl AC_CHECK_TYPE(sword,unsigned short int)
156 dnl AC_CHECK_TYPE(uint,unsigned long int)
158 dnl Checks for library functions.
159 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand)
162 avi2swf="avi2swf/Makefile"
163 if test "x${AVIFILE}" != "xtrue"; then
164 echo "* Couldn't compile the avifile test program."
165 echo "* Disabling avi2swf tool..."
166 echo all install uninstall clean: > avi2swf/Makefile
170 if test "x${UNCOMPRESS}" = "xgzip"; then
171 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
175 JPEG2SWF='jpeg2swf' #$(EXEEXT)
177 PNG2SWF='png2swf' #$(EXEEXT)
179 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
180 echo "***************************************************"
181 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
182 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
183 echo "Disabling pdf2swf tool..."
184 rm -f pdf2swf/Makefile
185 echo all install uninstall clean: > pdf2swf/Makefile
187 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
188 echo "Disabling jpeg2swf tool..."
192 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
193 echo "Disabling png2swf tool..."
197 if test "x${ZLIBMISSING}" = "xtrue"; then
199 echo "Warning! Without zlib, you will not be able to read"
200 echo "or write compressed Flash MX files!"
202 echo "***************************************************"
203 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile swfs/Makefile"
205 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile swfs/Makefile"
212 if test "x${srcdir}" != "x."; then
213 echo "Warning: --srcdir is not supported"