X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=m4%2Fpython.m4;h=23deed700c03f6aed7b6da841d7de02046006a52;hb=d30ede6864c10f35819e471dc50ba5d3cb6bc019;hp=9a1e026ea58a279a274596ad42a9d042391695fd;hpb=61b8c53b9732b711b1ea93281d9fc7a972032fa9;p=swftools.git diff --git a/m4/python.m4 b/m4/python.m4 index 9a1e026..23deed7 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -8,18 +8,23 @@ else if test "x$PYTHON_LIB" '!=' "x" -o "x$PYTHON_INCLUDES" '!=' "x";then echo "Set both PYTHON_LIB and PYTHON_INCLUDES, or none at all" fi - # iterate through version 2.2 to 2.4 - for v in 2 3 4; do + # iterate through version 2.2 to 2.5 + for v in 2 3 4 5; do # Linux if test -f "/usr/lib/python2.$v/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.$v/Python.h";then PY_VERSION=2.$v PYTHON_LIB="-lpython$PY_VERSION /usr/lib/python$PY_VERSION/site-packages/PIL/_imaging.so" PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION" # Mac OS X - elif test -f "/Library/Python/2.$v/PIL/_imaging.so" \ - -a -f "/System/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/Python.h";then + elif test -f "/System/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/Python.h";then + #TODO: test for /System/Library/Frameworks/Python.framework/Versions/2.3/Python ? PY_VERSION=2.$v - PYTHON_LIB="-framework Python /Library/Python/2.$v/PIL/_imaging.so" + PYTHON_LIB="-framework Python" + if test -f "/Library/Python/2.$v/PIL/_imaging.so";then + PYTHON_LIB2="$PYTHON_LIB /Library/Python/2.$v/PIL/_imaging.so" + else + PYTHON_LIB2="$PYTHON_LIB" + fi PYTHON_INCLUDES="-I/System/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/" # Mac OS X [Fink]: elif test "(" -f "/sw/lib/python2.$v/config/libpython2.$v.dylib" \ @@ -59,9 +64,16 @@ EOF AC_MSG_RESULT(yes) PYTHON_OK=yes else - echo "configure: failed program was:" >&5 - cat conftest.c >&5 - AC_MSG_RESULT(no) + ac_link='$CC $CPPFLAGS $CFLAGS $PYTHON_INCLUDES conftest.c $LDFLAGS ${PYTHON_LIB2} $LIBS -o conftest${ac_exeext}' + if { (eval echo python.m4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + AC_MSG_RESULT(yes) + PYTHON_LIB="${PYTHON_LIB2}" + PYTHON_OK=yes + else + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + AC_MSG_RESULT(no) + fi fi rm -f conftest* else