summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorPeter Eisentraut2015-05-02 01:38:21 +0000
committerPeter Eisentraut2015-05-02 01:38:21 +0000
commitd664a10f9623fd2198b257e513bce849d439a773 (patch)
tree122918562558012874096a6dc041f186df4252cd /configure.in
parent77477e745be534c5925cf7cb8b9c6a7698c575a3 (diff)
Move interpreter shared library detection to configure
For building PL/Perl, PL/Python, and PL/Tcl, we need a shared library of libperl, libpython, and libtcl, respectively. Previously, this was checked in the makefiles, skipping the PL build with a warning if no shared library was available. Now this is checked in configure, with an error if no shared library is available. The previous situation arose because in the olden days, the configure options --with-perl, --with-python, and --with-tcl controlled whether frontend interfaces for those languages would be built. The procedural languages were added later, and shared libraries were often not available in the beginning. So it was decided skip the builds of the procedural languages in those cases. The frontend interfaces have since been removed from the tree, and shared libraries are now available most of the time, so that setup makes much less sense now. Also, the new setup allows contrib modules and pgxs users to rely on the respective PLs being available based on configure flags.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in38
1 files changed, 37 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 1cd9e1eb46f..0080515c0c6 100644
--- a/configure.in
+++ b/configure.in
@@ -889,12 +889,44 @@ if test "$with_perl" = yes; then
AC_MSG_ERROR([Perl not found])
fi
PGAC_CHECK_PERL_CONFIGS([archlibexp,privlibexp,useshrplib])
+ if test "$perl_useshrplib" != yes && test "$perl_useshrplib" != true; then
+ AC_MSG_ERROR([cannot build PL/Perl because libperl is not a shared library
+You might have to rebuild your Perl installation. Refer to the
+documentation for details. Use --without-perl to disable building
+PL/Perl.])
+ fi
PGAC_CHECK_PERL_EMBED_LDFLAGS
fi
if test "$with_python" = yes; then
PGAC_PATH_PYTHON
PGAC_CHECK_PYTHON_EMBED_SETUP
+
+ # We need libpython as a shared library. With Python >=2.5, we check
+ # the Py_ENABLE_SHARED setting. OS X does supply a .dylib even
+ # though Py_ENABLE_SHARED does not get set. On Debian, the setting
+ # is not correct before the jessie release
+ # (http://bugs.debian.org/695979). We also want to support older
+ # Python versions. So as a fallback we see if there is a file that
+ # is named like a shared library.
+
+ if test "$python_enable_shared" != 1; then
+ # We don't know the platform shared library extension here yet, so
+ # we try some candidates.
+ for dlsuffix in .so .dll .dylib .sl; do
+ if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then
+ python_enable_shared=1
+ break
+ fi
+ done
+ fi
+
+ if test "$python_enable_shared" != 1; then
+ AC_MSG_ERROR([cannot build PL/Python because libpython is not a shared library
+You might have to rebuild your Python installation. Refer to the
+documentation for details. Use --without-python to disable building
+PL/Python.])
+ fi
fi
if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
@@ -1942,8 +1974,12 @@ fi
if test "$with_tcl" = yes; then
PGAC_PATH_TCLCONFIGSH([$with_tclconfig])
PGAC_EVAL_TCLCONFIGSH([$TCL_CONFIG_SH],
- [TCL_INCLUDE_SPEC,TCL_LIB_FILE,TCL_LIBS,TCL_LIB_SPEC,TCL_SHARED_BUILD])
+ [TCL_INCLUDE_SPEC,TCL_LIBS,TCL_LIB_SPEC,TCL_SHARED_BUILD])
AC_SUBST(TCL_SHLIB_LD_LIBS)dnl don't want to double-evaluate that one
+ if test "$TCL_SHARED_BUILD" != 1; then
+ AC_MSG_ERROR([cannot build PL/Tcl because Tcl is not a shared library
+Use --without-tcl to disable building PL/Tcl.])
+ fi
# now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"