X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=m4%2Fpython.m4;h=fee7f6806f10479d4be891e1da204bbe8487f919;hb=bfc74ab49c3b0e38199a71805eefd919a1df3de9;hp=ccbc95b20706d10207ba634a2701136bf259fed5;hpb=60efc7c6385000b61fb0aeb7d8053a0bdb847894;p=swftools.git diff --git a/m4/python.m4 b/m4/python.m4 index ccbc95b..fee7f68 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -15,13 +15,27 @@ else 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" - fi # Mac OS X - if test -f "/Library/Python/2.$v/_imaging.so" \ - -a "/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" + 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" \ + -o -f "/sw/lib/python2.$v/config/libpython2.$v.a" \ + -o -f "/sw/lib/python2.$v/config/libpython2.$v.so" \ + ")" \ + -a -f "/sw/include/python2.$v/Python.h" \ + -a -f "/sw/lib/python2.$v/site-packages/PIL/_imaging.so";then PY_VERSION=2.$v - PYTHON_LIB="-lpython$PY_VERSION /Library/Python/2.3/_imaging.so" - PYTHON_INCLUDES="-I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python$PY_VERSION/" + PYTHON_LIB="-L /sw/lib/python2.$v/config/ -lpython$PY_VERSION /sw/lib/python2.$v/site-packages/PIL/_imaging.so" + PYTHON_INCLUDES="-I /sw/include/python2.$v/" fi done fi @@ -50,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