Okay, I've hacked configure.in to make it possible to do this from
configure. The patch is attached. It applies only on top of my previous
patch, as it passes the python library name in as a define. This is gross,
but it gets the job done for now.
Thanks,
Danek
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
--- configure.in.orig Sat Feb 14 13:53:40 2009
+++ configure.in Sun Feb 15 21:24:19 2009
@@ -608,10 +608,10 @@
AC_MSG_CHECKING(--enable-pythoninterp argument)
AC_ARG_ENABLE(pythoninterp,
- [ --enable-pythoninterp Include Python interpreter.], ,
+ [ --enable-pythoninterp[=OPTS] Include Python interpreter.
[OPTS=yes/no/dynamic]], ,
[enable_pythoninterp="no"])
AC_MSG_RESULT($enable_pythoninterp)
-if test "$enable_pythoninterp" = "yes"; then
+if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic";
then
dnl -- find the python executable
AC_PATH_PROG(vi_cv_path_python, python)
if test "X$vi_cv_path_python" != "X"; then
@@ -668,6 +668,12 @@
done
])
+ if test "${enable_pythoninterp}" = "dynamic"; then
+ if test "`(uname) 2>/dev/null`" != SunOS; then
+ AC_MSG_RESULT([dynamically loaded Python interpreter not supported!])
+ fi
+ fi
+
PYTHON_CONFDIR="${vi_cv_path_python_conf}"
if test "X$PYTHON_CONFDIR" = "X"; then
@@ -686,6 +692,7 @@
@echo "python_LIBS='$(LIBS)'"
@echo "python_SYSLIBS='$(SYSLIBS)'"
@echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
+ @echo "python_INSTSONAME='$(INSTSONAME)'"
eof
dnl -- delete the lines from make about Entering/Leaving directory
eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/
directory /d'`"
@@ -697,7 +704,17 @@
if test "${vi_cv_var_python_version}" = "1.4"; then
vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a
${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a
${PYTHON_CONFDIR}/libParser.a"
else
+ if test "${enable_pythoninterp}" = "dynamic"; then
+ vi_cv_lazyon="-zlazyload"
+ vi_cv_lazyoff="-znolazyload"
+ if test "$GCC" = "yes"; then
+ vi_cv_lazyon="-Wl,${vi_cv_lazyon}"
+ vi_cv_lazyoff="-Wl,${vi_cv_lazyoff}"
+ fi
+ vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} ${vi_cv_lazyon}
-lpython${vi_cv_var_python_version} ${vi_cv_lazyoff}"
+ else
vi_cv_path_python_plibs="-L${PYTHON_CONFDIR}
-lpython${vi_cv_var_python_version}"
+ fi
fi
vi_cv_path_python_plibs="${vi_cv_path_python_plibs}
${python_MODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
dnl remove -ltermcap, it can conflict with an earlier -lncurses
@@ -711,6 +728,9 @@
else
PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}
-I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version}"
fi
+ if test "${enable_pythoninterp}" = "dynamic"; then
+ PYTHON_CFLAGS="${PYTHON_CFLAGS} -DDYNAMIC_PYTHON
-DPYTHONSONAME='\"${python_INSTSONAME}\"'"
+ fi
PYTHON_SRC="if_python.c"
dnl For Mac OSX 10.2 config.o is included in the Python library.
if test "x$MACOSX" = "xyes"; then
--- if_python.c.orig.2 Sun Feb 15 21:29:10 2009
+++ if_python.c Sun Feb 15 21:29:26 2009
@@ -442,7 +442,7 @@
int
python_enabled(int verbose)
{
- return python_runtime_link_init("libpython2.4.so.1.0", verbose) == OK;
+ return python_runtime_link_init(PYTHONSONAME, verbose) == OK;
}
#endif /* SOLARIS */
#endif /* DYNAMIC_PYTHON */