X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=configure.in;h=47fac70a31f374757c2ef17cb765a1ea330f1d40;hp=4d62e7509a609036de22ba587c27f1b87d648b1c;hb=7f237d6ab33b067711025e6d8f2d77b534dbe722;hpb=30bf74504c97d428af2ae4c3fcf96acf0b305d2a diff --git a/configure.in b/configure.in index 4d62e75..47fac70 100644 --- a/configure.in +++ b/configure.in @@ -1,13 +1,18 @@ dnl Process this file with autoconf to produce a configure script. -dnl AC_INIT(src/) # old autoconf -AC_INIT -AC_CONFIG_SRCDIR([src/]) +dnl old autoconf +AC_INIT(src/) + +dnl new autoconf +dnl AC_INIT +dnl AC_CONFIG_SRCDIR([src/]) AC_ARG_ENABLE(checkmem, [ --enable-checkmem turn on ccmalloc debugging], CHECKMEM=true) AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging], DEBUG=true) +AC_ARG_ENABLE(profiling, +[ --enable-profiling turn on profiling], PROFILING=true) AC_ARG_ENABLE(warnings, [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true) AC_ARG_ENABLE(optimizations, @@ -16,8 +21,7 @@ AC_ARG_ENABLE(lame, [ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true) PACKAGE=swftools -VERSION=2004-08-24-2049 - +VERSION=2006-12-02-1537 # ------------------------------------------------------------------ @@ -35,9 +39,18 @@ fi if test "x$CHECKMEM" '!=' "x";then DEBUG=yes fi +if test "x$PROFILING" '!=' "x";then + DEBUG=yes +fi if test "x$DEBUG" '!=' "x";then - CFLAGS="$WARNINGS -g $CFLAGS" - CXXFLAGS="$WARNINGS -g $CXXFLAGS" + if test "x$PROFILING" = "x";then + CFLAGS="$WARNINGS -O2 -g -D_FORTIFY_SOURCE=2 $CFLAGS" + CXXFLAGS="$WARNINGS -O2 -g -D_FORTIFY_SOURCE=2 $CXXFLAGS" + else + CFLAGS="$WARNINGS -O2 -g -pg $CFLAGS" + CXXFLAGS="$WARNINGS -O2 -g -pg $CXXFLAGS" + LDFLAGS="-g -pg $LIBS" + fi else if test "x$OPTIMIZE" '!=' "x"; then CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS" CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS" @@ -57,18 +70,46 @@ fi export PACKAGE VERSION CFLAGS CXXFLAGS dnl Checks for programs. - AC_CANONICAL_HOST + +AC_CANONICAL_HOST + +SHARED="-shared" MACOSX= case $host_os in *darwin* ) MACOSX=yes - CFLAGS="$CFLAGS -fno-rtti" + CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS -fno-rtti" + SHARED="-bundle" + # Use fink packages if available. + #if test -d /sw/include && test -d /sw/lib; then + # CPPFLAGS="${CPPFLAGS} -I/sw/include" + # LDFLAGS="${LDFLAGS} -L/sw/lib" + #fi ;; esac + +AC_SUBST(SHARED) + dnl Checks for programs. AC_PROG_CC AC_PROG_CXX + + +RFX_CHECK_OLDGCC + +if test "x$GCC_IS_OK" '=' "x";then + echo "***************************************************" + echo "* Your gcc is too old to compile this!" + echo "* " + echo "* The last version compilable by this compiler is " + echo "* swftools 0.7.0, which you can download from " + echo "* http://www.swftools.org/swftools-0.7.0.tar.gz " + echo "* ." + echo "* Newer versions require at least gcc 3.0.0 " + echo "***************************************************" + exit 1 +fi if test "x$CHECKMEM" '!=' "x";then CC="ccmalloc $CC" @@ -85,11 +126,22 @@ fi AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LN_S - AC_PROG_LIBTOOL AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, ) dnl Checks for system services - AC_EXEEXT +OBJEXT="o" +AREXT=".a" +CXXLIBS="-lstdc++" + +AC_EXEEXT + +if test "x$EXEEXT" = "x.exe";then + OBJEXT="obj" + AREXT=".lib" + CXXLIBS="" +fi +AC_SUBST(OBJEXT) +AC_SUBST(AREXT) RFX_CHECK_MING @@ -100,9 +152,11 @@ if test "x${MINGW}" != "xyes"; then else # mingW SLEXT="dll" + CXXLIBS="" fi export SLEXT AC_SUBST(SLEXT) +AC_SUBST(CXXLIBS) # The following tries to make use of includes and libraries in # /usr/local, too. Notice: A -I/usr/local/include might break @@ -126,6 +180,10 @@ if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/l # TODO- test whether gcc still works after this fi +#Mac OS: +#LDFLAGS "-L/sw/lib" ; CPPFLAGS "-I/sw/include -I/sw/include/lame" + + # this must be done after (I believe) AC_PROG_MAKE_SET if test "x$DEBUG" '!=' "x";then STRIP="@echo debug enabled, not stripping " @@ -141,6 +199,7 @@ dnl Checks for libraries. AC_CHECK_LIB(z, deflate,, ZLIBMISSING=true) AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true) AC_CHECK_LIB(t1, T1_LoadFont,, T1LIBMISSING=true) + AC_CHECK_LIB(ungif, DGifOpen,, UNGIFMISSING=true) RFX_CHECK_BYTEORDER AC_SUBST(WORDS_BIGENDIAN) @@ -153,7 +212,7 @@ dnl Checks for header files. AC_CONFIG_HEADER(config.h) AC_HEADER_DIRENT AC_HEADER_STDC - 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) + AC_CHECK_HEADERS(zlib.h gif_lib.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) AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") @@ -169,7 +228,7 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_STRUCT_TM - AC_CHECK_TYPE(boolean,int) + AC_CHECK_TYPE(boolean,int) #needed for jpeglib dnl AC_CHECK_TYPE(bool,char) dnl AC_CHECK_TYPE(uchar,unsigned char) dnl AC_CHECK_TYPE(schar,signed char) @@ -184,6 +243,8 @@ dnl Checks for library functions. RFX_CHECK_FREETYPE +#RFX_CHECK_FONTCONFIG + # ------------------------------------------------------------------ lame_objects= @@ -193,7 +254,7 @@ if test "x${DISABLE_LAME}" = "xtrue"; then else # old lame code at lib/lame if test -f lib/lame/Makefile.in; then - 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" + 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)" lame_makefile="lib/lame/Makefile" CPPFLAGS="$CPPFLAGS -Ilame" AC_DEFINE_UNQUOTED(HAVE_LAME, 1) @@ -217,7 +278,23 @@ AC_SUBST(lame_objects) # ------------------------------------------------------------------ RFX_CHECK_AVI2SWF +if test "x${AVIFILE}" = "xtrue"; then + VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS" + VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS" + AC_DEFINE_UNQUOTED(HAVE_AVIFILE, 1) +fi +if test "x${WIN32}" != "x"; then + #AC_CHECK_LIB(avifil32, AVIFileInit,AVIFIL32=true) + #if test "x${AVIFIL32}" != "x"; then + # VIDEO_LIBS="$VIDEO_LIBS -lavifil32" + #fi + VIDEO_LIBS="$VIDEO_LIBS -lavifil32" + AVIFIL32=true +fi + +AC_SUBST(VIDEO_LIBS) +AC_SUBST(VIDEO_CFLAGS) # ------------------------------------------------------------------ if test "x${UNCOMPRESS}" = "xgzip"; then @@ -240,39 +317,54 @@ fi # ------------------------------------------------------------------ AC_MSG_CHECKING([for missing libraries]) - + if test "x$ZLIBMISSING" = "xtrue";then MISSINGLIBS="${MISSINGLIBS} zlib" - DISABLEPNG2SWF=true; + DISABLEPNG2SWF=true + PARTIAL=true fi if test "x$JPEGLIBMISSING" = "xtrue";then MISSINGLIBS="${MISSINGLIBS} jpeglib" - DISABLEPDF2SWF=true; - DISABLEJPEG2SWF=true; + DISABLEPDF2SWF=true + DISABLEJPEG2SWF=true + PARTIAL=true fi if test "x$T1LIBMISSING" = "xtrue";then MISSINGLIBS="${MISSINGLIBS} t1lib" fi +if test "x$UNGIFMISSING" = "xtrue";then + DISABLEGIF2SWF=true + MISSINGLIBS="${MISSINGLIBS} ungif" + PARTIAL=true +fi -if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then - DISABLEPDF2SWF=true; - DISABLEJPEG2SWF=true; - MISSINGLIBS="${MISSINGLIBS} jpeglib.h" +if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then + DISABLEPDF2SWF=true; + DISABLEJPEG2SWF=true; + MISSINGLIBS="${MISSINGLIBS} jpeglib.h" + PARTIAL=true +fi +if test "x$HAVE_FREETYPE" '!=' "x1"; then + DISABLEPDF2SWF=true; + MISSINGLIBS="${MISSINGLIBS} freetype" + PARTIAL=true fi -if test "x$HAVE_FREETYPE" != "x1"; then - DISABLEPDF2SWF=true; - MISSINGLIBS="${MISSINGLIBS} freetype" +if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then + MISSINGLIBS="${MISSINGLIBS} t1lib.h" fi -if test "x${ac_cv_header_t1lib_h}" != "xyes"; then - DISABLEPDF2SWF=true; - MISSINGLIBS="${MISSINGLIBS} t1lib.h" +if test "x${ac_cv_header_gif_lib_h}" '!=' "xyes"; then + DISABLEGIF2SWF=true + MISSINGLIBS="${MISSINGLIBS} gif_lib.h" + PARTIAL=true fi -if test "x${ac_cv_header_zlib_h}" != "xyes"; then - DISABLEPNG2SWF=true; - MISSINGLIBS="${MISSINGLIBS} zlib.h" +if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then + DISABLEPNG2SWF=true; + MISSINGLIBS="${MISSINGLIBS} zlib.h" + PARTIAL=true fi -if test "x${AVIFILE}" != "xtrue"; then - MISSINGLIBS="${MISSINGLIBS} avifile" +if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then + MISSINGLIBS="${MISSINGLIBS} avifile" + PARTIAL=true fi AC_MSG_RESULT(${MISSINGLIBS}) @@ -285,19 +377,26 @@ if test "x${MISSINGLIBS}" '!=' "x"; then fi avi2swf="avi2swf/Makefile" -if test "x${AVIFILE}" != "xtrue"; then +if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then echo "* Disabling avi2swf tool..." echo all install uninstall clean: > avi2swf/Makefile avi2swf= fi -pdf2swf_makefile="pdf2swf/Makefile pdf2swf/xpdf/Makefile" +pdf2swf_makefile="lib/pdf/Makefile" +PDF2SWF='pdf2swf$(E)' +LIBPDF='libpdf$(A)' + if test "x${DISABLEPDF2SWF}" = "xtrue"; then echo "* Disabling pdf2swf tool..." - rm -f pdf2swf/Makefile - echo all install uninstall clean: > pdf2swf/Makefile + rm -f lib/pdf/Makefile + echo all install uninstall clean: > lib/pdf/Makefile pdf2swf_makefile="" + PDF2SWF= + LIBPDF= fi +AC_SUBST(PDF2SWF) +AC_SUBST(LIBPDF) if test "x${ZLIBMISSING}" = "xtrue"; then echo @@ -313,6 +412,14 @@ fi export JPEG2SWF AC_SUBST(JPEG2SWF) +GIF2SWF='gif2swf$(E)' +if test "x${DISABLEGIF2SWF}" = "xtrue"; then + echo "* Disabling gif2swf tool..." + GIF2SWF= +fi +export GIF2SWF +AC_SUBST(GIF2SWF) + PNG2SWF='png2swf$(E)' if test "x${DISABLEPNG2SWF}" = "xtrue"; then echo "* Disabling png2swf tool..." @@ -322,14 +429,43 @@ export PNG2SWF AC_SUBST(PNG2SWF) if test "x${MISSINGLIBS}" '!=' "x"; then + if test "x${PARTIAL}" '=' "x"; then + echo "* (never mind)" + fi echo "***************************************************" fi # ------------------------------------------------------------------ -FILES="./release Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile}" +if test -f "release.in"; then release_in="./release"; fi +FILES="$release_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile pdf2swf/fonts/Makefile ${pythonrfxswf} ${lame_makefile} lib/art/Makefile" + +dnl old autoconf +AC_OUTPUT(${FILES}) -dnl AC_OUTPUT(${FILES}) old autoconf -AC_CONFIG_FILES([${FILES}]) -AC_OUTPUT +dnl new autoconf +dnl AC_CONFIG_FILES([${FILES}]) +dnl AC_OUTPUT +# +# On development trees, create snapshots of config.status +# +if test -f snapshot -a "x$CHECKMEM" = "x" -a "x$PROFILING" = "x";then + if test "x${MINGW}" = "xyes"; then + echo cp config.status config.status.win32 + cp config.status config.status.win32 + else + if test "x$DEBUG" '=' "x" -a "x$OPTIMIZE" '=' "x";then + echo cp config.status config.status.linux + cp config.status config.status.linux + fi + if test "x$DEBUG" '!=' "x" -a "x$OPTIMIZE" '=' "x";then + echo cp config.status config.status.debug + cp config.status config.status.debug + fi + if test "x$DEBUG" = "x" -a "x$OPTIMIZE" '!=' "x"; then + echo cp config.status config.status.optimize + cp config.status config.status.optimize + fi + fi +fi