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 if test "x${MINGW}" != "xyes"; then
67 AC_DEFINE_UNQUOTED(O_BINARY, 0)
69 # The following tries to make use of includes and libraries in
70 # /usr/local, too. Notice: A -I/usr/local/include might break
71 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
72 # especially on systems which link /usr/local to /usr, so it has yet
73 # to be seen how useful this is.
74 if test -d /usr/local/lib; then
75 LDFLAGS="$LDFLAGS -L/usr/local/lib"
77 if test -d /usr/local/include; then
78 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
79 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
82 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
83 # if the user has a special prefix (like /opt), there might also be $prefix/lib
84 # and $prefix/include, which should be included in our search paths for libraries
86 LDFLAGS="$LDFLAGS -L${libdir}"
87 CPPFLAGS="$CPPFLAGS -I${includedir}"
88 # TODO- test whether gcc still works after this
91 dnl Checks for libraries.
93 echo "Error: Math library not found.";
96 AC_CHECK_LIB(z, deflate,,
98 MISSINGLIBS="${MISSINGLIBS} zlib"
101 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,,
103 DISABLEJPEG2SWF=true;
104 MISSINGLIBS="${MISSINGLIBS} jpeglib"
106 AC_CHECK_LIB(t1, T1_LoadFont,,
108 MISSINGLIBS="${MISSINGLIBS} t1lib"
112 AC_SUBST(WORDS_BIGENDIAN)
113 RFX_CHECK_SYSTEM_BACKTICKS
114 AC_SUBST(SYSTEM_BACKTICKS)
118 dnl Checks for header files.
119 AC_CONFIG_HEADER(config.h)
122 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)
124 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
126 DISABLEJPEG2SWF=true;
127 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
129 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
131 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
133 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
135 MISSINGLIBS="${MISSINGLIBS} zlib.h"
139 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
140 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
144 AC_SUBST(HAVE_UNISTD_H)
147 dnl Checks for typedefs, structures, and compiler characteristics.
153 AC_CHECK_TYPE(boolean,int)
154 AC_CHECK_TYPE(bool,char)
155 dnl AC_CHECK_TYPE(uchar,unsigned char)
156 dnl AC_CHECK_TYPE(schar,signed char)
157 dnl AC_CHECK_TYPE(word,unsigned short int)
158 dnl AC_CHECK_TYPE(sword,unsigned short int)
159 dnl AC_CHECK_TYPE(uint,unsigned long int)
161 dnl Checks for library functions.
162 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand)
165 avi2swf="avi2swf/Makefile"
166 if test "x${AVIFILE}" != "xtrue"; then
167 echo "* Couldn't compile the avifile test program."
168 echo "* Disabling avi2swf tool..."
169 echo all install uninstall clean: > avi2swf/Makefile
173 if test "x${UNCOMPRESS}" = "xgzip"; then
174 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
178 JPEG2SWF='jpeg2swf' #$(EXEEXT)
180 PNG2SWF='png2swf' #$(EXEEXT)
182 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
183 echo "***************************************************"
184 echo "The following headers/libraries are missing: " ${MISSINGLIBS}
185 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
186 echo "Disabling pdf2swf tool..."
187 rm -f pdf2swf/Makefile
188 echo all install uninstall clean: > pdf2swf/Makefile
190 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
191 echo "Disabling jpeg2swf tool..."
195 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
196 echo "Disabling png2swf tool..."
200 if test "x${ZLIBMISSING}" = "xtrue"; then
202 echo "Warning! Without zlib, you will not be able to read"
203 echo "or write compressed Flash MX files!"
205 echo "***************************************************"
206 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile swfs/Makefile"
208 FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile swfs/Makefile"
215 if test "x${srcdir}" != "x."; then
216 echo "Warning: --srcdir is not supported"