X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=m4%2Fpython.m4;h=9f958adb93935c61cc610a120ddec2d29c34aafb;hb=5bbc101cb90c91ac8d92b9bccc349cb33520bfe5;hp=daaa796d6b28b4cef6bbc939a9439c3c7b4e54da;hpb=55d0da52b189b233d0d6f0d9798918e6d8c42dd4;p=swftools.git diff --git a/m4/python.m4 b/m4/python.m4 index daaa796..9f958ad 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -1,25 +1,32 @@ AC_DEFUN(RFX_CHECK_PYTHON, [ 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 + +if test "x$PYTHON_LIB" '!=' "x" -a "x$PYTHON_INCLUDES" '!=' "x";then + PY_VERSION=unknown +else + # 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 + # OS X: + # /System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/Python.h + # /Library/Python/2.3/_imaging.so fi if test "x$PY_VERSION" "!=" "x"; then - AC_MSG_RESULT(python$PY_VERSION) - pythonrfxswf="lib/python/Makefile" + AC_MSG_RESULT($PY_VERSION) if test "x$PYTHON_LIB" = "x";then - PYTHON_LIB="-lpython$PY_VERSION /usr/lib/python$PY_VERSION/site-packages/PIL/_imaging.so" + PYTHON_LIB="-l$PY_VERSION /usr/lib/$PY_VERSION/site-packages/PIL/_imaging.so" fi if test "x$PYTHON_INCLUDES" = "x";then - PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION" + PYTHON_INCLUDES="-I/usr/include/$PY_VERSION" fi export PYTHON_INCLUDES PYTHON_LIB AC_SUBST(PYTHON_LIB) @@ -32,7 +39,10 @@ if test "x$PY_VERSION" "!=" "x"; then int main(int argn, char*argv[]) { - return Py_Main(argn, argv); + int ret; + ret = Py_Main(argn, argv); + int x; // check also for gcc 2.95.x incompatibilities + return ret; } EOF ac_link='$CC $CPPFLAGS $CFLAGS $PYTHON_INCLUDES conftest.c $LDFLAGS $PYTHON_LIB $LIBS -o conftest${ac_exeext}'