From 6de89c9ab78a557f98dc02dca97795d27a4112d2 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 10 Jun 2000 18:02:12 +0000 Subject: Moved the intricacies of the perl interface build into its own makefile that now functions as a wrapper around the MakeMaker stuff. It might even behave sensically when we have separate build dirs. Same for plperl, which of course still doesn't work very well. Made sure that plperl respects the choice of --libdir. Added --with-python to automatically build and install the Python interface. Works similarly to the Perl5 stuff. Moved the burden of the distclean targets lower down into the source tree. Eventually, each make file should have its own. Added automatic remaking of makefiles and configure. Currently only for the top-level because of a bug(?) in Autoconf. Use GNU `missing' to work around missing autoconf and aclocal. Start factoring out macros into their own config/*.m4 files to increase readability and organization. --- config/python.m4 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 config/python.m4 (limited to 'config/python.m4') diff --git a/config/python.m4 b/config/python.m4 new file mode 100644 index 00000000000..f73697d7989 --- /dev/null +++ b/config/python.m4 @@ -0,0 +1,50 @@ +# +# Autoconf macros for configuring the build of Python extension modules +# +# $Header: /cvsroot/pgsql/config/python.m4,v 1.1 2000/06/10 18:01:35 petere Exp $ +# + +# PGAC_PROG_PYTHON +# ---------------- +# Look for Python and set the output variable `PYTHON' +# to `python' if found, empty otherwise. +AC_DEFUN([PGAC_PROG_PYTHON], +[AC_CHECK_PROG(PYTHON, python, python)]) + + +# PGAC_PATH_PYTHONDIR +# ------------------- +# Finds the names of various install dirs and helper files +# necessary to build a Python extension module. +# +# It would be nice if we could check whether the current setup allows +# the build of the shared module. Future project. +AC_DEFUN([PGAC_PATH_PYTHONDIR], +[AC_REQUIRE([PGAC_PROG_PYTHON]) +[if test "${PYTHON+set}" = set ; then + python_version=`${PYTHON} -c "import sys; print sys.version[:3]"` + python_prefix=`${PYTHON} -c "import sys; print sys.prefix"` + python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"` + python_configdir="${python_execprefix}/lib/python${python_version}/config" + python_moduledir="${python_prefix}/lib/python${python_version}" + python_extmakefile="${python_configdir}/Makefile.pre.in"] + + AC_MSG_CHECKING(for Python extension makefile) + if test -f "${python_extmakefile}" ; then + AC_MSG_RESULT(found) + else + AC_MSG_RESULT(no) + AC_MSG_ERROR( +[The Python extension makefile was expected at \`${python_extmakefile}\' +but does not exist. This means the Python module cannot be built automatically.]) + fi + + AC_SUBST(python_version) + AC_SUBST(python_prefix) + AC_SUBST(python_execprefix) + AC_SUBST(python_configdir) + AC_SUBST(python_moduledir) + AC_SUBST(python_extmakefile) +else + AC_MSG_ERROR([Python not found]) +fi])# PGAC_PATH_PYTHONDIR -- cgit v1.2.3