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-11-03-1856
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.
67 CFLAGS="$CFLAGS -fno-rtti"
68 CXXFLAGS="$CXXFLAGS -fno-rtti"
75 dnl Checks for programs.
79 if test "x$CHECKMEM" '!=' "x";then
95 AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
97 dnl Checks for system services
103 if test "x${MINGW}" != "xyes"; then
105 AC_DEFINE_UNQUOTED(O_BINARY, 0)
113 # The following tries to make use of includes and libraries in
114 # /usr/local, too. Notice: A -I/usr/local/include might break
115 # things (MingW, cross-compiling etc.) in the same way as -I/usr/include,
116 # especially on systems which link /usr/local to /usr, so it has yet
117 # to be seen how useful this is.
118 if test -d /usr/local/lib; then
119 LDFLAGS="$LDFLAGS -L/usr/local/lib"
121 if test -d /usr/local/include; then
122 # Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo.
123 # CPPFLAGS="$CPPFLAGS -I/usr/local/include"
126 if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then
127 # if the user has a special prefix (like /opt), there might also be $prefix/lib
128 # and $prefix/include, which should be included in our search paths for libraries
130 LDFLAGS="$LDFLAGS -L${libdir}"
131 CPPFLAGS="$CPPFLAGS -I${includedir}"
132 # TODO- test whether gcc still works after this
135 # this must be done after (I believe) AC_PROG_MAKE_SET
136 if test "x$DEBUG" '!=' "x";then
137 STRIP="@echo debug enabled, not stripping "
142 dnl Checks for libraries.
143 AC_CHECK_LIB(m, sin,,
144 echo "Error: Math library not found.";
147 AC_CHECK_LIB(z, deflate,, ZLIBMISSING=true)
148 AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true)
149 AC_CHECK_LIB(t1, T1_LoadFont,, T1LIBMISSING=true)
152 AC_SUBST(WORDS_BIGENDIAN)
153 RFX_CHECK_SYSTEM_BACKTICKS
154 AC_SUBST(SYSTEM_BACKTICKS)
158 dnl Checks for header files.
159 AC_CONFIG_HEADER(config.h)
162 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)
164 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
165 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
169 AC_SUBST(HAVE_UNISTD_H)
172 dnl Checks for typedefs, structures, and compiler characteristics.
178 AC_CHECK_TYPE(boolean,int) #needed for jpeglib
179 dnl AC_CHECK_TYPE(bool,char)
180 dnl AC_CHECK_TYPE(uchar,unsigned char)
181 dnl AC_CHECK_TYPE(schar,signed char)
182 dnl AC_CHECK_TYPE(word,unsigned short int)
183 dnl AC_CHECK_TYPE(sword,unsigned short int)
184 dnl AC_CHECK_TYPE(uint,unsigned long int)
186 dnl Checks for library functions.
187 AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
189 # ------------------------------------------------------------------
195 # ------------------------------------------------------------------
199 if test "x${DISABLE_LAME}" = "xtrue"; then
200 echo "*" Disabling lame support...
202 # old lame code at lib/lame
203 if test -f lib/lame/Makefile.in; then
204 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"
205 lame_makefile="lib/lame/Makefile"
206 CPPFLAGS="$CPPFLAGS -Ilame"
207 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
209 if test -d /usr/include/lame; then
210 CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
212 if test -d /usr/local/include/lame; then
213 CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
216 AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
217 AC_CHECK_HEADERS(lame.h)
218 if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
219 AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
223 AC_SUBST(lame_objects)
225 # ------------------------------------------------------------------
228 if test "x${AVIFILE}" = "xtrue"; then
229 VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS"
230 VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS"
231 AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1)
234 if test "x${WIN32}" != "x"; then
235 #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true)
236 #if test "x${AVIFIL32}" != "x"; then
237 # VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
239 VIDEO_LIBS="$VIDEO_LIBS -lavifil32"
244 AC_SUBST(VIDEO_CFLAGS)
245 # ------------------------------------------------------------------
247 if test "x${UNCOMPRESS}" = "xgzip"; then
248 AC_DEFINE_UNQUOTED(USE_GZIP, 1)
252 # ------------------------------------------------------------------
256 if test "x$PYTHON_OK" '!=' "xyes";then
257 echo all install uninstall clean: > lib/python/Makefile
258 # fail silently- the most users won't have any need for the
259 # python interface anyway
261 pythonrfxswf="lib/python/Makefile"
264 # ------------------------------------------------------------------
266 AC_MSG_CHECKING([for missing libraries])
268 if test "x$ZLIBMISSING" = "xtrue";then
269 MISSINGLIBS="${MISSINGLIBS} zlib"
273 if test "x$JPEGLIBMISSING" = "xtrue";then
274 MISSINGLIBS="${MISSINGLIBS} jpeglib"
279 if test "x$T1LIBMISSING" = "xtrue";then
280 MISSINGLIBS="${MISSINGLIBS} t1lib"
283 if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then
285 DISABLEJPEG2SWF=true;
286 MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
289 if test "x$HAVE_FREETYPE" '!=' "x1"; then
291 MISSINGLIBS="${MISSINGLIBS} freetype"
294 if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then
295 MISSINGLIBS="${MISSINGLIBS} t1lib.h"
297 if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then
299 MISSINGLIBS="${MISSINGLIBS} zlib.h"
302 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
303 MISSINGLIBS="${MISSINGLIBS} avifile"
307 AC_MSG_RESULT(${MISSINGLIBS})
309 # ------------------------------------------------------------------
311 if test "x${MISSINGLIBS}" '!=' "x"; then
312 echo "***************************************************"
313 echo "* The following headers/libraries are missing: " ${MISSINGLIBS}
316 avi2swf="avi2swf/Makefile"
317 if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then
318 echo "* Disabling avi2swf tool..."
319 echo all install uninstall clean: > avi2swf/Makefile
323 pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile"
324 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
325 echo "* Disabling pdf2swf tool..."
326 rm -f pdf2swf/Makefile
327 echo all install uninstall clean: > pdf2swf/Makefile
331 if test "x${ZLIBMISSING}" = "xtrue"; then
333 echo "* Warning! Without zlib, you will not be able to read"
334 echo "* or write compressed Flash MX files!"
337 JPEG2SWF='jpeg2swf$(E)'
338 if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
339 echo "* Disabling jpeg2swf tool..."
345 PNG2SWF='png2swf$(E)'
346 if test "x${DISABLEPNG2SWF}" = "xtrue"; then
347 echo "* Disabling png2swf tool..."
353 if test "x${MISSINGLIBS}" '!=' "x"; then
354 if test "x${PARTIAL}" '=' "x"; then
355 echo "* (never mind)"
357 echo "***************************************************"
360 # ------------------------------------------------------------------
362 if test -f "release.in"; then release_in="./release"; fi
363 FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
365 dnl AC_OUTPUT(${FILES}) old autoconf
366 AC_CONFIG_FILES([${FILES}])