1 dnl Process this file with autoconf to produce a configure script.
3 dnl AC_INIT(src/) # old autoconf
5 AC_CONFIG_SRCDIR([src/])
7 AC_ARG_ENABLE(checkmem,
8 [ --enable-checkmem turn on ccmalloc debugging], CHECKMEM=true)
10 [ --enable-debug turn on debugging], DEBUG=true)
11 AC_ARG_ENABLE(warnings,
12 [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true)
13 AC_ARG_ENABLE(optimizations,
14 [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true)
16 [ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true)
22 # ------------------------------------------------------------------
24 if test "x${srcdir}" != "x."; then
25 echo "--srcdir is not supported"
29 WARNINGS="-Wparentheses -Wimplicit -Wreturn-type"
30 if test "x$ENABLE_WARNINGS" '!=' "x";then
31 WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls"
34 if test "x$CHECKMEM" '!=' "x";then
37 if test "x$DEBUG" '!=' "x";then
38 CFLAGS="$WARNINGS -g $CFLAGS"
39 CXXFLAGS="$WARNINGS -g $CXXFLAGS"
40 else if test "x$OPTIMIZE" '!=' "x"; then
41 CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS"
42 CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS"
44 CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS"
45 CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS"
49 #if test "x$OLDGCC" '!=' "x";then
50 # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic"
51 # #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic"
52 # CFLAGS="$CFLAGS -ansi -pendantic"
53 # CXXFLAGS="$CXXFLAGS -ansi -pendantic"
56 export PACKAGE VERSION CFLAGS CXXFLAGS
58 dnl Checks for programs.
64 CFLAGS="$CFLAGS -fno-rtti"
65 CXXFLAGS="$CXXFLAGS -fno-rtti"
68 dnl Checks for programs.
72 if test "x$CHECKMEM" '!=' "x";then
88 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
90 dnl Checks for system services
96 if test "x${MINGW}" != "xyes"; then
98 AC_DEFINE_UNQUOTED(O_BINARY, 0)
106 # The following tries to make use of includes and libraries in
107 # /usr/local, too. Notice: A -I/usr/local/include might break
108 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
109 # especially on systems which link /usr/local to /usr, so it has yet
110 # to be seen how useful this is.
111 if test -d /usr/local/lib; then
112 LDFLAGS="$LDFLAGS -L/usr/local/lib"
114 if test -d /usr/local/include; then
115 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
116 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
119 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
120 # if the user has a special prefix (like /opt), there might also be $prefix/lib
121 # and $prefix/include, which should be included in our search paths for libraries
123 LDFLAGS="$LDFLAGS -L${libdir}"
124 CPPFLAGS="$CPPFLAGS -I${includedir}"
125 # TODO- test whether gcc still works after this
128 # this must be done after (I believe) AC_PROG_MAKE_SET
129 if test "x$DEBUG" '!=' "x";then
130 STRIP="@echo debug enabled, not stripping "
135 dnl Checks for libraries.
136 AC_CHECK_LIB(m, sin,,
137 echo "Error: Math library not found.";
140 AC_CHECK_LIB(z, deflate,, ZLIBMISSING=true)
141 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true)
142 AC_CHECK_LIB(t1, T1_LoadFont,, T1LIBMISSING=true)
145 AC_SUBST(WORDS_BIGENDIAN)
146 RFX_CHECK_SYSTEM_BACKTICKS
147 AC_SUBST(SYSTEM_BACKTICKS)
151 dnl Checks for header files.
152 AC_CONFIG_HEADER(config.h)
155 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 time.h)
157 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
158 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
162 AC_SUBST(HAVE_UNISTD_H)
165 dnl Checks for typedefs, structures, and compiler characteristics.
171 AC_CHECK_TYPE(boolean,int) #needed for jpeglib
172 dnl AC_CHECK_TYPE(bool,char)
173 dnl AC_CHECK_TYPE(uchar,unsigned char)
174 dnl AC_CHECK_TYPE(schar,signed char)
175 dnl AC_CHECK_TYPE(word,unsigned short int)
176 dnl AC_CHECK_TYPE(sword,unsigned short int)
177 dnl AC_CHECK_TYPE(uint,unsigned long int)
179 dnl Checks for library functions.
180 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
182 # ------------------------------------------------------------------
188 # ------------------------------------------------------------------
192 if test "x${DISABLE_LAME}" = "xtrue"; then
193 echo "*" Disabling lame support...
195 # old lame code at lib/lame
196 if test -f lib/lame/Makefile.in; then
197 lame_objects="lame/psymodel.o lame/fft.o lame/newmdct.o lame/quantize.o lame/takehiro.o lame/reservoir.o lame/quantize_pvt.o lame/vbrquantize.o lame/encoder.o lame/id3tag.o lame/version.o lame/tables.o lame/util.o lame/bitstream.o lame/set_get.o lame/VbrTag.o lame/lame.o"
198 lame_makefile="lib/lame/Makefile"
199 CPPFLAGS="$CPPFLAGS -Ilame"
200 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
202 if test -d /usr/include/lame; then
203 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
205 if test -d /usr/local/include/lame; then
206 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
209 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
210 AC_CHECK_HEADERS(lame.h)
211 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
212 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
216 AC_SUBST(lame_objects)
218 # ------------------------------------------------------------------
221 if test "x${AVIFILE}" = "xtrue"; then
222 VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS"
223 VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS"
224 AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1)
227 if test "x${WIN32}" != "x"; then
228 #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true)
229 #if test "x${AVIFIL32}" != "x"; then
230 # VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
232 VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
237 AC_SUBST(VIDEO_CFLAGS)
238 # ------------------------------------------------------------------
240 if test "x${UNCOMPRESS}" = "xgzip"; then
241 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
245 # ------------------------------------------------------------------
249 if test "x$PYTHON_OK" '!=' "xyes";then
250 echo all install uninstall clean: > lib/python/Makefile
251 # fail silently- the most users won't have any need for the
252 # python interface anyway
254 pythonrfxswf="lib/python/Makefile"
257 # ------------------------------------------------------------------
259 AC_MSG_CHECKING([for missing libraries])
261 if test "x$ZLIBMISSING" = "xtrue";then
262 MISSINGLIBS="${MISSINGLIBS} zlib"
265 if test "x$JPEGLIBMISSING" = "xtrue";then
266 MISSINGLIBS="${MISSINGLIBS} jpeglib"
268 DISABLEJPEG2SWF=true;
270 if test "x$T1LIBMISSING" = "xtrue";then
271 MISSINGLIBS="${MISSINGLIBS} t1lib"
274 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
276 DISABLEJPEG2SWF=true;
277 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
279 if test "x$HAVE_FREETYPE" '!=' "x1"; then
281 MISSINGLIBS="${MISSINGLIBS} freetype"
283 if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
284 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
286 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
288 MISSINGLIBS="${MISSINGLIBS} zlib.h"
290 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
291 MISSINGLIBS="${MISSINGLIBS} avifile"
294 AC_MSG_RESULT(${MISSINGLIBS})
296 # ------------------------------------------------------------------
298 if test "x${MISSINGLIBS}" '!=' "x"; then
299 echo "***************************************************"
300 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
303 avi2swf="avi2swf/Makefile"
304 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
305 echo "* Disabling avi2swf tool..."
306 echo all install uninstall clean: > avi2swf/Makefile
310 pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile"
311 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
312 echo "* Disabling pdf2swf tool..."
313 rm -f pdf2swf/Makefile
314 echo all install uninstall clean: > pdf2swf/Makefile
318 if test "x${ZLIBMISSING}" = "xtrue"; then
320 echo "* Warning! Without zlib, you will not be able to read"
321 echo "* or write compressed Flash MX files!"
324 JPEG2SWF='jpeg2swf$(E)'
325 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
326 echo "* Disabling jpeg2swf tool..."
332 PNG2SWF='png2swf$(E)'
333 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
334 echo "* Disabling png2swf tool..."
340 if test "x${MISSINGLIBS}" '!=' "x"; then
341 echo "***************************************************"
344 # ------------------------------------------------------------------
346 if test -f "release.in"; then release_in="./release"; fi
347 FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
349 dnl AC_OUTPUT(${FILES}) old autoconf
350 AC_CONFIG_FILES([${FILES}])