summaryrefslogtreecommitdiff
path: root/config/programs.m4
AgeCommit message (Collapse)Author
3 daysoauth: Run Autoconf tests with correct compiler flagsJacob Champion
Commit b0635bfda split off the CPPFLAGS/LDFLAGS/LDLIBS for libcurl into their own separate Makefile variables, but I neglected to move the existing AC_CHECKs for Curl into a place where they would make use of those variables. They instead tested the system libcurl, which 1) is unhelpful if a different Curl is being used for the build and 2) will fail the build entirely if no system libcurl exists. Correct the order of operations here. Reported-by: Ivan Kush <ivan.kush@tantorlabs.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Ivan Kush <ivan.kush@tantorlabs.com> Discussion: https://postgr.es/m/8a611028-51a1-408c-b592-832e2e6e1fc9%40tantorlabs.com Backpatch-through: 18
2025-05-01oauth: Move the builtin flow into a separate moduleJacob Champion
The additional packaging footprint of the OAuth Curl dependency, as well as the existence of libcurl in the address space even if OAuth isn't ever used by a client, has raised some concerns. Split off this dependency into a separate loadable module called libpq-oauth. When configured using --with-libcurl, libpq.so searches for this new module via dlopen(). End users may choose not to install the libpq-oauth module, in which case the default flow is disabled. For static applications using libpq.a, the libpq-oauth staticlib is a mandatory link-time dependency for --with-libcurl builds. libpq.pc has been updated accordingly. The default flow relies on some libpq internals. Some of these can be safely duplicated (such as the SIGPIPE handlers), but others need to be shared between libpq and libpq-oauth for thread-safety. To avoid exporting these internals to all libpq clients forever, these dependencies are instead injected from the libpq side via an initialization function. This also lets libpq communicate the offsets of PGconn struct members to libpq-oauth, so that we can function without crashing if the module on the search path came from a different build of Postgres. (A minor-version upgrade could swap the libpq-oauth module out from under a long-running libpq client before it does its first load of the OAuth flow.) This ABI is considered "private". The module has no SONAME or version symlinks, and it's named libpq-oauth-<major>.so to avoid mixing and matching across Postgres versions. (Future improvements may promote this "OAuth flow plugin" to a first-class concept, at which point we would need a public API to replace this anyway.) Additionally, NLS support for error messages in b3f0be788a was incomplete, because the new error macros weren't being scanned by xgettext. Fix that now. Per request from Tom Lane and Bruce Momjian. Based on an initial patch by Daniel Gustafsson, who also contributed docs changes. The "bare" dlopen() concept came from Thomas Munro. Many people reviewed the design and implementation; thank you! Co-authored-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Christoph Berg <myon@debian.org> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Wolfgang Walther <walther@technowledgy.de> Discussion: https://postgr.es/m/641687.1742360249%40sss.pgh.pa.us
2025-03-19oauth: Disallow synchronous DNS in libcurlThomas Munro
There is concern that a blocking DNS lookup in libpq could stall a backend process (say, via FDW). Since there's currently no strong evidence that synchronous DNS is a popular option, disallow it entirely rather than warning at configure time. We can revisit if anyone complains. Per query from Andres Freund. Author: Jacob Champion <jacob.champion@enterprisedb.com> Discussion: https://postgr.es/m/p4bd7mn6dxr2zdak74abocyltpfdxif4pxqzixqpxpetjwt34h%40qc6jgfmoddvq
2025-02-20Add support for OAUTHBEARER SASL mechanismDaniel Gustafsson
This commit implements OAUTHBEARER, RFC 7628, and OAuth 2.0 Device Authorization Grants, RFC 8628. In order to use this there is a new pg_hba auth method called oauth. When speaking to a OAuth- enabled server, it looks a bit like this: $ psql 'host=example.org oauth_issuer=... oauth_client_id=...' Visit https://oauth.example.org/login and enter the code: FPQ2-M4BG Device authorization is currently the only supported flow so the OAuth issuer must support that in order for users to authenticate. Third-party clients may however extend this and provide their own flows. The built-in device authorization flow is currently not supported on Windows. In order for validation to happen server side a new framework for plugging in OAuth validation modules is added. As validation is implementation specific, with no default specified in the standard, PostgreSQL does not ship with one built-in. Each pg_hba entry can specify a specific validator or be left blank for the validator installed as default. This adds a requirement on libcurl for the client side support, which is optional to build, but the server side has no additional build requirements. In order to run the tests, Python is required as this adds a https server written in Python. Tests are gated behind PG_TEST_EXTRA as they open ports. This patch has been a multi-year project with many contributors involved with reviews and in-depth discussions: Michael Paquier, Heikki Linnakangas, Zhihong Yu, Mahendrakar Srinivasarao, Andrey Chudnovsky and Stephen Frost to name a few. While Jacob Champion is the main author there have been some levels of hacking by others. Daniel Gustafsson contributed the validation module and various bits and pieces; Thomas Munro wrote the client side support for kqueue. Author: Jacob Champion <jacob.champion@enterprisedb.com> Co-authored-by: Daniel Gustafsson <daniel@yesql.se> Co-authored-by: Thomas Munro <thomas.munro@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Antonin Houska <ah@cybertec.at> Reviewed-by: Kashif Zeeshan <kashi.zeeshan@gmail.com> Discussion: https://postgr.es/m/d1b467a78e0e36ed85a09adf979d04cf124a9d4b.camel@vmware.com
2025-01-17Remove flex version checksPeter Eisentraut
Remove the flex version checks from configure and meson. The cutoff versions are all so ancient that this is no longer relevant, and what the actual cutoff should be is a bit fuzzy. This also removes the ancient behavior that configure would also accept a "lex" program if it is actuall flex. This aligns the check with meson in this respect. For future reference, as of this commit, these are relevant flex versions: - The hard required minimum is flex 2.5.34 as of commit b1ef48980dd, but this has not actually been tested. - Prior to this, the minimum enforced by configure/meson was flex 2.5.35, which is the oldest present in the buildfarm right now. - As of commit 6fdd5d95634, the oldest version that will compile without warnings due to flex-generated code is flex 2.5.36. - The oldest version that probably still has some practical relevance is flex 2.5.37, which ships with CentOS/RHEL 7. Discussion: https://www.postgresql.org/message-id/1a204ccd-7ae6-478c-a431-407b5c48ccc6@eisentraut.org
2023-11-06Remove distprepPeter Eisentraut
A PostgreSQL release tarball contains a number of prebuilt files, in particular files produced by bison, flex, perl, and well as html and man documentation. We have done this consistent with established practice at the time to not require these tools for building from a tarball. Some of these tools were hard to get, or get the right version of, from time to time, and shipping the prebuilt output was a convenience to users. Now this has at least two problems: One, we have to make the build system(s) work in two modes: Building from a git checkout and building from a tarball. This is pretty complicated, but it works so far for autoconf/make. It does not currently work for meson; you can currently only build with meson from a git checkout. Making meson builds work from a tarball seems very difficult or impossible. One particular problem is that since meson requires a separate build directory, we cannot make the build update files like gram.h in the source tree. So if you were to build from a tarball and update gram.y, you will have a gram.h in the source tree and one in the build tree, but the way things work is that the compiler will always use the one in the source tree. So you cannot, for example, make any gram.y changes when building from a tarball. This seems impossible to fix in a non-horrible way. Second, there is increased interest nowadays in precisely tracking the origin of software. We can reasonably track contributions into the git tree, and users can reasonably track the path from a tarball to packages and downloads and installs. But what happens between the git tree and the tarball is obscure and in some cases non-reproducible. The solution for both of these issues is to get rid of the step that adds prebuilt files to the tarball. The tarball now only contains what is in the git tree (*). Getting the additional build dependencies is no longer a problem nowadays, and the complications to keep these dual build modes working are significant. And of course we want to get the meson build system working universally. This commit removes the make distprep target altogether. The make dist target continues to do its job, it just doesn't call distprep anymore. (*) - The tarball also contains the INSTALL file that is built at make dist time, but not by distprep. This is unchanged for now. The make maintainer-clean target, whose job it is to remove the prebuilt files in addition to what make distclean does, is now just an alias to make distprep. (In practice, it is probably obsolete given that git clean is available.) The following programs are now hard build requirements in configure (they were already required by meson.build): - bison - flex - perl Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/flat/e07408d9-e5f2-d9fd-5672-f53354e9305e@eisentraut.org
2023-04-20Use --strip-unneeded when stripping static libraries with GNU strip.Tom Lane
We've long used "--strip-unneeded" for shared libraries but plain "-x" for static libraries when stripping symbols with GNU strip. There doesn't seem to be any really good reason for that though, since --strip-unneeded produces smaller output (as "-x" alone does not remove debug symbols). Moreover it seems that llvm-strip, although it identifies as GNU strip, misbehaves when given "-x" for this purpose. It's unclear whether that's intentional or a bug in llvm-strip, but in any case it seems like changing to use --strip-unneeded in all cases should be a win. Note that this doesn't change our behavior when dealing with non-GNU strip. Per gripes from Ed Maste and Palle Girgensohn. Back-patch, in case anyone wants to use llvm-strip with stable branches. Discussion: https://postgr.es/m/17898-5308d09543463266@postgresql.org Discussion: https://postgr.es/m/20230420153338.bbj2g5jiyy3afhjz@awork3.anarazel.de
2022-09-09Bump minimum version of Flex to 2.5.35John Naylor
Since the retirement of some older buildfarm members, the oldest Flex that gets regular testing is 2.5.35. Reviewed by Andres Freund Discussion: https://www.postgresql.org/message-id/1097762.1662145681@sss.pgh.pa.us
2022-09-09Bump minimum version of Bison to 2.3John Naylor
Since the retirement of some older buildfarm members, the oldest Bison that gets regular testing is 2.3. MacOS ships that version, and will continue doing so for the forseeable future because of Apple's policy regarding GPLv3. While Mac users could use a package manager to install a newer version, there is no compelling reason to force them do so at this time. Reviewed by Andres Freund Discussion: https://www.postgresql.org/message-id/1097762.1662145681@sss.pgh.pa.us
2022-02-03Remove configure's check for rl_completion_append_character.Tom Lane
The comment for PGAC_READLINE_VARIABLES says "Readline versions < 2.1 don't have rl_completion_append_character". It seems certain that such versions are extinct in the wild, though; for sure there are none in the buildfarm. Libedit has had this variable for at least twenty years too. Also, tab-complete.c's behavior without it is quite unfriendly, since we'll emit a space even when completion fails; but we've had no complaints about that. Therefore, let's assume this variable is always there, and drop the configure check to save a few build cycles. Discussion: https://postgr.es/m/147685.1643858911@sss.pgh.pa.us
2020-01-23Add configure probe for rl_completion_suppress_quote.Tom Lane
I had supposed that all versions of Readline that have filename quoting hooks also have the rl_completion_suppress_quote variable. But it seems OpenBSD managed to find a version someplace that does not, so we'll have to expend a separate configure probe for that. (Light testing suggests that this version also lacks the bugs that make it necessary to frob that variable. Hooray!) Per buildfarm.
2020-01-23Improve psql's tab completion for filenames.Tom Lane
The Readline library contains a fair amount of knowledge about how to tab-complete filenames, but it turns out that that doesn't work too well unless we follow its expectation that we use its filename quoting hooks to quote and de-quote filenames. We were trying to do such quote handling within complete_from_files(), and that's still what we have to do if we're using libedit, which lacks those hooks. But for Readline, it works a lot better if we tell Readline that single-quote is a quoting character and then provide hooks that know the details of the quoting rules for SQL and psql meta-commands. Hence, resurrect the quoting hook functions that existed in the original version of tab-complete.c (and were disabled by commit f6689a328 because they "didn't work so well yet"), and whack on them until they do seem to work well. Notably, this fixes bug #16059 from Steven Winfield, who pointed out that the previous coding would strip quote marks from filenames in SQL COPY commands, even though they're syntactically necessary there. Now, we not only don't do that, but we'll add a quote mark when you tab-complete, even if you didn't type one. Getting this to work across a range of libedit versions (and, to a lesser extent, libreadline versions) was depressingly difficult. It will be interesting to see whether the new regression test cases pass everywhere in the buildfarm. Some future patch might try to handle quoted SQL identifiers with similar explicit quoting/dequoting logic, but that's for another day. Patch by me, reviewed by Peter Eisentraut. Discussion: https://postgr.es/m/16059-8836946734c02b84@postgresql.org
2019-08-18Remove obsolete reference to IrixPeter Eisentraut
2019-02-09Use better comment marker in Autoconf inputPeter Eisentraut
The comment marker "#" is copied to the output, so it's only appropriate for comments that make sense in the shell output. For comments about the Autoconf language, "dnl" should be used.
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 <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/30672.1546816567@sss.pgh.pa.us
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/90a92a7d-938e-507a-3bd7-ecd2b4004689@2ndquadrant.com
2017-07-31Record full paths of programs sought by "configure".Tom Lane
Previously we had a mix of uses of AC_CHECK_PROG[S] and AC_PATH_PROG[S]. The only difference between those macros is that the latter emits the full path to the program it finds, eg "/usr/bin/prove", whereas the former emits just "prove". Let's standardize on always emitting the full path; this is better for documentation of the build, and it might prevent some types of failures if later build steps are done with a different PATH setting. I did not touch the AC_CHECK_PROG[S] calls in ax_pthread.m4 and ax_prog_perl_modules.m4. There seems no need to make those diverge from upstream, since we do not record the programs sought by the former, while the latter's call to AC_CHECK_PROG(PERL,...) will never be reached. Discussion: https://postgr.es/m/25937.1501433410@sss.pgh.pa.us
2016-05-02Fix configure's incorrect version tests for flex and perl.Tom Lane
awk's equality-comparison operator is "==" not "=". We got this right in many places, but not in configure's checks for supported version numbers of flex and perl. It hadn't been noticed because unsupported versions are so old as to be basically extinct in the wild, and because the only consequence is whether or not a WARNING flies by during configure. Daniel Gustafsson noted the problem with respect to the test for flex, I found the other by reviewing other awk calls.
2015-11-18Accept flex > 2.5.x in configure.Tom Lane
Per buildfarm member anchovy, 2.6.0 exists in the wild now. Hopefully it works with Postgres; if not, we'll have to do something about that, but in any case claiming it's "too old" is pretty silly.
2015-07-02Replace obsolete autoconf macros with their modern replacements.Heikki Linnakangas
AC_TRY_COMPILE(...) -> AC_COMPILE_IFELSE([AC_LANG_PROGRAM(...)]) AC_TRY_LINK(...) -> AC_LINK_IFELSE([AC_LANG_PROGRAM(...)]) AC_TRY_RUN(...) -> AC_RUN_IFELSE([AC_LANG_PROGRAM(...)]) AC_LANG_SAVE/RESTORE -> AC_LANG_PUSH/POP AC_DECL_SYS_SIGLIST -> AC_CHECK_DECLS(...) (per snippet in autoconf manual) Also use AC_LANG_SOURCE instead of AC_LANG_PROGRAM, where the main() function is not needed. With these changes, autoconf -Wall doesn't complain anymore. Andreas Karlsson
2014-07-25Move PGAC_LDAP_SAFE to config/programs.m4.Noah Misch
This restores the style of keeping configure.in free of AC_DEFUN. Per gripe from Tom Lane.
2014-06-04Silence Bison deprecation warningsPeter Eisentraut
Bison >=3.0 issues warnings about %name-prefix="base_yy" instead of the now preferred %name-prefix "base_yy" but the latter doesn't work with Bison 2.3 or less. So for now we silence the deprecation warnings.
2013-10-11Remove maintainer-check target, fold into normal buildPeter Eisentraut
make maintainer-check was obscure and rarely called in practice, and many breakages were missed. Fold everything that make maintainer-check used to do into the normal build. Specifically: - Call duplicate_oids when genbki.pl is called. - Check for tabs in SGML files when the documentation is built. - Run msgfmt with the -c option during the regular build. Add an additional configure check to see whether we are using the GNU version. (make maintainer-check probably used to fail with non-GNU msgfmt.) Keep maintainer-check as around as phony target for the time being in case anyone is calling it. But it won't do anything anymore.
2012-08-22Fix install-strip on Mac OS XPeter Eisentraut
There was a hack put into install-sh to call strip with the correct options on Mac OS X. But that never worked, because configure disabled stripping on that platform altogether. So remove that dead code, and while we're at it, update install-sh to the latest upstream source (from Automake). Instead, set up the right strip options in programs.m4, so this now actually works the way it was originally intended.
2010-09-29Add/fix caching on some configure checksPeter Eisentraut
2010-09-22Fix remaining stray references to CVS.Tom Lane
These are just cosmetic and don't seem worth back-patching far. I put them into 9.0 just because it was trivial to do so.
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2010-02-22Revert configure warning to use "official distribution".Bruce Momjian
2010-02-22Use the term "bundled distribution" instead of "official distribution" inBruce Momjian
configure warnings.
2009-07-13Make the configure messages rejecting old bison and flex versions includeTom Lane
the full path and version of the program being rejected.
2009-07-13Advance the minimum required version of "flex" from 2.5.4 to 2.5.31, andTom Lane
update documentation accordingly. This is required in order to have support for a reentrant scanner. I'm committing this bit separately in order to have an easy reference if we later decide to make the minimum something different (like 2.5.33).
2008-08-29Remove all traces that suggest that a non-Bison yacc might be supported, andPeter Eisentraut
change build system to use only Bison. Simplify build rules, make file names uniform. Don't build the token table header file where it is not needed.
2008-05-27Require bind_textdomain_codeset() not just gettext() to enable NLS support.Tom Lane
GNU gettext before 0.10.36 does not have that function, and is generally too incomplete to be usable.
2008-02-17Upgrade to Autoconf 2.61:Peter Eisentraut
- Change configure.in to use Autoconf 2.61 and update generated files. - Update build system and documentation to support now directory variables offered by Autoconf 2.61. - Replace usages of PGAC_CHECK_ALIGNOF by AC_CHECK_ALIGNOF, now available in Autoconf 2.61. - Drop our patched version of AC_C_INLINE, as Autoconf now has the change.
2007-07-19Adjust configure script to print the bison and flex versions in use.Tom Lane
Minor rearrangements to make a few tests in a more logical order.
2006-05-23Avoid duplicate definition of LOCALEDIR in pg_config.h, already definedBruce Momjian
in port/pg_config_paths.h.
2005-12-04Add configure flag to allow libedit to be preferred over GNU readline:Bruce Momjian
--with-libedit-preferred prefer BSD Libedit over GNU Readline
2004-12-02Hack to work around broken linker on older NetBSD/OpenBSD/Irix assumedTom Lane
that readline must depend on libcurses, but it seems more recent ones use libtermcap instead. Allow that case.
2004-11-30Fix readline/libedit selection code to prefer readline over libeditTom Lane
reliably (ie, regardless of which libraries they depend on). Also make sure that we don't select headers that obviously belong to the wrong one of the two libraries. This was discussed back around 4-Sep but seems to have slipped through the cracks. The header selection could be checked more closely, perhaps, but let's see if this is good enough.
2004-09-02Some versions of lex will drop a lex.yy.c file when we probe to see ifTom Lane
they are flex. Clean up after them.
2004-09-02Use $PATH_SEPARATOR like the rest of the autoconf code, instead ofTom Lane
hardwiring IFS=: when searching paths.
2004-05-19Configure adjustments for irix.Bruce Momjian
David Turover
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-05-06Properly test for buggy flex 2.5.3.Bruce Momjian
2003-04-06Generate pg_config.h.in by autoheader. Separate out manually editablePeter Eisentraut
parts. Standardize spelling of comments in pg_config.h.
2002-04-10Readline and Zlib now required by default. Add options --without-readlinePeter Eisentraut
and --without-zlib to turn them off.
2002-04-10Add make install-strip target.Peter Eisentraut
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-08-28Fix the readline test to find dependent libraries on NetBSD and OpenBSD.Peter Eisentraut
Not pretty, but it doesn't look like the OS will get fixed sometime soon.
2001-08-06Do not pre-expand localedir as substituted in the makefile, so that 'makePeter Eisentraut
install prefix=elsewhere' works.