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)
19 VERSION=2004-10-24-1908
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"
266 if test "x$JPEGLIBMISSING" = "xtrue";then
267 MISSINGLIBS="${MISSINGLIBS} jpeglib"
272 if test "x$T1LIBMISSING" = "xtrue";then
273 MISSINGLIBS="${MISSINGLIBS} t1lib"
276 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
278 DISABLEJPEG2SWF=true;
279 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
282 if test "x$HAVE_FREETYPE" '!=' "x1"; then
284 MISSINGLIBS="${MISSINGLIBS} freetype"
287 if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
288 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
290 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
292 MISSINGLIBS="${MISSINGLIBS} zlib.h"
295 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
296 MISSINGLIBS="${MISSINGLIBS} avifile"
300 AC_MSG_RESULT(${MISSINGLIBS})
302 # ------------------------------------------------------------------
304 if test "x${MISSINGLIBS}" '!=' "x"; then
305 echo "***************************************************"
306 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
309 avi2swf="avi2swf/Makefile"
310 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
311 echo "* Disabling avi2swf tool..."
312 echo all install uninstall clean: > avi2swf/Makefile
316 pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile"
317 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
318 echo "* Disabling pdf2swf tool..."
319 rm -f pdf2swf/Makefile
320 echo all install uninstall clean: > pdf2swf/Makefile
324 if test "x${ZLIBMISSING}" = "xtrue"; then
326 echo "* Warning! Without zlib, you will not be able to read"
327 echo "* or write compressed Flash MX files!"
330 JPEG2SWF='jpeg2swf$(E)'
331 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
332 echo "* Disabling jpeg2swf tool..."
338 PNG2SWF='png2swf$(E)'
339 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
340 echo "* Disabling png2swf tool..."
346 if test "x${MISSINGLIBS}" '!=' "x"; then
347 if test "x${PARTIAL}" '=' "x"; then
348 echo "* (never mind)"
350 echo "***************************************************"
353 # ------------------------------------------------------------------
355 if test -f "release.in"; then release_in="./release"; fi
356 FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
358 dnl AC_OUTPUT(${FILES}) old autoconf
359 AC_CONFIG_FILES([${FILES}])