summaryrefslogtreecommitdiff
path: root/config/python.m4
AgeCommit message (Collapse)Author
2022-07-06Unify DLSUFFIX on DarwinPeter Eisentraut
macOS has traditionally used extension .dylib for shared libraries (used at build time) and .so for dynamically loaded modules (used by dlopen()). This complicates the build system a bit. Also, Meson uses .dylib for both, so it would be worth unifying this in order to be able to get equal build output. There doesn't appear to be any reason to use any particular extension for dlopened modules, since dlopen() will accept anything and PostgreSQL is well-factored to be able to deal with any extension. Other software packages that I have handy appear to be about 50/50 split on which extension they use for their plugins. So it seems possible to change this safely. Discussion: https://www.postgresql.org/message-id/flat/bcc45f78-e3c3-8fb3-7c42-5371b48b5266%40enterprisedb.com
2022-03-25Refactor DLSUFFIX handlingPeter Eisentraut
Move DLSUFFIX from makefiles into header files for all platforms. Move the DLSUFFIX assignment from src/makefiles/ to src/templates/, have configure read it, and then substitute it into Makefile.global and pg_config.h. This avoids the need for all makefile rules that need it to locally set CPPFLAGS. It also resolves an inconsistent setup between the two Windows build systems. Reviewed-by: Andres Freund <[email protected]> Discussion: https://www.postgresql.org/message-id/[email protected]
2022-02-17plpython: Reject Python 2 during build configuration.Andres Freund
Python 2.7 went EOL 2020-01-01 and the support for Python 2 requires a fair bit of infrastructure. Therefore we are removing Python 2 support in plpython. This patch just rejects Python 2 during configure / mkvcbuild.pl. Future commits will remove the code and infrastructure for Python 2 support and adjust more of the documentation. This way we can see the buildfarm state after the removal sooner and we can be sure that failures are due to desupporting Python 2, rather than caused by infrastructure cleanup. Reviewed-By: Peter Eisentraut <[email protected]> Discussion: https://postgr.es/m/[email protected]
2022-01-25Replace use of deprecated Python module distutils.sysconfig, take 2.Tom Lane
With Python 3.10, configure spits out warnings about the module distutils.sysconfig being deprecated and scheduled for removal in Python 3.12. Change the uses in configure to use the module sysconfig instead. The logic stays largely the same, although we have to rely on INCLUDEPY instead of the deprecated get_python_inc function. Note that sysconfig exists since Python 2.7, so this moves the minimum required version up from Python 2.6. Also, sysconfig didn't exist in Python 3.1, so the minimum 3.x version is now 3.2. We should consider back-patching this if it gives no further trouble, as the no-longer-supported versions are old enough to probably not be interesting to anyone. Peter Eisentraut, Tom Lane, Andres Freund Discussion: https://postgr.es/m/[email protected]
2022-01-25Revert "Temporarily add some information about python include paths to ↵Tom Lane
configure." This reverts commit f032f63e727c1ab07603b3d1cd88d50f850d5738. We don't need it anymore.
2022-01-24Temporarily add some information about python include paths to configure.Andres Freund
We're still (see e0e567a1067, e0e567a1067) working on replacing use of the deprecated distutils. This commit just makes configure print out the results of different ways of determining the include path. Hopefully this will help us to find a way to transition away from distutils without turning the buildfarm red for prolonged amounts of time. Discussion: https://postgr.es/m/[email protected]
2022-01-20Revert "Make configure prefer python3 to plain python."Tom Lane
This reverts commit f201da39edcd6ac1ab9a3edf3e20e2a73bbbe69e. The buildfarm is not ready for python3, evidently, so we'll give the owners some more time to get set up. Discussion: https://postgr.es/m/[email protected]
2022-01-19Make configure prefer python3 to plain python.Tom Lane
This avoids possibly selecting Python 2.x on systems that have both Python 2 and Python 3. We used to feel that what "python" links to is a user choice that we should honor. However, we're about to cease support for Python 2, so users will no longer have any choice of that sort. This small change is being made ahead of the big Python-2-ectomy so that we can see how much of the buildfarm is not yet prepared for that. Systems with only Python 2 will continue to build that way, for now. Discussion: https://postgr.es/m/[email protected]
2022-01-18Revert "Replace use of deprecated Python module distutils.sysconfig"Peter Eisentraut
This reverts commit e0e567a106726f6709601ee7cffe73eb6da8084e. On various platforms, the new approach using the sysconfig module reported incorrect values for the include directory, and so any Python-related compilations failed. Revert for now and revisit later.
2022-01-18Replace use of deprecated Python module distutils.sysconfigPeter Eisentraut
With Python 3.10, configure spits out warnings about the module distutils.sysconfig being deprecated and scheduled for removal in Python 3.12. Change the uses in configure to use the module sysconfig instead. The logic stays the same. Note that sysconfig exists since Python 2.7, so this moves the minimum required version up from Python 2.6. Discussion: https://www.postgresql.org/message-id/flat/c74add3c-09c4-a9dd-1a03-a846e5b2fc52%40enterprisedb.com
2020-01-08Remove support for Python older than 2.6Peter Eisentraut
Supporting very old Python versions is a maintenance burden, especially with the several variant test files to maintain for Python <2.6. Since we have dropped support for older OpenSSL versions in 7b283d0e1d1d79bf1c962d790c94d2a53f3bb38a, RHEL 5 is now effectively desupported, and that was also the only mainstream operating system still using Python versions before 2.6, so it's a good time to drop those as well. Reviewed-by: Tom Lane <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/98b69261-298c-13d2-f34d-836fd9c29b21%402ndquadrant.com
2019-01-18configure: More use of AC_ARG_VARPeter Eisentraut
AC_ARG_VAR is necessary if an environment variable influences a configure result that is then used by other tests that are cached. With AC_ARG_VAR, a change in the variable is detected on subsequent configure runs and the user is then advised to remove the cache. This adds AC_ARG_VAR calls for: MSGFMT, PERL, PYTHON, TCLSH, XML2_CONFIG Reviewed-by: Tom Lane <[email protected]> Discussion: https://www.postgresql.org/message-id/[email protected]
2019-01-13configure: Update python search orderPeter Eisentraut
Some systems don't ship with "python" by default anymore, only "python3" or "python2" or some combination, so include those in the configure search. Discussion: https://www.postgresql.org/message-id/flat/1457.1543184081%40sss.pgh.pa.us#c9cc1199338fd6a257589c6dcea6cf8d
2018-04-02Teach configure --with-python to report the Python version number.Tom Lane
We already do this for Perl and some other interesting tools, so it seems sensible to do it for Python as well, especially since the sub-release number is never determinable from other configure output and even the major/minor numbers may not be clear without excavation in config.log. While at it, get rid of the code's assumption that both the major and minor numbers contain exactly one digit. That will foreseeably be broken by Python 3.10 in perhaps four or five years. That's far enough out that we probably don't need to back-patch this. Discussion: https://postgr.es/m/[email protected]
2017-08-01Further improve consistency of configure's program searching.Tom Lane
Peter Eisentraut noted that commit 40b9f1921 had broken a configure behavior that some people might rely on: AC_CHECK_PROGS(FOO,...) will allow the search to be overridden by specifying a value for FOO on configure's command line or in its environment, but AC_PATH_PROGS(FOO,...) accepts such an override only if it's an absolute path. We had worked around that behavior for some, but not all, of the pre-existing uses of AC_PATH_PROGS by just skipping the macro altogether when FOO is already set. Let's standardize on that workaround for all uses of AC_PATH_PROGS, new and pre-existing, by wrapping AC_PATH_PROGS in a new macro PGAC_PATH_PROGS. While at it, fix a deficiency of the old workaround code by making sure we report the setting to configure's log. Eventually I'd like to improve PGAC_PATH_PROGS so that it converts non-absolute override inputs to absolute form, eg "PYTHON=python3" becomes, say, PYTHON = /usr/bin/python3. But that will take some nontrivial coding so it doesn't seem like a thing to do in late beta. Discussion: https://postgr.es/m/[email protected]
2017-02-21Reject too-old Python versions a bit sooner.Tom Lane
Commit 04aad4018 added this check after the search for a Python shared library, which seems to me to be a pretty unfriendly ordering. The search might fail for what are basically version-related reasons, and in such a case it'd be better to say "your Python is too old" than "could not find shared library for Python".
2017-02-21Drop support for Python 2.3Peter Eisentraut
There is no specific reason for this right now, but keeping support for old Python versions around indefinitely increases the maintenance burden. The oldest supported Python version is now Python 2.4, which is still shipped in RHEL/CentOS 5 by default. In configure, add a check for the required Python version and give a friendly error message for an old version, instead of relying on an obscure build error later on.
2016-10-07Fix python shlib probe for Cygwin.Tom Lane
On buildfarm member cockatiel, that library is in /usr/bin. (Possibly we should look at $PATH on this platform?) Per off-list report from Andrew Dunstan.
2016-10-06Try to fix python shlib probe for MinGW.Tom Lane
Per discussion with Andrew Dunstan, it seems there are three peculiarities of the Python installation on MinGW (or at least, of the instance on buildfarm member frogmouth). First, the library name doesn't contain "2.7" but just "27". It looks like we can deal with that by consulting get_config_vars('VERSION') to see whether a dot should be used or not. Second, the library might be in c:/Windows/System32, analogously to it possibly being in /usr/lib on Unix-oid platforms. Third, it's apparently not standard to use the prefix "lib" on the file name. This patch will accept files with or without "lib", but the first part of that may well be dead code.
2016-10-05In python shlib probe, cater for OpenBSD, which omits the .so symlink.Tom Lane
Most Unix-oid platforms provide a symlink "libfoo.so" -> "libfoo.so.n.n" to allow the linker to resolve a reference "-lfoo" to a version-numbered shared library. OpenBSD has apparently hacked ld(1) to do this internally, because there are no such symlinks to be found in their library directories. Tweak the new code in PGAC_CHECK_PYTHON_EMBED_SETUP to cope. Per buildfarm member curculio.
2016-10-04Huh, we do need to look in $python_configdir for the Python shlib.Tom Lane
Debian does it that way, for no doubt what seems to them a good reason. Thanks to Aidan Van Dyk for confirmation.
2016-10-04Improve (I hope) our autolocation of the Python shared library.Tom Lane
Older versions of Python produce garbage (or at least useless) values of get_config_vars('LDLIBRARY'). Newer versions produce garbage (or at least useless) values of get_config_vars('SO'), which was defeating our configure logic that attempted to identify where the Python shlib really is. The net result, at least with a stock Python 3.5 installation on macOS, was that we were linking against a static library in the mistaken belief that it was a shared library. This managed to work, if you count statically absorbing libpython into plpython.so as working. But it no longer works as of commit d51924be8, because now we get separate static copies of libpython in plpython.so and hstore_plpython.so, and those can't interoperate on the same data. There are some other infelicities like assuming that nobody ever installs a private version of Python on a macOS machine. Hence, forget about looking in $python_configdir for the Python shlib; as far as I can tell no version of Python has ever put one there, and certainly no currently-supported version does. Also, rather than relying on get_config_vars('SO'), just try all the possibilities for shlib extensions. Also, rather than trusting Py_ENABLE_SHARED, believe we've found a shlib only if it has a recognized extension. Last, explicitly cope with the possibility that the shlib is really in /usr/lib and $python_libdir is a red herring --- this is the actual situation on older macOS, but we were only accidentally working with it. Discussion: <[email protected]>
2015-05-27Remove configure check prohibiting threaded libpython on OpenBSD.Tom Lane
According to recent tests, this case now works fine, so there's no reason to reject it anymore. (Even if there are still some OpenBSD platforms in the wild where it doesn't work, removing the check won't break any case that worked before.) We can actually remove the entire test that discovers whether libpython is threaded, since without the OpenBSD case there's no need to know that at all. Per report from Davin Potts. Back-patch to all active branches.
2015-05-03fix escaping of brackets for m4 broken in ↵Andrew Dunstan
b6b2149e48aa61981ae0199c963d5145a37c258c
2015-05-03Fix python_includespec on Windows at configure timeAndrew Dunstan
By converting to using forward slashes at configure time we avoid having to repeat the logic anywhere that this is needed, such as in transforms modules for plpython.
2015-05-02Move interpreter shared library detection to configurePeter Eisentraut
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.
2014-05-30On OS X, link libpython normally, ignoring the "framework" framework.Tom Lane
As of Xcode 5.0, Apple isn't including the Python framework as part of the SDK-level files, which means that linking to it might fail depending on whether Xcode thinks you've selected a specific SDK version. According to their Tech Note 2328, they've basically deprecated the framework method of linking to libpython and are telling people to link to the shared library normally. (I'm pretty sure this is in direct contradiction to the advice they were giving a few years ago, but whatever.) Testing says that this approach works fine at least as far back as OS X 10.4.11, so let's just rip out the framework special case entirely. We do still need a special case to decide that OS X provides a shared library at all, unfortunately (I wonder why the distutils check doesn't work ...). But this is still less of a special case than before, so it's fine. Back-patch to all supported branches, since we'll doubtless be hearing about this more as more people update to recent Xcode.
2013-01-06Fix plpython build on older versions of OS X.Tom Lane
Pre-Lion versions of Apple's linker don't allow space between -F and its argument. (Snow Leopard is nice enough to tell you that in so many words, but older versions just fail with very obscure link errors, as seen on buildfarm member locust for instance.) Oversight in commit fc8745070a53469a43ecbf999dc5692a36a649cc.
2013-01-05PL/Python: Make build on OS X more flexiblePeter Eisentraut
The PL/Python build on OS X was previously hardcoded to use the system installation of Python, ignoring whatever was specified to configure. Except that it would use the header files from configure, which could lead to mismatches. It was not possible to build against a custom Python installation. Now, we check in configure how the specified Python installation was built and use that, supporting framework and non-framework builds.
2012-08-30Also check for Python platform-specific include directoryPeter Eisentraut
Python can be built to have two separate include directories: one for platform-independent files and one for platform-specific files. So far, this has apparently never mattered for a PL/Python build. But with the new multi-arch Python packages in Debian and Ubuntu, this is becoming the standard configuration on these platforms, so we must check these directories separately to be able to build there. Also add a bit of reporting in configure to be able to see better what is going on with this.
2012-02-20Don't reject threaded Python on FreeBSD.Tom Lane
According to Chris Rees, this has worked for awhile, and the current FreeBSD port is removing the test anyway.
2011-11-29python.m4: Remove useless "import string" callsPeter Eisentraut
They have been unneeded since the use of the string module has been removed in a65ed83f8a6fbf35c1e563533ab8293a788b1fce.
2011-08-18Improve detection of Python 3.2 installationsPeter Eisentraut
Because of ABI tagging, the library version number might no longer be exactly the Python version number, so do extra lookups. This affects installations without a shared library, such as ActiveState's installer. Also update the way to detect the location of the 'config' directory, which can also be versioned. Ashesh Vashi
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2010-03-17Don't link PL/Python against LOCALMODLIBSPeter Eisentraut
This variable is apparently only for Python internally. In newer releases of Python this variable pulls in more and more libraries that users are less likely to have, leading to potential build failures.
2009-12-15Python 3 support in PL/PythonPeter Eisentraut
Behaves more or less unchanged compared to Python 2, but the new language variant is called plpython3u. Documentation describing the naming scheme is included.
2009-10-14In the configure check for the Python distutils module, use a less obscurePeter Eisentraut
shell construct to hide away the stderr output. Python 3.1 actually core dumps on the current invocation (http://bugs.python.org/issue7111), but the new version also has the more general advantage of saving the error message in config.log for analysis.
2009-01-04Allow configure to deal with Python 3.0. Changes were:Peter Eisentraut
print foo --> print(foo) string.join(...) --> ' '.join(...) These changes are backward compatible. The actual plpython module appears to need significant updates to support Python 3.0, though. This change just relieves interested developers from having to deal with Autoconf.
2006-10-16Punt when trying to build with threaded Python on FreeBSD.Peter Eisentraut
Also cut back on excessive use of *** to decorate configure error messages. If it's an error message, you are sure to see it without any decoration.
2005-10-13Enable threaded python builds on freebsd5, per report from Jim C. NasbyBruce Momjian
2005-09-26Prevent threaded python build on BSD's, where it fails.Bruce Momjian
Marko Kreen
2004-10-11Another try at making plpython autoconfiguration work correctly. Use aTom Lane
-L spec rather than assuming libpython is in the standard search path (this returns to the way 7.4 did it). But check the distutils output to see if it looks like Python has built a shared library, and if so link with that instead of the probably-not-shared library found in configdir.
2004-10-10Un-break plpython build for non-Windows platforms.Tom Lane
2004-10-06Allow plpython to build on Win32.Bruce Momjian
Magnus Hagander
2004-09-16Make discovery of python_configdir architecture independent. SolutionJoe Conway
from James William Pye.
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-09-01Clean up after pygresql removal: adjust/remove documentation and removePeter Eisentraut
unneeded configure work.
2002-09-04Remove leftovers from subproject removals. Fixes for Python and KerberosPeter Eisentraut
configuration.
2002-03-29Upgrade to Autoconf version 2.53. Replaced many custom macroPeter Eisentraut
calls with new or now-built-in versions. Make sure that all calls to AC_DEFINE have a third argument, for possible use of autoheader in the future.
2001-07-10Support fake root install, separate build dir, dependency tracking, ourPeter Eisentraut
choice of compiler and flags, uninstall, and peculiar Python installation layouts for PyGreSql. Also install into site-packages now, as officially recommended. And pgdb.py is also installed now, used to be forgotten.