Hello,
Would somebody know how to make the system find the right python
framework in the case explained below:
It is with Mac OS X 10.4.3, XCode 2.2, latest libtool in fink 10.4-
transitional unstable
The configure.ac file is as follows:
AC_ARG_ENABLE(python,
AC_HELP_STRING([--disable-python],[don't build the python plugin]),
python=$enableval,
python=yes
)
if test "$python" = yes; then
AC_PATH_PROG(pythonpath, python)
if test "_$pythonpath" = _ ; then
AC_PATH_PROG(pythonpath, python2)
fi
if test "_$pythonpath" = _ ; then
python=no
else
AC_MSG_CHECKING(Python version)
changequote(<<, >>)dnl
PY_VER=`$pythonpath -c 'import distutils.sysconfig; print
distutils.sysconfig.get_config_vars("VERSION")[0];'`
PY_LIB=`$pythonpath -c 'import distutils.sysconfig; print
distutils.sysconfig.get_python_lib(standard_lib=1);'`
PY_INC=`$pythonpath -c 'import distutils.sysconfig; print
distutils.sysconfig.get_config_vars("INCLUDEPY")[0];'`
$pythonpath -c "import sys; map(int,sys.version[:3].split('.'))>=
[2,2] or sys.exit(1)"
changequote([, ])dnl
AC_MSG_RESULT($PY_VER)
if test "$?" != "1"; then
AC_MSG_CHECKING(Python compile flags)
PY_PREFIX=`$pythonpath -c 'import sys; print
sys.prefix'`
PY_EXEC_PREFIX=`$pythonpath -c 'import sys; print
sys.exec_prefix'`
if test -f $PY_INC/Python.h; then
AC_MSG_RESULT([-I${PY_INC}])
AC_MSG_CHECKING(Python link flags)
PYSHARED=`$pythonpath -c 'import distutils.sysconfig;print
distutils.sysconfig.get_config_var("LINKFORSHARED")'`
AC_MSG_RESULT([-L${PY_LIB}/config
-lpython${PY_VER} ${PYSHARED}])
LIBS="$LIBS -L${PY_LIB}/config -lpython${PY_VER}
${PYSHARED}"
CFLAGS="$CFLAGS -I$PY_INC"
else
python=no
AC_MSG_RESULT([Can't find Python.h])
fi
else
echo "Python too old. Only 2.2 or above is supported."
python=no
fi
fi
fi
if test "$python" = yes; then
AC_DEFINE(HAVE_PYTHON)
fi
It resolves at configure time as:
- Location of python
checking for python... /usr/bin/python
- Version of python
checking Python version... 2.3
- Compile flags
checking Python compile flags... -I/System/Library/Frameworks/
Python.framework/Versions/2.3/include/python2.3
Up to now everything seems OK.
- Linking flags
checking Python link flags... -L/System/Library/Frameworks/
Python.framework/Versions/2.3/lib/python2.3/config -lpython2.3 -u
__dummy -u _PyMac_Error -framework System Python.framework/Versions/
2.3/Python -framework CoreServices -framework Foundation
That's where it fails at link stage, not finding Python.framework/
Versions/2.3/Python:
powerpc-apple-darwin8-gcc-4.0.1: Python.framework/Versions/2.3/
Python: No such file or directory
- Brute method to make it compiled.
Not sure it is good. Is it?
I've changed:
AC_MSG_RESULT([-L${PY_LIB}/config -lpython${PY_VER} ${PYSHARED}])
LIBS="$LIBS -L${PY_LIB}/config -lpython${PY_VER}
${PYSHARED}"
to:
AC_MSG_RESULT([-L${PY_LIB}/config -lpython${PY_VER}])
LIBS="$LIBS -L${PY_LIB}/config -lpython${PY_VER}
"
Cheers,
Michèle
<http://micmacfr.homeunix.org>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Fink-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-devel