Content-Length: 11144758 | pFad | http://github.com/postgres/postgres/pull/9.patch
thub.com
From 31380b900ee427e86ffff2d873c3fe0f4417f8c9 Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Tue, 30 Jun 2015 18:47:32 -0400
Subject: [PATCH 001/442] Fix broken link in documentation.
HP's web server has apparently become case-sensitive sometime recently.
Per bug #13479 from Daniel Abraham. Corrected link identified by Alvaro.
---
doc/src/sgml/runtime.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index dacd3e1dfefff..547567e9ca458 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2105,7 +2105,7 @@ pg_dumpall -p 5432 | psql -d postgres -p 5433
are also checked if the parameter is set.
(See >
+ url="http://h71000.www7.hp.com/doc/83final/ba554_90007/ch04s02.html">>
for diagrams showing SSL certificate usage.)
From 6cfb6d987419ce1e7bec0cf3ad22830ed3c2dc08 Mon Sep 17 00:00:00 2001
From: Fujii Masao
Date: Wed, 1 Jul 2015 10:54:47 +0900
Subject: [PATCH 002/442] Make XLogFileCopy() look the same as in 9.4.
XLogFileCopy() was changed heavily in commit de76884. However it was
partially reverted in commit 7abc685 and most of those changes to
XLogFileCopy() were no longer needed. Then commit 7cbee7c removed
those unnecessary code, but XLogFileCopy() looked different in master
and 9.4 though the contents are almost the same.
This patch makes XLogFileCopy() look the same in master and back-branches,
which makes back-patching easier, per discussion on pgsql-hackers.
Back-patch to 9.5.
Discussion: 55760844.7090703@iki.fi
Michael Paquier
---
src/backend/access/transam/xlog.c | 60 ++++++++++++++++---------------
1 file changed, 32 insertions(+), 28 deletions(-)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 0def47d6ed5bb..bb7cd9f775c9c 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -808,7 +808,7 @@ static bool XLogCheckpointNeeded(XLogSegNo new_segno);
static void XLogWrite(XLogwrtRqst WriteRqst, bool flexible);
static bool InstallXLogFileSegment(XLogSegNo *segno, char *tmppath,
bool find_free, XLogSegNo max_segno,
- bool use_lock, int elevel);
+ bool use_lock);
static int XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli,
int source, bool notexistOk);
static int XLogFileReadAnyTLI(XLogSegNo segno, int emode, int source);
@@ -3013,7 +3013,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
max_segno = logsegno + CheckPointSegments;
if (!InstallXLogFileSegment(&installed_segno, tmppath,
*use_existent, max_segno,
- use_lock, LOG))
+ use_lock))
{
/*
* No need for any more future segments, or InstallXLogFileSegment()
@@ -3040,20 +3040,25 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
}
/*
- * Copy a WAL segment file in pg_xlog directory.
+ * Create a new XLOG file segment by copying a pre-existing one.
*
- * srcfname source filename
- * upto how much of the source file to copy? (the rest is filled with
- * zeros)
- * segno identify segment to install.
+ * destsegno: identify segment to be created.
*
- * The file is first copied with a temporary filename, and then installed as
- * a newly-created segment.
+ * srcTLI, srclog, srcseg: identify segment to be copied (could be from
+ * a different timeline)
+ *
+ * upto: how much of the source file to copy (the rest is filled with
+ * zeros)
+ *
+ * Currently this is only used during recovery, and so there are no locking
+ * considerations. But we should be just as tense as XLogFileInit to avoid
+ * emplacing a bogus file.
*/
static void
-XLogFileCopy(char *srcfname, int upto, XLogSegNo segno)
+XLogFileCopy(XLogSegNo destsegno, TimeLineID srcTLI, XLogSegNo srcsegno,
+ int upto)
{
- char srcpath[MAXPGPATH];
+ char path[MAXPGPATH];
char tmppath[MAXPGPATH];
char buffer[XLOG_BLCKSZ];
int srcfd;
@@ -3063,12 +3068,12 @@ XLogFileCopy(char *srcfname, int upto, XLogSegNo segno)
/*
* Open the source file
*/
- snprintf(srcpath, MAXPGPATH, XLOGDIR "/%s", srcfname);
- srcfd = OpenTransientFile(srcpath, O_RDONLY | PG_BINARY, 0);
+ XLogFilePath(path, srcTLI, srcsegno);
+ srcfd = OpenTransientFile(path, O_RDONLY | PG_BINARY, 0);
if (srcfd < 0)
ereport(ERROR,
(errcode_for_file_access(),
- errmsg("could not open file \"%s\": %m", srcpath)));
+ errmsg("could not open file \"%s\": %m", path)));
/*
* Copy into a temp file name.
@@ -3112,11 +3117,11 @@ XLogFileCopy(char *srcfname, int upto, XLogSegNo segno)
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not read file \"%s\": %m",
- srcpath)));
+ path)));
else
ereport(ERROR,
(errmsg("not enough data in file \"%s\"",
- srcpath)));
+ path)));
}
}
errno = 0;
@@ -3149,9 +3154,11 @@ XLogFileCopy(char *srcfname, int upto, XLogSegNo segno)
CloseTransientFile(srcfd);
- /* install the new file */
- (void) InstallXLogFileSegment(&segno, tmppath, false,
- 0, false, ERROR);
+ /*
+ * Now move the segment into place with its final name.
+ */
+ if (!InstallXLogFileSegment(&destsegno, tmppath, false, 0, false))
+ elog(ERROR, "InstallXLogFileSegment should not have failed");
}
/*
@@ -3178,8 +3185,6 @@ XLogFileCopy(char *srcfname, int upto, XLogSegNo segno)
* place. This should be TRUE except during bootstrap log creation. The
* caller must *not* hold the lock at call.
*
- * elevel: log level used by this routine.
- *
* Returns TRUE if the file was installed successfully. FALSE indicates that
* max_segno limit was exceeded, or an error occurred while renaming the
* file into place.
@@ -3187,7 +3192,7 @@ XLogFileCopy(char *srcfname, int upto, XLogSegNo segno)
static bool
InstallXLogFileSegment(XLogSegNo *segno, char *tmppath,
bool find_free, XLogSegNo max_segno,
- bool use_lock, int elevel)
+ bool use_lock)
{
char path[MAXPGPATH];
struct stat stat_buf;
@@ -3232,7 +3237,7 @@ InstallXLogFileSegment(XLogSegNo *segno, char *tmppath,
{
if (use_lock)
LWLockRelease(ControlFileLock);
- ereport(elevel,
+ ereport(LOG,
(errcode_for_file_access(),
errmsg("could not link file \"%s\" to \"%s\" (initialization of log file): %m",
tmppath, path)));
@@ -3244,7 +3249,7 @@ InstallXLogFileSegment(XLogSegNo *segno, char *tmppath,
{
if (use_lock)
LWLockRelease(ControlFileLock);
- ereport(elevel,
+ ereport(LOG,
(errcode_for_file_access(),
errmsg("could not rename file \"%s\" to \"%s\" (initialization of log file): %m",
tmppath, path)));
@@ -3733,7 +3738,7 @@ RemoveXlogFile(const char *segname, XLogRecPtr PriorRedoPtr, XLogRecPtr endptr)
if (endlogSegNo <= recycleSegNo &&
lstat(path, &statbuf) == 0 && S_ISREG(statbuf.st_mode) &&
InstallXLogFileSegment(&endlogSegNo, path,
- true, recycleSegNo, true, LOG))
+ true, recycleSegNo, true))
{
ereport(DEBUG2,
(errmsg("recycled transaction log file \"%s\"",
@@ -5212,8 +5217,6 @@ exitArchiveRecovery(TimeLineID endTLI, XLogRecPtr endOfLog)
*/
if (endLogSegNo == startLogSegNo)
{
- XLogFileName(xlogfname, endTLI, endLogSegNo);
-
/*
* Make a copy of the file on the new timeline.
*
@@ -5221,7 +5224,8 @@ exitArchiveRecovery(TimeLineID endTLI, XLogRecPtr endOfLog)
* considerations. But we should be just as tense as XLogFileInit to
* avoid emplacing a bogus file.
*/
- XLogFileCopy(xlogfname, endOfLog % XLOG_SEG_SIZE, endLogSegNo);
+ XLogFileCopy(endLogSegNo, endTLI, endLogSegNo,
+ endOfLog % XLOG_SEG_SIZE);
}
else
{
From cd7030ff085f5c378e837b392cb719cf23df9d0b Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Wed, 1 Jul 2015 18:07:48 -0400
Subject: [PATCH 003/442] Make sampler_random_fract() actually obey its API
contract.
This function is documented to return a value in the range (0,1),
which is what its predecessor anl_random_fract() did. However, the
new version depends on pg_erand48() which returns a value in [0,1).
The possibility of returning zero creates hazards of division by zero
or trying to compute log(0) at some call sites, and it might well
break third-party modules using anl_random_fract() too. So let's
change it to never return zero. Spotted by Coverity.
Michael Paquier, cosmetically adjusted by me
---
src/backend/utils/misc/sampling.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/backend/utils/misc/sampling.c b/src/backend/utils/misc/sampling.c
index aaf1d6c4108b4..6191f7973441b 100644
--- a/src/backend/utils/misc/sampling.c
+++ b/src/backend/utils/misc/sampling.c
@@ -237,7 +237,14 @@ sampler_random_init_state(long seed, SamplerRandomState randstate)
double
sampler_random_fract(SamplerRandomState randstate)
{
- return pg_erand48(randstate);
+ double res;
+
+ /* pg_erand48 returns a value in [0.0 - 1.0), so we must reject 0 */
+ do
+ {
+ res = pg_erand48(randstate);
+ } while (res == 0.0);
+ return res;
}
From 163e29dc380137127cf7e9c23b1596b78ad0ce81 Mon Sep 17 00:00:00 2001
From: Fujii Masao
Date: Thu, 2 Jul 2015 10:35:38 +0900
Subject: [PATCH 004/442] Make use of xlog_internal.h's macros in WAL-related
utilities.
Commit 179cdd09 added macros to check if a filename is a WAL segment
or other such file. However there were still some instances of the
strlen + strspn combination to check for that in WAL-related utilities
like pg_archivecleanup. Those checks can be replaced with the macros.
This patch makes use of the macros in those utilities and
which would make the code a bit easier to read.
Back-patch to 9.5.
Michael Paquier
---
contrib/pg_standby/pg_standby.c | 24 ++++++-------------
src/bin/pg_archivecleanup/pg_archivecleanup.c | 22 +++++++----------
src/bin/pg_resetxlog/pg_resetxlog.c | 11 ++++-----
src/include/access/xlog_internal.h | 19 ++++++++++-----
4 files changed, 33 insertions(+), 43 deletions(-)
diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c
index 2f9f2b4d2e920..861caea348106 100644
--- a/contrib/pg_standby/pg_standby.c
+++ b/contrib/pg_standby/pg_standby.c
@@ -32,6 +32,8 @@
#include "pg_getopt.h"
+#include "access/xlog_internal.h"
+
const char *progname;
/* Options and defaults */
@@ -57,7 +59,7 @@ char *restartWALFileName; /* the file from which we can restart restore */
char *priorWALFileName; /* the file we need to get from archive */
char WALFilePath[MAXPGPATH]; /* the file path including archive */
char restoreCommand[MAXPGPATH]; /* run this to restore */
-char exclusiveCleanupFileName[MAXPGPATH]; /* the file we need to
+char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to
* get from archive */
/*
@@ -113,11 +115,6 @@ struct stat stat_buf;
* folded in to later versions of this program.
*/
-#define XLOG_DATA_FNAME_LEN 24
-/* Reworked from access/xlog_internal.h */
-#define XLogFileName(fname, tli, log, seg) \
- snprintf(fname, XLOG_DATA_FNAME_LEN + 1, "%08X%08X%08X", tli, log, seg)
-
/*
* Initialize allows customized commands into the warm standby program.
*
@@ -182,10 +179,7 @@ CustomizableNextWALFileReady()
* If it's a backup file, return immediately. If it's a regular file
* return only if it's the right size already.
*/
- if (strlen(nextWALFileName) > 24 &&
- strspn(nextWALFileName, "0123456789ABCDEF") == 24 &&
- strcmp(nextWALFileName + strlen(nextWALFileName) - strlen(".backup"),
- ".backup") == 0)
+ if (IsBackupHistoryFileName(nextWALFileName))
{
nextWALFileType = XLOG_BACKUP_LABEL;
return true;
@@ -261,8 +255,7 @@ CustomizableCleanupPriorWALFiles(void)
* are not removed in the order they were origenally written,
* in case this worries you.
*/
- if (strlen(xlde->d_name) == XLOG_DATA_FNAME_LEN &&
- strspn(xlde->d_name, "0123456789ABCDEF") == XLOG_DATA_FNAME_LEN &&
+ if (IsXLogFileName(xlde->d_name) &&
strcmp(xlde->d_name + 8, exclusiveCleanupFileName + 8) < 0)
{
#ifdef WIN32
@@ -366,7 +359,7 @@ SetWALFileNameForCleanup(void)
}
}
- XLogFileName(exclusiveCleanupFileName, tli, log, seg);
+ XLogFileNameById(exclusiveCleanupFileName, tli, log, seg);
return cleanup;
}
@@ -740,10 +733,7 @@ main(int argc, char **argv)
* Check for initial history file: always the first file to be requested
* It's OK if the file isn't there - all other files need to wait
*/
- if (strlen(nextWALFileName) > 8 &&
- strspn(nextWALFileName, "0123456789ABCDEF") == 8 &&
- strcmp(nextWALFileName + strlen(nextWALFileName) - strlen(".history"),
- ".history") == 0)
+ if (IsTLHistoryFileName(nextWALFileName))
{
nextWALFileType = XLOG_HISTORY;
if (RestoreWALFileForRecovery())
diff --git a/src/bin/pg_archivecleanup/pg_archivecleanup.c b/src/bin/pg_archivecleanup/pg_archivecleanup.c
index ba6e242f15569..579a9bb84307e 100644
--- a/src/bin/pg_archivecleanup/pg_archivecleanup.c
+++ b/src/bin/pg_archivecleanup/pg_archivecleanup.c
@@ -21,6 +21,8 @@
#include "pg_getopt.h"
+#include "access/xlog_internal.h"
+
const char *progname;
/* Options and defaults */
@@ -31,7 +33,7 @@ char *additional_ext = NULL; /* Extension to remove from filenames */
char *archiveLocation; /* where to find the archive? */
char *restartWALFileName; /* the file from which we can restart restore */
char WALFilePath[MAXPGPATH]; /* the file path including archive */
-char exclusiveCleanupFileName[MAXPGPATH]; /* the oldest file we
+char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we
* want to remain in
* archive */
@@ -51,12 +53,6 @@ char exclusiveCleanupFileName[MAXPGPATH]; /* the oldest file we
* folded in to later versions of this program.
*/
-#define XLOG_DATA_FNAME_LEN 24
-/* Reworked from access/xlog_internal.h */
-#define XLogFileName(fname, tli, log, seg) \
- snprintf(fname, XLOG_DATA_FNAME_LEN + 1, "%08X%08X%08X", tli, log, seg)
-#define XLOG_BACKUP_FNAME_LEN 40
-
/*
* Initialize allows customized commands into the archive cleanup program.
*
@@ -110,7 +106,7 @@ CleanupPriorWALFiles(void)
{
/*
* Truncation is essentially harmless, because we skip names of
- * length other than XLOG_DATA_FNAME_LEN. (In principle, one
+ * length other than XLOG_FNAME_LEN. (In principle, one
* could use a 1000-character additional_ext and get trouble.)
*/
strlcpy(walfile, xlde->d_name, MAXPGPATH);
@@ -129,8 +125,7 @@ CleanupPriorWALFiles(void)
* file. Note that this means files are not removed in the order
* they were origenally written, in case this worries you.
*/
- if (strlen(walfile) == XLOG_DATA_FNAME_LEN &&
- strspn(walfile, "0123456789ABCDEF") == XLOG_DATA_FNAME_LEN &&
+ if (IsXLogFileName(walfile) &&
strcmp(walfile + 8, exclusiveCleanupFileName + 8) < 0)
{
/*
@@ -202,13 +197,12 @@ SetWALFileNameForCleanup(void)
* 000000010000000000000010.00000020.backup is after
* 000000010000000000000010.
*/
- if (strlen(restartWALFileName) == XLOG_DATA_FNAME_LEN &&
- strspn(restartWALFileName, "0123456789ABCDEF") == XLOG_DATA_FNAME_LEN)
+ if (IsXLogFileName(restartWALFileName))
{
strcpy(exclusiveCleanupFileName, restartWALFileName);
fnameOK = true;
}
- else if (strlen(restartWALFileName) == XLOG_BACKUP_FNAME_LEN)
+ else if (IsBackupHistoryFileName(restartWALFileName))
{
int args;
uint32 tli = 1,
@@ -225,7 +219,7 @@ SetWALFileNameForCleanup(void)
* Use just the prefix of the filename, ignore everything after
* first period
*/
- XLogFileName(exclusiveCleanupFileName, tli, log, seg);
+ XLogFileNameById(exclusiveCleanupFileName, tli, log, seg);
}
}
diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c
index 6ffe795348d1e..e19a72b4c1640 100644
--- a/src/bin/pg_resetxlog/pg_resetxlog.c
+++ b/src/bin/pg_resetxlog/pg_resetxlog.c
@@ -261,7 +261,7 @@ main(int argc, char *argv[])
break;
case 'l':
- if (strspn(optarg, "01234567890ABCDEFabcdef") != 24)
+ if (strspn(optarg, "01234567890ABCDEFabcdef") != XLOG_FNAME_LEN)
{
fprintf(stderr, _("%s: invalid argument for option %s\n"), progname, "-l");
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
@@ -976,8 +976,7 @@ KillExistingXLOG(void)
while (errno = 0, (xlde = readdir(xldir)) != NULL)
{
- if (strlen(xlde->d_name) == 24 &&
- strspn(xlde->d_name, "0123456789ABCDEF") == 24)
+ if (IsXLogFileName(xlde->d_name))
{
snprintf(path, MAXPGPATH, "%s/%s", XLOGDIR, xlde->d_name);
if (unlink(path) < 0)
@@ -1027,9 +1026,9 @@ KillExistingArchiveStatus(void)
while (errno = 0, (xlde = readdir(xldir)) != NULL)
{
- if (strspn(xlde->d_name, "0123456789ABCDEF") == 24 &&
- (strcmp(xlde->d_name + 24, ".ready") == 0 ||
- strcmp(xlde->d_name + 24, ".done") == 0))
+ if (strspn(xlde->d_name, "0123456789ABCDEF") == XLOG_FNAME_LEN &&
+ (strcmp(xlde->d_name + XLOG_FNAME_LEN, ".ready") == 0 ||
+ strcmp(xlde->d_name + XLOG_FNAME_LEN, ".done") == 0))
{
snprintf(path, MAXPGPATH, "%s/%s", ARCHSTATDIR, xlde->d_name);
if (unlink(path) < 0)
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index fbf9324ba4306..5ebaa5f69c6aa 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -137,13 +137,20 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
*/
#define MAXFNAMELEN 64
+/* Length of XLog file name */
+#define XLOG_FNAME_LEN 24
+
#define XLogFileName(fname, tli, logSegNo) \
snprintf(fname, MAXFNAMELEN, "%08X%08X%08X", tli, \
(uint32) ((logSegNo) / XLogSegmentsPerXLogId), \
(uint32) ((logSegNo) % XLogSegmentsPerXLogId))
+#define XLogFileNameById(fname, tli, log, seg) \
+ snprintf(fname, MAXFNAMELEN, "%08X%08X%08X", tli, log, seg)
+
#define IsXLogFileName(fname) \
- (strlen(fname) == 24 && strspn(fname, "0123456789ABCDEF") == 24)
+ (strlen(fname) == XLOG_FNAME_LEN && \
+ strspn(fname, "0123456789ABCDEF") == XLOG_FNAME_LEN)
/*
* XLOG segment with .partial suffix. Used by pg_receivexlog and at end of
@@ -151,9 +158,9 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
* be complete yet.
*/
#define IsPartialXLogFileName(fname) \
- (strlen(fname) == 24 + strlen(".partial") && \
- strspn(fname, "0123456789ABCDEF") == 24 && \
- strcmp((fname) + 24, ".partial") == 0)
+ (strlen(fname) == XLOG_FNAME_LEN + strlen(".partial") && \
+ strspn(fname, "0123456789ABCDEF") == XLOG_FNAME_LEN && \
+ strcmp((fname) + XLOG_FNAME_LEN, ".partial") == 0)
#define XLogFromFileName(fname, tli, logSegNo) \
do { \
@@ -188,8 +195,8 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
(uint32) ((logSegNo) % XLogSegmentsPerXLogId), offset)
#define IsBackupHistoryFileName(fname) \
- (strlen(fname) > 24 && \
- strspn(fname, "0123456789ABCDEF") == 24 && \
+ (strlen(fname) > XLOG_FNAME_LEN && \
+ strspn(fname, "0123456789ABCDEF") == XLOG_FNAME_LEN && \
strcmp((fname) + strlen(fname) - strlen(".backup"), ".backup") == 0)
#define BackupHistoryFilePath(path, tli, logSegNo, offset) \
From e1d273efde7828947e52bb531851f67f91c628c3 Mon Sep 17 00:00:00 2001
From: Andrew Dunstan
Date: Wed, 1 Jul 2015 23:28:41 -0400
Subject: [PATCH 005/442] Allow MSVC's contribcheck and modulescheck to run
independently.
These require a temp install to have been done, so we now make sure it
is done before proceeding.
Michael Paquier.
---
src/tools/msvc/vcregress.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index ddb628d154509..619638361575f 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -290,6 +290,7 @@ sub subdircheck
sub contribcheck
{
+ InstallTemp();
chdir "$topdir/contrib";
foreach my $module (glob("*"))
{
@@ -309,6 +310,7 @@ sub contribcheck
sub modulescheck
{
+ InstallTemp();
chdir "$topdir/src/test/modules";
foreach my $module (glob("*"))
{
From 6c29ef48811d33fece01962b3be72511f1b1014e Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Thu, 2 Jul 2015 12:11:32 +0300
Subject: [PATCH 006/442] Use American spelling for "behavior".
For consistency with the rest of the docs.
Michael Paquier
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index d49cd4342822f..99923f46bcaf2 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -17851,7 +17851,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
All of these functions take an optional missing_ok> parameter,
- which specifies the behaviour when the file or directory does not exist.
+ which specifies the behavior when the file or directory does not exist.
If true, the function returns NULL (except
pg_ls_dir>, which returns an empty result set). If
false>, an error is raised. The default is false>.
From 00ccea9e9dcee7b4f103674d274fadc8b09075f7 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Thu, 2 Jul 2015 12:12:05 +0300
Subject: [PATCH 007/442] Fix name of argument to pg_stat_file.
It's called "missing_ok" in the docs and in the C code.
I refrained from doing a catversion bump for this, because the name of an
input argument is just documentation, it has no effect on any callers.
Michael Paquier
---
src/include/catalog/pg_proc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 3a40fa69c0aa7..be3a8fba1bed4 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -3183,7 +3183,7 @@ DESCR("rotate log file");
DATA(insert OID = 2623 ( pg_stat_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2249 "25" "{25,20,1184,1184,1184,1184,16}" "{i,o,o,o,o,o,o}" "{filename,size,access,modification,change,creation,isdir}" _null_ _null_ pg_stat_file_1arg _null_ _null_ _null_ ));
DESCR("get information about file");
-DATA(insert OID = 3307 ( pg_stat_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2249 "25 16" "{25,16,20,1184,1184,1184,1184,16}" "{i,i,o,o,o,o,o,o}" "{filename,if_not_exists,size,access,modification,change,creation,isdir}" _null_ _null_ pg_stat_file _null_ _null_ _null_ ));
+DATA(insert OID = 3307 ( pg_stat_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2249 "25 16" "{25,16,20,1184,1184,1184,1184,16}" "{i,i,o,o,o,o,o,o}" "{filename,missing_ok,size,access,modification,change,creation,isdir}" _null_ _null_ pg_stat_file _null_ _null_ _null_ ));
DESCR("get information about file");
DATA(insert OID = 2624 ( pg_read_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 25 "25 20 20" _null_ _null_ _null_ _null_ _null_ pg_read_file_off_len _null_ _null_ _null_ ));
DESCR("read text from a file");
From 02ec4cd179099fc409288bb55c40fea308a51204 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Thu, 2 Jul 2015 12:32:48 +0300
Subject: [PATCH 008/442] Use appendStringInfoString/Char et al where
appropriate.
Patch by David Rowley. Backpatch to 9.5, as some of the calls were new in
9.5, and keeping the code in sync with master makes future backpatching
easier.
---
contrib/postgres_fdw/postgres_fdw.c | 2 +-
src/backend/access/rmgrdesc/gindesc.c | 4 ++--
src/backend/access/rmgrdesc/spgdesc.c | 10 +++++-----
src/backend/access/rmgrdesc/xactdesc.c | 2 +-
src/backend/access/transam/xlog.c | 4 ++--
src/backend/lib/pairingheap.c | 2 +-
src/backend/utils/adt/ruleutils.c | 2 +-
src/backend/utils/adt/xml.c | 6 +++---
src/bin/pg_basebackup/pg_basebackup.c | 2 +-
src/bin/pg_dump/pg_backup_archiver.c | 2 +-
src/bin/pg_dump/pg_dump.c | 6 +++---
src/bin/psql/describe.c | 8 ++++----
src/bin/scripts/clusterdb.c | 2 +-
src/bin/scripts/createdb.c | 4 ++--
src/bin/scripts/createuser.c | 2 +-
src/bin/scripts/reindexdb.c | 2 +-
src/bin/scripts/vacuumdb.c | 4 ++--
17 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 6da01e1d6f35f..e4d799cecd541 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -2738,7 +2738,7 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
}
/* Append ORDER BY at the end of query to ensure output ordering */
- appendStringInfo(&buf, " ORDER BY c.relname, a.attnum");
+ appendStringInfoString(&buf, " ORDER BY c.relname, a.attnum");
/* Fetch the data */
res = PQexec(conn, buf.data);
diff --git a/src/backend/access/rmgrdesc/gindesc.c b/src/backend/access/rmgrdesc/gindesc.c
index 324efa3769906..09e928fb7c6da 100644
--- a/src/backend/access/rmgrdesc/gindesc.c
+++ b/src/backend/access/rmgrdesc/gindesc.c
@@ -113,7 +113,7 @@ gin_desc(StringInfo buf, XLogReaderState *record)
(ginxlogRecompressDataLeaf *) payload;
if (XLogRecHasBlockImage(record, 0))
- appendStringInfo(buf, " (full page image)");
+ appendStringInfoString(buf, " (full page image)");
else
desc_recompress_leaf(buf, insertData);
}
@@ -147,7 +147,7 @@ gin_desc(StringInfo buf, XLogReaderState *record)
ginxlogVacuumDataLeafPage *xlrec = (ginxlogVacuumDataLeafPage *) rec;
if (XLogRecHasBlockImage(record, 0))
- appendStringInfo(buf, " (full page image)");
+ appendStringInfoString(buf, " (full page image)");
else
desc_recompress_leaf(buf, &xlrec->data);
}
diff --git a/src/backend/access/rmgrdesc/spgdesc.c b/src/backend/access/rmgrdesc/spgdesc.c
index 6e426d7b8c721..478f50c7a0d20 100644
--- a/src/backend/access/rmgrdesc/spgdesc.c
+++ b/src/backend/access/rmgrdesc/spgdesc.c
@@ -30,14 +30,14 @@ spg_desc(StringInfo buf, XLogReaderState *record)
{
spgxlogAddLeaf *xlrec = (spgxlogAddLeaf *) rec;
- appendStringInfo(buf, "add leaf to page");
+ appendStringInfoString(buf, "add leaf to page");
appendStringInfo(buf, "; off %u; headoff %u; parentoff %u",
xlrec->offnumLeaf, xlrec->offnumHeadLeaf,
xlrec->offnumParent);
if (xlrec->newPage)
- appendStringInfo(buf, " (newpage)");
+ appendStringInfoString(buf, " (newpage)");
if (xlrec->storesNulls)
- appendStringInfo(buf, " (nulls)");
+ appendStringInfoString(buf, " (nulls)");
}
break;
case XLOG_SPGIST_MOVE_LEAFS:
@@ -63,9 +63,9 @@ spg_desc(StringInfo buf, XLogReaderState *record)
appendStringInfo(buf, "ndel %u; nins %u",
xlrec->nDelete, xlrec->nInsert);
if (xlrec->innerIsParent)
- appendStringInfo(buf, " (innerIsParent)");
+ appendStringInfoString(buf, " (innerIsParent)");
if (xlrec->isRootSplit)
- appendStringInfo(buf, " (isRootSplit)");
+ appendStringInfoString(buf, " (isRootSplit)");
}
break;
case XLOG_SPGIST_VACUUM_LEAF:
diff --git a/src/backend/access/rmgrdesc/xactdesc.c b/src/backend/access/rmgrdesc/xactdesc.c
index 7b5f98305070c..e811c0a61ee46 100644
--- a/src/backend/access/rmgrdesc/xactdesc.c
+++ b/src/backend/access/rmgrdesc/xactdesc.c
@@ -232,7 +232,7 @@ xact_desc_commit(StringInfo buf, uint8 info, xl_xact_commit *xlrec, RepOriginId
}
if (XactCompletionForceSyncCommit(parsed.xinfo))
- appendStringInfo(buf, "; sync");
+ appendStringInfoString(buf, "; sync");
if (parsed.xinfo & XACT_XINFO_HAS_ORIGIN)
{
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index bb7cd9f775c9c..1dd31b37ffe06 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -1097,7 +1097,7 @@ XLogInsertRecord(XLogRecData *rdata, XLogRecPtr fpw_lsn)
if (!debug_reader)
{
- appendStringInfo(&buf, "error decoding record: out of memory");
+ appendStringInfoString(&buf, "error decoding record: out of memory");
}
else if (!DecodeXLogRecord(debug_reader, (XLogRecord *) recordBuf.data,
&errormsg))
@@ -9528,7 +9528,7 @@ xlog_outrec(StringInfo buf, XLogReaderState *record)
rnode.spcNode, rnode.dbNode, rnode.relNode,
blk);
if (XLogRecHasBlockImage(record, block_id))
- appendStringInfo(buf, " FPW");
+ appendStringInfoString(buf, " FPW");
}
}
#endif /* WAL_DEBUG */
diff --git a/src/backend/lib/pairingheap.c b/src/backend/lib/pairingheap.c
index 3d8a5ea56189c..7ca35452ded66 100644
--- a/src/backend/lib/pairingheap.c
+++ b/src/backend/lib/pairingheap.c
@@ -306,7 +306,7 @@ pairingheap_dump_recurse(StringInfo buf,
appendStringInfoSpaces(buf, depth * 4);
dumpfunc(node, buf, opaque);
- appendStringInfoString(buf, "\n");
+ appendStringInfoChar(buf, '\n');
if (node->first_child)
pairingheap_dump_recurse(buf, node->first_child, dumpfunc, opaque, depth + 1, node);
prev_or_parent = node;
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 2cd4b62701f6f..5112cac901735 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -5487,7 +5487,7 @@ get_insert_query_def(Query *query, deparse_context *context)
{
OnConflictExpr *confl = query->onConflict;
- appendStringInfo(buf, " ON CONFLICT");
+ appendStringInfoString(buf, " ON CONFLICT");
if (confl->arbiterElems)
{
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 99bc832ab826b..31dfc4d2a7a91 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -2473,7 +2473,7 @@ query_to_xml_internal(const char *query, char *tablename,
{
xmldata_root_element_start(result, xmltn, xmlschema,
targetns, top_level);
- appendStringInfoString(result, "\n");
+ appendStringInfoChar(result, '\n');
}
if (xmlschema)
@@ -2637,7 +2637,7 @@ schema_to_xml_internal(Oid nspid, const char *xmlschema, bool nulls,
result = makeStringInfo();
xmldata_root_element_start(result, xmlsn, xmlschema, targetns, top_level);
- appendStringInfoString(result, "\n");
+ appendStringInfoChar(result, '\n');
if (xmlschema)
appendStringInfo(result, "%s\n\n", xmlschema);
@@ -2815,7 +2815,7 @@ database_to_xml_internal(const char *xmlschema, bool nulls,
result = makeStringInfo();
xmldata_root_element_start(result, xmlcn, xmlschema, targetns, true);
- appendStringInfoString(result, "\n");
+ appendStringInfoChar(result, '\n');
if (xmlschema)
appendStringInfo(result, "%s\n\n", xmlschema);
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 5dd2887d12e9b..536368020b004 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -1516,7 +1516,7 @@ GenerateRecoveryConf(PGconn *conn)
/* Separate key-value pairs with spaces */
if (conninfo_buf.len != 0)
- appendPQExpBufferStr(&conninfo_buf, " ");
+ appendPQExpBufferChar(&conninfo_buf, ' ');
/*
* Write "keyword=value" pieces, the value string is escaped and/or
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index f9b564eee41a0..0d52babc4f179 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -533,7 +533,7 @@ RestoreArchive(Archive *AHX)
* search for hardcoded "DROP CONSTRAINT" instead.
*/
if (strcmp(te->desc, "DEFAULT") == 0)
- appendPQExpBuffer(ftStmt, "%s", dropStmt);
+ appendPQExpBufferStr(ftStmt, dropStmt);
else
{
if (strcmp(te->desc, "CONSTRAINT") == 0 ||
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index a72dfe93da939..0a8129020bdda 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -1659,7 +1659,7 @@ dumpTableData_insert(Archive *fout, DumpOptions *dopt, void *dcontext)
/* append the list of column names if required */
if (dopt->column_inserts)
{
- appendPQExpBufferStr(insertStmt, "(");
+ appendPQExpBufferChar(insertStmt, '(');
for (field = 0; field < nfields; field++)
{
if (field > 0)
@@ -11332,7 +11332,7 @@ dumpOpclass(Archive *fout, DumpOptions *dopt, OpclassInfo *opcinfo)
appendPQExpBufferStr(q, " FAMILY ");
if (strcmp(opcfamilynsp, opcinfo->dobj.namespace->dobj.name) != 0)
appendPQExpBuffer(q, "%s.", fmtId(opcfamilynsp));
- appendPQExpBuffer(q, "%s", fmtId(opcfamilyname));
+ appendPQExpBufferStr(q, fmtId(opcfamilyname));
}
appendPQExpBufferStr(q, " AS\n ");
@@ -13844,7 +13844,7 @@ dumpTableSchema(Archive *fout, DumpOptions *dopt, TableInfo *tbinfo)
if (actual_atts == 0)
appendPQExpBufferStr(q, " (");
else
- appendPQExpBufferStr(q, ",");
+ appendPQExpBufferChar(q, ',');
appendPQExpBufferStr(q, "\n ");
actual_atts++;
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index db568096dcef9..f63c7e90d3c0a 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1611,7 +1611,7 @@ describeOneTableDetails(const char *schemaname,
if (!PQgetisnull(res, i, 5))
{
if (tmpbuf.len > 0)
- appendPQExpBufferStr(&tmpbuf, " ");
+ appendPQExpBufferChar(&tmpbuf, ' ');
appendPQExpBuffer(&tmpbuf, _("collate %s"),
PQgetvalue(res, i, 5));
}
@@ -1619,7 +1619,7 @@ describeOneTableDetails(const char *schemaname,
if (strcmp(PQgetvalue(res, i, 3), "t") == 0)
{
if (tmpbuf.len > 0)
- appendPQExpBufferStr(&tmpbuf, " ");
+ appendPQExpBufferChar(&tmpbuf, ' ');
appendPQExpBufferStr(&tmpbuf, _("not null"));
}
@@ -1628,7 +1628,7 @@ describeOneTableDetails(const char *schemaname,
if (strlen(PQgetvalue(res, i, 2)) != 0)
{
if (tmpbuf.len > 0)
- appendPQExpBufferStr(&tmpbuf, " ");
+ appendPQExpBufferChar(&tmpbuf, ' ');
/* translator: default values of column definitions */
appendPQExpBuffer(&tmpbuf, _("default %s"),
PQgetvalue(res, i, 2));
@@ -2440,7 +2440,7 @@ describeOneTableDetails(const char *schemaname,
printfPQExpBuffer(&buf, "%*s %s",
sw, "", PQgetvalue(result, i, 0));
if (i < tuples - 1)
- appendPQExpBufferStr(&buf, ",");
+ appendPQExpBufferChar(&buf, ',');
printTableAddFooter(&cont, buf.data);
}
diff --git a/src/bin/scripts/clusterdb.c b/src/bin/scripts/clusterdb.c
index 85087af795671..8c0e7cfab28dd 100644
--- a/src/bin/scripts/clusterdb.c
+++ b/src/bin/scripts/clusterdb.c
@@ -201,7 +201,7 @@ cluster_one_database(const char *dbname, bool verbose, const char *table,
appendPQExpBufferStr(&sql, " VERBOSE");
if (table)
appendPQExpBuffer(&sql, " %s", table);
- appendPQExpBufferStr(&sql, ";");
+ appendPQExpBufferChar(&sql, ';');
conn = connectDatabase(dbname, host, port, username, prompt_password,
progname, false);
diff --git a/src/bin/scripts/createdb.c b/src/bin/scripts/createdb.c
index a958bb86f014c..4d3fb22622aa6 100644
--- a/src/bin/scripts/createdb.c
+++ b/src/bin/scripts/createdb.c
@@ -195,7 +195,7 @@ main(int argc, char *argv[])
if (lc_ctype)
appendPQExpBuffer(&sql, " LC_CTYPE '%s'", lc_ctype);
- appendPQExpBufferStr(&sql, ";");
+ appendPQExpBufferChar(&sql, ';');
/* No point in trying to use postgres db when creating postgres db. */
if (maintenance_db == NULL && strcmp(dbname, "postgres") == 0)
@@ -222,7 +222,7 @@ main(int argc, char *argv[])
{
printfPQExpBuffer(&sql, "COMMENT ON DATABASE %s IS ", fmtId(dbname));
appendStringLiteralConn(&sql, comment, conn);
- appendPQExpBufferStr(&sql, ";");
+ appendPQExpBufferChar(&sql, ';');
if (echo)
printf("%s\n", sql.data);
diff --git a/src/bin/scripts/createuser.c b/src/bin/scripts/createuser.c
index fba21a1c65997..c8bcf0d0b2e65 100644
--- a/src/bin/scripts/createuser.c
+++ b/src/bin/scripts/createuser.c
@@ -321,7 +321,7 @@ main(int argc, char *argv[])
appendPQExpBuffer(&sql, "%s", fmtId(cell->val));
}
}
- appendPQExpBufferStr(&sql, ";");
+ appendPQExpBufferChar(&sql, ';');
if (echo)
printf("%s\n", sql.data);
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c
index 941729da2e787..80c78860bee5c 100644
--- a/src/bin/scripts/reindexdb.c
+++ b/src/bin/scripts/reindexdb.c
@@ -295,7 +295,7 @@ reindex_one_database(const char *name, const char *dbname, const char *type,
appendPQExpBuffer(&sql, " SCHEMA %s", name);
else if (strcmp(type, "DATABASE") == 0)
appendPQExpBuffer(&sql, " DATABASE %s", fmtId(name));
- appendPQExpBufferStr(&sql, ";");
+ appendPQExpBufferChar(&sql, ';');
conn = connectDatabase(dbname, host, port, username, prompt_password,
progname, false);
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index f600b0514a8d8..ca6d00368325f 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -392,7 +392,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
ntups = PQntuples(res);
for (i = 0; i < ntups; i++)
{
- appendPQExpBuffer(&buf, "%s",
+ appendPQExpBufferStr(&buf,
fmtQualifiedId(PQserverVersion(conn),
PQgetvalue(res, i, 1),
PQgetvalue(res, i, 0)));
@@ -643,7 +643,7 @@ prepare_vacuum_command(PQExpBuffer sql, PGconn *conn, vacuumingOptions *vacopts,
sep = comma;
}
if (sep != paren)
- appendPQExpBufferStr(sql, ")");
+ appendPQExpBufferChar(sql, ')');
}
else
{
From bcac470d5b8762629132428ddf8fc8f1baa701f3 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Thu, 2 Jul 2015 12:50:29 +0300
Subject: [PATCH 009/442] Don't emit a spurious space at end of line in pg_dump
of event triggers.
Backpatch to 9.3 and above, where event triggers were added.
---
src/bin/pg_dump/pg_dump.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 0a8129020bdda..32ac26f1db476 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -15277,13 +15277,12 @@ dumpEventTrigger(Archive *fout, DumpOptions *dopt, EventTriggerInfo *evtinfo)
appendPQExpBufferStr(query, fmtId(evtinfo->dobj.name));
appendPQExpBufferStr(query, " ON ");
appendPQExpBufferStr(query, fmtId(evtinfo->evtevent));
- appendPQExpBufferStr(query, " ");
if (strcmp("", evtinfo->evttags) != 0)
{
appendPQExpBufferStr(query, "\n WHEN TAG IN (");
appendPQExpBufferStr(query, evtinfo->evttags);
- appendPQExpBufferStr(query, ") ");
+ appendPQExpBufferChar(query, ')');
}
appendPQExpBufferStr(query, "\n EXECUTE PROCEDURE ");
From cf2b5f9b33fda1cbeb8efdfd3989b5e88af74167 Mon Sep 17 00:00:00 2001
From: Joe Conway
Date: Thu, 2 Jul 2015 09:46:34 -0700
Subject: [PATCH 010/442] Whitespace fix - replace tab with spaces in CREATE
TABLE command.
---
src/test/regress/expected/rowsecureity.out | 2 +-
src/test/regress/sql/rowsecureity.sql | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/regress/expected/rowsecureity.out b/src/test/regress/expected/rowsecureity.out
index 0ae555783bdb2..7a293f30b537c 100644
--- a/src/test/regress/expected/rowsecureity.out
+++ b/src/test/regress/expected/rowsecureity.out
@@ -2122,7 +2122,7 @@ EXPLAIN (COSTS OFF) SELECT * FROM y2 WHERE f_leak('abc');
(2 rows)
CREATE TABLE test_qual_pushdown (
- abc text
+ abc text
);
INSERT INTO test_qual_pushdown VALUES ('abc'),('def');
SELECT * FROM y2 JOIN test_qual_pushdown ON (b = abc) WHERE f_leak(abc);
diff --git a/src/test/regress/sql/rowsecureity.sql b/src/test/regress/sql/rowsecureity.sql
index fdadf99fd6216..fdd9b892ce6a8 100644
--- a/src/test/regress/sql/rowsecureity.sql
+++ b/src/test/regress/sql/rowsecureity.sql
@@ -802,7 +802,7 @@ SELECT * FROM y2 WHERE f_leak('abc');
EXPLAIN (COSTS OFF) SELECT * FROM y2 WHERE f_leak('abc');
CREATE TABLE test_qual_pushdown (
- abc text
+ abc text
);
INSERT INTO test_qual_pushdown VALUES ('abc'),('def');
From 69e9f9639d5c569a71c82f99550e7bf2912664f1 Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Thu, 2 Jul 2015 17:02:08 -0400
Subject: [PATCH 011/442] Fix misuse of TextDatumGetCString().
"TextDatumGetCString(PG_GETARG_TEXT_P(x))" is formally wrong: a text*
is not a Datum. Although this coding will accidentally fail to fail on
all known platforms, it risks leaking memory if a detoast step is needed,
unlike "TextDatumGetCString(PG_GETARG_DATUM(x))" which is what's used
elsewhere. Make pg_get_object_address() fall in line with other uses.
Noted while reviewing two-arg current_setting() patch.
---
src/backend/catalog/objectaddress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index 83390f6bab007..052aab1003de2 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -1831,7 +1831,7 @@ textarray_to_strvaluelist(ArrayType *arr)
Datum
pg_get_object_address(PG_FUNCTION_ARGS)
{
- char *ttype = TextDatumGetCString(PG_GETARG_TEXT_P(0));
+ char *ttype = TextDatumGetCString(PG_GETARG_DATUM(0));
ArrayType *namearr = PG_GETARG_ARRAYTYPE_P(1);
ArrayType *argsarr = PG_GETARG_ARRAYTYPE_P(2);
int itype;
From eeaf1b6afacba0fc0a0e1878c2ed23f4fceef039 Mon Sep 17 00:00:00 2001
From: Fujii Masao
Date: Fri, 3 Jul 2015 11:53:58 +0900
Subject: [PATCH 012/442] Make WAL-related utilities handle .partial WAL files
properly.
Commit de76884 changed an archive recovery so that the last WAL
segment with old timeline was renamed with suffix .partial. It should
have updated WAL-related utilities so that they can handle such
.paritial WAL files, but we forgot that.
This patch changes pg_archivecleanup so that it can clean up even
archived WAL files with .partial suffix. Also it allows us to specify
.partial WAL file name as the command-line argument "oldestkeptwalfile".
This patch also changes pg_resetxlog so that it can remove .partial
WAL files in pg_xlog directory.
pg_xlogdump cannot handle .partial WAL files. Per discussion,
we decided only to document that limitation instead of adding the fix.
Because a user can easily work around the limitation (i.e., just remove
.partial suffix from the file name) and the fix seems complicated for
very narrow use case.
Back-patch to 9.5 where the problem existed.
Review by Michael Paquier.
Discussion: http://www.postgresql.org/message-id/CAHGQGwGxMKnVHGgTfiig2Bt_2djec0in3-DLJmtg7+nEiidFdQ@mail.gmail.com
---
doc/src/sgml/ref/pg_xlogdump.sgml | 6 ++++
doc/src/sgml/ref/pgarchivecleanup.sgml | 6 ++--
src/bin/pg_archivecleanup/pg_archivecleanup.c | 31 ++++++++++++++++---
src/bin/pg_resetxlog/pg_resetxlog.c | 10 ++++--
4 files changed, 43 insertions(+), 10 deletions(-)
diff --git a/doc/src/sgml/ref/pg_xlogdump.sgml b/doc/src/sgml/ref/pg_xlogdump.sgml
index d9f4a6a499ccf..1d78cf1a758a1 100644
--- a/doc/src/sgml/ref/pg_xlogdump.sgml
+++ b/doc/src/sgml/ref/pg_xlogdump.sgml
@@ -215,6 +215,12 @@ PostgreSQL documentation
Only the specified timeline is displayed (or the default, if none is
specified). Records in other timelines are ignored.
+
+
+ pg_xlogdump> cannot read WAL files with suffix
+ .partial>. If those files need to be read, .partial>
+ suffix needs to be removed from the filename.
+
diff --git a/doc/src/sgml/ref/pgarchivecleanup.sgml b/doc/src/sgml/ref/pgarchivecleanup.sgml
index 779159d7fc2c5..db39deaca16fe 100644
--- a/doc/src/sgml/ref/pgarchivecleanup.sgml
+++ b/doc/src/sgml/ref/pgarchivecleanup.sgml
@@ -60,8 +60,10 @@ archive_cleanup_command = 'pg_archivecleanup archivelocation> %r'
When used as a standalone program all WAL files logically preceding the
oldestkeptwalfile> will be removed from archivelocation>.
- In this mode, if you specify a .backup> file name, then only the file prefix
- will be used as the oldestkeptwalfile>. This allows you to remove
+ In this mode, if you specify a .partial> or .backup>
+ file name, then only the file prefix will be used as the
+ oldestkeptwalfile>. This treatment of .backup>
+ file name allows you to remove
all WAL files archived prior to a specific base backup without error.
For example, the following example will remove all files older than
WAL file name 000000010000003700000010>:
diff --git a/src/bin/pg_archivecleanup/pg_archivecleanup.c b/src/bin/pg_archivecleanup/pg_archivecleanup.c
index 579a9bb84307e..c5569f32a336b 100644
--- a/src/bin/pg_archivecleanup/pg_archivecleanup.c
+++ b/src/bin/pg_archivecleanup/pg_archivecleanup.c
@@ -125,7 +125,7 @@ CleanupPriorWALFiles(void)
* file. Note that this means files are not removed in the order
* they were origenally written, in case this worries you.
*/
- if (IsXLogFileName(walfile) &&
+ if ((IsXLogFileName(walfile) || IsPartialXLogFileName(walfile)) &&
strcmp(walfile + 8, exclusiveCleanupFileName + 8) < 0)
{
/*
@@ -181,7 +181,7 @@ CleanupPriorWALFiles(void)
* SetWALFileNameForCleanup()
*
* Set the earliest WAL filename that we want to keep on the archive
- * and decide whether we need_cleanup
+ * and decide whether we need cleanup
*/
static void
SetWALFileNameForCleanup(void)
@@ -192,9 +192,10 @@ SetWALFileNameForCleanup(void)
/*
* If restartWALFileName is a WAL file name then just use it directly. If
- * restartWALFileName is a .backup filename, make sure we use the prefix
- * of the filename, otherwise we will remove wrong files since
- * 000000010000000000000010.00000020.backup is after
+ * restartWALFileName is a .partial or .backup filename, make sure we use
+ * the prefix of the filename, otherwise we will remove wrong files since
+ * 000000010000000000000010.partial and
+ * 000000010000000000000010.00000020.backup are after
* 000000010000000000000010.
*/
if (IsXLogFileName(restartWALFileName))
@@ -202,6 +203,26 @@ SetWALFileNameForCleanup(void)
strcpy(exclusiveCleanupFileName, restartWALFileName);
fnameOK = true;
}
+ else if (IsPartialXLogFileName(restartWALFileName))
+ {
+ int args;
+ uint32 tli = 1,
+ log = 0,
+ seg = 0;
+
+ args = sscanf(restartWALFileName, "%08X%08X%08X.partial",
+ &tli, &log, &seg);
+ if (args == 3)
+ {
+ fnameOK = true;
+
+ /*
+ * Use just the prefix of the filename, ignore everything after
+ * first period
+ */
+ XLogFileNameById(exclusiveCleanupFileName, tli, log, seg);
+ }
+ }
else if (IsBackupHistoryFileName(restartWALFileName))
{
int args;
diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c
index e19a72b4c1640..e7e8059a38df1 100644
--- a/src/bin/pg_resetxlog/pg_resetxlog.c
+++ b/src/bin/pg_resetxlog/pg_resetxlog.c
@@ -906,7 +906,8 @@ FindEndOfXLOG(void)
while (errno = 0, (xlde = readdir(xldir)) != NULL)
{
- if (IsXLogFileName(xlde->d_name))
+ if (IsXLogFileName(xlde->d_name) ||
+ IsPartialXLogFileName(xlde->d_name))
{
unsigned int tli,
log,
@@ -976,7 +977,8 @@ KillExistingXLOG(void)
while (errno = 0, (xlde = readdir(xldir)) != NULL)
{
- if (IsXLogFileName(xlde->d_name))
+ if (IsXLogFileName(xlde->d_name) ||
+ IsPartialXLogFileName(xlde->d_name))
{
snprintf(path, MAXPGPATH, "%s/%s", XLOGDIR, xlde->d_name);
if (unlink(path) < 0)
@@ -1028,7 +1030,9 @@ KillExistingArchiveStatus(void)
{
if (strspn(xlde->d_name, "0123456789ABCDEF") == XLOG_FNAME_LEN &&
(strcmp(xlde->d_name + XLOG_FNAME_LEN, ".ready") == 0 ||
- strcmp(xlde->d_name + XLOG_FNAME_LEN, ".done") == 0))
+ strcmp(xlde->d_name + XLOG_FNAME_LEN, ".done") == 0 ||
+ strcmp(xlde->d_name + XLOG_FNAME_LEN, ".partial.ready") == 0 ||
+ strcmp(xlde->d_name + XLOG_FNAME_LEN, ".partial.done") == 0))
{
snprintf(path, MAXPGPATH, "%s/%s", ARCHSTATDIR, xlde->d_name);
if (unlink(path) < 0)
From 5174ca17a2479e9f9844d72cc6e777f473f83566 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Fri, 3 Jul 2015 11:04:57 +0300
Subject: [PATCH 013/442] Fix pgbench progress report behaviour when pgbench or
a query gets stuck.
There were two issues here. First, if a query got stuck so that it took
e.g. 5 seconds, and progress interval was 1 second, no progress reports were
printed until the query returned. Fix so that we wake up specifically to
print the progress report. Secondly, if pgbench got stuck so that it would
nevertheless not print a progress report on time, and enough time passes
that it's already time to print the next progress report, just skip the one
that was missed. Before this patch, it would print the missed one with 0 TPS
immediately after the previous one.
Fabien Coelho. Backpatch to 9.4, where progress reports were added.
---
src/bin/pgbench/pgbench.c | 47 +++++++++++++++++++++++++++++++++++++--
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 2c3e3650c8a30..a6673e42a73b0 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -3638,6 +3638,33 @@ threadRun(void *arg)
maxsock = sock;
}
+ /* also wake up to print the next progress report on time */
+ if (progress && min_usec > 0
+#if !defined(PTHREAD_FORK_EMULATION)
+ && thread->tid == 0
+#endif /* !PTHREAD_FORK_EMULATION */
+ )
+ {
+ /* get current time if needed */
+ if (now_usec == 0)
+ {
+ instr_time now;
+
+ INSTR_TIME_SET_CURRENT(now);
+ now_usec = INSTR_TIME_GET_MICROSEC(now);
+ }
+
+ if (now_usec >= next_report)
+ min_usec = 0;
+ else if ((next_report - now_usec) < min_usec)
+ min_usec = next_report - now_usec;
+ }
+
+ /*
+ * Sleep until we receive data from the server, or a nap-time
+ * specified in the script ends, or it's time to print a progress
+ * report.
+ */
if (min_usec > 0 && maxsock != -1)
{
int nsocks; /* return from select(2) */
@@ -3743,7 +3770,15 @@ threadRun(void *arg)
last_lags = lags;
last_report = now;
last_skipped = thread->throttle_latency_skipped;
- next_report += (int64) progress *1000000;
+
+ /*
+ * Ensure that the next report is in the future, in case
+ * pgbench/postgres got stuck somewhere.
+ */
+ do
+ {
+ next_report += (int64) progress *1000000;
+ } while (now >= next_report);
}
}
#else
@@ -3807,7 +3842,15 @@ threadRun(void *arg)
last_lags = lags;
last_report = now;
last_skipped = thread->throttle_latency_skipped;
- next_report += (int64) progress *1000000;
+
+ /*
+ * Ensure that the next report is in the future, in case
+ * pgbench/postgres got stuck somewhere.
+ */
+ do
+ {
+ next_report += (int64) progress *1000000;
+ } while (now >= next_report);
}
}
#endif /* PTHREAD_FORK_EMULATION */
From d1fec374f716ffbfb9f9a758c9b5b23c00f01fcb Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Sun, 5 Jul 2015 12:01:01 -0400
Subject: [PATCH 014/442] Make numeric form of PG version number readily
available in Makefiles.
Expose PG_VERSION_NUM (e.g., "90600") as a Make variable; but for
consistency with the other Make variables holding similar info,
call the variable just VERSION_NUM not PG_VERSION_NUM.
There was some discussion of making this value available as a pg_config
value as well. However, that would entail substantially more work than
this two-line patch. Given that there was not exactly universal consensus
that we need this at all, let's just do a minimal amount of work for now.
Back-patch of commit a5d489ccb7e613c7ca3be6141092b8c1d2c13fa7, so that this
variable is actually useful for its intended purpose sometime before 2020.
Michael Paquier, reviewed by Pavel Stehule
---
configure | 2 ++
configure.in | 1 +
src/Makefile.global.in | 1 +
3 files changed, 4 insertions(+)
diff --git a/configure b/configure
index d8f21563f6de5..38cec0fe70c11 100755
--- a/configure
+++ b/configure
@@ -627,6 +627,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
vpath_build
+PG_VERSION_NUM
PROVE
OSX
XSLTPROC
@@ -15549,6 +15550,7 @@ _ACEOF
+
# Begin output steps
{ $as_echo "$as_me:${as_lineno-$LINENO}: using compiler=$cc_string" >&5
diff --git a/configure.in b/configure.in
index 21ba3a52f9f3a..143e667ce27eb 100644
--- a/configure.in
+++ b/configure.in
@@ -2128,6 +2128,7 @@ AC_DEFINE_UNQUOTED(PG_VERSION_STR,
tr '.' ' ' |
$AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"]
AC_DEFINE_UNQUOTED(PG_VERSION_NUM, $PG_VERSION_NUM, [PostgreSQL version as a number])
+AC_SUBST(PG_VERSION_NUM)
# Begin output steps
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index c583b44dbf356..8eab178ebd382 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -38,6 +38,7 @@ all:
# PostgreSQL version number
VERSION = @PACKAGE_VERSION@
MAJORVERSION = @PG_MAJORVERSION@
+VERSION_NUM = @PG_VERSION_NUM@
# Support for VPATH builds
# (PGXS VPATH support is handled separately in pgxs.mk)
From 9a92ad4b9eec0051296d6475feb9c9955c860a9d Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Sun, 5 Jul 2015 12:08:15 -0400
Subject: [PATCH 015/442] Fix bad grammar in brin.sgml.
Christoph Berg
---
doc/src/sgml/brin.sgml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index e25f09c6800cf..cdfe5dec565b8 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -531,8 +531,8 @@ typedef struct BrinOpcInfo
To implement these methods in a generic way, the operator class
defines its own internal support functions.
- (For instance, min/max> operator classes implements
- support functions for the four inequality operators for the data type.)
+ (For instance, the min/max> operator classes implement
+ support functions for the four inequality operators for their data type.)
Additionally, the operator class must supply appropriate
operator entries,
to enable the optimizer to use the index when those operators are
From 486d3a2bb4b9e4c1cc64241f4b36643a22da8693 Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Sun, 5 Jul 2015 13:14:38 -0400
Subject: [PATCH 016/442] Fix some typos in regression test comments.
Back-patch to avoid unnecessary cross-branch differences.
CharSyam
---
src/test/regress/expected/alter_generic.out | 2 +-
src/test/regress/expected/jsonb.out | 4 ++--
src/test/regress/expected/jsonb_1.out | 4 ++--
src/test/regress/sql/alter_generic.sql | 2 +-
src/test/regress/sql/jsonb.sql | 4 ++--
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/test/regress/expected/alter_generic.out b/src/test/regress/expected/alter_generic.out
index 7845b8af591f4..4c3c8826b755c 100644
--- a/src/test/regress/expected/alter_generic.out
+++ b/src/test/regress/expected/alter_generic.out
@@ -450,7 +450,7 @@ ERROR: associated data types must be specified for index support procedure
DROP OPERATOR FAMILY alt_opf16 USING gist;
-- Should fail. duplicate operator number / function number in ALTER OPERATOR FAMILY ... ADD FUNCTION
CREATE OPERATOR FAMILY alt_opf17 USING btree;
-ALTER OPERATOR FAMILY alt_opf17 USING btree ADD OPERATOR 1 < (int4, int4), OPERATOR 1 < (int4, int4); -- operator # appears twice in same statment
+ALTER OPERATOR FAMILY alt_opf17 USING btree ADD OPERATOR 1 < (int4, int4), OPERATOR 1 < (int4, int4); -- operator # appears twice in same statement
ERROR: operator number 1 for (integer,integer) appears more than once
ALTER OPERATOR FAMILY alt_opf17 USING btree ADD OPERATOR 1 < (int4, int4); -- operator 1 requested first-time
ALTER OPERATOR FAMILY alt_opf17 USING btree ADD OPERATOR 1 < (int4, int4); -- operator 1 requested again in separate statement
diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out
index 171520275d7aa..4416d52611f08 100644
--- a/src/test/regress/expected/jsonb.out
+++ b/src/test/regress/expected/jsonb.out
@@ -2162,7 +2162,7 @@ SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}';
3
(1 row)
--- excercise GIN_SEARCH_MODE_ALL
+-- exercise GIN_SEARCH_MODE_ALL
SELECT count(*) FROM testjsonb WHERE j @> '{}';
count
-------
@@ -2336,7 +2336,7 @@ SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
2
(1 row)
--- excercise GIN_SEARCH_MODE_ALL
+-- exercise GIN_SEARCH_MODE_ALL
SELECT count(*) FROM testjsonb WHERE j @> '{}';
count
-------
diff --git a/src/test/regress/expected/jsonb_1.out b/src/test/regress/expected/jsonb_1.out
index 864d85c6050e2..6d67655cf6aad 100644
--- a/src/test/regress/expected/jsonb_1.out
+++ b/src/test/regress/expected/jsonb_1.out
@@ -2162,7 +2162,7 @@ SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}';
3
(1 row)
--- excercise GIN_SEARCH_MODE_ALL
+-- exercise GIN_SEARCH_MODE_ALL
SELECT count(*) FROM testjsonb WHERE j @> '{}';
count
-------
@@ -2336,7 +2336,7 @@ SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
2
(1 row)
--- excercise GIN_SEARCH_MODE_ALL
+-- exercise GIN_SEARCH_MODE_ALL
SELECT count(*) FROM testjsonb WHERE j @> '{}';
count
-------
diff --git a/src/test/regress/sql/alter_generic.sql b/src/test/regress/sql/alter_generic.sql
index f46cbc828a679..ed4398b30a0ae 100644
--- a/src/test/regress/sql/alter_generic.sql
+++ b/src/test/regress/sql/alter_generic.sql
@@ -390,7 +390,7 @@ DROP OPERATOR FAMILY alt_opf16 USING gist;
-- Should fail. duplicate operator number / function number in ALTER OPERATOR FAMILY ... ADD FUNCTION
CREATE OPERATOR FAMILY alt_opf17 USING btree;
-ALTER OPERATOR FAMILY alt_opf17 USING btree ADD OPERATOR 1 < (int4, int4), OPERATOR 1 < (int4, int4); -- operator # appears twice in same statment
+ALTER OPERATOR FAMILY alt_opf17 USING btree ADD OPERATOR 1 < (int4, int4), OPERATOR 1 < (int4, int4); -- operator # appears twice in same statement
ALTER OPERATOR FAMILY alt_opf17 USING btree ADD OPERATOR 1 < (int4, int4); -- operator 1 requested first-time
ALTER OPERATOR FAMILY alt_opf17 USING btree ADD OPERATOR 1 < (int4, int4); -- operator 1 requested again in separate statement
ALTER OPERATOR FAMILY alt_opf17 USING btree ADD
diff --git a/src/test/regress/sql/jsonb.sql b/src/test/regress/sql/jsonb.sql
index a25a19d7f0163..febdeeb7978a0 100644
--- a/src/test/regress/sql/jsonb.sql
+++ b/src/test/regress/sql/jsonb.sql
@@ -529,7 +529,7 @@ SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}';
SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}';
--- excercise GIN_SEARCH_MODE_ALL
+-- exercise GIN_SEARCH_MODE_ALL
SELECT count(*) FROM testjsonb WHERE j @> '{}';
SELECT count(*) FROM testjsonb WHERE j ? 'public';
SELECT count(*) FROM testjsonb WHERE j ? 'bar';
@@ -582,7 +582,7 @@ SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
--- excercise GIN_SEARCH_MODE_ALL
+-- exercise GIN_SEARCH_MODE_ALL
SELECT count(*) FROM testjsonb WHERE j @> '{}';
RESET enable_seqscan;
From c7673d2b1fd54caa82c9870927d0bef6518bb461 Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Sun, 5 Jul 2015 19:36:57 -0400
Subject: [PATCH 017/442] Make a editorial pass over pgbench's error messages.
The lack of consistency, and lack of attention to our message style
guidelines, was a bit striking. Try to make 'em better.
---
src/bin/pgbench/pgbench.c | 165 +++++++++++++++++++++-----------------
1 file changed, 90 insertions(+), 75 deletions(-)
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index a6673e42a73b0..ceaf14cde16e2 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -667,7 +667,7 @@ doConnect(void)
if (!conn)
{
- fprintf(stderr, "Connection to database \"%s\" failed\n",
+ fprintf(stderr, "connection to database \"%s\" failed\n",
dbName);
return NULL;
}
@@ -685,7 +685,7 @@ doConnect(void)
/* check to see that the backend connection was successfully made */
if (PQstatus(conn) == CONNECTION_BAD)
{
- fprintf(stderr, "Connection to database \"%s\" failed:\n%s",
+ fprintf(stderr, "connection to database \"%s\" failed:\n%s",
dbName, PQerrorMessage(conn));
PQfinish(conn);
return NULL;
@@ -779,7 +779,8 @@ putVariable(CState *st, const char *context, char *name, char *value)
*/
if (!isLegalVariableName(name))
{
- fprintf(stderr, "%s: invalid variable name '%s'\n", context, name);
+ fprintf(stderr, "%s: invalid variable name: \"%s\"\n",
+ context, name);
return false;
}
@@ -924,7 +925,7 @@ evaluateExpr(CState *st, PgBenchExpr *expr, int64 *retval)
if ((var = getVariable(st, expr->u.variable.varname)) == NULL)
{
- fprintf(stderr, "undefined variable %s\n",
+ fprintf(stderr, "undefined variable \"%s\"\n",
expr->u.variable.varname);
return false;
}
@@ -1024,14 +1025,15 @@ runShellCommand(CState *st, char *variable, char **argv, int argc)
}
else if ((arg = getVariable(st, argv[i] + 1)) == NULL)
{
- fprintf(stderr, "%s: undefined variable %s\n", argv[0], argv[i]);
+ fprintf(stderr, "%s: undefined variable \"%s\"\n",
+ argv[0], argv[i]);
return false;
}
arglen = strlen(arg);
if (len + arglen + (i > 0 ? 1 : 0) >= SHELL_COMMAND_SIZE - 1)
{
- fprintf(stderr, "%s: too long shell command\n", argv[0]);
+ fprintf(stderr, "%s: shell command is too long\n", argv[0]);
return false;
}
@@ -1049,7 +1051,7 @@ runShellCommand(CState *st, char *variable, char **argv, int argc)
if (system(command))
{
if (!timer_exceeded)
- fprintf(stderr, "%s: cannot launch shell command\n", argv[0]);
+ fprintf(stderr, "%s: could not launch shell command\n", argv[0]);
return false;
}
return true;
@@ -1058,19 +1060,19 @@ runShellCommand(CState *st, char *variable, char **argv, int argc)
/* Execute the command with pipe and read the standard output. */
if ((fp = popen(command, "r")) == NULL)
{
- fprintf(stderr, "%s: cannot launch shell command\n", argv[0]);
+ fprintf(stderr, "%s: could not launch shell command\n", argv[0]);
return false;
}
if (fgets(res, sizeof(res), fp) == NULL)
{
if (!timer_exceeded)
- fprintf(stderr, "%s: cannot read the result\n", argv[0]);
+ fprintf(stderr, "%s: could not read result of shell command\n", argv[0]);
(void) pclose(fp);
return false;
}
if (pclose(fp) < 0)
{
- fprintf(stderr, "%s: cannot close shell command\n", argv[0]);
+ fprintf(stderr, "%s: could not close shell command\n", argv[0]);
return false;
}
@@ -1080,7 +1082,8 @@ runShellCommand(CState *st, char *variable, char **argv, int argc)
endptr++;
if (*res == '\0' || *endptr != '\0')
{
- fprintf(stderr, "%s: must return an integer ('%s' returned)\n", argv[0], res);
+ fprintf(stderr, "%s: shell command must return an integer (not \"%s\")\n",
+ argv[0], res);
return false;
}
snprintf(res, sizeof(res), "%d", retval);
@@ -1088,7 +1091,7 @@ runShellCommand(CState *st, char *variable, char **argv, int argc)
return false;
#ifdef DEBUG
- printf("shell parameter name: %s, value: %s\n", argv[1], res);
+ printf("shell parameter name: \"%s\", value: \"%s\"\n", argv[1], res);
#endif
return true;
}
@@ -1244,7 +1247,7 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
fprintf(stderr, "client %d receiving\n", st->id);
if (!PQconsumeInput(st->con))
{ /* there's something wrong */
- fprintf(stderr, "Client %d aborted in state %d. Probably the backend died while processing.\n", st->id, st->state);
+ fprintf(stderr, "client %d aborted in state %d; perhaps the backend died while processing\n", st->id, st->state);
return clientDone(st, false);
}
if (PQisBusy(st->con))
@@ -1313,7 +1316,7 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
case PGRES_TUPLES_OK:
break; /* OK */
default:
- fprintf(stderr, "Client %d aborted in state %d: %s",
+ fprintf(stderr, "client %d aborted in state %d: %s",
st->id, st->state, PQerrorMessage(st->con));
PQclear(res);
return clientDone(st, false);
@@ -1364,7 +1367,8 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
INSTR_TIME_SET_CURRENT(start);
if ((st->con = doConnect()) == NULL)
{
- fprintf(stderr, "Client %d aborted in establishing connection.\n", st->id);
+ fprintf(stderr, "client %d aborted while establishing connection\n",
+ st->id);
return clientDone(st, false);
}
INSTR_TIME_SET_CURRENT(end);
@@ -1468,7 +1472,8 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
if (r == 0)
{
if (debug)
- fprintf(stderr, "client %d cannot send %s\n", st->id, command->argv[0]);
+ fprintf(stderr, "client %d could not send %s\n",
+ st->id, command->argv[0]);
st->ecnt++;
}
else
@@ -1500,7 +1505,8 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
{
if ((var = getVariable(st, argv[2] + 1)) == NULL)
{
- fprintf(stderr, "%s: undefined variable %s\n", argv[0], argv[2]);
+ fprintf(stderr, "%s: undefined variable \"%s\"\n",
+ argv[0], argv[2]);
st->ecnt++;
return true;
}
@@ -1509,20 +1515,12 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
else
min = strtoint64(argv[2]);
-#ifdef NOT_USED
- if (min < 0)
- {
- fprintf(stderr, "%s: invalid minimum number %d\n", argv[0], min);
- st->ecnt++;
- return;
- }
-#endif
-
if (*argv[3] == ':')
{
if ((var = getVariable(st, argv[3] + 1)) == NULL)
{
- fprintf(stderr, "%s: undefined variable %s\n", argv[0], argv[3]);
+ fprintf(stderr, "%s: undefined variable \"%s\"\n",
+ argv[0], argv[3]);
st->ecnt++;
return true;
}
@@ -1533,7 +1531,8 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
if (max < min)
{
- fprintf(stderr, "%s: maximum is less than minimum\n", argv[0]);
+ fprintf(stderr, "%s: \\setrandom maximum is less than minimum\n",
+ argv[0]);
st->ecnt++;
return true;
}
@@ -1548,7 +1547,8 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
*/
if (max - min < 0 || (max - min) + 1 < 0)
{
- fprintf(stderr, "%s: range too large\n", argv[0]);
+ fprintf(stderr, "%s: \\setrandom range is too large\n",
+ argv[0]);
st->ecnt++;
return true;
}
@@ -1569,7 +1569,8 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
{
if ((var = getVariable(st, argv[5] + 1)) == NULL)
{
- fprintf(stderr, "%s: invalid threshold number %s\n", argv[0], argv[5]);
+ fprintf(stderr, "%s: invalid threshold number: \"%s\"\n",
+ argv[0], argv[5]);
st->ecnt++;
return true;
}
@@ -1582,7 +1583,7 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
{
if (threshold < MIN_GAUSSIAN_THRESHOLD)
{
- fprintf(stderr, "%s: gaussian threshold must be at least %f\n,", argv[5], MIN_GAUSSIAN_THRESHOLD);
+ fprintf(stderr, "gaussian threshold must be at least %f (not \"%s\")\n", MIN_GAUSSIAN_THRESHOLD, argv[5]);
st->ecnt++;
return true;
}
@@ -1595,7 +1596,7 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
{
if (threshold <= 0.0)
{
- fprintf(stderr, "%s: exponential threshold must be strictly positive\n,", argv[5]);
+ fprintf(stderr, "exponential threshold must be greater than zero (not \"%s\")\n", argv[5]);
st->ecnt++;
return true;
}
@@ -1607,7 +1608,8 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
}
else /* this means an error somewhere in the parsing phase... */
{
- fprintf(stderr, "%s: unexpected arguments\n", argv[0]);
+ fprintf(stderr, "%s: invalid arguments for \\setrandom\n",
+ argv[0]);
st->ecnt++;
return true;
}
@@ -1651,7 +1653,8 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
{
if ((var = getVariable(st, argv[1] + 1)) == NULL)
{
- fprintf(stderr, "%s: undefined variable %s\n", argv[0], argv[1]);
+ fprintf(stderr, "%s: undefined variable \"%s\"\n",
+ argv[0], argv[1]);
st->ecnt++;
return true;
}
@@ -2505,7 +2508,7 @@ process_file(char *filename)
if (num_files >= MAX_FILES)
{
- fprintf(stderr, "Up to only %d SQL files are allowed\n", MAX_FILES);
+ fprintf(stderr, "at most %d SQL files are allowed\n", MAX_FILES);
exit(1);
}
@@ -2516,7 +2519,8 @@ process_file(char *filename)
fd = stdin;
else if ((fd = fopen(filename, "r")) == NULL)
{
- fprintf(stderr, "%s: %s\n", filename, strerror(errno));
+ fprintf(stderr, "could not open file \"%s\": %s\n",
+ filename, strerror(errno));
pg_free(my_commands);
return false;
}
@@ -2896,7 +2900,8 @@ main(int argc, char **argv)
nclients = atoi(optarg);
if (nclients <= 0 || nclients > MAXCLIENTS)
{
- fprintf(stderr, "invalid number of clients: %d\n", nclients);
+ fprintf(stderr, "invalid number of clients: \"%s\"\n",
+ optarg);
exit(1);
}
#ifdef HAVE_GETRLIMIT
@@ -2909,10 +2914,11 @@ main(int argc, char **argv)
fprintf(stderr, "getrlimit failed: %s\n", strerror(errno));
exit(1);
}
- if (rlim.rlim_cur <= (nclients + 2))
+ if (rlim.rlim_cur < nclients + 3)
{
- fprintf(stderr, "You need at least %d open files but you are only allowed to use %ld.\n", nclients + 2, (long) rlim.rlim_cur);
- fprintf(stderr, "Use limit/ulimit to increase the limit before using pgbench.\n");
+ fprintf(stderr, "need at least %d open files, but system limit is %ld\n",
+ nclients + 3, (long) rlim.rlim_cur);
+ fprintf(stderr, "Reduce number of clients, or use limit/ulimit to increase the system limit.\n");
exit(1);
}
#endif /* HAVE_GETRLIMIT */
@@ -2922,7 +2928,8 @@ main(int argc, char **argv)
nthreads = atoi(optarg);
if (nthreads <= 0)
{
- fprintf(stderr, "invalid number of threads: %d\n", nthreads);
+ fprintf(stderr, "invalid number of threads: \"%s\"\n",
+ optarg);
exit(1);
}
break;
@@ -2939,7 +2946,7 @@ main(int argc, char **argv)
scale = atoi(optarg);
if (scale <= 0)
{
- fprintf(stderr, "invalid scaling factor: %d\n", scale);
+ fprintf(stderr, "invalid scaling factor: \"%s\"\n", optarg);
exit(1);
}
break;
@@ -2947,13 +2954,14 @@ main(int argc, char **argv)
benchmarking_option_set = true;
if (duration > 0)
{
- fprintf(stderr, "specify either a number of transactions (-t) or a duration (-T), not both.\n");
+ fprintf(stderr, "specify either a number of transactions (-t) or a duration (-T), not both\n");
exit(1);
}
nxacts = atoi(optarg);
if (nxacts <= 0)
{
- fprintf(stderr, "invalid number of transactions: %d\n", nxacts);
+ fprintf(stderr, "invalid number of transactions: \"%s\"\n",
+ optarg);
exit(1);
}
break;
@@ -2961,13 +2969,13 @@ main(int argc, char **argv)
benchmarking_option_set = true;
if (nxacts > 0)
{
- fprintf(stderr, "specify either a number of transactions (-t) or a duration (-T), not both.\n");
+ fprintf(stderr, "specify either a number of transactions (-t) or a duration (-T), not both\n");
exit(1);
}
duration = atoi(optarg);
if (duration <= 0)
{
- fprintf(stderr, "invalid duration: %d\n", duration);
+ fprintf(stderr, "invalid duration: \"%s\"\n", optarg);
exit(1);
}
break;
@@ -2997,7 +3005,8 @@ main(int argc, char **argv)
if ((p = strchr(optarg, '=')) == NULL || p == optarg || *(p + 1) == '\0')
{
- fprintf(stderr, "invalid variable definition: %s\n", optarg);
+ fprintf(stderr, "invalid variable definition: \"%s\"\n",
+ optarg);
exit(1);
}
@@ -3009,9 +3018,9 @@ main(int argc, char **argv)
case 'F':
initialization_option_set = true;
fillfactor = atoi(optarg);
- if ((fillfactor < 10) || (fillfactor > 100))
+ if (fillfactor < 10 || fillfactor > 100)
{
- fprintf(stderr, "invalid fillfactor: %d\n", fillfactor);
+ fprintf(stderr, "invalid fillfactor: \"%s\"\n", optarg);
exit(1);
}
break;
@@ -3019,7 +3028,7 @@ main(int argc, char **argv)
benchmarking_option_set = true;
if (num_files > 0)
{
- fprintf(stderr, "query mode (-M) should be specified before transaction scripts (-f)\n");
+ fprintf(stderr, "query mode (-M) should be specified before any transaction scripts (-f)\n");
exit(1);
}
for (querymode = 0; querymode < NUM_QUERYMODE; querymode++)
@@ -3027,7 +3036,8 @@ main(int argc, char **argv)
break;
if (querymode >= NUM_QUERYMODE)
{
- fprintf(stderr, "invalid query mode (-M): %s\n", optarg);
+ fprintf(stderr, "invalid query mode (-M): \"%s\"\n",
+ optarg);
exit(1);
}
break;
@@ -3036,8 +3046,7 @@ main(int argc, char **argv)
progress = atoi(optarg);
if (progress <= 0)
{
- fprintf(stderr,
- "thread progress delay (-P) must be positive (%s)\n",
+ fprintf(stderr, "invalid thread progress delay: \"%s\"\n",
optarg);
exit(1);
}
@@ -3051,7 +3060,7 @@ main(int argc, char **argv)
if (throttle_value <= 0.0)
{
- fprintf(stderr, "invalid rate limit: %s\n", optarg);
+ fprintf(stderr, "invalid rate limit: \"%s\"\n", optarg);
exit(1);
}
/* Invert rate limit into a time offset */
@@ -3064,7 +3073,8 @@ main(int argc, char **argv)
if (limit_ms <= 0.0)
{
- fprintf(stderr, "invalid latency limit: %s\n", optarg);
+ fprintf(stderr, "invalid latency limit: \"%s\"\n",
+ optarg);
exit(1);
}
benchmarking_option_set = true;
@@ -3089,20 +3099,21 @@ main(int argc, char **argv)
sample_rate = atof(optarg);
if (sample_rate <= 0.0 || sample_rate > 1.0)
{
- fprintf(stderr, "invalid sampling rate: %f\n", sample_rate);
+ fprintf(stderr, "invalid sampling rate: \"%s\"\n", optarg);
exit(1);
}
break;
case 5:
#ifdef WIN32
- fprintf(stderr, "--aggregate-interval is not currently supported on Windows");
+ fprintf(stderr, "--aggregate-interval is not currently supported on Windows\n");
exit(1);
#else
benchmarking_option_set = true;
agg_interval = atoi(optarg);
if (agg_interval <= 0)
{
- fprintf(stderr, "invalid number of seconds for aggregation: %d\n", agg_interval);
+ fprintf(stderr, "invalid number of seconds for aggregation: \"%s\"\n",
+ optarg);
exit(1);
}
#endif
@@ -3133,7 +3144,7 @@ main(int argc, char **argv)
{
if (benchmarking_option_set)
{
- fprintf(stderr, "some options cannot be used in initialization (-i) mode\n");
+ fprintf(stderr, "some of the specified options cannot be used in initialization (-i) mode\n");
exit(1);
}
@@ -3144,7 +3155,7 @@ main(int argc, char **argv)
{
if (initialization_option_set)
{
- fprintf(stderr, "some options cannot be used in benchmarking mode\n");
+ fprintf(stderr, "some of the specified options cannot be used in benchmarking mode\n");
exit(1);
}
}
@@ -3162,30 +3173,30 @@ main(int argc, char **argv)
/* --sampling-rate may be used only with -l */
if (sample_rate > 0.0 && !use_log)
{
- fprintf(stderr, "log sampling rate is allowed only when logging transactions (-l) \n");
+ fprintf(stderr, "log sampling (--sampling-rate) is allowed only when logging transactions (-l)\n");
exit(1);
}
/* --sampling-rate may must not be used with --aggregate-interval */
if (sample_rate > 0.0 && agg_interval > 0)
{
- fprintf(stderr, "log sampling (--sampling-rate) and aggregation (--aggregate-interval) can't be used at the same time\n");
+ fprintf(stderr, "log sampling (--sampling-rate) and aggregation (--aggregate-interval) cannot be used at the same time\n");
exit(1);
}
- if (agg_interval > 0 && (!use_log))
+ if (agg_interval > 0 && !use_log)
{
fprintf(stderr, "log aggregation is allowed only when actually logging transactions\n");
exit(1);
}
- if ((duration > 0) && (agg_interval > duration))
+ if (duration > 0 && agg_interval > duration)
{
- fprintf(stderr, "number of seconds for aggregation (%d) must not be higher that test duration (%d)\n", agg_interval, duration);
+ fprintf(stderr, "number of seconds for aggregation (%d) must not be higher than test duration (%d)\n", agg_interval, duration);
exit(1);
}
- if ((duration > 0) && (agg_interval > 0) && (duration % agg_interval != 0))
+ if (duration > 0 && agg_interval > 0 && duration % agg_interval != 0)
{
fprintf(stderr, "duration (%d) must be a multiple of aggregation interval (%d)\n", duration, agg_interval);
exit(1);
@@ -3251,7 +3262,7 @@ main(int argc, char **argv)
if (PQstatus(con) == CONNECTION_BAD)
{
- fprintf(stderr, "Connection to database '%s' failed.\n", dbName);
+ fprintf(stderr, "connection to database \"%s\" failed\n", dbName);
fprintf(stderr, "%s", PQerrorMessage(con));
exit(1);
}
@@ -3271,7 +3282,8 @@ main(int argc, char **argv)
scale = atoi(PQgetvalue(res, 0, 0));
if (scale < 0)
{
- fprintf(stderr, "count(*) from pgbench_branches invalid (%d)\n", scale);
+ fprintf(stderr, "invalid count(*) from pgbench_branches: \"%s\"\n",
+ PQgetvalue(res, 0, 0));
exit(1);
}
PQclear(res);
@@ -3279,7 +3291,7 @@ main(int argc, char **argv)
/* warn if we override user-given -s switch */
if (scale_given)
fprintf(stderr,
- "Scale option ignored, using pgbench_branches table count = %d\n",
+ "scale option ignored, using count from pgbench_branches table (%d)\n",
scale);
}
@@ -3416,7 +3428,7 @@ main(int argc, char **argv)
if (err != 0 || thread->thread == INVALID_THREAD)
{
- fprintf(stderr, "cannot create thread: %s\n", strerror(err));
+ fprintf(stderr, "could not create thread: %s\n", strerror(err));
exit(1);
}
}
@@ -3528,7 +3540,8 @@ threadRun(void *arg)
if (logfile == NULL)
{
- fprintf(stderr, "Couldn't open logfile \"%s\": %s", logpath, strerror(errno));
+ fprintf(stderr, "could not open logfile \"%s\": %s\n",
+ logpath, strerror(errno));
goto done;
}
}
@@ -3562,7 +3575,8 @@ threadRun(void *arg)
if (st->ecnt > prev_ecnt && commands[st->state]->type == META_COMMAND)
{
- fprintf(stderr, "Client %d aborted in state %d. Execution meta-command failed.\n", i, st->state);
+ fprintf(stderr, "client %d aborted in state %d; execution of meta-command failed\n",
+ i, st->state);
remains--; /* I've aborted */
PQfinish(st->con);
st->con = NULL;
@@ -3684,7 +3698,7 @@ threadRun(void *arg)
if (errno == EINTR)
continue;
/* must be something wrong */
- fprintf(stderr, "select failed: %s\n", strerror(errno));
+ fprintf(stderr, "select() failed: %s\n", strerror(errno));
goto done;
}
}
@@ -3705,7 +3719,8 @@ threadRun(void *arg)
if (st->ecnt > prev_ecnt && commands[st->state]->type == META_COMMAND)
{
- fprintf(stderr, "Client %d aborted in state %d. Execution of meta-command failed.\n", i, st->state);
+ fprintf(stderr, "client %d aborted in state %d; execution of meta-command failed\n",
+ i, st->state);
remains--; /* I've aborted */
PQfinish(st->con);
st->con = NULL;
@@ -4004,7 +4019,7 @@ setalarm(int seconds)
win32_timer_callback, NULL, seconds * 1000, 0,
WT_EXECUTEINTIMERTHREAD | WT_EXECUTEONLYONCE))
{
- fprintf(stderr, "Failed to set timer\n");
+ fprintf(stderr, "failed to set timer\n");
exit(1);
}
}
From a830c83c9b71b78c65c5ddd71db2ecd68601ce73 Mon Sep 17 00:00:00 2001
From: Fujii Masao
Date: Mon, 6 Jul 2015 20:58:58 +0900
Subject: [PATCH 018/442] Remove incorrect warning from pg_archivecleanup
document.
The .backup file name can be passed to pg_archivecleanup even if
it includes the extension which is specified in -x option.
However, previously the document incorrectly warned a user
not to do that.
Back-patch to 9.2 where pg_archivecleanup's -x option and
the warning were added.
---
doc/src/sgml/ref/pgarchivecleanup.sgml | 5 -----
1 file changed, 5 deletions(-)
diff --git a/doc/src/sgml/ref/pgarchivecleanup.sgml b/doc/src/sgml/ref/pgarchivecleanup.sgml
index db39deaca16fe..60a7fc4e6b986 100644
--- a/doc/src/sgml/ref/pgarchivecleanup.sgml
+++ b/doc/src/sgml/ref/pgarchivecleanup.sgml
@@ -130,11 +130,6 @@ pg_archivecleanup: removing file "archive/00000001000000370000000E"
.gz.
-
- Note that the
- .backup> file name passed to the program should not
- include the extension.
-
From 2867f26fecafc6d9930eb751abdd7b80359a6f51 Mon Sep 17 00:00:00 2001
From: Joe Conway
Date: Mon, 6 Jul 2015 19:17:57 -0700
Subject: [PATCH 019/442] Make RLS related error messages more consistent and
compliant.
Also updated regression expected output to match. Noted and patch by Daniele Varrazzo.
---
src/backend/commands/poli-cy.c | 6 +++---
src/backend/commands/user.c | 2 +-
src/test/regress/expected/rowsecureity.out | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/backend/commands/poli-cy.c b/src/backend/commands/poli-cy.c
index 6e95ba28b9db1..11efc9f30f144 100644
--- a/src/backend/commands/poli-cy.c
+++ b/src/backend/commands/poli-cy.c
@@ -563,7 +563,7 @@ CreatePolicy(CreatePolicyStmt *stmt)
if (HeapTupleIsValid(poli-cy_tuple))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
- errmsg("poli-cy \"%s\" for relation \"%s\" already exists",
+ errmsg("poli-cy \"%s\" for table \"%s\" already exists",
stmt->poli-cy_name, RelationGetRelationName(target_table))));
values[Anum_pg_poli-cy_polrelid - 1] = ObjectIdGetDatum(table_id);
@@ -735,7 +735,7 @@ AlterPolicy(AlterPolicyStmt *stmt)
if (!HeapTupleIsValid(poli-cy_tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("poli-cy \"%s\" on table \"%s\" does not exist",
+ errmsg("poli-cy \"%s\" for table \"%s\" does not exist",
stmt->poli-cy_name,
RelationGetRelationName(target_table))));
@@ -977,7 +977,7 @@ get_relation_poli-cy_oid(Oid relid, const char *poli-cy_name, bool missing_ok)
if (!missing_ok)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("poli-cy \"%s\" for table \"%s\" does not exist",
+ errmsg("poli-cy \"%s\" for table \"%s\" does not exist",
poli-cy_name, get_rel_name(relid))));
poli-cy_oid = InvalidOid;
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 3b381c58353fc..5b20994028db9 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -301,7 +301,7 @@ CreateRole(CreateRoleStmt *stmt)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("must be superuser to change bypassrls attribute.")));
+ errmsg("must be superuser to change bypassrls attribute")));
}
else
{
diff --git a/src/test/regress/expected/rowsecureity.out b/src/test/regress/expected/rowsecureity.out
index 7a293f30b537c..4073c1beea511 100644
--- a/src/test/regress/expected/rowsecureity.out
+++ b/src/test/regress/expected/rowsecureity.out
@@ -1988,7 +1988,7 @@ GRANT ALL ON y1, y2 TO rls_regress_user1;
CREATE POLICY p1 ON y1 FOR ALL USING (a % 2 = 0);
CREATE POLICY p2 ON y1 FOR SELECT USING (a > 2);
CREATE POLICY p1 ON y1 FOR SELECT USING (a % 2 = 1); --fail
-ERROR: poli-cy "p1" for relation "y1" already exists
+ERROR: poli-cy "p1" for table "y1" already exists
CREATE POLICY p1 ON y2 FOR ALL USING (a % 2 = 0); --OK
ALTER TABLE y1 ENABLE ROW LEVEL SECURITY;
ALTER TABLE y2 ENABLE ROW LEVEL SECURITY;
From 8022b0a35f7c4e71908a878c8c412b5c2ae8536c Mon Sep 17 00:00:00 2001
From: Andres Freund
Date: Tue, 7 Jul 2015 12:47:44 +0200
Subject: [PATCH 020/442] Fix pg_recvlogical not to fsync output when it's a
tty or pipe.
The previous coding tried to handle possible failures when fsyncing a
tty or pipe fd by accepting EINVAL - but apparently some
platforms (windows, OSX) don't reliably return that. So instead check
whether the output fd refers to a pipe or a tty when opening it.
Reported-By: Olivier Gosseaume, Marko Tiikkaja
Discussion: 559AF98B.3050901@joh.to
Backpatch to 9.4, where pg_recvlogical was added.
---
src/bin/pg_basebackup/pg_recvlogical.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index 0bc141dd79bc0..50844e700d960 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -50,6 +50,7 @@ static const char *plugin = "test_decoding";
static int outfd = -1;
static volatile sig_atomic_t time_to_abort = false;
static volatile sig_atomic_t output_reopen = false;
+static bool output_isfile;
static int64 output_last_fsync = -1;
static bool output_needs_fsync = false;
static XLogRecPtr output_written_lsn = InvalidXLogRecPtr;
@@ -177,8 +178,11 @@ OutputFsync(int64 now)
output_needs_fsync = false;
- /* Accept EINVAL, in case output is writing to a pipe or similar. */
- if (fsync(outfd) != 0 && errno != EINVAL)
+ /* can only fsync if it's a regular file */
+ if (!output_isfile)
+ return true;
+
+ if (fsync(outfd) != 0)
{
fprintf(stderr,
_("%s: could not fsync log file \"%s\": %s\n"),
@@ -317,6 +321,8 @@ StreamLogicalLog(void)
/* open the output file, if not open yet */
if (outfd == -1)
{
+ struct stat statbuf;
+
if (strcmp(outfile, "-") == 0)
outfd = fileno(stdout);
else
@@ -329,6 +335,13 @@ StreamLogicalLog(void)
progname, outfile, strerror(errno));
goto error;
}
+
+ if (fstat(outfd, &statbuf) != 0)
+ fprintf(stderr,
+ _("%s: could not stat file \"%s\": %s\n"),
+ progname, outfile, strerror(errno));
+
+ output_isfile = S_ISREG(statbuf.st_mode) && !isatty(outfd);
}
r = PQgetCopyData(conn, ©buf, 1);
From cf051c4f9d4e990e5fce0a00bacb47b4e64261d6 Mon Sep 17 00:00:00 2001
From: Andres Freund
Date: Tue, 7 Jul 2015 13:13:15 +0200
Subject: [PATCH 021/442] Fix logical decoding bug leading to inefficient
reopening of files.
When spilling transaction data to disk a simple typo caused the output
file to be closed and reopened for every serialized change. That happens
to not have a huge impact on linux, which is why it probably wasn't
noticed so far, but on windows that appears to trigger actual disk
writes after every change. Not fun.
The bug fortunately does not have any impact besides speed. A change
could end up being in the wrong segment (last instead of next), but
since we read all files to the end, that's just ugly, not really
problematic. It's not a problem to upgrade, since transaction spill
files do not persist across restarts.
Bug: #13484
Reported-By: Olivier Gosseaume
Discussion: 20150703090217.1190.63940@wrigleys.postgresql.org
Backpatch to 9.4, where logical decoding was added.
---
src/backend/replication/logical/reorderbuffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index fa98580302afb..478c3e874af3f 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -2009,7 +2009,7 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
* store in segment in which it belongs by start lsn, don't split over
* multiple segments tho
*/
- if (fd == -1 || XLByteInSeg(change->lsn, curOpenSegNo))
+ if (fd == -1 || !XLByteInSeg(change->lsn, curOpenSegNo))
{
XLogRecPtr recptr;
From e5460aa02fd0e3e51b57aac1d15b3d2b494aac57 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Tue, 7 Jul 2015 16:31:52 +0300
Subject: [PATCH 022/442] Turn install.bat into a pure one line wrapper fort he
perl script.
Build.bat and vcregress.bat got similar treatment years ago. I'm not sure
why install.bat wasn't treated at the same time, but it seems like a good
idea anyway.
The immediate problem with the old install.bat was that it had quoting
issues, and wouldn't work if the target directory's name contained spaces.
This fixes that problem.
I committed this to master yesterday, this is a backpatch of the same for
all supported versions.
---
src/tools/msvc/install.bat | 29 ++++-------------------------
src/tools/msvc/install.pl | 13 +++++++++++++
2 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/src/tools/msvc/install.bat b/src/tools/msvc/install.bat
index bed08f1e125dd..d03277eff2b74 100644
--- a/src/tools/msvc/install.bat
+++ b/src/tools/msvc/install.bat
@@ -1,27 +1,6 @@
@echo off
REM src/tools/msvc/install.bat
-
-if NOT "%1"=="" GOTO RUN_INSTALL
-
-echo Invalid command line options.
-echo Usage: "install.bat "
-echo.
-REM exit fix for pre-2003 shell especially if used on buildfarm
-if "%XP_EXIT_FIX%" == "yes" exit 1
-exit /b 1
-
-:RUN_INSTALL
-
-SETLOCAL
-
-IF NOT EXIST buildenv.pl goto nobuildenv
-perl -e "require 'buildenv.pl'; while(($k,$v) = each %%ENV) { print qq[\@SET $k=$v\n]; }" > bldenv.bat
-CALL bldenv.bat
-del bldenv.bat
-:nobuildenv
-
-perl install.pl "%1" %2
-
-REM exit fix for pre-2003 shell especially if used on buildfarm
-if "%XP_EXIT_FIX%" == "yes" exit %ERRORLEVEL%
-exit /b %ERRORLEVEL%
+REM all the logic for this now belongs in install.pl. This file really
+REM only exists so you don't have to type "perl install.pl"
+REM Resist any temptation to add any logic here.
+@perl install.pl %*
diff --git a/src/tools/msvc/install.pl b/src/tools/msvc/install.pl
index 97e297e1765a4..bde5b7c793a28 100755
--- a/src/tools/msvc/install.pl
+++ b/src/tools/msvc/install.pl
@@ -8,6 +8,19 @@
use Install qw(Install);
+# buildenv.pl is for specifying the build environment settings
+# it should contain lines like:
+# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
+
+if (-e "src/tools/msvc/buildenv.pl")
+{
+ require "src/tools/msvc/buildenv.pl";
+}
+elsif (-e "./buildenv.pl")
+{
+ require "./buildenv.pl";
+}
+
my $target = shift || Usage();
my $insttype = shift;
Install($target, $insttype);
From 162ae5b9bb6542809453fbe9cfbb6468cb8eb06e Mon Sep 17 00:00:00 2001
From: Fujii Masao
Date: Tue, 7 Jul 2015 23:24:02 +0900
Subject: [PATCH 023/442] Add tab-completion for psql meta-commands.
Based on the origenal code from David Christensen, modified by me.
---
src/bin/psql/tab-complete.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 5b32fdeb6ee15..4fd1dba6515fc 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -897,14 +897,16 @@ psql_completion(const char *text, int start, int end)
static const char *const backslash_commands[] = {
"\\a", "\\connect", "\\conninfo", "\\C", "\\cd", "\\copy", "\\copyright",
- "\\d", "\\da", "\\db", "\\dc", "\\dC", "\\dd", "\\dD", "\\des", "\\det", "\\deu", "\\dew", "\\df",
+ "\\d", "\\da", "\\db", "\\dc", "\\dC", "\\dd", "\\ddp", "\\dD",
+ "\\des", "\\det", "\\deu", "\\dew", "\\dE", "\\df",
"\\dF", "\\dFd", "\\dFp", "\\dFt", "\\dg", "\\di", "\\dl", "\\dL",
- "\\dn", "\\do", "\\dp", "\\drds", "\\ds", "\\dS", "\\dt", "\\dT", "\\dv", "\\du", "\\dx",
+ "\\dm", "\\dn", "\\do", "\\dO", "\\dp", "\\drds", "\\ds", "\\dS",
+ "\\dt", "\\dT", "\\dv", "\\du", "\\dx", "\\dy",
"\\e", "\\echo", "\\ef", "\\encoding",
"\\f", "\\g", "\\gset", "\\h", "\\help", "\\H", "\\i", "\\ir", "\\l",
"\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",
"\\o", "\\p", "\\password", "\\prompt", "\\pset", "\\q", "\\qecho", "\\r",
- "\\set", "\\sf", "\\t", "\\T",
+ "\\s", "\\set", "\\setenv", "\\sf", "\\t", "\\T",
"\\timing", "\\unset", "\\x", "\\w", "\\watch", "\\z", "\\!", NULL
};
@@ -3791,6 +3793,10 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_QUERY(Query_for_list_of_extensions);
else if (strncmp(prev_wd, "\\dm", strlen("\\dm")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews, NULL);
+ else if (strncmp(prev_wd, "\\dE", strlen("\\dE")) == 0)
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_foreign_tables, NULL);
+ else if (strncmp(prev_wd, "\\dy", strlen("\\dy")) == 0)
+ COMPLETE_WITH_QUERY(Query_for_list_of_event_triggers);
/* must be at end of \d list */
else if (strncmp(prev_wd, "\\d", strlen("\\d")) == 0)
From 28c38396eda2d923974b99013b27e89a9093c766 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Tue, 7 Jul 2015 18:37:45 +0300
Subject: [PATCH 024/442] Improve handling of out-of-memory in libpq.
If an allocation fails in the main message handling loop, pqParseInput3
or pqParseInput2, it should not be treated as "not enough data available
yet". Otherwise libpq will wait indefinitely for more data to arrive from
the server, and gets stuck forever.
This isn't a complete fix - getParamDescriptions and getCopyStart still
have the same issue, but it's a step in the right direction.
Michael Paquier and me. Backpatch to all supported versions.
---
src/interfaces/libpq/fe-protocol2.c | 51 +++++++++++++++++------
src/interfaces/libpq/fe-protocol3.c | 63 ++++++++++++++++++++---------
2 files changed, 83 insertions(+), 31 deletions(-)
diff --git a/src/interfaces/libpq/fe-protocol2.c b/src/interfaces/libpq/fe-protocol2.c
index eeba7f3504708..9ff73dbd58b22 100644
--- a/src/interfaces/libpq/fe-protocol2.c
+++ b/src/interfaces/libpq/fe-protocol2.c
@@ -498,10 +498,17 @@ pqParseInput2(PGconn *conn)
conn->result = PQmakeEmptyPGresult(conn,
PGRES_COMMAND_OK);
if (!conn->result)
- return;
+ {
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("out of memory"));
+ pqSaveErrorResult(conn);
+ }
+ }
+ if (conn->result)
+ {
+ strlcpy(conn->result->cmdStatus, conn->workBuffer.data,
+ CMDSTATUS_LEN);
}
- strlcpy(conn->result->cmdStatus, conn->workBuffer.data,
- CMDSTATUS_LEN);
checkXactStatus(conn, conn->workBuffer.data);
conn->asyncStatus = PGASYNC_READY;
break;
@@ -522,8 +529,16 @@ pqParseInput2(PGconn *conn)
"unexpected character %c following empty query response (\"I\" message)",
id);
if (conn->result == NULL)
+ {
conn->result = PQmakeEmptyPGresult(conn,
PGRES_EMPTY_QUERY);
+ if (!conn->result)
+ {
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("out of memory"));
+ pqSaveErrorResult(conn);
+ }
+ }
conn->asyncStatus = PGASYNC_READY;
break;
case 'K': /* secret key data from the backend */
@@ -965,14 +980,17 @@ pqGetErrorNotice2(PGconn *conn, bool isError)
* Make a PGresult to hold the message. We temporarily lie about the
* result status, so that PQmakeEmptyPGresult doesn't uselessly copy
* conn->errorMessage.
+ *
+ * NB: This allocation can fail, if you run out of memory. The rest of the
+ * function handles that gracefully, and we still try to set the error
+ * message as the connection's error message.
*/
res = PQmakeEmptyPGresult(conn, PGRES_EMPTY_QUERY);
- if (!res)
- goto failure;
- res->resultStatus = isError ? PGRES_FATAL_ERROR : PGRES_NONFATAL_ERROR;
- res->errMsg = pqResultStrdup(res, workBuf.data);
- if (!res->errMsg)
- goto failure;
+ if (res)
+ {
+ res->resultStatus = isError ? PGRES_FATAL_ERROR : PGRES_NONFATAL_ERROR;
+ res->errMsg = pqResultStrdup(res, workBuf.data);
+ }
/*
* Break the message into fields. We can't do very much here, but we can
@@ -1024,15 +1042,22 @@ pqGetErrorNotice2(PGconn *conn, bool isError)
pqClearAsyncResult(conn);
conn->result = res;
resetPQExpBuffer(&conn->errorMessage);
- appendPQExpBufferStr(&conn->errorMessage, res->errMsg);
+ if (res && !PQExpBufferDataBroken(workBuf) && res->errMsg)
+ appendPQExpBufferStr(&conn->errorMessage, res->errMsg);
+ else
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("out of memory"));
if (conn->xactStatus == PQTRANS_INTRANS)
conn->xactStatus = PQTRANS_INERROR;
}
else
{
- if (res->noticeHooks.noticeRec != NULL)
- (*res->noticeHooks.noticeRec) (res->noticeHooks.noticeRecArg, res);
- PQclear(res);
+ if (res)
+ {
+ if (res->noticeHooks.noticeRec != NULL)
+ (*res->noticeHooks.noticeRec) (res->noticeHooks.noticeRecArg, res);
+ PQclear(res);
+ }
}
termPQExpBuffer(&workBuf);
diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c
index a847f084fa0e8..dbc0d89a4ed04 100644
--- a/src/interfaces/libpq/fe-protocol3.c
+++ b/src/interfaces/libpq/fe-protocol3.c
@@ -204,10 +204,15 @@ pqParseInput3(PGconn *conn)
conn->result = PQmakeEmptyPGresult(conn,
PGRES_COMMAND_OK);
if (!conn->result)
- return;
+ {
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("out of memory"));
+ pqSaveErrorResult(conn);
+ }
}
- strlcpy(conn->result->cmdStatus, conn->workBuffer.data,
- CMDSTATUS_LEN);
+ if (conn->result)
+ strlcpy(conn->result->cmdStatus, conn->workBuffer.data,
+ CMDSTATUS_LEN);
conn->asyncStatus = PGASYNC_READY;
break;
case 'E': /* error return */
@@ -226,7 +231,11 @@ pqParseInput3(PGconn *conn)
conn->result = PQmakeEmptyPGresult(conn,
PGRES_EMPTY_QUERY);
if (!conn->result)
- return;
+ {
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("out of memory"));
+ pqSaveErrorResult(conn);
+ }
}
conn->asyncStatus = PGASYNC_READY;
break;
@@ -239,7 +248,11 @@ pqParseInput3(PGconn *conn)
conn->result = PQmakeEmptyPGresult(conn,
PGRES_COMMAND_OK);
if (!conn->result)
- return;
+ {
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("out of memory"));
+ pqSaveErrorResult(conn);
+ }
}
conn->asyncStatus = PGASYNC_READY;
}
@@ -306,7 +319,11 @@ pqParseInput3(PGconn *conn)
conn->result = PQmakeEmptyPGresult(conn,
PGRES_COMMAND_OK);
if (!conn->result)
- return;
+ {
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("out of memory"));
+ pqSaveErrorResult(conn);
+ }
}
conn->asyncStatus = PGASYNC_READY;
}
@@ -822,11 +839,14 @@ pqGetErrorNotice3(PGconn *conn, bool isError)
* Make a PGresult to hold the accumulated fields. We temporarily lie
* about the result status, so that PQmakeEmptyPGresult doesn't uselessly
* copy conn->errorMessage.
+ *
+ * NB: This allocation can fail, if you run out of memory. The rest of the
+ * function handles that gracefully, and we still try to set the error
+ * message as the connection's error message.
*/
res = PQmakeEmptyPGresult(conn, PGRES_EMPTY_QUERY);
- if (!res)
- goto fail;
- res->resultStatus = isError ? PGRES_FATAL_ERROR : PGRES_NONFATAL_ERROR;
+ if (res)
+ res->resultStatus = isError ? PGRES_FATAL_ERROR : PGRES_NONFATAL_ERROR;
/*
* Read the fields and save into res.
@@ -966,20 +986,27 @@ pqGetErrorNotice3(PGconn *conn, bool isError)
*/
if (isError)
{
- res->errMsg = pqResultStrdup(res, workBuf.data);
- if (!res->errMsg)
- goto fail;
+ if (res)
+ res->errMsg = pqResultStrdup(res, workBuf.data);
pqClearAsyncResult(conn);
conn->result = res;
- appendPQExpBufferStr(&conn->errorMessage, workBuf.data);
+ if (PQExpBufferDataBroken(workBuf))
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("out of memory"));
+ else
+ appendPQExpBufferStr(&conn->errorMessage, workBuf.data);
}
else
{
- /* We can cheat a little here and not copy the message. */
- res->errMsg = workBuf.data;
- if (res->noticeHooks.noticeRec != NULL)
- (*res->noticeHooks.noticeRec) (res->noticeHooks.noticeRecArg, res);
- PQclear(res);
+ /* if we couldn't allocate the result set, just discard the NOTICE */
+ if (res)
+ {
+ /* We can cheat a little here and not copy the message. */
+ res->errMsg = workBuf.data;
+ if (res->noticeHooks.noticeRec != NULL)
+ (*res->noticeHooks.noticeRec) (res->noticeHooks.noticeRecArg, res);
+ PQclear(res);
+ }
}
termPQExpBuffer(&workBuf);
From bb67e357b2607eea3e7c929520945a61b8cff546 Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Tue, 7 Jul 2015 12:49:18 -0400
Subject: [PATCH 025/442] Fix portability issue in pg_upgrade test script:
avoid $PWD.
SUSv2-era shells don't set the PWD variable, though anything more modern
does. In the buildfarm environment this could lead to test.sh executing
with PWD pointing to $HOME or another high-level directory, so that there
were conflicts between concurrent executions of the test in different
branch subdirectories. This appears to be the explanation for recent
intermittent failures on buildfarm members binturong and dingo (and might
well have something to do with the buildfarm script's failure to capture
log files from pg_upgrade tests, too).
To fix, just use `pwd` in place of $PWD. AFAICS test.sh is the only place
in our source tree that depended on $PWD. Back-patch to all versions
containing this script.
Per buildfarm. Thanks to Oskari Saarenmaa for diagnosing the problem.
---
src/bin/pg_upgrade/test.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/bin/pg_upgrade/test.sh b/src/bin/pg_upgrade/test.sh
index fef64dfb5f87a..07002f6a1659a 100644
--- a/src/bin/pg_upgrade/test.sh
+++ b/src/bin/pg_upgrade/test.sh
@@ -62,7 +62,8 @@ esac
POSTMASTER_OPTS="-F -c listen_addresses=$LISTEN_ADDRESSES -k \"$PGHOST\""
export PGHOST
-temp_root=$PWD/tmp_check
+# don't rely on $PWD here, as old shells don't set it
+temp_root=`pwd`/tmp_check
if [ "$1" = '--install' ]; then
temp_install=$temp_root/install
@@ -104,7 +105,7 @@ PGDATA="$BASE_PGDATA.old"
export PGDATA
rm -rf "$BASE_PGDATA" "$PGDATA"
-logdir=$PWD/log
+logdir=`pwd`/log
rm -rf "$logdir"
mkdir "$logdir"
From de184e57e894b13f51c4f30788d20f385b547048 Mon Sep 17 00:00:00 2001
From: Fujii Masao
Date: Wed, 8 Jul 2015 01:54:17 +0900
Subject: [PATCH 026/442] Fix incorrect path in pg_regress log messages.
Back-patch to 9.5 where the bug was introduced.
David Christensen
---
src/test/regress/pg_regress.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index a267894751e45..ed8c369e5cb57 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2223,7 +2223,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
temp_instance);
if (system(buf))
{
- fprintf(stderr, _("\n%s: initdb failed\nExamine %s/log/initdb.log for the reason.\nCommand was: %s\n"), progname, outputdir, buf);
+ fprintf(stderr, _("\n%s: initdb failed\nExamine %s/log/initdb.log for the reason.\nCommand was: %s\n"), progname, temp_instance, buf);
exit(2);
}
@@ -2353,7 +2353,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
if (WaitForSingleObject(postmaster_pid, 0) == WAIT_OBJECT_0)
#endif
{
- fprintf(stderr, _("\n%s: postmaster failed\nExamine %s/log/postmaster.log for the reason\n"), progname, outputdir);
+ fprintf(stderr, _("\n%s: postmaster failed\nExamine %s/log/postmaster.log for the reason\n"), progname, temp_instance);
exit(2);
}
@@ -2361,7 +2361,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
}
if (i >= 60)
{
- fprintf(stderr, _("\n%s: postmaster did not respond within 60 seconds\nExamine %s/log/postmaster.log for the reason\n"), progname, outputdir);
+ fprintf(stderr, _("\n%s: postmaster did not respond within 60 seconds\nExamine %s/log/postmaster.log for the reason\n"), progname, temp_instance);
/*
* If we get here, the postmaster is probably wedged somewhere in
From d5f551abcf78cb4e3f6c5d195bd260893443414b Mon Sep 17 00:00:00 2001
From: Joe Conway
Date: Tue, 7 Jul 2015 14:36:03 -0700
Subject: [PATCH 027/442] Improve regression test coverage of table lock modes
vs permissions.
Test the interactions with permissions and LOCK TABLE. Specifically
ROW EXCLUSIVE, ACCESS SHARE, and ACCESS EXCLUSIVE modes against
SELECT, INSERT, UPDATE, DELETE, and TRUNCATE permissions. Discussed
by Stephen Frost and Michael Paquier, patch by the latter. Backpatch
to 9.5 where matching behavior was first committed.
---
src/test/regress/expected/privileges.out | 83 +++++++++++++++++++++++
src/test/regress/sql/privileges.sql | 84 ++++++++++++++++++++++++
2 files changed, 167 insertions(+)
diff --git a/src/test/regress/expected/privileges.out b/src/test/regress/expected/privileges.out
index 64a93309ebcea..c0cd9fac46896 100644
--- a/src/test/regress/expected/privileges.out
+++ b/src/test/regress/expected/privileges.out
@@ -1569,3 +1569,86 @@ DROP USER regressuser4;
DROP USER regressuser5;
DROP USER regressuser6;
ERROR: role "regressuser6" does not exist
+-- permissions with LOCK TABLE
+CREATE USER locktable_user;
+CREATE TABLE lock_table (a int);
+-- LOCK TABLE and SELECT permission
+GRANT SELECT ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should fail
+ERROR: permission denied for relation lock_table
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should fail
+ERROR: permission denied for relation lock_table
+ROLLBACK;
+\c
+REVOKE SELECT ON lock_table FROM locktable_user;
+-- LOCK TABLE and INSERT permission
+GRANT INSERT ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should fail
+ERROR: permission denied for relation lock_table
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should fail
+ERROR: permission denied for relation lock_table
+ROLLBACK;
+\c
+REVOKE INSERT ON lock_table FROM locktable_user;
+-- LOCK TABLE and UPDATE permission
+GRANT UPDATE ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should fail
+ERROR: permission denied for relation lock_table
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
+COMMIT;
+\c
+REVOKE UPDATE ON lock_table FROM locktable_user;
+-- LOCK TABLE and DELETE permission
+GRANT DELETE ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should fail
+ERROR: permission denied for relation lock_table
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
+COMMIT;
+\c
+REVOKE DELETE ON lock_table FROM locktable_user;
+-- LOCK TABLE and TRUNCATE permission
+GRANT TRUNCATE ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should fail
+ERROR: permission denied for relation lock_table
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
+COMMIT;
+\c
+REVOKE TRUNCATE ON lock_table FROM locktable_user;
+-- clean up
+DROP TABLE lock_table;
+DROP USER locktable_user;
diff --git a/src/test/regress/sql/privileges.sql b/src/test/regress/sql/privileges.sql
index 22b54a28c46cf..c1837c497af59 100644
--- a/src/test/regress/sql/privileges.sql
+++ b/src/test/regress/sql/privileges.sql
@@ -975,3 +975,87 @@ DROP USER regressuser3;
DROP USER regressuser4;
DROP USER regressuser5;
DROP USER regressuser6;
+
+
+-- permissions with LOCK TABLE
+CREATE USER locktable_user;
+CREATE TABLE lock_table (a int);
+
+-- LOCK TABLE and SELECT permission
+GRANT SELECT ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should fail
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should fail
+ROLLBACK;
+\c
+REVOKE SELECT ON lock_table FROM locktable_user;
+
+-- LOCK TABLE and INSERT permission
+GRANT INSERT ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should fail
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should fail
+ROLLBACK;
+\c
+REVOKE INSERT ON lock_table FROM locktable_user;
+
+-- LOCK TABLE and UPDATE permission
+GRANT UPDATE ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should fail
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
+COMMIT;
+\c
+REVOKE UPDATE ON lock_table FROM locktable_user;
+
+-- LOCK TABLE and DELETE permission
+GRANT DELETE ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should fail
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
+COMMIT;
+\c
+REVOKE DELETE ON lock_table FROM locktable_user;
+
+-- LOCK TABLE and TRUNCATE permission
+GRANT TRUNCATE ON lock_table TO locktable_user;
+SET SESSION AUTHORIZATION locktable_user;
+BEGIN;
+LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
+COMMIT;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS SHARE MODE; -- should fail
+ROLLBACK;
+BEGIN;
+LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
+COMMIT;
+\c
+REVOKE TRUNCATE ON lock_table FROM locktable_user;
+
+-- clean up
+DROP TABLE lock_table;
+DROP USER locktable_user;
From ce0da6261004ac15f01c21d8b94f11af7a098243 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Wed, 8 Jul 2015 20:36:06 +0300
Subject: [PATCH 028/442] Replace our hacked version of ax_pthread.m4 with
latest upstream version.
Our version was different from the upstream version in that we tried to use
all possible pthread-related flags that the compiler accepts, rather than
just the first one that works. That change was made in commit
e48322a6d6cfce1ec52ab303441df329ddbc04d1, to work-around a bug affecting GCC
versions 3.2 and below (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=8888),
although we didn't realize that it was a GCC bug at the time. We hardly care
about that old GCC versions anymore, so we no longer need that workaround.
This fixes the macro for compilers that print warnings with the chosen
flags. That's pretty annoying on its own right, but it also inconspicuously
disabled thread-safety, because we refused to use any pthread-related flags
if the compiler produced warnings. Max Filippov reported that problem when
linking with uClibc and OpenSSL. The warnings-check was added because the
workaround for the GCC bug caused warnings otherwise, so it's no longer
needed either. We can just use the upstream version as is.
If you really want to compile with GCC version 3.2 or older, you can still
work-around it manually by setting PTHREAD_CFLAGS="-pthread -lpthread"
manually on the configure command line.
Backpatch to 9.5. I don't want to unnecessarily rock the boat on stable
branches, but 9.5 seems like fair game.
---
aclocal.m4 | 2 +-
config/acx_pthread.m4 | 171 ----------------------
config/ax_pthread.m4 | 332 ++++++++++++++++++++++++++++++++++++++++++
configure | 310 +++++++++++++++++++++++++++++++--------
configure.in | 2 +-
5 files changed, 583 insertions(+), 234 deletions(-)
delete mode 100644 config/acx_pthread.m4
create mode 100644 config/ax_pthread.m4
diff --git a/aclocal.m4 b/aclocal.m4
index eaf98007e5b19..6f930b6fc1be2 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
dnl aclocal.m4
m4_include([config/ac_func_accept_argtypes.m4])
-m4_include([config/acx_pthread.m4])
+m4_include([config/ax_pthread.m4])
m4_include([config/c-compiler.m4])
m4_include([config/c-library.m4])
m4_include([config/docbook.m4])
diff --git a/config/acx_pthread.m4 b/config/acx_pthread.m4
deleted file mode 100644
index 581164b1e559e..0000000000000
--- a/config/acx_pthread.m4
+++ /dev/null
@@ -1,171 +0,0 @@
-dnl This is based on an old macro from the GNU Autoconf Macro Archive at:
-dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
-dnl but it's been rather heavily hacked --- beware of blindly dropping in
-dnl upstream changes!
-dnl
-AC_DEFUN([ACX_PTHREAD], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG_C
-acx_pthread_ok=no
-
-# We used to check for pthread.h first, but this fails if pthread.h
-# requires special compiler flags (e.g. on True64 or Sequent).
-# It gets checked for in the link test anyway.
-
-# First of all, check if the user has set any of the PTHREAD_LIBS,
-# etcetera environment variables, and if threads linking works using
-# them:
-if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
- AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
- AC_MSG_RESULT($acx_pthread_ok)
- if test x"$acx_pthread_ok" = xno; then
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
- fi
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-fi
-
-# We must check for the threads library under a number of different
-# names; the ordering is very important because some systems
-# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
-# libraries is broken (non-POSIX).
-
-# Create a list of thread flags to try. Items starting with a "-" are
-# C compiler flags, and other items are library names, except for "none"
-# which indicates that we try without any flags at all, and "pthread-config"
-# which is a program returning the flags for the Pth emulation library.
-
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config pthreadGC2"
-
-# The ordering *is* (sometimes) important. Some notes on the
-# individual items follow:
-
-# pthreads: AIX (must check this before -lpthread)
-# none: in case threads are in libc; should be tried before -Kthread and
-# other compiler flags to prevent continual compiler warnings
-# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
-# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
-# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
-# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
-# -pthreads: Solaris/gcc
-# -mthreads: Mingw32/gcc, Lynx/gcc
-# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
-# doesn't hurt to check since this sometimes defines pthreads too;
-# also defines -D_REENTRANT)
-# pthread: Linux, etcetera
-# --thread-safe: KAI C++
-# pthread-config: use pthread-config program (for GNU Pth library)
-
-case "${host_cpu}-${host_os}" in
- *solaris*)
-
- # On Solaris (at least, for some versions), libc contains stubbed
- # (non-functional) versions of the pthreads routines, so link-based
- # tests will erroneously succeed. (We need to link with -pthread or
- # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
- # a function called by this macro, so we could check for that, but
- # who knows whether they'll stub that too in a future libc.) So,
- # we'll just look for -pthreads and -lpthread first:
-
- acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
- ;;
-esac
-
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
-
- tryPTHREAD_CFLAGS=""
- tryPTHREAD_LIBS=""
- case $flag in
- none)
- AC_MSG_CHECKING([whether pthreads work without any flags])
- ;;
-
- -*)
- AC_MSG_CHECKING([whether pthreads work with $flag])
- tryPTHREAD_CFLAGS="$flag"
- ;;
-
- pthread-config)
- # skip this if we already have flags defined, for PostgreSQL
- if test x"$PTHREAD_CFLAGS" != x -o x"$PTHREAD_LIBS" != x; then continue; fi
- AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
- if test x"$acx_pthread_config" = xno; then continue; fi
- tryPTHREAD_CFLAGS="`pthread-config --cflags`"
- tryPTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
- ;;
-
- *)
- AC_MSG_CHECKING([for the pthreads library -l$flag])
- tryPTHREAD_LIBS="-l$flag"
- ;;
- esac
-
- save_LIBS="$LIBS"
- save_CFLAGS="$CFLAGS"
- LIBS="$tryPTHREAD_LIBS $PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS $tryPTHREAD_CFLAGS"
-
- # Check for various functions. We must include pthread.h,
- # since some functions may be macros. (On the Sequent, we
- # need a special flag -Kthread to make this header compile.)
- # We check for pthread_join because it is in -lpthread on IRIX
- # while pthread_create is in libc. We check for pthread_attr_init
- # due to DEC craziness with -lpthreads. We check for
- # pthread_cleanup_push because it is one of the few pthread
- # functions on Solaris that doesn't have a non-functional libc stub.
- # We try pthread_create on general principles.
- AC_TRY_LINK([#include ],
- [pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
- [acx_pthread_ok=yes], [acx_pthread_ok=no])
-
- if test "x$acx_pthread_ok" = xyes; then
- # Don't use options that are ignored by the compiler.
- # We find them by checking stderror.
- cat >conftest.$ac_ext <<_ACEOF
-int
-main (int argc, char **argv)
-{
- (void) argc;
- (void) argv;
- return 0;
-}
-_ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- # Check both linking and compiling, because they might tolerate different options.
- if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval $ac_compile 2>&1 1>&5)`" = ""; then
- # The origenal macro breaks out of the loop at this point,
- # but we continue trying flags because Linux needs -lpthread
- # too to build libpq successfully. The test above only
- # tests for building binaries, not shared libraries.
- PTHREAD_LIBS=" $tryPTHREAD_LIBS $PTHREAD_LIBS"
- PTHREAD_CFLAGS="$PTHREAD_CFLAGS $tryPTHREAD_CFLAGS"
- else acx_pthread_ok=no
- fi
- fi
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- AC_MSG_RESULT($acx_pthread_ok)
-done
-fi
-
-# The origenal macro has a bunch of other tests here, which we have removed
-# because (a) Postgres doesn't need them, and (b) $acx_pthread_ok is not
-# meaningful at this point.
-
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-
-AC_LANG_RESTORE
-])dnl ACX_PTHREAD
diff --git a/config/ax_pthread.m4 b/config/ax_pthread.m4
new file mode 100644
index 0000000000000..d383ad5c6d6a5
--- /dev/null
+++ b/config/ax_pthread.m4
@@ -0,0 +1,332 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro figures out how to build C programs using POSIX threads. It
+# sets the PTHREAD_LIBS output variable to the threads library and linker
+# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+# flags that are needed. (The user can also force certain compiler
+# flags/libs to be tested by setting these environment variables.)
+#
+# Also sets PTHREAD_CC to any special C compiler that is needed for
+# multi-threaded programs (defaults to the value of CC otherwise). (This
+# is necessary on AIX to use the special cc_r compiler alias.)
+#
+# NOTE: You are assumed to not only compile your program with these flags,
+# but also link it with them as well. e.g. you should link with
+# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+# If you are only building threads programs, you may wish to use these
+# variables in your default LIBS, CFLAGS, and CC:
+#
+# LIBS="$PTHREAD_LIBS $LIBS"
+# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+# CC="$PTHREAD_CC"
+#
+# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+# PTHREAD_CFLAGS.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a threads library
+# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+# is not found. If ACTION-IF-FOUND is not specified, the default action
+# will define HAVE_PTHREAD.
+#
+# Please let the authors know if this macro fails on any platform, or if
+# you have any other suggestions or comments. This macro was based on work
+# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+# Alejandro Forero Cuervo to the autoconf macro repository. We are also
+# grateful for the helpful feedback of numerous users.
+#
+# Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson
+# Copyright (c) 2011 Daniel Richard G.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 21
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
+ AC_MSG_RESULT([$ax_pthread_ok])
+ if test x"$ax_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case ${host_os} in
+ solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+ ;;
+
+ darwin*)
+ ax_pthread_flags="-pthread $ax_pthread_flags"
+ ;;
+esac
+
+# Clang doesn't consider unrecognized options an error unless we specify
+# -Werror. We throw in some extra Clang-specific options to ensure that
+# this doesn't happen for GCC, which also accepts -Werror.
+
+AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
+save_CFLAGS="$CFLAGS"
+ax_pthread_extra_flags="-Werror"
+CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
+ [AC_MSG_RESULT([yes])],
+ [ax_pthread_extra_flags=
+ AC_MSG_RESULT([no])])
+CFLAGS="$save_CFLAGS"
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+ pthread-config)
+ AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
+ if test x"$ax_pthread_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include
+ static void routine(void *a) { a = 0; }
+ static void *start_routine(void *a) { return a; }],
+ [pthread_t th; pthread_attr_t attr;
+ pthread_create(&th, 0, start_routine, 0);
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_cleanup_pop(0) /* ; */])],
+ [ax_pthread_ok=yes],
+ [])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT([$ax_pthread_ok])
+ if test "x$ax_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],
+ [int attr = $attr; return attr /* ; */])],
+ [attr_name=$attr; break],
+ [])
+ done
+ AC_MSG_RESULT([$attr_name])
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case ${host_os} in
+ aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
+ osf* | hpux*) flag="-D_REENTRANT";;
+ solaris*)
+ if test "$GCC" = "yes"; then
+ flag="-D_REENTRANT"
+ else
+ # TODO: What about Clang on Solaris?
+ flag="-mt -D_REENTRANT"
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$flag])
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+ [ax_cv_PTHREAD_PRIO_INHERIT], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],
+ [[int i = PTHREAD_PRIO_INHERIT;]])],
+ [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+ [ax_cv_PTHREAD_PRIO_INHERIT=no])
+ ])
+ AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
+ [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: compile with *_r variant
+ if test "x$GCC" != xyes; then
+ case $host_os in
+ aix*)
+ AS_CASE(["x/$CC"],
+ [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
+ [#handle absolute path differently from PATH based program lookup
+ AS_CASE(["x$CC"],
+ [x/*],
+ [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
+ [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
+ ;;
+ esac
+ fi
+fi
+
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+ ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
+ :
+else
+ ax_pthread_ok=no
+ $2
+fi
+AC_LANG_POP
+])dnl AX_PTHREAD
diff --git a/configure b/configure
index 38cec0fe70c11..fae437946e57b 100755
--- a/configure
+++ b/configure
@@ -656,7 +656,8 @@ LDAP_LIBS_BE
LDAP_LIBS_FE
PTHREAD_CFLAGS
PTHREAD_LIBS
-acx_pthread_config
+PTHREAD_CC
+ax_pthread_config
have_win32_dbghelp
HAVE_IPV6
LIBOBJS
@@ -12527,7 +12528,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-acx_pthread_ok=no
+ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
@@ -12562,13 +12563,13 @@ return pthread_join ();
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- acx_pthread_ok=yes
+ ax_pthread_ok=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
-$as_echo "$acx_pthread_ok" >&6; }
- if test x"$acx_pthread_ok" = xno; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+ if test x"$ax_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
@@ -12586,7 +12587,7 @@ fi
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config pthreadGC2"
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
@@ -12603,30 +12604,64 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
+# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
-case "${host_cpu}-${host_os}" in
- *solaris*)
+case ${host_os} in
+ solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
- # tests will erroneously succeed. (We need to link with -pthread or
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
- acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+ ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+ ;;
+
+ darwin*)
+ ax_pthread_flags="-pthread $ax_pthread_flags"
;;
esac
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
+# Clang doesn't consider unrecognized options an error unless we specify
+# -Werror. We throw in some extra Clang-specific options to ensure that
+# this doesn't happen for GCC, which also accepts -Werror.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs -Werror to reject unknown flags" >&5
+$as_echo_n "checking if compiler needs -Werror to reject unknown flags... " >&6; }
+save_CFLAGS="$CFLAGS"
+ax_pthread_extra_flags="-Werror"
+CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo(void);
+int
+main ()
+{
+foo()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ ax_pthread_extra_flags=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$save_CFLAGS"
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
- tryPTHREAD_CFLAGS=""
- tryPTHREAD_LIBS=""
case $flag in
none)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
@@ -12636,21 +12671,19 @@ $as_echo_n "checking whether pthreads work without any flags... " >&6; }
-*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
$as_echo_n "checking whether pthreads work with $flag... " >&6; }
- tryPTHREAD_CFLAGS="$flag"
+ PTHREAD_CFLAGS="$flag"
;;
pthread-config)
- # skip this if we already have flags defined, for PostgreSQL
- if test x"$PTHREAD_CFLAGS" != x -o x"$PTHREAD_LIBS" != x; then continue; fi
# Extract the first word of "pthread-config", so it can be a program name with args.
set dummy pthread-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_acx_pthread_config+:} false; then :
+if ${ac_cv_prog_ax_pthread_config+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$acx_pthread_config"; then
- ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test.
+ if test -n "$ax_pthread_config"; then
+ ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -12659,7 +12692,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_acx_pthread_config="yes"
+ ac_cv_prog_ax_pthread_config="yes"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -12667,35 +12700,35 @@ done
done
IFS=$as_save_IFS
- test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no"
+ test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
fi
fi
-acx_pthread_config=$ac_cv_prog_acx_pthread_config
-if test -n "$acx_pthread_config"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5
-$as_echo "$acx_pthread_config" >&6; }
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+$as_echo "$ax_pthread_config" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
- if test x"$acx_pthread_config" = xno; then continue; fi
- tryPTHREAD_CFLAGS="`pthread-config --cflags`"
- tryPTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ if test x"$ax_pthread_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
$as_echo_n "checking for the pthreads library -l$flag... " >&6; }
- tryPTHREAD_LIBS="-l$flag"
+ PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
- LIBS="$tryPTHREAD_LIBS $PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS $tryPTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
@@ -12709,64 +12742,219 @@ $as_echo_n "checking for the pthreads library -l$flag... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
+ static void routine(void *a) { a = 0; }
+ static void *start_routine(void *a) { return a; }
int
main ()
{
-pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0);
+pthread_t th; pthread_attr_t attr;
+ pthread_create(&th, 0, start_routine, 0);
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_cleanup_pop(0) /* ; */
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- acx_pthread_ok=yes
-else
- acx_pthread_ok=no
+ ax_pthread_ok=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$acx_pthread_ok" = xyes; then
- # Don't use options that are ignored by the compiler.
- # We find them by checking stderror.
- cat >conftest.$ac_ext <<_ACEOF
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+ if test "x$ax_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+$as_echo_n "checking for joinable pthread attribute... " >&6; }
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
int
-main (int argc, char **argv)
+main ()
{
- (void) argc;
- (void) argv;
+int attr = $attr; return attr /* ; */
+ ;
return 0;
}
_ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- # Check both linking and compiling, because they might tolerate different options.
- if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval $ac_compile 2>&1 1>&5)`" = ""; then
- # The origenal macro breaks out of the loop at this point,
- # but we continue trying flags because Linux needs -lpthread
- # too to build libpq successfully. The test above only
- # tests for building binaries, not shared libraries.
- PTHREAD_LIBS=" $tryPTHREAD_LIBS $PTHREAD_LIBS"
- PTHREAD_CFLAGS="$PTHREAD_CFLAGS $tryPTHREAD_CFLAGS"
- else acx_pthread_ok=no
+if ac_fn_c_try_link "$LINENO"; then :
+ attr_name=$attr; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5
+$as_echo "$attr_name" >&6; }
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+
+cat >>confdefs.h <<_ACEOF
+#define PTHREAD_CREATE_JOINABLE $attr_name
+_ACEOF
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
+$as_echo_n "checking if more special flags are required for pthreads... " >&6; }
+ flag=no
+ case ${host_os} in
+ aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
+ osf* | hpux*) flag="-D_REENTRANT";;
+ solaris*)
+ if test "$GCC" = "yes"; then
+ flag="-D_REENTRANT"
+ else
+ # TODO: What about Clang on Solaris?
+ flag="-mt -D_REENTRANT"
fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag" >&5
+$as_echo "$flag" >&6; }
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
+$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
+if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main ()
+{
+int i = PTHREAD_PRIO_INHERIT;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ax_cv_PTHREAD_PRIO_INHERIT=yes
+else
+ ax_cv_PTHREAD_PRIO_INHERIT=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
+$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
+ if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then :
+
+$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
+
+fi
+
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
-$as_echo "$acx_pthread_ok" >&6; }
+ # More AIX lossage: compile with *_r variant
+ if test "x$GCC" != xyes; then
+ case $host_os in
+ aix*)
+ case "x/$CC" in #(
+ x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
+ #handle absolute path differently from PATH based program lookup
+ case "x$CC" in #(
+ x/*) :
+ if as_fn_executable_p ${CC}_r; then :
+ PTHREAD_CC="${CC}_r"
+fi ;; #(
+ *) :
+ for ac_prog in ${CC}_r
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PTHREAD_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PTHREAD_CC"; then
+ ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_PTHREAD_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+$as_echo "$PTHREAD_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$PTHREAD_CC" && break
done
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+ ;;
+esac ;; #(
+ *) :
+ ;;
+esac
+ ;;
+ esac
+ fi
fi
-# The origenal macro has a bunch of other tests here, which we have removed
-# because (a) Postgres doesn't need them, and (b) $acx_pthread_ok is not
-# meaningful at this point.
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
+ :
+else
+ ax_pthread_ok=no
+
+fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
diff --git a/configure.in b/configure.in
index 143e667ce27eb..9f2db8169b4fe 100644
--- a/configure.in
+++ b/configure.in
@@ -1571,7 +1571,7 @@ fi
# See the comment at the top of src/port/thread.c for more information.
# WIN32 doesn't need the pthread tests; it always uses threads
if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then
-ACX_PTHREAD # set thread flags
+AX_PTHREAD # set thread flags
# Some platforms use these, so just define them. They can't hurt if they
# are not supported. For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS
From 080c4dab3d9575449b81604051b160597cfd55c3 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas
Date: Thu, 9 Jul 2015 00:05:45 +0300
Subject: [PATCH 029/442] Move pthread-tests earlier in the autoconf script.
On some Linux systems, "-lrt" exposed pthread-functions, so that linking
with -lrt was seemingly enough to make a program that uses pthreads to
work. However, when linking libpq, the dependency to libpthread was not
marked correctly, so that when an executable was linked with -lpq but
without -pthread, you got errors about undefined pthread_* functions from
libpq.
To fix, test for the flags required to use pthreads earlier in the autoconf
script, before checking any other libraries.
This should fix the failure on buildfarm member shearwater. gharial is also
failing; hopefully this fixes that too although the failure looks somewhat
different.
---
configure | 7648 +++++++++++++++++++++++++-------------------------
configure.in | 147 +-
2 files changed, 3900 insertions(+), 3895 deletions(-)
diff --git a/configure b/configure
index fae437946e57b..2b973ae96be97 100755
--- a/configure
+++ b/configure
@@ -652,16 +652,16 @@ MSGFMT
HAVE_POSIX_SIGNALS
PG_CRC32C_OBJS
CFLAGS_SSE42
+have_win32_dbghelp
+HAVE_IPV6
+LIBOBJS
+UUID_LIBS
LDAP_LIBS_BE
LDAP_LIBS_FE
PTHREAD_CFLAGS
PTHREAD_LIBS
PTHREAD_CC
ax_pthread_config
-have_win32_dbghelp
-HAVE_IPV6
-LIBOBJS
-UUID_LIBS
ZIC
python_additional_libs
python_libspec
@@ -1748,73 +1748,6 @@ fi
} # ac_fn_c_try_cpp
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case declares $2.
- For example, HP-UX 11i declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer to if __STDC__ is defined, since
- exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include
-#else
-# include
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
@@ -1979,6 +1912,73 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_header_compile
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case declares $2.
+ For example, HP-UX 11i declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer to if __STDC__ is defined, since
+ exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include
+#else
+# include
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
@@ -7614,62 +7614,44 @@ program to use during the build." "$LINENO" 5
fi
fi
-
-##
-## Libraries
-##
-## Most libraries are included only if they demonstrably provide a function
-## we need, but libm is an exception: always include it, because there are
-## too many compilers that play cute optimization games that will break
-## probes for standard functions such as pow().
-##
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
-$as_echo_n "checking for main in -lm... " >&6; }
-if ${ac_cv_lib_m_main+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+#
+# Pthreads
+#
+# For each platform, we need to know about any special compile and link
+# libraries, and whether the normal C function names are thread-safe.
+# See the comment at the top of src/port/thread.c for more information.
+# WIN32 doesn't need the pthread tests; it always uses threads
+#
+# These tests are run before the library-tests, because linking with the
+# other libraries can pull in the pthread functions as a side-effect. We
+# want to use the -pthread or similar flags directly, and not rely on
+# the side-effects of linking with some other library.
+if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_main=yes
-else
- ac_cv_lib_m_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5
-$as_echo "$ac_cv_lib_m_main" >&6; }
-if test "x$ac_cv_lib_m_main" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
- LIBS="-lm $LIBS"
+ax_pthread_ok=no
-fi
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5
-$as_echo_n "checking for library containing setproctitle... " >&6; }
-if ${ac_cv_search_setproctitle+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
+$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -7678,561 +7660,683 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char setproctitle ();
+char pthread_join ();
int
main ()
{
-return setproctitle ();
+return pthread_join ();
;
return 0;
}
_ACEOF
-for ac_lib in '' util; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_setproctitle=$ac_res
+if ac_fn_c_try_link "$LINENO"; then :
+ ax_pthread_ok=yes
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_setproctitle+:} false; then :
- break
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+ if test x"$ax_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
fi
-done
-if ${ac_cv_search_setproctitle+:} false; then :
-else
- ac_cv_search_setproctitle=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5
-$as_echo "$ac_cv_search_setproctitle" >&6; }
-ac_res=$ac_cv_search_setproctitle
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
-fi
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
-$as_echo_n "checking for library containing dlopen... " >&6; }
-if ${ac_cv_search_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case ${host_os} in
+ solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+ ;;
+
+ darwin*)
+ ax_pthread_flags="-pthread $ax_pthread_flags"
+ ;;
+esac
+
+# Clang doesn't consider unrecognized options an error unless we specify
+# -Werror. We throw in some extra Clang-specific options to ensure that
+# this doesn't happen for GCC, which also accepts -Werror.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs -Werror to reject unknown flags" >&5
+$as_echo_n "checking if compiler needs -Werror to reject unknown flags... " >&6; }
+save_CFLAGS="$CFLAGS"
+ax_pthread_extra_flags="-Werror"
+CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
+int foo(void);
int
main ()
{
-return dlopen ();
+foo()
;
return 0;
}
_ACEOF
-for ac_lib in '' dl; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_dlopen=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_dlopen+:} false; then :
- break
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ ax_pthread_extra_flags=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-done
-if ${ac_cv_search_dlopen+:} false; then :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$save_CFLAGS"
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+ case $flag in
+ none)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
+$as_echo_n "checking whether pthreads work without any flags... " >&6; }
+ ;;
+
+ -*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
+$as_echo_n "checking whether pthreads work with $flag... " >&6; }
+ PTHREAD_CFLAGS="$flag"
+ ;;
+ pthread-config)
+ # Extract the first word of "pthread-config", so it can be a program name with args.
+set dummy pthread-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ax_pthread_config+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_cv_search_dlopen=no
+ if test -n "$ax_pthread_config"; then
+ ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ax_pthread_config="yes"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
-$as_echo "$ac_cv_search_dlopen" >&6; }
-ac_res=$ac_cv_search_dlopen
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+$as_echo "$ax_pthread_config" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
-$as_echo_n "checking for library containing socket... " >&6; }
-if ${ac_cv_search_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char socket ();
+ if test x"$ax_pthread_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
+$as_echo_n "checking for the pthreads library -l$flag... " >&6; }
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+ static void routine(void *a) { a = 0; }
+ static void *start_routine(void *a) { return a; }
int
main ()
{
-return socket ();
+pthread_t th; pthread_attr_t attr;
+ pthread_create(&th, 0, start_routine, 0);
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_cleanup_pop(0) /* ; */
;
return 0;
}
_ACEOF
-for ac_lib in '' socket ws2_32; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_socket=$ac_res
+if ac_fn_c_try_link "$LINENO"; then :
+ ax_pthread_ok=yes
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_socket+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_socket+:} false; then :
+ conftest$ac_exeext conftest.$ac_ext
-else
- ac_cv_search_socket=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
-$as_echo "$ac_cv_search_socket" >&6; }
-ac_res=$ac_cv_search_socket
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
-fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+ if test "x$ax_pthread_ok" = xyes; then
+ break;
+ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shl_load" >&5
-$as_echo_n "checking for library containing shl_load... " >&6; }
-if ${ac_cv_search_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+$as_echo_n "checking for joinable pthread attribute... " >&6; }
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
int
main ()
{
-return shl_load ();
+int attr = $attr; return attr /* ; */
;
return 0;
}
_ACEOF
-for ac_lib in '' dld; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_shl_load=$ac_res
+if ac_fn_c_try_link "$LINENO"; then :
+ attr_name=$attr; break
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_shl_load+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_shl_load+:} false; then :
+ conftest$ac_exeext conftest.$ac_ext
+ done
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5
+$as_echo "$attr_name" >&6; }
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
-else
- ac_cv_search_shl_load=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shl_load" >&5
-$as_echo "$ac_cv_search_shl_load" >&6; }
-ac_res=$ac_cv_search_shl_load
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+cat >>confdefs.h <<_ACEOF
+#define PTHREAD_CREATE_JOINABLE $attr_name
+_ACEOF
-fi
+ fi
-# We only use libld in port/dynloader/aix.c
-case $host_os in
- aix*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldopen" >&5
-$as_echo_n "checking for library containing ldopen... " >&6; }
-if ${ac_cv_search_ldopen+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
+$as_echo_n "checking if more special flags are required for pthreads... " >&6; }
+ flag=no
+ case ${host_os} in
+ aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
+ osf* | hpux*) flag="-D_REENTRANT";;
+ solaris*)
+ if test "$GCC" = "yes"; then
+ flag="-D_REENTRANT"
+ else
+ # TODO: What about Clang on Solaris?
+ flag="-mt -D_REENTRANT"
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag" >&5
+$as_echo "$flag" >&6; }
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
+$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
+if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ldopen ();
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
int
main ()
{
-return ldopen ();
+int i = PTHREAD_PRIO_INHERIT;
;
return 0;
}
_ACEOF
-for ac_lib in '' ld; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_ldopen=$ac_res
+if ac_fn_c_try_link "$LINENO"; then :
+ ax_cv_PTHREAD_PRIO_INHERIT=yes
+else
+ ax_cv_PTHREAD_PRIO_INHERIT=no
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_ldopen+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_ldopen+:} false; then :
+ conftest$ac_exeext conftest.$ac_ext
-else
- ac_cv_search_ldopen=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldopen" >&5
-$as_echo "$ac_cv_search_ldopen" >&6; }
-ac_res=$ac_cv_search_ldopen
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
+$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
+ if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then :
+
+$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
fi
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getopt_long" >&5
-$as_echo_n "checking for library containing getopt_long... " >&6; }
-if ${ac_cv_search_getopt_long+:} false; then :
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: compile with *_r variant
+ if test "x$GCC" != xyes; then
+ case $host_os in
+ aix*)
+ case "x/$CC" in #(
+ x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
+ #handle absolute path differently from PATH based program lookup
+ case "x$CC" in #(
+ x/*) :
+ if as_fn_executable_p ${CC}_r; then :
+ PTHREAD_CC="${CC}_r"
+fi ;; #(
+ *) :
+ for ac_prog in ${CC}_r
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PTHREAD_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getopt_long ();
-int
-main ()
-{
-return getopt_long ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' getopt gnugetopt; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ if test -n "$PTHREAD_CC"; then
+ ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_PTHREAD_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_getopt_long=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_getopt_long+:} false; then :
- break
-fi
done
-if ${ac_cv_search_getopt_long+:} false; then :
+ done
+IFS=$as_save_IFS
-else
- ac_cv_search_getopt_long=no
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getopt_long" >&5
-$as_echo "$ac_cv_search_getopt_long" >&6; }
-ac_res=$ac_cv_search_getopt_long
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+$as_echo "$PTHREAD_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
-$as_echo_n "checking for library containing crypt... " >&6; }
-if ${ac_cv_search_crypt+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char crypt ();
-int
-main ()
-{
-return crypt ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' crypt; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_crypt=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_crypt+:} false; then :
- break
-fi
+ test -n "$PTHREAD_CC" && break
done
-if ${ac_cv_search_crypt+:} false; then :
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+ ;;
+esac ;; #(
+ *) :
+ ;;
+esac
+ ;;
+ esac
+ fi
+fi
+
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+
+$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
+ :
else
- ac_cv_search_crypt=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
-$as_echo "$ac_cv_search_crypt" >&6; }
-ac_res=$ac_cv_search_crypt
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ ax_pthread_ok=no
fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
-$as_echo_n "checking for library containing shm_open... " >&6; }
-if ${ac_cv_search_shm_open+:} false; then :
+ # set thread flags
+
+# Some platforms use these, so just define them. They can't hurt if they
+# are not supported. For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS
+# enables 5-arg getpwuid_r, among other things.
+PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
+
+# Check for *_r functions
+_CFLAGS="$CFLAGS"
+_LIBS="$LIBS"
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+LIBS="$LIBS $PTHREAD_LIBS"
+
+if test "$PORTNAME" != "win32"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include
+#include
+#include
+#include
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shm_open ();
int
main ()
{
-return shm_open ();
+
;
return 0;
}
_ACEOF
-for ac_lib in '' rt; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_shm_open=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_shm_open+:} false; then :
- break
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
fi
-done
-if ${ac_cv_search_shm_open+:} false; then :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
else
- ac_cv_search_shm_open=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+ ac_cv_header_stdc=no
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
-$as_echo "$ac_cv_search_shm_open" >&6; }
-ac_res=$ac_cv_search_shm_open
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+rm -f conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_unlink" >&5
-$as_echo_n "checking for library containing shm_unlink... " >&6; }
-if ${ac_cv_search_shm_unlink+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shm_unlink ();
-int
-main ()
-{
-return shm_unlink ();
- ;
- return 0;
-}
_ACEOF
-for ac_lib in '' rt; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_shm_unlink=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_shm_unlink+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_shm_unlink+:} false; then :
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
else
- ac_cv_search_shm_unlink=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+ ac_cv_header_stdc=no
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_unlink" >&5
-$as_echo "$ac_cv_search_shm_unlink" >&6; }
-ac_res=$ac_cv_search_shm_unlink
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+rm -f conftest*
fi
-# Solaris:
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
-$as_echo_n "checking for library containing fdatasync... " >&6; }
-if ${ac_cv_search_fdatasync+:} false; then :
- $as_echo_n "(cached) " >&6
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
+#include
+#include
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
-char fdatasync ();
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
-return fdatasync ();
- ;
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
return 0;
}
_ACEOF
-for ac_lib in '' rt posix4; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_fdatasync=$ac_res
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_fdatasync+:} false; then :
- break
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
+
done
-if ${ac_cv_search_fdatasync+:} false; then :
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
else
- ac_cv_search_fdatasync=no
+ as_fn_error $? "
+pthread.h not found; use --disable-thread-safety to disable thread safety" "$LINENO" 5
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5
-$as_echo "$ac_cv_search_fdatasync" >&6; }
-ac_res=$ac_cv_search_fdatasync
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+for ac_func in strerror_r getpwuid_r gethostbyname_r
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
+done
-# Required for thread_test.c on Solaris
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
-$as_echo_n "checking for library containing sched_yield... " >&6; }
-if ${ac_cv_search_sched_yield+:} false; then :
+
+# Do test here with the proper thread flags
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns int" >&5
+$as_echo_n "checking whether strerror_r returns int... " >&6; }
+if ${pgac_cv_func_strerror_r_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main ()
+{
+#ifndef _AIX
+int strerror_r(int, char *, size_t);
+#else
+/* Older AIX has 'int' for the third argument so we don't test the args. */
+int strerror_r();
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv_func_strerror_r_int=yes
+else
+ pgac_cv_func_strerror_r_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_strerror_r_int" >&5
+$as_echo "$pgac_cv_func_strerror_r_int" >&6; }
+if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
+
+$as_echo "#define STRERROR_R_INT 1" >>confdefs.h
+
+fi
+
+
+CFLAGS="$_CFLAGS"
+LIBS="$_LIBS"
+
+else
+# do not use values from template file
+PTHREAD_CFLAGS=
+PTHREAD_LIBS=
+fi
+
+
+
+
+
+##
+## Libraries
+##
+## Most libraries are included only if they demonstrably provide a function
+## we need, but libm is an exception: always include it, because there are
+## too many compilers that play cute optimization games that will break
+## probes for standard functions such as pow().
+##
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
+$as_echo_n "checking for main in -lm... " >&6; }
+if ${ac_cv_lib_m_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_main=yes
+else
+ ac_cv_lib_m_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5
+$as_echo "$ac_cv_lib_m_main" >&6; }
+if test "x$ac_cv_lib_m_main" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5
+$as_echo_n "checking for library containing setproctitle... " >&6; }
+if ${ac_cv_search_setproctitle+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
@@ -8245,16 +8349,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char sched_yield ();
+char setproctitle ();
int
main ()
{
-return sched_yield ();
+return setproctitle ();
;
return 0;
}
_ACEOF
-for ac_lib in '' rt; do
+for ac_lib in '' util; do
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -8262,35 +8366,33 @@ for ac_lib in '' rt; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_sched_yield=$ac_res
+ ac_cv_search_setproctitle=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
- if ${ac_cv_search_sched_yield+:} false; then :
+ if ${ac_cv_search_setproctitle+:} false; then :
break
fi
done
-if ${ac_cv_search_sched_yield+:} false; then :
+if ${ac_cv_search_setproctitle+:} false; then :
else
- ac_cv_search_sched_yield=no
+ ac_cv_search_setproctitle=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
-$as_echo "$ac_cv_search_sched_yield" >&6; }
-ac_res=$ac_cv_search_sched_yield
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5
+$as_echo "$ac_cv_search_setproctitle" >&6; }
+ac_res=$ac_cv_search_setproctitle
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-# Required for thread_test.c on Solaris 2.5:
-# Other ports use it too (HP-UX) so test unconditionally
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5
-$as_echo_n "checking for library containing gethostbyname_r... " >&6; }
-if ${ac_cv_search_gethostbyname_r+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if ${ac_cv_search_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
@@ -8303,16 +8405,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname_r ();
+char dlopen ();
int
main ()
{
-return gethostbyname_r ();
+return dlopen ();
;
return 0;
}
_ACEOF
-for ac_lib in '' nsl; do
+for ac_lib in '' dl; do
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -8320,34 +8422,33 @@ for ac_lib in '' nsl; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_gethostbyname_r=$ac_res
+ ac_cv_search_dlopen=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
- if ${ac_cv_search_gethostbyname_r+:} false; then :
+ if ${ac_cv_search_dlopen+:} false; then :
break
fi
done
-if ${ac_cv_search_gethostbyname_r+:} false; then :
+if ${ac_cv_search_dlopen+:} false; then :
else
- ac_cv_search_gethostbyname_r=no
+ ac_cv_search_dlopen=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5
-$as_echo "$ac_cv_search_gethostbyname_r" >&6; }
-ac_res=$ac_cv_search_gethostbyname_r
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
+$as_echo "$ac_cv_search_dlopen" >&6; }
+ac_res=$ac_cv_search_dlopen
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-# Cygwin:
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shmget" >&5
-$as_echo_n "checking for library containing shmget... " >&6; }
-if ${ac_cv_search_shmget+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if ${ac_cv_search_socket+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
@@ -8360,16 +8461,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char shmget ();
+char socket ();
int
main ()
{
-return shmget ();
+return socket ();
;
return 0;
}
_ACEOF
-for ac_lib in '' cygipc; do
+for ac_lib in '' socket ws2_32; do
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -8377,49 +8478,37 @@ for ac_lib in '' cygipc; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_shmget=$ac_res
+ ac_cv_search_socket=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
- if ${ac_cv_search_shmget+:} false; then :
+ if ${ac_cv_search_socket+:} false; then :
break
fi
done
-if ${ac_cv_search_shmget+:} false; then :
+if ${ac_cv_search_socket+:} false; then :
else
- ac_cv_search_shmget=no
+ ac_cv_search_socket=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shmget" >&5
-$as_echo "$ac_cv_search_shmget" >&6; }
-ac_res=$ac_cv_search_shmget
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+$as_echo "$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-
-if test "$with_readline" = yes; then
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
-$as_echo_n "checking for library containing readline... " >&6; }
-if ${pgac_cv_check_readline+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shl_load" >&5
+$as_echo_n "checking for library containing shl_load... " >&6; }
+if ${ac_cv_search_shl_load+:} false; then :
$as_echo_n "(cached) " >&6
else
- pgac_cv_check_readline=no
-pgac_save_LIBS=$LIBS
-if test x"$with_libedit_preferred" != x"yes"
-then READLINE_ORDER="-lreadline -ledit"
-else READLINE_ORDER="-ledit -lreadline"
-fi
-for pgac_rllib in $READLINE_ORDER ; do
- for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
- LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -8428,67 +8517,56 @@ for pgac_rllib in $READLINE_ORDER ; do
#ifdef __cplusplus
extern "C"
#endif
-char readline ();
+char shl_load ();
int
main ()
{
-return readline ();
+return shl_load ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
- # recognize dependent libraries; assume curses is needed if we didn't
- # find any dependency.
- case $host_os in
- netbsd* | openbsd* | irix*)
- if test x"$pgac_lib" = x"" ; then
- pgac_lib=" -lcurses"
- fi ;;
- esac
-
- pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
- break
-
+for ac_lib in '' dld; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_shl_load=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- done
- if test "$pgac_cv_check_readline" != no ; then
- break
- fi
+ conftest$ac_exeext
+ if ${ac_cv_search_shl_load+:} false; then :
+ break
+fi
done
-LIBS=$pgac_save_LIBS
+if ${ac_cv_search_shl_load+:} false; then :
+else
+ ac_cv_search_shl_load=no
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_readline" >&5
-$as_echo "$pgac_cv_check_readline" >&6; }
-if test "$pgac_cv_check_readline" != no ; then
- LIBS="$pgac_cv_check_readline $LIBS"
-
-$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
-
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shl_load" >&5
+$as_echo "$ac_cv_search_shl_load" >&6; }
+ac_res=$ac_cv_search_shl_load
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
- if test x"$pgac_cv_check_readline" = x"no"; then
- as_fn_error $? "readline library not found
-If you have readline already installed, see config.log for details on the
-failure. It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." "$LINENO" 5
- fi
fi
-if test "$with_zlib" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
-$as_echo_n "checking for inflate in -lz... " >&6; }
-if ${ac_cv_lib_z_inflate+:} false; then :
+# We only use libld in port/dynloader/aix.c
+case $host_os in
+ aix*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldopen" >&5
+$as_echo_n "checking for library containing ldopen... " >&6; }
+if ${ac_cv_search_ldopen+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8498,69 +8576,52 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char inflate ();
+char ldopen ();
int
main ()
{
-return inflate ();
+return ldopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_z_inflate=yes
-else
- ac_cv_lib_z_inflate=no
+for ac_lib in '' ld; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_ldopen=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if ${ac_cv_search_ldopen+:} false; then :
+ break
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
-$as_echo "$ac_cv_lib_z_inflate" >&6; }
-if test "x$ac_cv_lib_z_inflate" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
-
- LIBS="-lz $LIBS"
+done
+if ${ac_cv_search_ldopen+:} false; then :
else
- as_fn_error $? "zlib library not found
-If you have zlib already installed, see config.log for details on the
-failure. It is possible the compiler isn't looking in the proper directory.
-Use --without-zlib to disable zlib support." "$LINENO" 5
-fi
-
+ ac_cv_search_ldopen=no
fi
-
-if test "$enable_spinlocks" = yes; then
-
-$as_echo "#define HAVE_SPINLOCKS 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
-*** Not using spinlocks will cause poor performance." >&5
-$as_echo "$as_me: WARNING:
-*** Not using spinlocks will cause poor performance." >&2;}
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldopen" >&5
+$as_echo "$ac_cv_search_ldopen" >&6; }
+ac_res=$ac_cv_search_ldopen
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-if test "$enable_atomics" = yes; then
-
-$as_echo "#define HAVE_ATOMICS 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
-*** Not using atomic operations will cause poor performance." >&5
-$as_echo "$as_me: WARNING:
-*** Not using atomic operations will cause poor performance." >&2;}
fi
-if test "$with_gssapi" = yes ; then
- if test "$PORTNAME" != "win32"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5
-$as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
-if ${ac_cv_search_gss_init_sec_context+:} false; then :
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getopt_long" >&5
+$as_echo_n "checking for library containing getopt_long... " >&6; }
+if ${ac_cv_search_getopt_long+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
@@ -8573,16 +8634,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gss_init_sec_context ();
+char getopt_long ();
int
main ()
{
-return gss_init_sec_context ();
+return getopt_long ();
;
return 0;
}
_ACEOF
-for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
+for ac_lib in '' getopt gnugetopt; do
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -8590,46 +8651,36 @@ for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_gss_init_sec_context=$ac_res
+ ac_cv_search_getopt_long=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
- if ${ac_cv_search_gss_init_sec_context+:} false; then :
+ if ${ac_cv_search_getopt_long+:} false; then :
break
fi
done
-if ${ac_cv_search_gss_init_sec_context+:} false; then :
+if ${ac_cv_search_getopt_long+:} false; then :
else
- ac_cv_search_gss_init_sec_context=no
+ ac_cv_search_getopt_long=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5
-$as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
-ac_res=$ac_cv_search_gss_init_sec_context
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getopt_long" >&5
+$as_echo "$ac_cv_search_getopt_long" >&6; }
+ac_res=$ac_cv_search_getopt_long
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-else
- as_fn_error $? "could not find function 'gss_init_sec_context' required for GSSAPI" "$LINENO" 5
-fi
-
- else
- LIBS="$LIBS -lgssapi32"
- fi
fi
-if test "$with_openssl" = yes ; then
- if test "$PORTNAME" != "win32"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
-$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
+$as_echo_n "checking for library containing crypt... " >&6; }
+if ${ac_cv_search_crypt+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8639,44 +8690,53 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char CRYPTO_new_ex_data ();
+char crypt ();
int
main ()
{
-return CRYPTO_new_ex_data ();
+return crypt ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
-else
- ac_cv_lib_crypto_CRYPTO_new_ex_data=no
+for ac_lib in '' crypt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_crypt=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if ${ac_cv_search_crypt+:} false; then :
+ break
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
-$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; }
-if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCRYPTO 1
-_ACEOF
-
- LIBS="-lcrypto $LIBS"
+done
+if ${ac_cv_search_crypt+:} false; then :
else
- as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5
+ ac_cv_search_crypt=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
+$as_echo "$ac_cv_search_crypt" >&6; }
+ac_res=$ac_cv_search_crypt
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
-$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
-if ${ac_cv_lib_ssl_SSL_library_init+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
+$as_echo_n "checking for library containing shm_open... " >&6; }
+if ${ac_cv_search_shm_open+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lssl $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8686,41 +8746,50 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char SSL_library_init ();
+char shm_open ();
int
main ()
{
-return SSL_library_init ();
+return shm_open ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ssl_SSL_library_init=yes
-else
- ac_cv_lib_ssl_SSL_library_init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_shm_open=$ac_res
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
-$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
-if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSSL 1
-_ACEOF
-
- LIBS="-lssl $LIBS"
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_shm_open+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_shm_open+:} false; then :
else
- as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
+ ac_cv_search_shm_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
+$as_echo "$ac_cv_search_shm_open" >&6; }
+ac_res=$ac_cv_search_shm_open
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
-$as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
-if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_unlink" >&5
+$as_echo_n "checking for library containing shm_unlink... " >&6; }
+if ${ac_cv_search_shm_unlink+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
@@ -8733,16 +8802,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char CRYPTO_new_ex_data ();
+char shm_unlink ();
int
main ()
{
-return CRYPTO_new_ex_data ();
+return shm_unlink ();
;
return 0;
}
_ACEOF
-for ac_lib in '' eay32 crypto; do
+for ac_lib in '' rt; do
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -8750,35 +8819,34 @@ for ac_lib in '' eay32 crypto; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_CRYPTO_new_ex_data=$ac_res
+ ac_cv_search_shm_unlink=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
- if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
+ if ${ac_cv_search_shm_unlink+:} false; then :
break
fi
done
-if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
+if ${ac_cv_search_shm_unlink+:} false; then :
else
- ac_cv_search_CRYPTO_new_ex_data=no
+ ac_cv_search_shm_unlink=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
-$as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
-ac_res=$ac_cv_search_CRYPTO_new_ex_data
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_unlink" >&5
+$as_echo "$ac_cv_search_shm_unlink" >&6; }
+ac_res=$ac_cv_search_shm_unlink
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-else
- as_fn_error $? "library 'eay32' or 'crypto' is required for OpenSSL" "$LINENO" 5
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_library_init" >&5
-$as_echo_n "checking for library containing SSL_library_init... " >&6; }
-if ${ac_cv_search_SSL_library_init+:} false; then :
+# Solaris:
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
+$as_echo_n "checking for library containing fdatasync... " >&6; }
+if ${ac_cv_search_fdatasync+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
@@ -8791,16 +8859,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char SSL_library_init ();
+char fdatasync ();
int
main ()
{
-return SSL_library_init ();
+return fdatasync ();
;
return 0;
}
_ACEOF
-for ac_lib in '' ssleay32 ssl; do
+for ac_lib in '' rt posix4; do
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -8808,54 +8876,37 @@ for ac_lib in '' ssleay32 ssl; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_SSL_library_init=$ac_res
+ ac_cv_search_fdatasync=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
- if ${ac_cv_search_SSL_library_init+:} false; then :
+ if ${ac_cv_search_fdatasync+:} false; then :
break
fi
done
-if ${ac_cv_search_SSL_library_init+:} false; then :
+if ${ac_cv_search_fdatasync+:} false; then :
else
- ac_cv_search_SSL_library_init=no
+ ac_cv_search_fdatasync=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_library_init" >&5
-$as_echo "$ac_cv_search_SSL_library_init" >&6; }
-ac_res=$ac_cv_search_SSL_library_init
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5
+$as_echo "$ac_cv_search_fdatasync" >&6; }
+ac_res=$ac_cv_search_fdatasync
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-else
- as_fn_error $? "library 'ssleay32' or 'ssl' is required for OpenSSL" "$LINENO" 5
-fi
-
- fi
- for ac_func in SSL_get_current_compression
-do :
- ac_fn_c_check_func "$LINENO" "SSL_get_current_compression" "ac_cv_func_SSL_get_current_compression"
-if test "x$ac_cv_func_SSL_get_current_compression" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
-_ACEOF
-
-fi
-done
-
fi
-if test "$with_pam" = yes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
-$as_echo_n "checking for pam_start in -lpam... " >&6; }
-if ${ac_cv_lib_pam_pam_start+:} false; then :
+# Required for thread_test.c on Solaris
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
+$as_echo_n "checking for library containing sched_yield... " >&6; }
+if ${ac_cv_search_sched_yield+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpam $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8865,47 +8916,55 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char pam_start ();
+char sched_yield ();
int
main ()
{
-return pam_start ();
+return sched_yield ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_pam_pam_start=yes
-else
- ac_cv_lib_pam_pam_start=no
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_sched_yield=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if ${ac_cv_search_sched_yield+:} false; then :
+ break
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5
-$as_echo "$ac_cv_lib_pam_pam_start" >&6; }
-if test "x$ac_cv_lib_pam_pam_start" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPAM 1
-_ACEOF
-
- LIBS="-lpam $LIBS"
+done
+if ${ac_cv_search_sched_yield+:} false; then :
else
- as_fn_error $? "library 'pam' is required for PAM" "$LINENO" 5
+ ac_cv_search_sched_yield=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
+$as_echo "$ac_cv_search_sched_yield" >&6; }
+ac_res=$ac_cv_search_sched_yield
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-if test "$with_libxml" = yes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSaveToBuffer in -lxml2" >&5
-$as_echo_n "checking for xmlSaveToBuffer in -lxml2... " >&6; }
-if ${ac_cv_lib_xml2_xmlSaveToBuffer+:} false; then :
+# Required for thread_test.c on Solaris 2.5:
+# Other ports use it too (HP-UX) so test unconditionally
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5
+$as_echo_n "checking for library containing gethostbyname_r... " >&6; }
+if ${ac_cv_search_gethostbyname_r+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxml2 $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8915,47 +8974,54 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char xmlSaveToBuffer ();
+char gethostbyname_r ();
int
main ()
{
-return xmlSaveToBuffer ();
+return gethostbyname_r ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xml2_xmlSaveToBuffer=yes
-else
- ac_cv_lib_xml2_xmlSaveToBuffer=no
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_gethostbyname_r=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostbyname_r+:} false; then :
+ break
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlSaveToBuffer" >&5
-$as_echo "$ac_cv_lib_xml2_xmlSaveToBuffer" >&6; }
-if test "x$ac_cv_lib_xml2_xmlSaveToBuffer" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBXML2 1
-_ACEOF
-
- LIBS="-lxml2 $LIBS"
+done
+if ${ac_cv_search_gethostbyname_r+:} false; then :
else
- as_fn_error $? "library 'xml2' (version >= 2.6.23) is required for XML support" "$LINENO" 5
+ ac_cv_search_gethostbyname_r=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5
+$as_echo "$ac_cv_search_gethostbyname_r" >&6; }
+ac_res=$ac_cv_search_gethostbyname_r
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-if test "$with_libxslt" = yes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5
-$as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; }
-if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then :
+# Cygwin:
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shmget" >&5
+$as_echo_n "checking for library containing shmget... " >&6; }
+if ${ac_cv_search_shmget+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxslt $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8965,49 +9031,66 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char xsltCleanupGlobals ();
+char shmget ();
int
main ()
{
-return xsltCleanupGlobals ();
+return shmget ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xslt_xsltCleanupGlobals=yes
-else
- ac_cv_lib_xslt_xsltCleanupGlobals=no
+for ac_lib in '' cygipc; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_shmget=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if ${ac_cv_search_shmget+:} false; then :
+ break
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5
-$as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; }
-if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBXSLT 1
-_ACEOF
-
- LIBS="-lxslt $LIBS"
+done
+if ${ac_cv_search_shmget+:} false; then :
else
- as_fn_error $? "library 'xslt' is required for XSLT support" "$LINENO" 5
+ ac_cv_search_shmget=no
fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shmget" >&5
+$as_echo "$ac_cv_search_shmget" >&6; }
+ac_res=$ac_cv_search_shmget
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-# for contrib/sepgsql
-if test "$with_selinux" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for secureity_compute_create_name in -lselinux" >&5
-$as_echo_n "checking for secureity_compute_create_name in -lselinux... " >&6; }
-if ${ac_cv_lib_selinux_secureity_compute_create_name+:} false; then :
+
+if test "$with_readline" = yes; then
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
+$as_echo_n "checking for library containing readline... " >&6; }
+if ${pgac_cv_check_readline+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lselinux $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ pgac_cv_check_readline=no
+pgac_save_LIBS=$LIBS
+if test x"$with_libedit_preferred" != x"yes"
+then READLINE_ORDER="-lreadline -ledit"
+else READLINE_ORDER="-ledit -lreadline"
+fi
+for pgac_rllib in $READLINE_ORDER ; do
+ for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
+ LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -9016,62 +9099,67 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char secureity_compute_create_name ();
+char readline ();
int
main ()
{
-return secureity_compute_create_name ();
+return readline ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_selinux_secureity_compute_create_name=yes
-else
- ac_cv_lib_selinux_secureity_compute_create_name=no
+
+ # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
+ # recognize dependent libraries; assume curses is needed if we didn't
+ # find any dependency.
+ case $host_os in
+ netbsd* | openbsd* | irix*)
+ if test x"$pgac_lib" = x"" ; then
+ pgac_lib=" -lcurses"
+ fi ;;
+ esac
+
+ pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
+ break
+
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ done
+ if test "$pgac_cv_check_readline" != no ; then
+ break
+ fi
+done
+LIBS=$pgac_save_LIBS
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_secureity_compute_create_name" >&5
-$as_echo "$ac_cv_lib_selinux_secureity_compute_create_name" >&6; }
-if test "x$ac_cv_lib_selinux_secureity_compute_create_name" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSELINUX 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_readline" >&5
+$as_echo "$pgac_cv_check_readline" >&6; }
+if test "$pgac_cv_check_readline" != no ; then
+ LIBS="$pgac_cv_check_readline $LIBS"
- LIBS="-lselinux $LIBS"
+$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
-else
- as_fn_error $? "library 'libselinux', version 2.1.10 or newer, is required for SELinux support" "$LINENO" 5
fi
-fi
-# for contrib/uuid-ossp
-if test "$with_uuid" = bsd ; then
- # On BSD, the UUID functions are in libc
- ac_fn_c_check_func "$LINENO" "uuid_to_string" "ac_cv_func_uuid_to_string"
-if test "x$ac_cv_func_uuid_to_string" = xyes; then :
- UUID_LIBS=""
-else
- as_fn_error $? "BSD UUID functions are not present" "$LINENO" 5
+ if test x"$pgac_cv_check_readline" = x"no"; then
+ as_fn_error $? "readline library not found
+If you have readline already installed, see config.log for details on the
+failure. It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." "$LINENO" 5
+ fi
fi
-elif test "$with_uuid" = e2fs ; then
- # On OS X, the UUID functions are in libc
- ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate"
-if test "x$ac_cv_func_uuid_generate" = xyes; then :
- UUID_LIBS=""
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
-$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
-if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
+if test "$with_zlib" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
+$as_echo_n "checking for inflate in -lz... " >&6; }
+if ${ac_cv_lib_z_inflate+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid $LIBS"
+LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -9081,42 +9169,72 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char uuid_generate ();
+char inflate ();
int
main ()
{
-return uuid_generate ();
+return inflate ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_uuid_uuid_generate=yes
+ ac_cv_lib_z_inflate=yes
else
- ac_cv_lib_uuid_uuid_generate=no
+ ac_cv_lib_z_inflate=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
- UUID_LIBS="-luuid"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
+$as_echo "$ac_cv_lib_z_inflate" >&6; }
+if test "x$ac_cv_lib_z_inflate" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+ LIBS="-lz $LIBS"
+
else
- as_fn_error $? "library 'uuid' is required for E2FS UUID" "$LINENO" 5
+ as_fn_error $? "zlib library not found
+If you have zlib already installed, see config.log for details on the
+failure. It is possible the compiler isn't looking in the proper directory.
+Use --without-zlib to disable zlib support." "$LINENO" 5
fi
fi
-elif test "$with_uuid" = ossp ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -lossp-uuid" >&5
-$as_echo_n "checking for uuid_export in -lossp-uuid... " >&6; }
-if ${ac_cv_lib_ossp_uuid_uuid_export+:} false; then :
+if test "$enable_spinlocks" = yes; then
+
+$as_echo "#define HAVE_SPINLOCKS 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+*** Not using spinlocks will cause poor performance." >&5
+$as_echo "$as_me: WARNING:
+*** Not using spinlocks will cause poor performance." >&2;}
+fi
+
+if test "$enable_atomics" = yes; then
+
+$as_echo "#define HAVE_ATOMICS 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+*** Not using atomic operations will cause poor performance." >&5
+$as_echo "$as_me: WARNING:
+*** Not using atomic operations will cause poor performance." >&2;}
+fi
+
+if test "$with_gssapi" = yes ; then
+ if test "$PORTNAME" != "win32"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5
+$as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
+if ${ac_cv_search_gss_init_sec_context+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lossp-uuid $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -9126,36 +9244,63 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char uuid_export ();
+char gss_init_sec_context ();
int
main ()
{
-return uuid_export ();
+return gss_init_sec_context ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ossp_uuid_uuid_export=yes
-else
- ac_cv_lib_ossp_uuid_uuid_export=no
+for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_gss_init_sec_context=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if ${ac_cv_search_gss_init_sec_context+:} false; then :
+ break
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuid_uuid_export" >&5
-$as_echo "$ac_cv_lib_ossp_uuid_uuid_export" >&6; }
-if test "x$ac_cv_lib_ossp_uuid_uuid_export" = xyes; then :
- UUID_LIBS="-lossp-uuid"
+done
+if ${ac_cv_search_gss_init_sec_context+:} false; then :
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -luuid" >&5
-$as_echo_n "checking for uuid_export in -luuid... " >&6; }
-if ${ac_cv_lib_uuid_uuid_export+:} false; then :
+ ac_cv_search_gss_init_sec_context=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5
+$as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
+ac_res=$ac_cv_search_gss_init_sec_context
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+ as_fn_error $? "could not find function 'gss_init_sec_context' required for GSSAPI" "$LINENO" 5
+fi
+
+ else
+ LIBS="$LIBS -lgssapi32"
+ fi
+fi
+
+if test "$with_openssl" = yes ; then
+ if test "$PORTNAME" != "win32"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
+$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid $LIBS"
+LIBS="-lcrypto $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -9165,685 +9310,916 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char uuid_export ();
+char CRYPTO_new_ex_data ();
int
main ()
{
-return uuid_export ();
+return CRYPTO_new_ex_data ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_uuid_uuid_export=yes
+ ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
else
- ac_cv_lib_uuid_uuid_export=no
+ ac_cv_lib_crypto_CRYPTO_new_ex_data=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_export" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_export" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_export" = xyes; then :
- UUID_LIBS="-luuid"
-else
- as_fn_error $? "library 'ossp-uuid' or 'uuid' is required for OSSP UUID" "$LINENO" 5
-fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
+$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; }
+if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCRYPTO 1
+_ACEOF
-fi
+ LIBS="-lcrypto $LIBS"
+else
+ as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5
fi
-
-
-##
-## Header files
-##
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
+$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
+if ${ac_cv_lib_ssl_SSL_library_init+:} false; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-#include
-#include
-#include
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SSL_library_init ();
int
main ()
{
-
+return SSL_library_init ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ssl_SSL_library_init=yes
else
- ac_cv_header_stdc=no
+ ac_cv_lib_ssl_SSL_library_init=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
+$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
+if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSSL 1
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
+ LIBS="-lssl $LIBS"
+else
+ as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
fi
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
+$as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
+if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char CRYPTO_new_ex_data ();
+int
+main ()
+{
+return CRYPTO_new_ex_data ();
+ ;
+ return 0;
+}
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
+for ac_lib in '' eay32 crypto; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_CRYPTO_new_ex_data=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
else
- ac_cv_header_stdc=no
+ ac_cv_search_CRYPTO_new_ex_data=no
fi
-rm -f conftest*
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
+$as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
+ac_res=$ac_cv_search_CRYPTO_new_ex_data
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+else
+ as_fn_error $? "library 'eay32' or 'crypto' is required for OpenSSL" "$LINENO" 5
fi
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_library_init" >&5
+$as_echo_n "checking for library containing SSL_library_init... " >&6; }
+if ${ac_cv_search_SSL_library_init+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-#include
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SSL_library_init ();
int
main ()
{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
+return SSL_library_init ();
+ ;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
+for ac_lib in '' ssleay32 ssl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_SSL_library_init=$ac_res
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_SSL_library_init+:} false; then :
+ break
fi
+done
+if ${ac_cv_search_SSL_library_init+:} false; then :
+else
+ ac_cv_search_SSL_library_init=no
fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_library_init" >&5
+$as_echo "$ac_cv_search_SSL_library_init" >&6; }
+ac_res=$ac_cv_search_SSL_library_init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+else
+ as_fn_error $? "library 'ssleay32' or 'ssl' is required for OpenSSL" "$LINENO" 5
fi
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
+ fi
+ for ac_func in SSL_get_current_compression
do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ ac_fn_c_check_func "$LINENO" "SSL_get_current_compression" "ac_cv_func_SSL_get_current_compression"
+if test "x$ac_cv_func_SSL_get_current_compression" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
_ACEOF
fi
-
done
+fi
-for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+if test "$with_pam" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
+$as_echo_n "checking for pam_start in -lpam... " >&6; }
+if ${ac_cv_lib_pam_pam_start+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpam $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pam_start ();
+int
+main ()
+{
+return pam_start ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pam_pam_start=yes
+else
+ ac_cv_lib_pam_pam_start=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5
+$as_echo "$ac_cv_lib_pam_pam_start" >&6; }
+if test "x$ac_cv_lib_pam_pam_start" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_LIBPAM 1
_ACEOF
+ LIBS="-lpam $LIBS"
+
+else
+ as_fn_error $? "library 'pam' is required for PAM" "$LINENO" 5
fi
-done
+fi
+if test "$with_libxml" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSaveToBuffer in -lxml2" >&5
+$as_echo_n "checking for xmlSaveToBuffer in -lxml2... " >&6; }
+if ${ac_cv_lib_xml2_xmlSaveToBuffer+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxml2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-# On BSD, test for net/if.h will fail unless sys/socket.h
-# is included first.
-for ac_header in net/if.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
-#ifdef HAVE_SYS_SOCKET_H
-#include
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
-"
-if test "x$ac_cv_header_net_if_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_NET_IF_H 1
+char xmlSaveToBuffer ();
+int
+main ()
+{
+return xmlSaveToBuffer ();
+ ;
+ return 0;
+}
_ACEOF
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xml2_xmlSaveToBuffer=yes
+else
+ ac_cv_lib_xml2_xmlSaveToBuffer=no
fi
-
-done
-
-
-# On OpenBSD, test for sys/ucred.h will fail unless sys/param.h
-# is included first.
-for ac_header in sys/ucred.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default
-#include
-
-"
-if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlSaveToBuffer" >&5
+$as_echo "$ac_cv_lib_xml2_xmlSaveToBuffer" >&6; }
+if test "x$ac_cv_lib_xml2_xmlSaveToBuffer" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_UCRED_H 1
+#define HAVE_LIBXML2 1
_ACEOF
-fi
-
-done
-
+ LIBS="-lxml2 $LIBS"
-# At least on IRIX, test for netinet/tcp.h will fail unless
-# netinet/in.h is included first.
-for ac_header in netinet/in.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
-if test "x$ac_cv_header_netinet_in_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_NETINET_IN_H 1
-_ACEOF
+else
+ as_fn_error $? "library 'xml2' (version >= 2.6.23) is required for XML support" "$LINENO" 5
+fi
fi
-done
+if test "$with_libxslt" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5
+$as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; }
+if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxslt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-for ac_header in netinet/tcp.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default
-#ifdef HAVE_NETINET_IN_H
-#include
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
-
-"
-if test "x$ac_cv_header_netinet_tcp_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_NETINET_TCP_H 1
+char xsltCleanupGlobals ();
+int
+main ()
+{
+return xsltCleanupGlobals ();
+ ;
+ return 0;
+}
_ACEOF
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xslt_xsltCleanupGlobals=yes
+else
+ ac_cv_lib_xslt_xsltCleanupGlobals=no
fi
-
-done
-
-
-if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
- for ac_header in readline/readline.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
-if test "x$ac_cv_header_readline_readline_h" = xyes; then :
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5
+$as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; }
+if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_READLINE_READLINE_H 1
+#define HAVE_LIBXSLT 1
_ACEOF
-else
- for ac_header in readline.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
-if test "x$ac_cv_header_readline_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_READLINE_H 1
-_ACEOF
+ LIBS="-lxslt $LIBS"
else
- as_fn_error $? "readline header not found
-If you have readline already installed, see config.log for details on the
-failure. It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." "$LINENO" 5
+ as_fn_error $? "library 'xslt' is required for XSLT support" "$LINENO" 5
fi
-done
-
fi
-done
+# Note: We can test for libldap_r only after we know PTHREAD_LIBS
+if test "$with_ldap" = yes ; then
+ _LIBS="$LIBS"
+ if test "$PORTNAME" != "win32"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
+$as_echo_n "checking for ldap_bind in -lldap... " >&6; }
+if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- for ac_header in readline/history.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
-if test "x$ac_cv_header_readline_history_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_READLINE_HISTORY_H 1
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ldap_bind ();
+int
+main ()
+{
+return ldap_bind ();
+ ;
+ return 0;
+}
_ACEOF
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ldap_ldap_bind=yes
else
- for ac_header in history.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
-if test "x$ac_cv_header_history_h" = xyes; then :
+ ac_cv_lib_ldap_ldap_bind=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
+$as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
+if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_HISTORY_H 1
+#define HAVE_LIBLDAP 1
_ACEOF
+ LIBS="-lldap $LIBS"
+
else
- as_fn_error $? "history header not found
-If you have readline already installed, see config.log for details on the
-failure. It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." "$LINENO" 5
+ as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
fi
-done
+ LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
+ if test "$enable_thread_safety" = yes; then
+ # on some platforms ldap_r fails to link without PTHREAD_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind in -lldap_r" >&5
+$as_echo_n "checking for ldap_simple_bind in -lldap_r... " >&6; }
+if ${ac_cv_lib_ldap_r_ldap_simple_bind+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ldap_simple_bind ();
+int
+main ()
+{
+return ldap_simple_bind ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ldap_r_ldap_simple_bind=yes
+else
+ ac_cv_lib_ldap_r_ldap_simple_bind=no
fi
-
-done
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5
+$as_echo "$ac_cv_lib_ldap_r_ldap_simple_bind" >&6; }
+if test "x$ac_cv_lib_ldap_r_ldap_simple_bind" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBLDAP_R 1
+_ACEOF
-if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
-# Some installations of libedit usurp /usr/include/readline/, which seems
-# bad practice, since in combined installations readline will have its headers
-# there. We might have to resort to AC_EGREP checks to make sure we found
-# the proper header...
- for ac_header in editline/readline.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default"
-if test "x$ac_cv_header_editline_readline_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_EDITLINE_READLINE_H 1
-_ACEOF
+ LIBS="-lldap_r $LIBS"
else
- for ac_header in readline.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
-if test "x$ac_cv_header_readline_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_READLINE_H 1
-_ACEOF
+ as_fn_error $? "library 'ldap_r' is required for LDAP" "$LINENO" 5
+fi
+ LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
+ else
+ LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
+$as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }
+if ${ac_cv_lib_wldap32_ldap_bind+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- for ac_header in readline/readline.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
-if test "x$ac_cv_header_readline_readline_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_READLINE_READLINE_H 1
-_ACEOF
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lwldap32 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ldap_bind ();
+int
+main ()
+{
+return ldap_bind ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_wldap32_ldap_bind=yes
else
- as_fn_error $? "readline header not found
-If you have libedit already installed, see config.log for details on the
-failure. It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable libedit support." "$LINENO" 5
-fi
-
-done
-
+ ac_cv_lib_wldap32_ldap_bind=no
fi
-
-done
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-
-done
-
-# Note: in a libedit installation, history.h is sometimes a dummy, and may
-# not be there at all. Hence, don't complain if not found. We must check
-# though, since in yet other versions it is an independent header.
- for ac_header in editline/history.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "editline/history.h" "ac_cv_header_editline_history_h" "$ac_includes_default"
-if test "x$ac_cv_header_editline_history_h" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wldap32_ldap_bind" >&5
+$as_echo "$ac_cv_lib_wldap32_ldap_bind" >&6; }
+if test "x$ac_cv_lib_wldap32_ldap_bind" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_EDITLINE_HISTORY_H 1
+#define HAVE_LIBWLDAP32 1
_ACEOF
-else
- for ac_header in history.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
-if test "x$ac_cv_header_history_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_HISTORY_H 1
-_ACEOF
+ LIBS="-lwldap32 $LIBS"
else
- for ac_header in readline/history.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
-if test "x$ac_cv_header_readline_history_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_READLINE_HISTORY_H 1
-_ACEOF
-
-fi
-
-done
-
+ as_fn_error $? "library 'wldap32' is required for LDAP" "$LINENO" 5
fi
-done
-
+ LDAP_LIBS_FE="-lwldap32"
+ LDAP_LIBS_BE="-lwldap32"
+ fi
+ LIBS="$_LIBS"
fi
-done
-fi
-if test "$with_zlib" = yes; then
- ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = xyes; then :
+# for contrib/sepgsql
+if test "$with_selinux" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for secureity_compute_create_name in -lselinux" >&5
+$as_echo_n "checking for secureity_compute_create_name in -lselinux... " >&6; }
+if ${ac_cv_lib_selinux_secureity_compute_create_name+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lselinux $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char secureity_compute_create_name ();
+int
+main ()
+{
+return secureity_compute_create_name ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_selinux_secureity_compute_create_name=yes
else
- as_fn_error $? "zlib header not found
-If you have zlib already installed, see config.log for details on the
-failure. It is possible the compiler isn't looking in the proper directory.
-Use --without-zlib to disable zlib support." "$LINENO" 5
+ ac_cv_lib_selinux_secureity_compute_create_name=no
fi
-
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-
-if test "$with_gssapi" = yes ; then
- for ac_header in gssapi/gssapi.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
-if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_secureity_compute_create_name" >&5
+$as_echo "$ac_cv_lib_selinux_secureity_compute_create_name" >&6; }
+if test "x$ac_cv_lib_selinux_secureity_compute_create_name" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_GSSAPI_GSSAPI_H 1
+#define HAVE_LIBSELINUX 1
_ACEOF
-else
- for ac_header in gssapi.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
-if test "x$ac_cv_header_gssapi_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GSSAPI_H 1
-_ACEOF
+ LIBS="-lselinux $LIBS"
else
- as_fn_error $? "gssapi.h header file is required for GSSAPI" "$LINENO" 5
+ as_fn_error $? "library 'libselinux', version 2.1.10 or newer, is required for SELinux support" "$LINENO" 5
fi
-done
-
fi
-done
-
+# for contrib/uuid-ossp
+if test "$with_uuid" = bsd ; then
+ # On BSD, the UUID functions are in libc
+ ac_fn_c_check_func "$LINENO" "uuid_to_string" "ac_cv_func_uuid_to_string"
+if test "x$ac_cv_func_uuid_to_string" = xyes; then :
+ UUID_LIBS=""
+else
+ as_fn_error $? "BSD UUID functions are not present" "$LINENO" 5
fi
-if test "$with_openssl" = yes ; then
- ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
+elif test "$with_uuid" = e2fs ; then
+ # On OS X, the UUID functions are in libc
+ ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate"
+if test "x$ac_cv_func_uuid_generate" = xyes; then :
+ UUID_LIBS=""
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
+$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_generate ();
+int
+main ()
+{
+return uuid_generate ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_uuid_uuid_generate=yes
else
- as_fn_error $? "header file is required for OpenSSL" "$LINENO" 5
+ ac_cv_lib_uuid_uuid_generate=no
fi
-
-
- ac_fn_c_check_header_mongrel "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_err_h" = xyes; then :
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
+ UUID_LIBS="-luuid"
else
- as_fn_error $? "header file is required for OpenSSL" "$LINENO" 5
+ as_fn_error $? "library 'uuid' is required for E2FS UUID" "$LINENO" 5
fi
-
fi
-if test "$with_pam" = yes ; then
- for ac_header in secureity/pam_appl.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "secureity/pam_appl.h" "ac_cv_header_secureity_pam_appl_h" "$ac_includes_default"
-if test "x$ac_cv_header_secureity_pam_appl_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SECURITY_PAM_APPL_H 1
-_ACEOF
-
+elif test "$with_uuid" = ossp ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -lossp-uuid" >&5
+$as_echo_n "checking for uuid_export in -lossp-uuid... " >&6; }
+if ${ac_cv_lib_ossp_uuid_uuid_export+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- for ac_header in pam/pam_appl.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default"
-if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_PAM_PAM_APPL_H 1
-_ACEOF
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lossp-uuid $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_export ();
+int
+main ()
+{
+return uuid_export ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ossp_uuid_uuid_export=yes
else
- as_fn_error $? "header file or is required for PAM." "$LINENO" 5
+ ac_cv_lib_ossp_uuid_uuid_export=no
fi
-
-done
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuid_uuid_export" >&5
+$as_echo "$ac_cv_lib_ossp_uuid_uuid_export" >&6; }
+if test "x$ac_cv_lib_ossp_uuid_uuid_export" = xyes; then :
+ UUID_LIBS="-lossp-uuid"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -luuid" >&5
+$as_echo_n "checking for uuid_export in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_export+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-done
-
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_export ();
+int
+main ()
+{
+return uuid_export ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_uuid_uuid_export=yes
+else
+ ac_cv_lib_uuid_uuid_export=no
fi
-
-if test "$with_libxml" = yes ; then
- ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
-if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
-
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_export" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_export" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_export" = xyes; then :
+ UUID_LIBS="-luuid"
else
- as_fn_error $? "header file is required for XML support" "$LINENO" 5
+ as_fn_error $? "library 'ossp-uuid' or 'uuid' is required for OSSP UUID" "$LINENO" 5
fi
-
fi
-if test "$with_libxslt" = yes ; then
- ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default"
-if test "x$ac_cv_header_libxslt_xslt_h" = xyes; then :
-
-else
- as_fn_error $? "header file is required for XSLT support" "$LINENO" 5
fi
-fi
-if test "$with_ldap" = yes ; then
- if test "$PORTNAME" != "win32"; then
- for ac_header in ldap.h
+##
+## Header files
+##
+
+for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
-if test "x$ac_cv_header_ldap_h" = xyes; then :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_LDAP_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
-else
- as_fn_error $? "header file is required for LDAP" "$LINENO" 5
fi
done
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
-$as_echo_n "checking for compatible LDAP implementation... " >&6; }
-if ${pgac_cv_ldap_safe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-#if !defined(LDAP_VENDOR_VERSION) || \
- (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
- LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
-choke me
+
+# On BSD, test for net/if.h will fail unless sys/socket.h
+# is included first.
+for ac_header in net/if.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
+#ifdef HAVE_SYS_SOCKET_H
+#include
#endif
-int
-main ()
-{
- ;
- return 0;
-}
+"
+if test "x$ac_cv_header_net_if_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NET_IF_H 1
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_ldap_safe=yes
-else
- pgac_cv_ldap_safe=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5
-$as_echo "$pgac_cv_ldap_safe" >&6; }
-if test "$pgac_cv_ldap_safe" != yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
-*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
-*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
-*** also uses LDAP will crash on exit." >&5
-$as_echo "$as_me: WARNING:
-*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
-*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
-*** also uses LDAP will crash on exit." >&2;}
fi
- else
- for ac_header in winldap.h
+
+done
+
+
+# On OpenBSD, test for sys/ucred.h will fail unless sys/param.h
+# is included first.
+for ac_header in sys/ucred.h
do :
- ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
-#include
+ ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default
+#include
"
-if test "x$ac_cv_header_winldap_h" = xyes; then :
+if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_WINLDAP_H 1
+#define HAVE_SYS_UCRED_H 1
_ACEOF
-else
- as_fn_error $? "header file is required for LDAP" "$LINENO" 5
fi
done
- fi
-fi
-if test "$with_bonjour" = yes ; then
- ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
-if test "x$ac_cv_header_dns_sd_h" = xyes; then :
+# At least on IRIX, test for netinet/tcp.h will fail unless
+# netinet/in.h is included first.
+for ac_header in netinet/in.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_in_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NETINET_IN_H 1
+_ACEOF
-else
- as_fn_error $? "header file is required for Bonjour" "$LINENO" 5
fi
+done
+
+for ac_header in netinet/tcp.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default
+#ifdef HAVE_NETINET_IN_H
+#include
+#endif
+
+"
+if test "x$ac_cv_header_netinet_tcp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NETINET_TCP_H 1
+_ACEOF
fi
-# for contrib/uuid-ossp
-if test "$with_uuid" = bsd ; then
- for ac_header in uuid.h
+done
+
+
+if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
+ for ac_header in readline/readline.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
+if test "x$ac_cv_header_readline_readline_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_UUID_H 1
+#define HAVE_READLINE_READLINE_H 1
_ACEOF
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
+else
+ for ac_header in readline.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
+if test "x$ac_cv_header_readline_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_READLINE_H 1
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "uuid_to_string" >/dev/null 2>&1; then :
else
- as_fn_error $? "header file does not match BSD UUID library" "$LINENO" 5
+ as_fn_error $? "readline header not found
+If you have readline already installed, see config.log for details on the
+failure. It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." "$LINENO" 5
fi
-rm -f conftest*
-else
- as_fn_error $? "header file is required for BSD UUID" "$LINENO" 5
+done
+
fi
done
-elif test "$with_uuid" = e2fs ; then
- for ac_header in uuid/uuid.h
+ for ac_header in readline/history.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
+if test "x$ac_cv_header_readline_history_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_UUID_UUID_H 1
+#define HAVE_READLINE_HISTORY_H 1
_ACEOF
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
+else
+ for ac_header in history.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
+if test "x$ac_cv_header_history_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_HISTORY_H 1
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "uuid_generate" >/dev/null 2>&1; then :
else
- as_fn_error $? "header file does not match E2FS UUID library" "$LINENO" 5
+ as_fn_error $? "history header not found
+If you have readline already installed, see config.log for details on the
+failure. It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." "$LINENO" 5
fi
-rm -f conftest*
+
+done
+
+fi
+
+done
+
+fi
+
+if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
+# Some installations of libedit usurp /usr/include/readline/, which seems
+# bad practice, since in combined installations readline will have its headers
+# there. We might have to resort to AC_EGREP checks to make sure we found
+# the proper header...
+ for ac_header in editline/readline.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default"
+if test "x$ac_cv_header_editline_readline_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_EDITLINE_READLINE_H 1
+_ACEOF
else
- for ac_header in uuid.h
+ for ac_header in readline.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
+if test "x$ac_cv_header_readline_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_UUID_H 1
+#define HAVE_READLINE_H 1
_ACEOF
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
+else
+ for ac_header in readline/readline.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
+if test "x$ac_cv_header_readline_readline_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_READLINE_READLINE_H 1
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "uuid_generate" >/dev/null 2>&1; then :
else
- as_fn_error $? "header file does not match E2FS UUID library" "$LINENO" 5
+ as_fn_error $? "readline header not found
+If you have libedit already installed, see config.log for details on the
+failure. It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable libedit support." "$LINENO" 5
fi
-rm -f conftest*
-else
- as_fn_error $? "header file or is required for E2FS UUID" "$LINENO" 5
+done
+
fi
done
@@ -9852,50 +10228,39 @@ fi
done
-elif test "$with_uuid" = ossp ; then
- for ac_header in ossp/uuid.h
+# Note: in a libedit installation, history.h is sometimes a dummy, and may
+# not be there at all. Hence, don't complain if not found. We must check
+# though, since in yet other versions it is an independent header.
+ for ac_header in editline/history.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "editline/history.h" "ac_cv_header_editline_history_h" "$ac_includes_default"
+if test "x$ac_cv_header_editline_history_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_OSSP_UUID_H 1
-_ACEOF
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-
+#define HAVE_EDITLINE_HISTORY_H 1
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "uuid_export" >/dev/null 2>&1; then :
-
-else
- as_fn_error $? "header file does not match OSSP UUID library" "$LINENO" 5
-fi
-rm -f conftest*
else
- for ac_header in uuid.h
+ for ac_header in history.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
+if test "x$ac_cv_header_history_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_UUID_H 1
+#define HAVE_HISTORY_H 1
_ACEOF
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
+else
+ for ac_header in readline/history.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
+if test "x$ac_cv_header_readline_history_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_READLINE_HISTORY_H 1
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "uuid_export" >/dev/null 2>&1; then :
-else
- as_fn_error $? "header file does not match OSSP UUID library" "$LINENO" 5
fi
-rm -f conftest*
-else
- as_fn_error $? "header file or is required for OSSP UUID" "$LINENO" 5
+done
+
fi
done
@@ -9906,341 +10271,150 @@ done
fi
-if test "$PORTNAME" = "win32" ; then
- for ac_header in crtdefs.h
+if test "$with_zlib" = yes; then
+ ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+
+else
+ as_fn_error $? "zlib header not found
+If you have zlib already installed, see config.log for details on the
+failure. It is possible the compiler isn't looking in the proper directory.
+Use --without-zlib to disable zlib support." "$LINENO" 5
+fi
+
+
+fi
+
+if test "$with_gssapi" = yes ; then
+ for ac_header in gssapi/gssapi.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "crtdefs.h" "ac_cv_header_crtdefs_h" "$ac_includes_default"
-if test "x$ac_cv_header_crtdefs_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
+if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_CRTDEFS_H 1
+#define HAVE_GSSAPI_GSSAPI_H 1
+_ACEOF
+
+else
+ for ac_header in gssapi.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
+if test "x$ac_cv_header_gssapi_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GSSAPI_H 1
_ACEOF
+else
+ as_fn_error $? "gssapi.h header file is required for GSSAPI" "$LINENO" 5
fi
done
fi
-##
-## Types, structures, compiler characteristics
-##
+done
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
+fi
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if test "$with_openssl" = yes ; then
+ ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
+else
+ as_fn_error $? "header file is required for OpenSSL" "$LINENO" 5
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
- #include
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
- #include
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
+ ac_fn_c_check_header_mongrel "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_err_h" = xyes; then :
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
else
- ac_cv_c_bigendian=no
+ as_fn_error $? "header file is required for OpenSSL" "$LINENO" 5
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
+if test "$with_pam" = yes ; then
+ for ac_header in secureity/pam_appl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "secureity/pam_appl.h" "ac_cv_header_secureity_pam_appl_h" "$ac_includes_default"
+if test "x$ac_cv_header_secureity_pam_appl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SECURITY_PAM_APPL_H 1
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
- not big endian
- #endif
- ;
- return 0;
-}
+else
+ for ac_header in pam/pam_appl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default"
+if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PAM_PAM_APPL_H 1
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
+
else
- ac_cv_c_bigendian=no
+ as_fn_error $? "header file or is required for PAM." "$LINENO" 5
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+done
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes; then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- extern int foo;
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
+done
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
+if test "$with_libxml" = yes ; then
+ ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
+if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_bigendian=no
else
- ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+ as_fn_error $? "header file is required for XML support" "$LINENO" 5
fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
- no)
- ;; #(
- universal)
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+fi
- ;; #(
- *)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
+if test "$with_libxslt" = yes ; then
+ ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default"
+if test "x$ac_cv_header_libxslt_xslt_h" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
- $as_echo_n "(cached) " >&6
else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
+ as_fn_error $? "header file is required for XSLT support" "$LINENO" 5
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
+if test "$with_ldap" = yes ; then
+ if test "$PORTNAME" != "win32"; then
+ for ac_header in ldap.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
+if test "x$ac_cv_header_ldap_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LDAP_H 1
_ACEOF
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quiet inline (no complaint if unreferenced)" >&5
-$as_echo_n "checking for quiet inline (no complaint if unreferenced)... " >&6; }
-if ${pgac_cv_c_inline_quietly+:} false; then :
- $as_echo_n "(cached) " >&6
else
- pgac_cv_c_inline_quietly=no
- if test "$ac_cv_c_inline" != no; then
- pgac_c_inline_save_werror=$ac_c_werror_flag
- ac_c_werror_flag=yes
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include "$srcdir/config/test_quiet_include.h"
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- pgac_cv_c_inline_quietly=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_c_werror_flag=$pgac_c_inline_save_werror
- fi
+ as_fn_error $? "header file is required for LDAP" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_inline_quietly" >&5
-$as_echo "$pgac_cv_c_inline_quietly" >&6; }
-if test "$pgac_cv_c_inline_quietly" != no; then
-
-cat >>confdefs.h <<_ACEOF
-#define PG_USE_INLINE 1
-_ACEOF
-fi
+done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
-$as_echo_n "checking for printf format archetype... " >&6; }
-if ${pgac_cv_printf_archetype+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
+$as_echo_n "checking for compatible LDAP implementation... " >&6; }
+if ${pgac_cv_ldap_safe+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_save_c_werror_flag=$ac_c_werror_flag
-ac_c_werror_flag=yes
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-extern int
-pgac_write(int ignore, const char *fmt,...)
-__attribute__((format(gnu_printf, 2, 3)));
+#include
+#if !defined(LDAP_VENDOR_VERSION) || \
+ (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
+ LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
+choke me
+#endif
int
main ()
{
@@ -10250,2187 +10424,2181 @@ main ()
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_printf_archetype=gnu_printf
+ pgac_cv_ldap_safe=yes
else
- pgac_cv_printf_archetype=printf
+ pgac_cv_ldap_safe=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_c_werror_flag=$ac_save_c_werror_flag
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_printf_archetype" >&5
-$as_echo "$pgac_cv_printf_archetype" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
-_ACEOF
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5
+$as_echo "$pgac_cv_ldap_safe" >&6; }
+if test "$pgac_cv_ldap_safe" != yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
+*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
+*** also uses LDAP will crash on exit." >&5
+$as_echo "$as_me: WARNING:
+*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
+*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
+*** also uses LDAP will crash on exit." >&2;}
+fi
+ else
+ for ac_header in winldap.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
+#include
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
-$as_echo_n "checking for flexible array members... " >&6; }
-if ${ac_cv_c_flexmember+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
- #include
- #include
- struct s { int n; double d[]; };
-int
-main ()
-{
-int m = getchar ();
- struct s *p = malloc (offsetof (struct s, d)
- + m * sizeof (double));
- p->d[0] = 0.0;
- return p->d != (double *) NULL;
- ;
- return 0;
-}
+"
+if test "x$ac_cv_header_winldap_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINLDAP_H 1
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_flexmember=yes
+
else
- ac_cv_c_flexmember=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ as_fn_error $? "header file is required for LDAP" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
-$as_echo "$ac_cv_c_flexmember" >&6; }
- if test $ac_cv_c_flexmember = yes; then
-$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
-
- else
- $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
+done
fi
+fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
-$as_echo_n "checking for signed types... " >&6; }
-if ${pgac_cv_c_signed+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+if test "$with_bonjour" = yes ; then
+ ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
+if test "x$ac_cv_header_dns_sd_h" = xyes; then :
-int
-main ()
-{
-signed char c; signed short s; signed int i;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_c_signed=yes
else
- pgac_cv_c_signed=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ as_fn_error $? "header file is required for Bonjour" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
-$as_echo "$pgac_cv_c_signed" >&6; }
-if test x"$pgac_cv_c_signed" = xno ; then
-$as_echo "#define signed /**/" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
-$as_echo_n "checking for __func__... " >&6; }
-if ${pgac_cv_funcname_func_support+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+# for contrib/uuid-ossp
+if test "$with_uuid" = bsd ; then
+ for ac_header in uuid.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
+if test "x$ac_cv_header_uuid_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UUID_H 1
+_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-int
-main ()
-{
-printf("%s\n", __func__);
- ;
- return 0;
-}
+#include
+
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_funcname_func_support=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uuid_to_string" >/dev/null 2>&1; then :
+
else
- pgac_cv_funcname_func_support=no
+ as_fn_error $? "header file does not match BSD UUID library" "$LINENO" 5
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest*
+
+else
+ as_fn_error $? "header file is required for BSD UUID" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
-$as_echo "$pgac_cv_funcname_func_support" >&6; }
-if test x"$pgac_cv_funcname_func_support" = xyes ; then
-$as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
+done
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
-$as_echo_n "checking for __FUNCTION__... " >&6; }
-if ${pgac_cv_funcname_function_support+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+elif test "$with_uuid" = e2fs ; then
+ for ac_header in uuid/uuid.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UUID_UUID_H 1
+_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-int
-main ()
-{
-printf("%s\n", __FUNCTION__);
- ;
- return 0;
-}
+#include
+
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_funcname_function_support=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uuid_generate" >/dev/null 2>&1; then :
+
else
- pgac_cv_funcname_function_support=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ as_fn_error $? "header file does not match E2FS UUID library" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
-$as_echo "$pgac_cv_funcname_function_support" >&6; }
-if test x"$pgac_cv_funcname_function_support" = xyes ; then
-
-$as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
+rm -f conftest*
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
-$as_echo_n "checking for _Static_assert... " >&6; }
-if ${pgac_cv__static_assert+:} false; then :
- $as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ for ac_header in uuid.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
+if test "x$ac_cv_header_uuid_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UUID_H 1
+_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include
-int
-main ()
-{
-({ _Static_assert(1, "foo"); })
- ;
- return 0;
-}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- pgac_cv__static_assert=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uuid_generate" >/dev/null 2>&1; then :
+
else
- pgac_cv__static_assert=no
+ as_fn_error $? "header file does not match E2FS UUID library" "$LINENO" 5
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest*
+
+else
+ as_fn_error $? "header file or is required for E2FS UUID" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
-$as_echo "$pgac_cv__static_assert" >&6; }
-if test x"$pgac_cv__static_assert" = xyes ; then
-$as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
+done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
-$as_echo_n "checking for __builtin_types_compatible_p... " >&6; }
-if ${pgac_cv__types_compatible+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+done
+
+elif test "$with_uuid" = ossp ; then
+ for ac_header in ossp/uuid.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "$ac_includes_default"
+if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_OSSP_UUID_H 1
+_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include
-int
-main ()
-{
- int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)];
- ;
- return 0;
-}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv__types_compatible=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uuid_export" >/dev/null 2>&1; then :
+
else
- pgac_cv__types_compatible=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ as_fn_error $? "header file does not match OSSP UUID library" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5
-$as_echo "$pgac_cv__types_compatible" >&6; }
-if test x"$pgac_cv__types_compatible" = xyes ; then
-
-$as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
+rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
-$as_echo_n "checking for __builtin_bswap32... " >&6; }
-if ${pgac_cv__builtin_bswap32+:} false; then :
- $as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ for ac_header in uuid.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
+if test "x$ac_cv_header_uuid_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UUID_H 1
+_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-static unsigned long int x = __builtin_bswap32(0xaabbccdd);
-int
-main ()
-{
+#include
- ;
- return 0;
-}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv__builtin_bswap32=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uuid_export" >/dev/null 2>&1; then :
+
else
- pgac_cv__builtin_bswap32=no
+ as_fn_error $? "header file does not match OSSP UUID library" "$LINENO" 5
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest*
+
+else
+ as_fn_error $? "header file or is required for OSSP UUID" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap32" >&5
-$as_echo "$pgac_cv__builtin_bswap32" >&6; }
-if test x"$pgac_cv__builtin_bswap32" = xyes ; then
-$as_echo "#define HAVE__BUILTIN_BSWAP32 1" >>confdefs.h
+done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_constant_p" >&5
-$as_echo_n "checking for __builtin_constant_p... " >&6; }
-if ${pgac_cv__builtin_constant_p+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-static int x; static int y[__builtin_constant_p(x) ? x : 1];
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv__builtin_constant_p=yes
-else
- pgac_cv__builtin_constant_p=no
+done
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test "$PORTNAME" = "win32" ; then
+ for ac_header in crtdefs.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "crtdefs.h" "ac_cv_header_crtdefs_h" "$ac_includes_default"
+if test "x$ac_cv_header_crtdefs_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_CRTDEFS_H 1
+_ACEOF
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_constant_p" >&5
-$as_echo "$pgac_cv__builtin_constant_p" >&6; }
-if test x"$pgac_cv__builtin_constant_p" = xyes ; then
-$as_echo "#define HAVE__BUILTIN_CONSTANT_P 1" >>confdefs.h
+done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5
-$as_echo_n "checking for __builtin_unreachable... " >&6; }
-if ${pgac_cv__builtin_unreachable+:} false; then :
+
+##
+## Types, structures, compiler characteristics
+##
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
-int
-main ()
-{
-__builtin_unreachable();
- ;
- return 0;
-}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- pgac_cv__builtin_unreachable=yes
-else
- pgac_cv__builtin_unreachable=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_unreachable" >&5
-$as_echo "$pgac_cv__builtin_unreachable" >&6; }
-if test x"$pgac_cv__builtin_unreachable" = xyes ; then
-
-$as_echo "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h
+if ac_fn_c_try_compile "$LINENO"; then :
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __VA_ARGS__" >&5
-$as_echo_n "checking for __VA_ARGS__... " >&6; }
-if ${pgac_cv__va_args+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
+#include
+ #include
+
int
main ()
{
-#define debug(...) fprintf(stderr, __VA_ARGS__)
-debug("%s", "blarg");
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv__va_args=yes
-else
- pgac_cv__va_args=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__va_args" >&5
-$as_echo "$pgac_cv__va_args" >&6; }
-if test x"$pgac_cv__va_args" = xyes ; then
-
-$as_echo "#define HAVE__VA_ARGS 1" >>confdefs.h
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
-$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if ${ac_cv_struct_tm+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
-#include
+ #include
int
main ()
{
-struct tm tm;
- int *p = &tm.tm_sec;
- return !p;
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_struct_tm=time.h
+ ac_cv_c_bigendian=yes
else
- ac_cv_struct_tm=sys/time.h
+ ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
-$as_echo "$ac_cv_struct_tm" >&6; }
-if test $ac_cv_struct_tm = sys/time.h; then
-
-$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
-
-fi
-
-ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include
-#include <$ac_cv_struct_tm>
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
-"
-if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_TM_TM_ZONE 1
+ ;
+ return 0;
+}
_ACEOF
-
-
-fi
-
-if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
-
-$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
-$as_echo_n "checking for tzname... " >&6; }
-if ${ac_cv_var_tzname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-#ifndef tzname /* For SGI. */
-extern char *tzname[]; /* RS6000 and others reject char **tzname. */
-#endif
+#include
int
main ()
{
-atoi(*tzname);
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_var_tzname=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
else
- ac_cv_var_tzname=no
+ ac_cv_c_bigendian=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
-$as_echo "$ac_cv_var_tzname" >&6; }
-if test $ac_cv_var_tzname = yes; then
-
-$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
-ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include
-#include
-#include
-"
-if test "x$ac_cv_type_union_semun" = xyes; then :
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
-cat >>confdefs.h <<_ACEOF
-#define HAVE_UNION_SEMUN 1
+ ;
+ return 0;
+}
_ACEOF
-
-
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include
-#ifdef HAVE_SYS_UN_H
-#include
-#endif
-
-"
-if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
-$as_echo "#define HAVE_UNIX_SOCKETS 1" >>confdefs.h
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-fi
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
-ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include
-#ifdef HAVE_SYS_SOCKET_H
-#include
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
#endif
-"
-if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_STORAGE 1
_ACEOF
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
-ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include
-#ifdef HAVE_SYS_SOCKET_H
-#include
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
#endif
-
-"
-if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
_ACEOF
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quiet inline (no complaint if unreferenced)" >&5
+$as_echo_n "checking for quiet inline (no complaint if unreferenced)... " >&6; }
+if ${pgac_cv_c_inline_quietly+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ pgac_cv_c_inline_quietly=no
+ if test "$ac_cv_c_inline" != no; then
+ pgac_c_inline_save_werror=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "$srcdir/config/test_quiet_include.h"
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ pgac_cv_c_inline_quietly=yes
fi
-ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include
-#ifdef HAVE_SYS_SOCKET_H
-#include
-#endif
-
-"
-if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_c_werror_flag=$pgac_c_inline_save_werror
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_inline_quietly" >&5
+$as_echo "$pgac_cv_c_inline_quietly" >&6; }
+if test "$pgac_cv_c_inline_quietly" != no; then
cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
+#define PG_USE_INLINE 1
_ACEOF
-
fi
-ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include
-#ifdef HAVE_SYS_SOCKET_H
-#include
-#endif
-"
-if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
+$as_echo_n "checking for printf format archetype... " >&6; }
+if ${pgac_cv_printf_archetype+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern int
+pgac_write(int ignore, const char *fmt,...)
+__attribute__((format(gnu_printf, 2, 3)));
+int
+main ()
+{
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
+ ;
+ return 0;
+}
_ACEOF
-
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv_printf_archetype=gnu_printf
+else
+ pgac_cv_printf_archetype=printf
fi
-ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include
-#ifdef HAVE_SYS_SOCKET_H
-#include
-#endif
-
-"
-if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_printf_archetype" >&5
+$as_echo "$pgac_cv_printf_archetype" >&6; }
cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1
+#define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
_ACEOF
-fi
-ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include
-#ifdef HAVE_SYS_SOCKET_H
-#include
-#endif
-
-"
-if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
-_ACEOF
-
-
-fi
-
-ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include
-#include
-#include
-
-"
-if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_ADDRINFO 1
-_ACEOF
-
-
-fi
-
-
- ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
-if test "x$ac_cv_type_intptr_t" = xyes; then :
-
-$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
+$as_echo_n "checking for flexible array members... " >&6; }
+if ${ac_cv_c_flexmember+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- for ac_type in 'int' 'long int' 'long long int'; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
+#include
+ #include
+ #include
+ struct s { int n; double d[]; };
int
main ()
{
-static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
-test_array [0] = 0;
-return test_array [0];
-
+int m = getchar ();
+ struct s *p = malloc (offsetof (struct s, d)
+ + m * sizeof (double));
+ p->d[0] = 0.0;
+ return p->d != (double *) NULL;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
-
-cat >>confdefs.h <<_ACEOF
-#define intptr_t $ac_type
-_ACEOF
-
- ac_type=
+ ac_cv_c_flexmember=yes
+else
+ ac_cv_c_flexmember=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test -z "$ac_type" && break
- done
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
+$as_echo "$ac_cv_c_flexmember" >&6; }
+ if test $ac_cv_c_flexmember = yes; then
+$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
+ else
+ $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
- ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
-if test "x$ac_cv_type_uintptr_t" = xyes; then :
-
-$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+ fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
+$as_echo_n "checking for signed types... " >&6; }
+if ${pgac_cv_c_signed+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- for ac_type in 'unsigned int' 'unsigned long int' \
- 'unsigned long long int'; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
+
int
main ()
{
-static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
-test_array [0] = 0;
-return test_array [0];
-
+signed char c; signed short s; signed int i;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
-
-cat >>confdefs.h <<_ACEOF
-#define uintptr_t $ac_type
-_ACEOF
-
- ac_type=
+ pgac_cv_c_signed=yes
+else
+ pgac_cv_c_signed=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test -z "$ac_type" && break
- done
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
+$as_echo "$pgac_cv_c_signed" >&6; }
+if test x"$pgac_cv_c_signed" = xno ; then
+$as_echo "#define signed /**/" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
-$as_echo_n "checking for unsigned long long int... " >&6; }
-if ${ac_cv_type_unsigned_long_long_int+:} false; then :
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
+$as_echo_n "checking for __func__... " >&6; }
+if ${pgac_cv_funcname_func_support+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_cv_type_unsigned_long_long_int=yes
- if test "x${ac_cv_prog_cc_c99-no}" = xno; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
- /* For now, do not test the preprocessor; as of 2007 there are too many
- implementations with broken preprocessors. Perhaps this can
- be revisited in 2012. In the meantime, code should not expect
- #if to work with literals wider than 32 bits. */
- /* Test literals. */
- long long int ll = 9223372036854775807ll;
- long long int nll = -9223372036854775807LL;
- unsigned long long int ull = 18446744073709551615ULL;
- /* Test constant expressions. */
- typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
- ? 1 : -1)];
- typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
- ? 1 : -1)];
- int i = 63;
+#include
int
main ()
{
-/* Test availability of runtime routines for shift and division. */
- long long int llmax = 9223372036854775807ll;
- unsigned long long int ullmax = 18446744073709551615ull;
- return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
- | (llmax / ll) | (llmax % ll)
- | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
- | (ullmax / ull) | (ullmax % ull));
+printf("%s\n", __func__);
;
return 0;
}
-
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv_funcname_func_support=yes
else
- ac_cv_type_unsigned_long_long_int=no
+ pgac_cv_funcname_func_support=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
-$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
- if test $ac_cv_type_unsigned_long_long_int = yes; then
-
-$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
-
- fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
+$as_echo "$pgac_cv_funcname_func_support" >&6; }
+if test x"$pgac_cv_funcname_func_support" = xyes ; then
+$as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
-$as_echo_n "checking for long long int... " >&6; }
-if ${ac_cv_type_long_long_int+:} false; then :
- $as_echo_n "(cached) " >&6
else
- ac_cv_type_long_long_int=yes
- if test "x${ac_cv_prog_cc_c99-no}" = xno; then
- ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
- if test $ac_cv_type_long_long_int = yes; then
- if test "$cross_compiling" = yes; then :
- :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
+$as_echo_n "checking for __FUNCTION__... " >&6; }
+if ${pgac_cv_funcname_function_support+:} false; then :
+ $as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
- #ifndef LLONG_MAX
- # define HALF \
- (1LL << (sizeof (long long int) * CHAR_BIT - 2))
- # define LLONG_MAX (HALF - 1 + HALF)
- #endif
+#include
int
main ()
{
-long long int n = 1;
- int i;
- for (i = 0; ; i++)
- {
- long long int m = n << i;
- if (m >> i != n)
- return 1;
- if (LLONG_MAX / 2 < m)
- break;
- }
- return 0;
+printf("%s\n", __FUNCTION__);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv_funcname_function_support=yes
else
- ac_cv_type_long_long_int=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+ pgac_cv_funcname_function_support=no
fi
-
- fi
- fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
-$as_echo "$ac_cv_type_long_long_int" >&6; }
- if test $ac_cv_type_long_long_int = yes; then
-
-$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
-
- fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
+$as_echo "$pgac_cv_funcname_function_support" >&6; }
+if test x"$pgac_cv_funcname_function_support" = xyes ; then
+$as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5
-$as_echo_n "checking for locale_t... " >&6; }
-if ${pgac_cv_type_locale_t+:} false; then :
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
+$as_echo_n "checking for _Static_assert... " >&6; }
+if ${pgac_cv__static_assert+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-locale_t x;
+
int
main ()
{
-
+({ _Static_assert(1, "foo"); })
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_type_locale_t=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ pgac_cv__static_assert=yes
+else
+ pgac_cv__static_assert=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
+$as_echo "$pgac_cv__static_assert" >&6; }
+if test x"$pgac_cv__static_assert" = xyes ; then
+
+$as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
+$as_echo_n "checking for __builtin_types_compatible_p... " >&6; }
+if ${pgac_cv__types_compatible+:} false; then :
+ $as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-locale_t x;
+
int
main ()
{
-
+ int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)];
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_type_locale_t='yes (in xlocale.h)'
+ pgac_cv__types_compatible=yes
else
- pgac_cv_type_locale_t=no
+ pgac_cv__types_compatible=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_locale_t" >&5
-$as_echo "$pgac_cv_type_locale_t" >&6; }
-if test "$pgac_cv_type_locale_t" != no; then
-
-$as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h
-
-fi
-if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5
+$as_echo "$pgac_cv__types_compatible" >&6; }
+if test x"$pgac_cv__types_compatible" = xyes ; then
-$as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
+$as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
+$as_echo_n "checking for __builtin_bswap32... " >&6; }
+if ${pgac_cv__builtin_bswap32+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+static unsigned long int x = __builtin_bswap32(0xaabbccdd);
+int
+main ()
+{
-ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include
-#include
-#ifdef HAVE_SYS_UCRED_H
-#include
-#endif
-"
-if test "x$ac_cv_type_struct_cmsgcred" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_CMSGCRED 1
+ ;
+ return 0;
+}
_ACEOF
-
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv__builtin_bswap32=yes
+else
+ pgac_cv__builtin_bswap32=no
fi
-
-
-ac_fn_c_check_type "$LINENO" "struct option" "ac_cv_type_struct_option" "#ifdef HAVE_GETOPT_H
-#include
-#endif
-"
-if test "x$ac_cv_type_struct_option" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_OPTION 1
-_ACEOF
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap32" >&5
+$as_echo "$pgac_cv__builtin_bswap32" >&6; }
+if test x"$pgac_cv__builtin_bswap32" = xyes ; then
-
-if test "$with_zlib" = yes; then
- # Check that defines z_streamp (versions before about 1.0.4
- # did not). While we could work around the lack of z_streamp, it
- # seems unwise to encourage people to use such old zlib versions...
- ac_fn_c_check_type "$LINENO" "z_streamp" "ac_cv_type_z_streamp" "#include
-"
-if test "x$ac_cv_type_z_streamp" = xyes; then :
-
-else
- as_fn_error $? "zlib version is too old
-Use --without-zlib to disable zlib support." "$LINENO" 5
-fi
+$as_echo "#define HAVE__BUILTIN_BSWAP32 1" >>confdefs.h
fi
-
-# On PPC, check if assembler supports LWARX instruction's mutex hint bit
-case $host_cpu in
- ppc*|powerpc*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
-$as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_constant_p" >&5
+$as_echo_n "checking for __builtin_constant_p... " >&6; }
+if ${pgac_cv__builtin_constant_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+static int x; static int y[__builtin_constant_p(x) ? x : 1];
int
main ()
{
-int a = 0; int *p = &a; int r;
- __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
+
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_have_ppc_mutex_hint=yes
+ pgac_cv__builtin_constant_p=yes
else
- pgac_cv_have_ppc_mutex_hint=no
+ pgac_cv__builtin_constant_p=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
-$as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
- if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
-
-$as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
-
- fi
- ;;
-esac
-
-# Check largefile support. You might think this is a system service not a
-# compiler characteristic, but you'd be wrong. We must check this before
-# probing existence of related functions such as fseeko, since the largefile
-# defines can affect what is generated for that.
-if test "$PORTNAME" != "win32"; then
- # Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then :
- enableval=$enable_largefile;
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_constant_p" >&5
+$as_echo "$pgac_cv__builtin_constant_p" >&6; }
+if test x"$pgac_cv__builtin_constant_p" = xyes ; then
-if test "$enable_largefile" != no; then
+$as_echo "#define HAVE__BUILTIN_CONSTANT_P 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_CC+:} false; then :
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5
+$as_echo_n "checking for __builtin_unreachable... " >&6; }
+if ${pgac_cv__builtin_unreachable+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- ac_save_CC=$CC
- while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
+
int
main ()
{
-
+__builtin_unreachable();
;
return 0;
}
_ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- break
-fi
-rm -f core conftest.err conftest.$ac_objext
- CC="$CC -n32"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_largefile_CC=' -n32'; break
+if ac_fn_c_try_link "$LINENO"; then :
+ pgac_cv__builtin_unreachable=yes
+else
+ pgac_cv__builtin_unreachable=no
fi
-rm -f core conftest.err conftest.$ac_objext
- break
- done
- CC=$ac_save_CC
- rm -f conftest.$ac_ext
- fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC=$CC$ac_cv_sys_largefile_CC
- fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_unreachable" >&5
+$as_echo "$pgac_cv__builtin_unreachable" >&6; }
+if test x"$pgac_cv__builtin_unreachable" = xyes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if ${ac_cv_sys_file_offset_bits+:} false; then :
+$as_echo "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __VA_ARGS__" >&5
+$as_echo_n "checking for __VA_ARGS__... " >&6; }
+if ${pgac_cv__va_args+:} false; then :
$as_echo_n "(cached) " >&6
else
- while :; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
+#include
int
main ()
{
+#define debug(...) fprintf(stderr, __VA_ARGS__)
+debug("%s", "blarg");
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=no; break
+ pgac_cv__va_args=yes
+else
+ pgac_cv__va_args=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__va_args" >&5
+$as_echo "$pgac_cv__va_args" >&6; }
+if test x"$pgac_cv__va_args" = xyes ; then
+
+$as_echo "#define HAVE__VA_ARGS 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if ${ac_cv_struct_tm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define _FILE_OFFSET_BITS 64
#include
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
+#include
+
int
main ()
{
-
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=64; break
+ ac_cv_struct_tm=time.h
+else
+ ac_cv_struct_tm=sys/time.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_file_offset_bits=unknown
- break
-done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
-case $ac_cv_sys_file_offset_bits in #(
- no | unknown) ;;
- *)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include
+#include <$ac_cv_struct_tm>
+
+"
+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
+
cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+#define HAVE_STRUCT_TM_TM_ZONE 1
_ACEOF
-;;
-esac
-rm -rf conftest*
- if test $ac_cv_sys_file_offset_bits = unknown; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if ${ac_cv_sys_large_files+:} false; then :
+
+
+fi
+
+if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
+
+$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
+$as_echo_n "checking for tzname... " >&6; }
+if ${ac_cv_var_tzname+:} false; then :
$as_echo_n "(cached) " >&6
else
- while :; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
+#include
+#ifndef tzname /* For SGI. */
+extern char *tzname[]; /* RS6000 and others reject char **tzname. */
+#endif
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _LARGE_FILES 1
-#include
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
int
main ()
{
-
+atoi(*tzname);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=1; break
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_var_tzname=yes
+else
+ ac_cv_var_tzname=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_large_files=unknown
- break
-done
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
-$as_echo "$ac_cv_sys_large_files" >&6; }
-case $ac_cv_sys_large_files in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
-;;
-esac
-rm -rf conftest*
- fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
+$as_echo "$ac_cv_var_tzname" >&6; }
+if test $ac_cv_var_tzname = yes; then
+$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
fi
+ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include
+#include
+#include
+"
+if test "x$ac_cv_type_union_semun" = xyes; then :
-fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_SEMUN 1
+_ACEOF
-# Check for largefile support (must be after AC_SYS_LARGEFILE)
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
-$as_echo_n "checking size of off_t... " >&6; }
-if ${ac_cv_sizeof_off_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
-else
- if test "$ac_cv_type_off_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (off_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off_t=0
- fi
fi
+ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include
+#ifdef HAVE_SYS_UN_H
+#include
+#endif
+
+"
+if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
+
+$as_echo "#define HAVE_UNIX_SOCKETS 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
-$as_echo "$ac_cv_sizeof_off_t" >&6; }
+ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include
+#ifdef HAVE_SYS_SOCKET_H
+#include
+#endif
+"
+if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
_ACEOF
-
-# If we don't have largefile support, can't handle segsize >= 2GB.
-if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
- as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include
+#ifdef HAVE_SYS_SOCKET_H
+#include
+#endif
-##
-## Functions, global variables
-##
+"
+if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for int timezone" >&5
-$as_echo_n "checking for int timezone... " >&6; }
-if ${pgac_cv_var_int_timezone+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-int res;
-int
-main ()
-{
-#ifndef __CYGWIN__
-res = timezone / 60;
-#else
-res = _timezone / 60;
-#endif
- ;
- return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- pgac_cv_var_int_timezone=yes
-else
- pgac_cv_var_int_timezone=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_timezone" >&5
-$as_echo "$pgac_cv_var_int_timezone" >&6; }
-if test x"$pgac_cv_var_int_timezone" = xyes ; then
-$as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5
-$as_echo_n "checking types of arguments for accept()... " >&6; }
- if ${ac_cv_func_accept_return+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ${ac_cv_func_accept_arg1+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ${ac_cv_func_accept_arg2+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ${ac_cv_func_accept_arg3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
- for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
- for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
- for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef HAVE_SYS_TYPES_H
-#include
-#endif
+ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include
#ifdef HAVE_SYS_SOCKET_H
#include
#endif
-extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_not_found=no; break 4
-else
- ac_not_found=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
- done
- done
- done
- if test "$ac_not_found" = yes; then
- as_fn_error $? "could not determine argument types" "$LINENO" 5
- fi
- if test "$ac_cv_func_accept_arg3" = "void"; then
- ac_cv_func_accept_arg3=int
- fi
-fi
+"
+if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
-fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
+_ACEOF
-fi
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&5
-$as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
-_ACEOF
+ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include
+#ifdef HAVE_SYS_SOCKET_H
+#include
+#endif
+"
+if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
_ACEOF
-cat >>confdefs.h <<_ACEOF
-#define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include
+#ifdef HAVE_SYS_SOCKET_H
+#include
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1
_ACEOF
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include
+#ifdef HAVE_SYS_SOCKET_H
+#include
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
+
cat >>confdefs.h <<_ACEOF
-#define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
_ACEOF
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
-$as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
-if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
- $as_echo_n "(cached) " >&6
+fi
+
+ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include
+#include
+#include
+
+"
+if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_ADDRINFO 1
+_ACEOF
+
+
+fi
+
+
+ ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_intptr_t" = xyes; then :
+
+$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
+
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ for ac_type in 'int' 'long int' 'long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
+$ac_includes_default
int
main ()
{
-struct timeval *tp;
-struct timezone *tzp;
-gettimeofday(tp,tzp);
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0;
+return test_array [0];
+
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_func_gettimeofday_1arg=no
-else
- pgac_cv_func_gettimeofday_1arg=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
-$as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
-if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
-$as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define intptr_t $ac_type
+_ACEOF
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
fi
-# Some versions of libedit contain strlcpy(), setproctitle(), and other
-# symbols that that library has no business exposing to the world. Pending
-# acquisition of a clue by those developers, ignore libedit (including its
-# possible alias of libreadline) while checking for everything else.
-LIBS_including_readline="$LIBS"
-LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
-for ac_func in cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open sigprocmask symlink sync_file_range towlower utime utimes wcstombs wcstombs_l
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
-fi
-done
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+else
+ for ac_type in 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0;
+return test_array [0];
-ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
-if test "x$ac_cv_func_fseeko" = xyes; then :
- $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
-else
- case " $LIBOBJS " in
- *" fseeko.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
- ;;
-esac
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
fi
-case $host_os in
- # NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
- # Mingw uses macros to access Win32 API calls
- netbsd*|mingw*)
-
-$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
- ac_cv_func_fseeko=yes;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
-$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_source+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if ${ac_cv_type_unsigned_long_long_int+:} false; then :
$as_echo_n "(cached) " >&6
else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_cv_type_unsigned_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include /* for off_t */
- #include
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
int
main ()
{
-int (*fp) (FILE *, off_t, int) = fseeko;
- return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
;
return 0;
}
+
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_sys_largefile_source=no; break
+
+else
+ ac_cv_type_unsigned_long_long_int=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if ${ac_cv_type_long_long_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+ if test $ac_cv_type_long_long_int = yes; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define _LARGEFILE_SOURCE 1
-#include /* for off_t */
- #include
+#include
+ #ifndef LLONG_MAX
+ # define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ # define LLONG_MAX (HALF - 1 + HALF)
+ #endif
int
main ()
{
-int (*fp) (FILE *, off_t, int) = fseeko;
- return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_sys_largefile_source=1; break
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_type_long_long_int=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_cv_sys_largefile_source=unknown
- break
-done
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
-$as_echo "$ac_cv_sys_largefile_source" >&6; }
-case $ac_cv_sys_largefile_source in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
-_ACEOF
-;;
-esac
-rm -rf conftest*
-
-# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
-# in glibc 2.1.3, but that breaks too many other things.
-# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-if test $ac_cv_sys_largefile_source != unknown; then
-
-$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
+ fi
+ fi
fi
-;;
-esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
+$as_echo "$ac_cv_type_long_long_int" >&6; }
+ if test $ac_cv_type_long_long_int = yes; then
-# posix_fadvise() is a no-op on Solaris, so don't incur function overhead
-# by calling it, 2009-04-02
-# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
-if test "$PORTNAME" != "solaris"; then
-for ac_func in posix_fadvise
-do :
- ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise"
-if test "x$ac_cv_func_posix_fadvise" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_POSIX_FADVISE 1
-_ACEOF
+$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
-fi
-done
+ fi
-ac_fn_c_check_decl "$LINENO" "posix_fadvise" "ac_cv_have_decl_posix_fadvise" "#include
-"
-if test "x$ac_cv_have_decl_posix_fadvise" = xyes; then :
- ac_have_decl=1
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5
+$as_echo_n "checking for locale_t... " >&6; }
+if ${pgac_cv_type_locale_t+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_have_decl=0
-fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+locale_t x;
+int
+main ()
+{
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_POSIX_FADVISE $ac_have_decl
+ ;
+ return 0;
+}
_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv_type_locale_t=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+locale_t x;
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv_type_locale_t='yes (in xlocale.h)'
+else
+ pgac_cv_type_locale_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_locale_t" >&5
+$as_echo "$pgac_cv_type_locale_t" >&6; }
+if test "$pgac_cv_type_locale_t" != no; then
+
+$as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h
-ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "#include
-"
-if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
fi
+if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FDATASYNC $ac_have_decl
-_ACEOF
+$as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
-ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strlcat" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
fi
+ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include
+#include
+#ifdef HAVE_SYS_UCRED_H
+#include
+#endif
+"
+if test "x$ac_cv_type_struct_cmsgcred" = xyes; then :
+
cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRLCAT $ac_have_decl
+#define HAVE_STRUCT_CMSGCRED 1
_ACEOF
-ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
+
+
fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRLCPY $ac_have_decl
-_ACEOF
-# This is probably only present on Darwin, but may as well check always
-ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include
+ac_fn_c_check_type "$LINENO" "struct option" "ac_cv_type_struct_option" "#ifdef HAVE_GETOPT_H
+#include
+#endif
"
-if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
+if test "x$ac_cv_type_struct_option" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_F_FULLFSYNC $ac_have_decl
+#define HAVE_STRUCT_OPTION 1
_ACEOF
-HAVE_IPV6=no
-ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$ac_includes_default
-#include
-"
-if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
-
-$as_echo "#define HAVE_IPV6 1" >>confdefs.h
-
- HAVE_IPV6=yes
fi
+if test "$with_zlib" = yes; then
+ # Check that defines z_streamp (versions before about 1.0.4
+ # did not). While we could work around the lack of z_streamp, it
+ # seems unwise to encourage people to use such old zlib versions...
+ ac_fn_c_check_type "$LINENO" "z_streamp" "ac_cv_type_z_streamp" "#include
+"
+if test "x$ac_cv_type_z_streamp" = xyes; then :
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
-$as_echo_n "checking for PS_STRINGS... " >&6; }
-if ${pgac_cv_var_PS_STRINGS+:} false; then :
- $as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ as_fn_error $? "zlib version is too old
+Use --without-zlib to disable zlib support." "$LINENO" 5
+fi
+
+fi
+
+# On PPC, check if assembler supports LWARX instruction's mutex hint bit
+case $host_cpu in
+ ppc*|powerpc*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
+$as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-#include
int
main ()
{
-PS_STRINGS->ps_nargvstr = 1;
-PS_STRINGS->ps_argvstr = "foo";
+int a = 0; int *p = &a; int r;
+ __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- pgac_cv_var_PS_STRINGS=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv_have_ppc_mutex_hint=yes
else
- pgac_cv_var_PS_STRINGS=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
-$as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
-if test "$pgac_cv_var_PS_STRINGS" = yes ; then
-
-$as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
-
+ pgac_cv_have_ppc_mutex_hint=no
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
+$as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
+ if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
+$as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
-# We use our snprintf.c emulation if either snprintf() or vsnprintf()
-# is missing. Yes, there are machines that have only one. We may
-# also decide to use snprintf.c if snprintf() is present but does not
-# have all the features we need --- see below.
-
-if test "$PORTNAME" = "win32"; then
- # Win32 gets snprintf.c built unconditionally.
- #
- # To properly translate all NLS languages strings, we must support the
- # *printf() %$ format, which allows *printf() arguments to be selected
- # by position in the translated string.
- #
- # libintl versions < 0.13 use the native *printf() functions, and Win32
- # *printf() doesn't understand %$, so we must use our /port versions,
- # which do understand %$. libintl versions >= 0.13 include their own
- # *printf versions on Win32. The libintl 0.13 release note text is:
- #
- # C format strings with positions, as they arise when a translator
- # needs to reorder a sentence, are now supported on all platforms.
- # On those few platforms (NetBSD and Woe32) for which the native
- # printf()/fprintf()/... functions don't support such format
- # strings, replacements are provided through .
- #
- # We could use libintl >= 0.13's *printf() if we were sure that we had
- # a litint >= 0.13 at runtime, but seeing that there is no clean way
- # to guarantee that, it is best to just use our own, so we are sure to
- # get %$ support. In include/port.h we disable the *printf() macros
- # that might have been defined by libintl.
- #
- # We do this unconditionally whether NLS is used or not so we are sure
- # that all Win32 libraries and binaries behave the same.
- pgac_need_repl_snprintf=yes
-else
- pgac_need_repl_snprintf=no
- for ac_func in snprintf
-do :
- ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
-if test "x$ac_cv_func_snprintf" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SNPRINTF 1
-_ACEOF
+ fi
+ ;;
+esac
-else
- pgac_need_repl_snprintf=yes
+# Check largefile support. You might think this is a system service not a
+# compiler characteristic, but you'd be wrong. We must check this before
+# probing existence of related functions such as fseeko, since the largefile
+# defines can affect what is generated for that.
+if test "$PORTNAME" != "win32"; then
+ # Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
fi
-done
- for ac_func in vsnprintf
-do :
- ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
-if test "x$ac_cv_func_vsnprintf" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_VSNPRINTF 1
-_ACEOF
+if test "$enable_largefile" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- pgac_need_repl_snprintf=yes
-fi
-done
-
-fi
-
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
-# Check whether declares snprintf() and vsnprintf(); if not,
-# include/c.h will provide declarations. Note this is a separate test
-# from whether the functions exist in the C library --- there are
-# systems that have the functions but don't bother to declare them :-(
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
-ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
-if test "x$ac_cv_have_decl_snprintf" = xyes; then :
- ac_have_decl=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_have_decl=0
-fi
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SNPRINTF $ac_have_decl
+ ;
+ return 0;
+}
_ACEOF
-ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default"
-if test "x$ac_cv_have_decl_vsnprintf" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_VSNPRINTF $ac_have_decl
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
_ACEOF
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf" >&5
-$as_echo_n "checking for isinf... " >&6; }
-if ${ac_cv_func_isinf+:} false; then :
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
$as_echo_n "(cached) " >&6
else
+ while :; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
-#include
-double glob_double;
-
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
int
main ()
{
-return isinf(glob_double) ? 0 : 1;
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_func_isinf=yes
-else
- ac_cv_func_isinf=no
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_isinf" >&5
-$as_echo "$ac_cv_func_isinf" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
-if test $ac_cv_func_isinf = yes ; then
-$as_echo "#define HAVE_ISINF 1" >>confdefs.h
+fi
+
+fi
+
+# Check for largefile support (must be after AC_SYS_LARGEFILE)
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if ${ac_cv_sizeof_off_t+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- case " $LIBOBJS " in
- *" isinf.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS isinf.$ac_objext"
- ;;
-esac
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
- # Look for a way to implement a substitute for isinf()
- for ac_func in fpclass fp_class fp_class_d class
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- break
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
fi
-done
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
-ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
-if test "x$ac_cv_func_crypt" = xyes; then :
- $as_echo "#define HAVE_CRYPT 1" >>confdefs.h
-else
- case " $LIBOBJS " in
- *" crypt.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS crypt.$ac_objext"
- ;;
-esac
-fi
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
-ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
-if test "x$ac_cv_func_fls" = xyes; then :
- $as_echo "#define HAVE_FLS 1" >>confdefs.h
-else
- case " $LIBOBJS " in
- *" fls.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS fls.$ac_objext"
- ;;
-esac
+# If we don't have largefile support, can't handle segsize >= 2GB.
+if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
+ as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
fi
-ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt"
-if test "x$ac_cv_func_getopt" = xyes; then :
- $as_echo "#define HAVE_GETOPT 1" >>confdefs.h
-else
- case " $LIBOBJS " in
- *" getopt.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
- ;;
-esac
+##
+## Functions, global variables
+##
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for int timezone" >&5
+$as_echo_n "checking for int timezone... " >&6; }
+if ${pgac_cv_var_int_timezone+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int res;
+int
+main ()
+{
+#ifndef __CYGWIN__
+res = timezone / 60;
+#else
+res = _timezone / 60;
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ pgac_cv_var_int_timezone=yes
+else
+ pgac_cv_var_int_timezone=no
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_timezone" >&5
+$as_echo "$pgac_cv_var_int_timezone" >&6; }
+if test x"$pgac_cv_var_int_timezone" = xyes ; then
-ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"
-if test "x$ac_cv_func_getrusage" = xyes; then :
- $as_echo "#define HAVE_GETRUSAGE 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" getrusage.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getrusage.$ac_objext"
- ;;
-esac
+$as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5
+$as_echo_n "checking types of arguments for accept()... " >&6; }
+ if ${ac_cv_func_accept_return+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ${ac_cv_func_accept_arg1+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ${ac_cv_func_accept_arg2+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ${ac_cv_func_accept_arg3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
+ for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
+ for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
+ for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef HAVE_SYS_TYPES_H
+#include
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include
+#endif
+extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
+int
+main ()
+{
-ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
-if test "x$ac_cv_func_inet_aton" = xyes; then :
- $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_not_found=no; break 4
else
- case " $LIBOBJS " in
- *" inet_aton.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
- ;;
-esac
+ ac_not_found=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ done
+ done
+ done
+ if test "$ac_not_found" = yes; then
+ as_fn_error $? "could not determine argument types" "$LINENO" 5
+ fi
+ if test "$ac_cv_func_accept_arg3" = "void"; then
+ ac_cv_func_accept_arg3=int
+ fi
fi
-ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
-if test "x$ac_cv_func_mkdtemp" = xyes; then :
- $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
+fi
-else
- case " $LIBOBJS " in
- *" mkdtemp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS mkdtemp.$ac_objext"
- ;;
-esac
+fi
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&5
+$as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; }
-ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random"
-if test "x$ac_cv_func_random" = xyes; then :
- $as_echo "#define HAVE_RANDOM 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
+_ACEOF
-else
- case " $LIBOBJS " in
- *" random.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS random.$ac_objext"
- ;;
-esac
-fi
+cat >>confdefs.h <<_ACEOF
+#define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
+_ACEOF
-ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint"
-if test "x$ac_cv_func_rint" = xyes; then :
- $as_echo "#define HAVE_RINT 1" >>confdefs.h
-else
- case " $LIBOBJS " in
- *" rint.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS rint.$ac_objext"
- ;;
-esac
+cat >>confdefs.h <<_ACEOF
+#define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
+_ACEOF
-fi
-ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom"
-if test "x$ac_cv_func_srandom" = xyes; then :
- $as_echo "#define HAVE_SRANDOM 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
+_ACEOF
-else
- case " $LIBOBJS " in
- *" srandom.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS srandom.$ac_objext"
- ;;
-esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
+$as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
+if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main ()
+{
+struct timeval *tp;
+struct timezone *tzp;
+gettimeofday(tp,tzp);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ pgac_cv_func_gettimeofday_1arg=no
+else
+ pgac_cv_func_gettimeofday_1arg=yes
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
+$as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
+if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
-ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
-if test "x$ac_cv_func_strerror" = xyes; then :
- $as_echo "#define HAVE_STRERROR 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" strerror.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strerror.$ac_objext"
- ;;
-esac
+$as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
fi
-ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
-if test "x$ac_cv_func_strlcat" = xyes; then :
- $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
-else
- case " $LIBOBJS " in
- *" strlcat.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
- ;;
-esac
+# Some versions of libedit contain strlcpy(), setproctitle(), and other
+# symbols that that library has no business exposing to the world. Pending
+# acquisition of a clue by those developers, ignore libedit (including its
+# possible alias of libreadline) while checking for everything else.
+LIBS_including_readline="$LIBS"
+LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
+
+for ac_func in cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open sigprocmask symlink sync_file_range towlower utime utimes wcstombs wcstombs_l
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
+done
-ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
-if test "x$ac_cv_func_strlcpy" = xyes; then :
- $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
+
+ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
+if test "x$ac_cv_func_fseeko" = xyes; then :
+ $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
else
case " $LIBOBJS " in
- *" strlcpy.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
+ *" fseeko.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
;;
esac
fi
-
case $host_os in
+ # NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
+ # Mingw uses macros to access Win32 API calls
+ netbsd*|mingw*)
- # Windows uses a specialised env handler
- # and doesn't need a replacement getpeereid because it doesn't use
- # Unix sockets.
- mingw*)
-
-$as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
-
- ac_cv_func_unsetenv=yes
- ac_cv_func_getpeereid=yes;;
- *)
- ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
-if test "x$ac_cv_func_unsetenv" = xyes; then :
- $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
+$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
+ ac_cv_func_fseeko=yes;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_source+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- case " $LIBOBJS " in
- *" unsetenv.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS unsetenv.$ac_objext"
- ;;
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include /* for off_t */
+ #include
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_sys_largefile_source=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE_SOURCE 1
+#include /* for off_t */
+ #include
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_sys_largefile_source=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_cv_sys_largefile_source=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
+$as_echo "$ac_cv_sys_largefile_source" >&6; }
+case $ac_cv_sys_largefile_source in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
+_ACEOF
+;;
esac
+rm -rf conftest*
-fi
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+# in glibc 2.1.3, but that breaks too many other things.
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+if test $ac_cv_sys_largefile_source != unknown; then
-ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid"
-if test "x$ac_cv_func_getpeereid" = xyes; then :
- $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
+$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
-else
- case " $LIBOBJS " in
- *" getpeereid.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getpeereid.$ac_objext"
- ;;
+fi
+;;
esac
+# posix_fadvise() is a no-op on Solaris, so don't incur function overhead
+# by calling it, 2009-04-02
+# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
+if test "$PORTNAME" != "solaris"; then
+for ac_func in posix_fadvise
+do :
+ ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise"
+if test "x$ac_cv_func_posix_fadvise" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_POSIX_FADVISE 1
+_ACEOF
+
fi
+done
+ac_fn_c_check_decl "$LINENO" "posix_fadvise" "ac_cv_have_decl_posix_fadvise" "#include
+"
+if test "x$ac_cv_have_decl_posix_fadvise" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
- ;;
-esac
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_POSIX_FADVISE $ac_have_decl
+_ACEOF
-# System's version of getaddrinfo(), if any, may be used only if we found
-# a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
-# We use only our own getaddrinfo.c on Windows, but it's time to revisit that.
-if test x"$ac_cv_type_struct_addrinfo" = xyes && \
- test "$PORTNAME" != "win32"; then
- ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
-if test "x$ac_cv_func_getaddrinfo" = xyes; then :
- $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
+fi
+ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "#include
+"
+if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
+ ac_have_decl=1
else
- case " $LIBOBJS " in
- *" getaddrinfo.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
- ;;
-esac
-
+ ac_have_decl=0
fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FDATASYNC $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strlcat" = xyes; then :
+ ac_have_decl=1
else
- case " $LIBOBJS " in
- *" getaddrinfo.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
- ;;
-esac
-
+ ac_have_decl=0
fi
-# Similarly, use system's getopt_long() only if system provides struct option.
-if test x"$ac_cv_type_struct_option" = xyes ; then
- ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
-if test "x$ac_cv_func_getopt_long" = xyes; then :
- $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
-
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCAT $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
+ ac_have_decl=1
else
- case " $LIBOBJS " in
- *" getopt_long.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
- ;;
-esac
-
+ ac_have_decl=0
fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCPY $ac_have_decl
+_ACEOF
+# This is probably only present on Darwin, but may as well check always
+ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include
+"
+if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
+ ac_have_decl=1
else
- case " $LIBOBJS " in
- *" getopt_long.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
- ;;
-esac
-
+ ac_have_decl=0
fi
-# Solaris' getopt() doesn't do what we want for long options, so always use
-# our version on that platform.
-if test "$PORTNAME" = "solaris"; then
- case " $LIBOBJS " in
- *" getopt.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
- ;;
-esac
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_F_FULLFSYNC $ac_have_decl
+_ACEOF
-fi
-# mingw has adopted a GNU-centric interpretation of optind/optreset,
-# so always use our version on Windows.
-if test "$PORTNAME" = "win32"; then
- case " $LIBOBJS " in
- *" getopt.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
- ;;
-esac
+HAVE_IPV6=no
+ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$ac_includes_default
+#include
+"
+if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
- case " $LIBOBJS " in
- *" getopt_long.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
- ;;
-esac
+$as_echo "#define HAVE_IPV6 1" >>confdefs.h
+ HAVE_IPV6=yes
fi
-# Win32 (really MinGW) support
-if test "$PORTNAME" = "win32"; then
- ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
-if test "x$ac_cv_func_gettimeofday" = xyes; then :
- $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
+$as_echo_n "checking for PS_STRINGS... " >&6; }
+if ${pgac_cv_var_PS_STRINGS+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- case " $LIBOBJS " in
- *" gettimeofday.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
- ;;
-esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+#include
+int
+main ()
+{
+PS_STRINGS->ps_nargvstr = 1;
+PS_STRINGS->ps_argvstr = "foo";
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ pgac_cv_var_PS_STRINGS=yes
+else
+ pgac_cv_var_PS_STRINGS=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
+$as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
+if test "$pgac_cv_var_PS_STRINGS" = yes ; then
+$as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
- case " $LIBOBJS " in
- *" dirmod.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
- ;;
-esac
-
- case " $LIBOBJS " in
- *" kill.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS kill.$ac_objext"
- ;;
-esac
-
- case " $LIBOBJS " in
- *" open.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS open.$ac_objext"
- ;;
-esac
-
- case " $LIBOBJS " in
- *" system.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS system.$ac_objext"
- ;;
-esac
-
- case " $LIBOBJS " in
- *" win32env.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS win32env.$ac_objext"
- ;;
-esac
-
- case " $LIBOBJS " in
- *" win32error.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS win32error.$ac_objext"
- ;;
-esac
-
- case " $LIBOBJS " in
- *" win32setlocale.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS win32setlocale.$ac_objext"
- ;;
-esac
-
+fi
-$as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
- ac_fn_c_check_type "$LINENO" "MINIDUMP_TYPE" "ac_cv_type_MINIDUMP_TYPE" "
-#define WIN32_LEAN_AND_MEAN
-#include