summaryrefslogtreecommitdiff
path: root/configure
AgeCommit message (Collapse)Author
2013-01-13Improve handling of ereport(ERROR) and elog(ERROR).Tom Lane
In commit 71450d7fd6c7cf7b3e38ac56e363bff6a681973c, we added code to inform suitably-intelligent compilers that ereport() doesn't return if the elevel is ERROR or higher. This patch extends that to elog(), and also fixes a double-evaluation hazard that the previous commit created in ereport(), as well as reducing the emitted code size. The elog() improvement requires the compiler to support __VA_ARGS__, which should be available in just about anything nowadays since it's required by C99. But our minimum language baseline is still C89, so add a configure test for that. The previous commit assumed that ereport's elevel could be evaluated twice, which isn't terribly safe --- there are already counterexamples in xlog.c. On compilers that have __builtin_constant_p, we can use that to protect the second test, since there's no possible optimization gain if the compiler doesn't know the value of elevel. Otherwise, use a local variable inside the macros to prevent double evaluation. The local-variable solution is inferior because (a) it leads to useless code being emitted when elevel isn't constant, and (b) it increases the optimization level needed for the compiler to recognize that subsequent code is unreachable. But it seems better than not teaching non-gcc compilers about unreachability at all. Lastly, if the compiler has __builtin_unreachable(), we can use that instead of abort(), resulting in a noticeable code savings since no function call is actually emitted. However, it seems wise to do this only in non-assert builds. In an assert build, continue to use abort(), so that the behavior will be predictable and debuggable if the "impossible" happens. These changes involve making the ereport and elog macros emit do-while statement blocks not just expressions, which forces small changes in a few call sites. Andres Freund, Tom Lane, Heikki Linnakangas
2013-01-11Last-gasp attempt to save libperl.so configure probe.Tom Lane
I notice that plperl's makefile adds the -I for $perl_archlibexp/CORE at the end of CPPFLAGS not the beginning. It seems somewhat unlikely that the include search order has anything to do with why buildfarm member okapi is failing, but I'm about out of other ideas.
2013-01-10Test linking libperl.so using only Perl's required libraries.Tom Lane
It appears that perl_embed_ldflags should already mention all the libraries that are required by libperl.so itself. So let's try the test link with just those and not the other LIBS we've found up to now. This should more nearly reproduce what will happen when plperl is linked, and perhaps will fix buildfarm member okapi's problem.
2013-01-10Add explicit configure-time checks for perl.h and libperl.so.Tom Lane
Although most platforms seem to package Perl in such a way that these files are present even in basic Perl installations, Debian does not. Hence, make an effort to fail during configure rather than build if --with-perl was given and these files are lacking. Per gripe from Josh Berkus.
2013-01-09Detect Windows perl linkage parameters in configure script.Andrew Dunstan
This means we can now construct a configure test for the library presence. Previously these parameters were only figured out at build time in plperl's GnuMakefile.
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.
2013-01-01Update copyrights for 2013Bruce Momjian
Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
2012-12-18Ignore libedit/libreadline while probing for standard functions.Tom Lane
Some versions of libedit expose bogus definitions of setproctitle(), optreset, and perhaps other symbols that we don't want configure to pick up on. There was a previous report of similar problems with strlcpy(), which we addressed in commit 59cf88da91bc88978b05275ebd94ac2d980c4047, but the problem has evidently grown in scope since then. In hopes of not having to deal with it again in future, rearrange configure's tests for supplied functions so that we ignore libedit/libreadline except when probing specifically for functions we expect them to provide. Per report from Christoph Berg, though this is slightly more aggressive than his proposed patch.
2012-11-23Remove -Wlogical-op from standard compiler flagsPeter Eisentraut
It creates too many warnings with GCC 4.3 and 4.4.
2012-11-16Add -Wlogical-op to standard compiler flags, if supportedPeter Eisentraut
2012-10-09restore permission bitsAlvaro Herrera
2012-10-09Rename USE_INLINE to PG_USE_INLINEAlvaro Herrera
The former name was too likely to conflict with symbols from external headers; and, as seen in recent buildfarm failures in member spoonbill, it has now happened at least in plpython.
2012-10-08Autoconfiscate selection of 64-bit int type for 64-bit large object API.Tom Lane
Get rid of the fundamentally indefensible assumption that "long long int" exists and is exactly 64 bits wide on every platform Postgres runs on. Instead let the configure script select the type to use for "pg_int64". This is a bit of a pain in the rear since we do not want to pollute client namespace with all the random symbols that pg_config.h defines; instead we have to create a separate generated header file, "pg_config_ext.h". But now that the infrastructure is there, we might have the ability to add some other stuff that's long been wanting in this area.
2012-09-30Add infrastructure for compile-time assertions about variable types.Tom Lane
Currently, the macros only work with fairly recent gcc versions, but there is room to expand them to other compilers that have comparable features. Heavily revised and autoconfiscated version of a patch by Andres Freund.
2012-08-31Make configure probe for mbstowcs_l as well as wcstombs_l.Tom Lane
We previously supposed that any given platform would supply both or neither of these functions, so that one configure test would be sufficient. It now appears that at least on AIX this is not the case ... which is likely an AIX bug, but nonetheless we need to cope with it. So use separate tests. Per bug #6758; thanks to Andrew Hastie for doing the followup testing needed to confirm what was happening. Backpatch to 9.1, where we began using these functions.
2012-08-30Remove configure flag --disable-shared, as it is no longer used by anyBruce Momjian
port. The last use was QNX, per Peter Eisentraut.
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-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.
2012-08-17Check LIBXML_VERSION instead of testing in configure script.Tom Lane
We had put a test for libxml2's xmlStructuredErrorContext variable in configure, but of course that doesn't work on Windows builds. The next best alternative seems to be to test the LIBXML_VERSION symbol provided by xmlversion.h. Per report from Talha Bin Rizwan, though this fixes it in a different way than his proposed patch.
2012-07-13Add fsync capability to initdb, and use sync_file_range() if available.Tom Lane
Historically we have not worried about fsync'ing anything during initdb (in fact, initdb intentionally passes -F to each backend launch to prevent it from fsync'ing). But with filesystems getting more aggressive about caching data, that's not such a good plan anymore. Make initdb do a pass over the finished data directory tree to fsync everything. For testing purposes, the -N/--nosync flag can be used to restore the old behavior. Also, testing shows that on Linux, sync_file_range() is much faster than posix_fadvise() for hinting to the kernel that an fsync is coming, apparently because the latter blocks on a rather small request queue while the former doesn't. So use this function if available in initdb, and also in the backend's pg_flush_data() (where it currently will affect only the speed of CREATE DATABASE's cloning step). We will later make pg_regress invoke initdb with the --nosync flag to avoid slowing down cases such as "make check" in contrib. But let's not do so until we've shaken out any portability issues in this patch. Jeff Davis, reviewed by Andres Freund
2012-07-05Remove support for using wait3() in place of waitpid().Tom Lane
All Unix-oid platforms that we currently support should have waitpid(), since it's in V2 of the Single Unix Spec. Our git history shows that the wait3 code was added to support NextStep, which we officially dropped support for as of 9.2. So get rid of the configure test, and simplify the macro spaghetti in reaper(). Per suggestion from Fujii Masao.
2012-06-28Further fix install program detectionPeter Eisentraut
The $(or) make function was introduced in GNU make 3.81, so the previous coding didn't work in 3.80. Write it differently, and improve the variable naming to make more sense in the new coding.
2012-06-27Fix install program detectionPeter Eisentraut
configure handles INSTALL as a substitution variable specially, and apparently it gets confused when it's set to empty. Use INSTALL_ instead as a workaround to avoid the issue.
2012-06-27Use system install program when available and usablePeter Eisentraut
In a3176dac22c4cd14971e35119e245abee7649cb9 we switched to using install-sh unconditionally, because the configure check AC_PROG_INSTALL would pick up any random program named install, which has caused failure reports (http://archives.postgresql.org/pgsql-hackers/2001-03/msg00312.php). Now the configure check is much improved and should avoid false positives. It has also been shown that using a system install program can significantly reduce "make install" times, so it's worth trying.
2012-06-14Stamp HEAD as 9.3devel.Tom Lane
Let the hacking begin ...
2012-05-31Stamp 9.2beta2.REL9_2_BETA2Tom Lane
2012-05-15Put back AC_REQUIRE([AC_STRUCT_TM]).Tom Lane
The BSD-ish members of the buildfarm all seem to think removing this was a bad idea. It looks to me like it resulted in omitting the system header inclusion necessary to detect the fields of struct tm correctly.
2012-05-14Remove unused AC_DEFINE symbolsPeter Eisentraut
ENABLE_DTRACE unused as of a7b7b07af340c73adee9959edf260695591a9496 HAVE_ERR_SET_MARK unused as of 4ed4b6c54e5fab24ab2624d80e26f7546edc88ad HAVE_FCVT unused as of 4553e1d80f824291932cfde30aa24a76dd8f1941 HAVE_STRUCT_SOCKADDR_UN unused as of b4cea00a1fc9d2270bfe9aeeee44915378d5f733 HAVE_SYSCONF unused as of f83356c7f574bc69969f29dc7b430b286a0cd9f4 TM_IN_SYS_TIME never used, obsolescent per Autoconf documentation
2012-05-14Remove leftovers of BeOS portPeter Eisentraut
These should have been removed when the BeOS port was removed in 44f90212236bfb6fc1279e95dc8fa315104d964e.
2012-05-12Remove unused AC_SUBST variablesPeter Eisentraut
These were apparently never used. The AC_SUBST was probably just added in a copy-and-paste manner. (The shell variables continue to be used inside configure. The change is just that we don't need them outside of configure.)
2012-05-10Stamp 9.2beta1.REL9_2_BETA1Tom Lane
2012-05-07Remove strdup, strtol, strtoul from libpgportPeter Eisentraut
These should not be needed anymore, at least after the recent port removals. So let's see whether we can do without them.
2012-05-03Remove BSD/OS (BSDi) port. There are no known users upgrading toBruce Momjian
Postgres 9.2, and perhaps no existing users either.
2012-05-01Remove dead portsPeter Eisentraut
Remove the following ports: - dgux - nextstep - sunos4 - svr4 - ultrix4 - univel These are obsolete and not worth rescuing. In most cases, there is circumstantial evidence that they wouldn't work anymore anyway.
2012-03-22Fix configure's search for collateindex.pl.Tom Lane
PGAC_PATH_COLLATEINDEX supposed that it could use AC_PATH_PROGS to search for collateindex.pl, but that macro will only accept files that are marked executable, and at least some DocBook installations don't mark the script executable (a case the docs Makefile was already prepared for). Accept the script if it's present and readable in $DOCBOOKSTYLE/bin, and otherwise search the PATH as before. Having fixed that up, we don't need the fallback case that was in the docs Makefile, and instead can throw an understandable error if configure didn't find the script. Per recent trouble report from John Lumby.
2012-02-23Allow MinGW builds to use standardly-named OpenSSL libraries.Tom Lane
In the Fedora variant of MinGW, the openssl libraries have their normal names, not libeay32 and libssleay32. Adjust configure probes to allow that, per bug #6486. Tomasz Ostrowski
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.
2012-02-07Support fls().Robert Haas
The immediate impetus for this is that Noah Misch's patch to elide unnecessary table and index rebuilds when changing typmod for temporal types uses it; and this is extracted from that patch, with some further commentary by me. But it seems logically separate from the remainder of the patch, so I'm committing it separately; this is not the first time someone has wanted fls() in the backend and probably won't be the last. If we end up using this in more performance-critical spots it may be worthwhile to add some architecture-specific optimizations to our src/port version of fls() - e.g. any x86 platform can implement this using the assembly instruction BSRL. But performance won't matter a bit for assessing typmod changes, so I'm not worried about that right now.
2012-01-07Use __sync_lock_test_and_set() for spinlocks on ARM, if available.Tom Lane
Historically we've used the SWPB instruction for TAS() on ARM, but this is deprecated and not available on ARMv6 and later. Instead, make use of a GCC builtin if available. We'll still fall back to SWPB if not, so as not to break existing ports using older GCC versions. Eventually we might want to try using __sync_lock_test_and_set() on some other architectures too, but for now that seems to present only risk and not reward. Back-patch to all supported versions, since people might want to use any of them on more recent ARM chips. Martin Pitt
2012-01-02Use mutex hint bit in PPC LWARX instructions, where possible.Tom Lane
The hint bit makes for a small but measurable performance improvement in access to contended spinlocks. On the other hand, some PPC chips give an illegal-instruction failure. There doesn't seem to be a completely bulletproof way to tell whether the hint bit will cause an illegal-instruction failure other than by trying it; but most if not all 64-bit PPC machines should accept it, so follow the Linux kernel's lead and assume it's okay to use it in 64-bit builds. Of course we must also check whether the assembler accepts the command, since even with a recent CPU the toolchain could be old. Patch by Manabu Ori, significantly modified by me.
2012-01-01Update copyright notices for year 2012.Bruce Momjian
2011-12-27Remove support for on_exit()Peter Eisentraut
All supported platforms support the C89 standard function atexit() (SunOS 4 probably being the last one not to), and supporting both makes the code clumsy.
2011-12-14Disable excessive FP optimization by recent versions of gcc.Andrew Dunstan
Suggested solution from Tom Lane. Problem discovered, probably not for the first time, while testing the mingw-w64 32 bit compiler. Backpatched to all live branches.
2011-12-10Enable compiling with the mingw-w64 32 bit compiler.Andrew Dunstan
Original patch by Lars Kanis, reviewed by Nishiyama Tomoaki and tweaked some by me. This compiler, or at least the latest version of it, is currently broken, and only passes the regression tests if built with -O0.
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-11-18Remove scandir() requirement in pg_upgrade; instead just use readdir()Bruce Momjian
--- we were not using the scandir pattern filtering anyway. This also removes the scandir requirement in configure.
2011-09-10Add missing format attributesPeter Eisentraut
Add __attribute__ decorations for printf format checking to the places that were missing them. Fix the resulting warnings. Add -Wmissing-format-attribute to the standard set of warnings for GCC, so these don't happen again. The warning fixes here are relatively harmless. The one serious problem discovered by this was already committed earlier in cf15fb5cabfbc71e07be23cfbc813daee6c5014f.
2011-09-01Userspace access vector cache for contrib/sepgsql.Robert Haas
KaiGai Kohei
2011-09-01Fix MinGW build, broken by my previous patch to add a setlocale() wrapperHeikki Linnakangas
on Windows. ecpglib doesn't link with libpgport, but picks and compiles the .c files it needs individually. To cope with that, move the setlocale() wrapper from chklocale.c to a separate setlocale.c file, and include that in ecpglib.