X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=configure.in;h=64c7dfbc092760b6e57649fabce4ec26ab131359;hp=492a6bba9c5ff2d9a88627134d65da36fa2f1e55;hb=4cc575e3000d7deda913996aaa42199635979a8e;hpb=ccc5f82c2bb8e14ff3941d862e0e5a6feb722201 diff --git a/configure.in b/configure.in index 492a6bb..64c7dfb 100644 --- a/configure.in +++ b/configure.in @@ -1,8 +1,11 @@ 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) @@ -18,7 +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-11-13-2026 +VERSION=2007-02-06-1213 # ------------------------------------------------------------------ @@ -30,7 +33,7 @@ fi WARNINGS="-Wparentheses -Wimplicit -Wreturn-type" if test "x$ENABLE_WARNINGS" '!=' "x";then - WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls" + WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls -D_FORTIFY_SOURCE=2 " fi if test "x$CHECKMEM" '!=' "x";then @@ -41,8 +44,9 @@ if test "x$PROFILING" '!=' "x";then fi if test "x$DEBUG" '!=' "x";then if test "x$PROFILING" = "x";then - CFLAGS="$WARNINGS -g $CFLAGS" - CXXFLAGS="$WARNINGS -g $CXXFLAGS" + CFLAGS="$WARNINGS -O2 -g $CFLAGS" + CXXFLAGS="$WARNINGS -O2 -g $CXXFLAGS" + LDFLAGS="-g $LIBS" else CFLAGS="$WARNINGS -O2 -g -pg $CFLAGS" CXXFLAGS="$WARNINGS -O2 -g -pg $CXXFLAGS" @@ -56,6 +60,10 @@ else CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS" fi fi + +CFLAGS="-fPIC $CFLAGS" +CXXFLAGS="-fPIC $CFLAGS" + #OLDGCC=1 #if test "x$OLDGCC" '!=' "x";then # #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic" @@ -75,9 +83,14 @@ 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 @@ -86,6 +99,22 @@ 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" @@ -102,16 +131,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 OBJEXT="o" - AC_EXEEXT +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 @@ -122,9 +157,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 @@ -148,8 +185,12 @@ 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 +if test "x$DEBUG" '!=' "x" -o "x$STRIP" = "x";then STRIP="@echo debug enabled, not stripping " export STRIP AC_SUBST(STRIP) @@ -161,8 +202,22 @@ dnl Checks for libraries. exit; ) 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) + +if test "x$ZLIBMISSING" = "xtrue";then + echo + echo "ERROR:" + echo "You need zlib to compile swftools" + echo + exit +fi + +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) +if test "$UNGIFMISSING";then + UNGIFMISSING= + AC_CHECK_LIB(gif, DGifOpen,, UNGIFMISSING=true) +fi RFX_CHECK_BYTEORDER AC_SUBST(WORDS_BIGENDIAN) @@ -175,7 +230,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") @@ -192,24 +247,19 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_STRUCT_TM 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) - dnl AC_CHECK_TYPE(word,unsigned short int) - dnl AC_CHECK_TYPE(sword,unsigned short int) - dnl AC_CHECK_TYPE(uint,unsigned long int) - -dnl Checks for library functions. AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time) -# ------------------------------------------------------------------ +AC_CHECK_SIZEOF([signed]) +AC_CHECK_SIZEOF([unsigned]) +AC_CHECK_SIZEOF([signed long]) +AC_CHECK_SIZEOF([unsigned long]) +AC_CHECK_SIZEOF([signed long long]) +AC_CHECK_SIZEOF([unsigned long long]) RFX_CHECK_FREETYPE -RFX_CHECK_FONTCONFIG +#RFX_CHECK_FONTCONFIG -# ------------------------------------------------------------------ - lame_objects= lame_makefile= if test "x${DISABLE_LAME}" = "xtrue"; then @@ -295,6 +345,11 @@ 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; @@ -310,15 +365,19 @@ fi if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then MISSINGLIBS="${MISSINGLIBS} t1lib.h" fi +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" PARTIAL=true fi -if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then - MISSINGLIBS="${MISSINGLIBS} avifile" - PARTIAL=true -fi +#if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then +# MISSINGLIBS="${MISSINGLIBS} avifile" +#fi AC_MSG_RESULT(${MISSINGLIBS}) @@ -331,18 +390,26 @@ fi avi2swf="avi2swf/Makefile" if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then - echo "* Disabling avi2swf tool..." + #don't whine, avi2swf is outdated anyway + #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 @@ -358,6 +425,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..." @@ -376,9 +451,33 @@ fi # ------------------------------------------------------------------ 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 ${pythonrfxswf} ${lame_makefile}" - -dnl AC_OUTPUT(${FILES}) old autoconf -AC_CONFIG_FILES([${FILES}]) -AC_OUTPUT - +if test -f "wx/Makefile.in"; then wx_in="wx/Makefile"; fi +FILES="$release_in $wx_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 lib/swf/Makefile" +AC_OUTPUT(${FILES}) + +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