version is now 0.6.0.
[swftools.git] / configure.in
index 31b5167..9130c1f 100644 (file)
@@ -16,7 +16,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-05-18-1254
+VERSION=0.6.0
 
 
 
@@ -200,7 +200,40 @@ dnl Checks for typedefs, structures, and compiler characteristics.
 
 dnl Checks for library functions.
  AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand bcopy bzero time)
- RFX_CHECK_AVI2SWF
+
+# ------------------------------------------------------------------
+lame_objects= 
+lame_makefile=
+if test "x${DISABLE_LAME}" = "xtrue"; then
+    echo "*" Disabling lame support...
+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_makefile="lib/lame/Makefile"
+       CPPFLAGS="$CPPFLAGS -Ilame"
+       AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
+    else
+       if test -d /usr/include/lame; then
+           CPPFLAGS="$CPPFLAGS -I /usr/include/lame"
+       else
+           if test -d /usr/local/include/lame; then
+               CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame"
+           fi
+       fi
+       AC_CHECK_LIB(mp3lame, lame_init,, NO_LIBMP3LAME=1)
+       AC_CHECK_HEADERS(lame.h)
+       if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$ac_cv_header_lame_h" "!=" "x";then
+           AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
+       fi
+    fi
+fi
+AC_SUBST(lame_objects)
+
+# ------------------------------------------------------------------
+RFX_CHECK_AVI2SWF
 
 avi2swf="avi2swf/Makefile"
 if test "x${AVIFILE}" != "xtrue"; then
@@ -210,60 +243,30 @@ if test "x${AVIFILE}" != "xtrue"; then
  avi2swf=
 fi
 
-if test "x${DISABLE_LAME}" = "xtrue"; then
-    echo "*" Disabling lame support...
-    lame_objects= 
-else
-    AC_DEFINE_UNQUOTED(HAVE_LAME, 1)
-    lame_objects='$(lame_objects_2)'
-fi
-AC_SUBST(lame_objects)
+# ------------------------------------------------------------------
 
 if test "x${UNCOMPRESS}" = "xgzip"; then
     AC_DEFINE_UNQUOTED(USE_GZIP, 1)
 fi
 AC_SUBST(USE_GZIP)
 
-JPEG2SWF='jpeg2swf$(E)'
-export JPEG2SWF
-PNG2SWF='png2swf$(E)'
-export PNG2SWF
-
 # ------------------------------------------------------------------
 
-AC_MSG_CHECKING([for Python.h and PIL])
-# should we support python versions below 2.2?
-if test -f "/usr/lib/python2.2/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.2/Python.h";then
-    PY_VERSION=2.2
-fi
-if test -f "/usr/lib/python2.3/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.3/Python.h";then
-    PY_VERSION=2.3
-fi
-if test -f "/usr/lib/python2.4/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.4/Python.h";then
-    PY_VERSION=2.4
-fi
+RFX_CHECK_PYTHON
 
-if test "x$PY_VERSION" "!=" "x"; then
-    pythonrfxswf="lib/python/Makefile"
-    if test "x$PYTHON_LIB" = "x";then
-       PYTHON_LIB="-lpython$PY_VERSION /usr/lib/python$PY_VERSION/site-packages/PIL/_imaging.so"
-    fi
-    if test "x$PYTHON_INCLUDES" = "x";then
-       PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION"
-    fi
-    export PYTHON_INCLUDES PYTHON_LIB
-    AC_SUBST(PYTHON_LIB)
-    AC_SUBST(PYTHON_INCLUDES)
-    AC_MSG_RESULT(yes)
-else
+if test "x$PYTHON_OK" '!=' "xyes";then
     echo all install uninstall clean: > lib/python/Makefile
-    AC_MSG_RESULT(nope)
     echo "* No usable python installation found"
     echo "* Not compiling the python interface"
 fi
 
 # ------------------------------------------------------------------
 
+JPEG2SWF='jpeg2swf$(E)'
+export JPEG2SWF
+PNG2SWF='png2swf$(E)'
+export PNG2SWF
+
 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
   echo "***************************************************"
   echo "The following headers/libraries are missing: " ${MISSINGLIBS}
@@ -288,9 +291,9 @@ if test "x${DISABLEPDF2SWF}" = "xtrue"; then
     echo "or write compressed Flash MX files!"
   fi
   echo "***************************************************"
-  FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile ${pythonrfxswf}"
+  FILES="./release Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
 else
-  FILES="./release Makefile.common ${avi2swf} Makefile lib/lame/Makefile lib/Makefile lib/action/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile swfs/Makefile ${pythonrfxswf}"
+  FILES="./release Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile swfs/Makefile ${pythonrfxswf} ${lame_makefile}"
 fi
 AC_SUBST(JPEG2SWF)
 AC_SUBST(PNG2SWF)