1 AC_DEFUN(RFX_CHECK_PYTHON,
3 AC_MSG_CHECKING([for Python.h and PIL])
4 # should we support python versions below 2.2?
5 if test -f "/usr/lib/python2.2/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.2/Python.h";then
8 if test -f "/usr/lib/python2.3/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.3/Python.h";then
11 if test -f "/usr/lib/python2.4/site-packages/PIL/_imaging.so" -a -f "/usr/include/python2.4/Python.h";then
15 if test "x$PY_VERSION" "!=" "x"; then
16 AC_MSG_RESULT(python$PY_VERSION)
17 pythonrfxswf="lib/python/Makefile"
18 if test "x$PYTHON_LIB" = "x";then
19 PYTHON_LIB="-lpython$PY_VERSION /usr/lib/python$PY_VERSION/site-packages/PIL/_imaging.so"
21 if test "x$PYTHON_INCLUDES" = "x";then
22 PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION"
24 export PYTHON_INCLUDES PYTHON_LIB
26 AC_SUBST(PYTHON_INCLUDES)
27 AC_MSG_CHECKING([whether we can compile the python test program])
29 cat > conftest.c << EOF
33 int main(int argn, char*argv[])
35 return Py_Main(argn, argv);
38 ac_link='$CC $CPPFLAGS $CFLAGS $PYTHON_INCLUDES conftest.c $LDFLAGS $PYTHON_LIB $LIBS -o conftest${ac_exeext}'
39 if { (eval echo python.m4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
43 echo "configure: failed program was:" >&5