From 2fe039df7d848390a6491a4eb1e5c49ca6ea5e64 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 9 Jun 2026 11:20:46 +1000 Subject: [PATCH 01/15] libpcp, libpcp_import: implement an archive append mode of operation Rename the second argument of pmiStart() from the implicit boolean 'inherit' to an explicit 'flags' field. Named constants are now provided in import.h: PMI_INHERIT (0x1) - existing behaviour: inherit metric definitions from the current context into the new one PMI_APPEND (0x2) - open an existing archive for appending instead of creating a new one pmiStart() with PMI_APPEND opens the named archive if it already exists and positions all file handles at end-of-file, loading the existing metadata so that subsequent pmiWrite() calls append new records after the last existing record. If the archive does not yet exist the flag is silently ignored and a new archive is created, making PMI_APPEND safe for unconditional use in timer-driven collectors (e.g. sadc) on first invocation. Add QA test 1693 to exercise the append mode. Signed-off-by: Nathan Scott Co-Authored-By: Claude Sonnet 4.6 (1M context) --- man/man3/pmistart.3 | 75 +++++++++++++++--- qa/1693 | 48 ++++++++++++ qa/1693.out | 45 +++++++++++ qa/group | 2 +- qa/src/.gitignore | 1 + qa/src/GNUlocaldefs | 4 + qa/src/check_import_append.c | 132 ++++++++++++++++++++++++++++++++ src/include/pcp/import.h | 4 + src/include/pcp/libpcp.h | 1 + src/libpcp/src/exports.in | 1 + src/libpcp/src/logutil.c | 124 ++++++++++++++++++++++++++++++ src/libpcp_import/src/archive.c | 95 ++++++++++++++++++++++- src/libpcp_import/src/import.c | 9 ++- src/libpcp_import/src/private.h | 1 + 14 files changed, 523 insertions(+), 19 deletions(-) create mode 100755 qa/1693 create mode 100644 qa/1693.out create mode 100644 qa/src/check_import_append.c diff --git a/man/man3/pmistart.3 b/man/man3/pmistart.3 index 99f73f75c1a..df0847780ee 100644 --- a/man/man3/pmistart.3 +++ b/man/man3/pmistart.3 @@ -25,7 +25,7 @@ .br #include .sp -int pmiStart(const char *\fIarchive\fP, int \fIinherit\fP); +int pmiStart(const char *\fIarchive\fP, int \fIflags\fP); .sp cc ... \-lpcp_import \-lpcp .hy @@ -37,7 +37,7 @@ cc ... \-lpcp_import \-lpcp .hy 0 use PCP::LogImport; .sp -pmiStart($\fIarchive\fP, $\fIinherit\fP); +pmiStart($\fIarchive\fP, $\fIflags\fP); .hy .ad .ft 1 @@ -88,20 +88,62 @@ by calls to or .BR pmiPutValueHandle (3). .PP -If -.I inherit -is true, then the new context will inherit any and all -metadata (metrics, instance domains, instances and handles) from the current -context, otherwise the new context is created with no metadata. +The +.I flags +argument is a bitwise-OR of zero or more of the following constants: +.TP +.B PMI_INHERIT +The new context will inherit any and all metadata (metrics, instance +domains, instances and handles) from the current context. The basename for the output PCP archive, the source hostname, the source timezone and any data values from the current context are .B not inherited. If this is the first call to .B pmiStart -the metadata will be empty -independent of the value of -.IR inherit . +the metadata will be empty independent of whether +.B PMI_INHERIT +is set. +.TP +.B PMI_APPEND +Open an existing PCP archive for appending rather than creating a +new one. +The archive label (hostname, timezone, version, start timestamp) is +read from the existing +.IR archive .meta +file and used to initialise the new context. +The temporal index is read to seed the last-written timestamp; all +subsequent +.BR pmiWrite (3) +calls must use timestamps strictly later than this value. +The +.IR archive .meta +and +.IR archive .index +files are opened in read/write mode and positioned at end-of-file; +the highest-numbered data volume is opened in append mode. +Metrics and instance domains must still be registered via +.BR pmiAddMetric (3) +and +.BR pmiAddInstance (3) +before calling +.BR pmiPutValue (3) +\(em if the metric descriptor is already present in the archive the +duplicate entry in +.I archive .meta +is harmless and will be ignored by readers. +If the archive files do not yet exist, +.B PMI_APPEND +behaves identically to creating a new archive (no flags). +.PP +If +.I flags +is zero, or neither +.B PMI_INHERIT +nor +.B PMI_APPEND +is set, the new context is created with no metadata and a new archive +will be created from scratch. .PP Since no physical files for the output PCP archive will be created until the first call to @@ -125,7 +167,10 @@ call or a call to or a call to .BR pmiEnd (3). .SH DIAGNOSTICS -It is an error if the physical files +When creating a new archive (neither +.B PMI_APPEND +nor any other flag that implies file creation), it is an error if the +physical files \fIarchive\fR.\fB0\fR and/or \fIarchive\fR.\fBindex\fR and/or \fIarchive\fR.\fBmeta\fR already exist, but this is not discovered @@ -136,6 +181,14 @@ or so .B pmiStart always returns a positive context identifier. +.PP +When +.B PMI_APPEND +is set and the archive files do not exist, +.B pmiStart +silently falls back to creating a new archive, making it safe to use +.B PMI_APPEND +unconditionally on the first invocation of a data collector. .SH SEE ALSO .BR LOGIMPORT (3), .BR PMAPI (3), diff --git a/qa/1693 b/qa/1693 new file mode 100755 index 00000000000..558fde099aa --- /dev/null +++ b/qa/1693 @@ -0,0 +1,48 @@ +#!/bin/sh +# PCP QA Test No. 1693 +# Exercise PMI_APPEND flag to pmiStart() - create an archive then +# append additional records in a separate context. +# +# Copyright (c) 2026 Red Hat. All Rights Reserved. +# + +seq=`basename $0` +echo "QA output created by $seq" + +. ./common.product +. ./common.filter +. ./common.check + +[ -f ${PCP_LIB_DIR}/libpcp_import.${DSO_SUFFIX} ] || \ + _notrun "No support for libpcp_import" + +status=0 # success is the default! +trap "cd $here; rm -rf $tmp; exit \$status" 0 1 2 3 15 + +mkdir $tmp +cd $tmp + +# Handles both the pmi* stderr output and pmdumplog output. +_filter() +{ + sed -e '/pmResult/s/ .* numpmid/ ... numpmid/' \ + | _filter_pmdumplog +} + +# real QA test starts here +$here/src/check_import_append 2>&1 | _filter + +echo +echo "=== archive integrity ===" +pmlogcheck appendtest + +echo +echo "=== all four records present ===" +pmdumplog -t appendtest 2>&1 | _filter + +echo +echo "=== fallback archive created ===" +pmlogcheck appendnew + +# success, all done +exit diff --git a/qa/1693.out b/qa/1693.out new file mode 100644 index 00000000000..427e42ac99b --- /dev/null +++ b/qa/1693.out @@ -0,0 +1,45 @@ +QA output created by 1693 +=== Phase 1: create === +pmiStart: OK ->1 +pmiSetHostname: OK +pmiSetTimezone: OK +pmiAddMetric counter: OK +pmiAddMetric instant: OK +pmiPutValue counter (1): OK +pmiPutValue instant (1): OK +pmiWrite (1): OK +pmiPutValue counter (2): OK +pmiPutValue instant (2): OK +pmiWrite (2): OK +pmiEnd: OK + +=== Phase 2: append === +pmiStart (PMI_APPEND): OK ->2 +pmiAddMetric counter (append): OK +pmiAddMetric instant (append): OK +pmiPutValue counter (3): OK +pmiPutValue instant (3): OK +pmiWrite (3): OK +pmiPutValue counter (4): OK +pmiPutValue instant (4): OK +pmiWrite (4): OK +pmiEnd (append): OK + +=== Phase 3: append-creates-new === +pmiStart (PMI_APPEND, new archive): OK ->3 +pmiAddMetric counter (new): OK +pmiPutValue counter (new): OK +pmiWrite (new): OK +pmiEnd (new): OK + +=== archive integrity === + +=== all four records present === + +Temporal Index + Log Vol end(meta) end(log) +TIMESTAMP 0 808 808 +TIMESTAMP 0 922 960 +TIMESTAMP 0 922 1112 + +=== fallback archive created === diff --git a/qa/group b/qa/group index bc1db6cadb9..d767310e4fc 100644 --- a/qa/group +++ b/qa/group @@ -2238,7 +2238,7 @@ suse 1690 pmseries local 1691 pmseries local 1692 pmda.pmcd local -1693:reserved libpcp_import python +1693 libpcp_import local 1694 pidstat local python pcp pmlogextract 1695 pmproxy valgrind local 1696 pmproxy valgrind local diff --git a/qa/src/.gitignore b/qa/src/.gitignore index 38ec075fac5..b7561d8d3a1 100644 --- a/qa/src/.gitignore +++ b/qa/src/.gitignore @@ -30,6 +30,7 @@ chain check_attribute check_fault_injection check_import +check_import_append check_import_name check_import.pl check_pmiend_fdleak diff --git a/qa/src/GNUlocaldefs b/qa/src/GNUlocaldefs index c6dd709cf40..38a0956219f 100644 --- a/qa/src/GNUlocaldefs +++ b/qa/src/GNUlocaldefs @@ -1442,6 +1442,10 @@ check_import_name: check_import_name.c $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import $(LINKER_MAKERULE) +check_import_append: check_import_append.c + rm -f $@ + $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import + check_pmiend_fdleak: check_pmiend_fdleak.c rm -f $@ $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import diff --git a/qa/src/check_import_append.c b/qa/src/check_import_append.c new file mode 100644 index 00000000000..0e80f4c1665 --- /dev/null +++ b/qa/src/check_import_append.c @@ -0,0 +1,132 @@ +/* + * Exercise PMI_APPEND flag to pmiStart() - create an archive then + * append additional records to it in a separate context. + * + * Copyright (c) 2026 Red Hat. All Rights Reserved. + */ + +#include +#include + +static void +check(int sts, char *name) +{ + if (sts < 0) + fprintf(stderr, "%s: Error: %s\n", name, pmiErrStr(sts)); + else { + fprintf(stderr, "%s: OK", name); + if (sts != 0) fprintf(stderr, " ->%d", sts); + fputc('\n', stderr); + } +} + +int +main(int argc, char **argv) +{ + int sts; + int ctx; + + pmSetProgname(argv[0]); + + /* + * Phase 1: create a fresh archive with two records. + */ + fprintf(stderr, "=== Phase 1: create ===\n"); + + ctx = pmiStart("appendtest", 0); + check(ctx, "pmiStart"); + + sts = pmiSetHostname("testhost.example.com"); + check(sts, "pmiSetHostname"); + + sts = pmiSetTimezone("UTC"); + check(sts, "pmiSetTimezone"); + + sts = pmiAddMetric("qa.append.counter", + PM_ID_NULL, PM_TYPE_U32, PM_INDOM_NULL, + PM_SEM_COUNTER, pmiUnits(0, 0, 0, 0, 0, 0)); + check(sts, "pmiAddMetric counter"); + + sts = pmiAddMetric("qa.append.instant", + PM_ID_NULL, PM_TYPE_DOUBLE, PM_INDOM_NULL, + PM_SEM_INSTANT, pmiUnits(0, 0, 0, 0, 0, 0)); + check(sts, "pmiAddMetric instant"); + + sts = pmiPutValue("qa.append.counter", NULL, "10"); + check(sts, "pmiPutValue counter (1)"); + sts = pmiPutValue("qa.append.instant", NULL, "1.5"); + check(sts, "pmiPutValue instant (1)"); + sts = pmiWrite(1000, 0); + check(sts, "pmiWrite (1)"); + + sts = pmiPutValue("qa.append.counter", NULL, "20"); + check(sts, "pmiPutValue counter (2)"); + sts = pmiPutValue("qa.append.instant", NULL, "2.5"); + check(sts, "pmiPutValue instant (2)"); + sts = pmiWrite(2000, 0); + check(sts, "pmiWrite (2)"); + + sts = pmiEnd(); + check(sts, "pmiEnd"); + + /* + * Phase 2: reopen with PMI_APPEND and add two more records. + * Timestamps must be strictly after the last one written (2000s). + */ + fprintf(stderr, "\n=== Phase 2: append ===\n"); + + ctx = pmiStart("appendtest", PMI_APPEND); + check(ctx, "pmiStart (PMI_APPEND)"); + + /* Metrics must be re-registered so pmiPutValue() can look them up */ + sts = pmiAddMetric("qa.append.counter", + PM_ID_NULL, PM_TYPE_U32, PM_INDOM_NULL, + PM_SEM_COUNTER, pmiUnits(0, 0, 0, 0, 0, 0)); + check(sts, "pmiAddMetric counter (append)"); + + sts = pmiAddMetric("qa.append.instant", + PM_ID_NULL, PM_TYPE_DOUBLE, PM_INDOM_NULL, + PM_SEM_INSTANT, pmiUnits(0, 0, 0, 0, 0, 0)); + check(sts, "pmiAddMetric instant (append)"); + + sts = pmiPutValue("qa.append.counter", NULL, "30"); + check(sts, "pmiPutValue counter (3)"); + sts = pmiPutValue("qa.append.instant", NULL, "3.5"); + check(sts, "pmiPutValue instant (3)"); + sts = pmiWrite(3000, 0); + check(sts, "pmiWrite (3)"); + + sts = pmiPutValue("qa.append.counter", NULL, "40"); + check(sts, "pmiPutValue counter (4)"); + sts = pmiPutValue("qa.append.instant", NULL, "4.5"); + check(sts, "pmiPutValue instant (4)"); + sts = pmiWrite(4000, 0); + check(sts, "pmiWrite (4)"); + + sts = pmiEnd(); + check(sts, "pmiEnd (append)"); + + /* + * Phase 3: PMI_APPEND on a non-existent archive should silently + * create a new one (fallback behaviour). + */ + fprintf(stderr, "\n=== Phase 3: append-creates-new ===\n"); + + ctx = pmiStart("appendnew", PMI_APPEND); + check(ctx, "pmiStart (PMI_APPEND, new archive)"); + + sts = pmiAddMetric("qa.append.counter", + PM_ID_NULL, PM_TYPE_U32, PM_INDOM_NULL, + PM_SEM_COUNTER, pmiUnits(0, 0, 0, 0, 0, 0)); + check(sts, "pmiAddMetric counter (new)"); + + sts = pmiPutValue("qa.append.counter", NULL, "1"); + check(sts, "pmiPutValue counter (new)"); + sts = pmiWrite(1000, 0); + check(sts, "pmiWrite (new)"); + + sts = pmiEnd(); + check(sts, "pmiEnd (new)"); + + exit(0); +} diff --git a/src/include/pcp/import.h b/src/include/pcp/import.h index 06ddb2657bf..419fed37dcb 100644 --- a/src/include/pcp/import.h +++ b/src/include/pcp/import.h @@ -29,6 +29,10 @@ extern "C" { # endif #endif +/* Flags for the second argument to pmiStart() */ +#define PMI_INHERIT 0x1 /* inherit metric definitions from previous context */ +#define PMI_APPEND 0x2 /* append to an existing archive rather than creating a new one */ + /* core libpcp_import API routines */ PMI_CALL extern int pmiStart(const char *, int); PMI_CALL extern int pmiUseContext(int); diff --git a/src/include/pcp/libpcp.h b/src/include/pcp/libpcp.h index 18a15bba251..c5083da01f7 100644 --- a/src/include/pcp/libpcp.h +++ b/src/include/pcp/libpcp.h @@ -961,6 +961,7 @@ PCP_CALL extern int __pmLogEncodeLabel(const __pmLogLabel *, void **, size_t *); PCP_CALL extern int __pmLogChkLabel(__pmArchCtl *, __pmFILE *, __pmLogLabel *, int); PCP_CALL extern int __pmLogCreateLabel(const char *, int, __pmLogCtl *); PCP_CALL extern int __pmLogCreate(const char *, const char *, int, __pmArchCtl *, int); +PCP_CALL extern int __pmLogOpenAppend(const char *, __pmArchCtl *); PCP_CALL extern __pmFILE *__pmLogNewFile(const char *, int); PCP_CALL extern void __pmLogClose(__pmArchCtl *); PCP_CALL extern int __pmLogPutDesc(__pmArchCtl *, const pmDesc *, int, char **); diff --git a/src/libpcp/src/exports.in b/src/libpcp/src/exports.in index be0e456241a..7b82e972243 100644 --- a/src/libpcp/src/exports.in +++ b/src/libpcp/src/exports.in @@ -730,6 +730,7 @@ PCP_4.1 { PCP_4.2 { global: + __pmLogOpenAppend; #if ! HAVE_CFMAKERAW cfmakeraw; #endif diff --git a/src/libpcp/src/logutil.c b/src/libpcp/src/logutil.c index fc77bb353fb..92922ef477b 100644 --- a/src/libpcp/src/logutil.c +++ b/src/libpcp/src/logutil.c @@ -663,6 +663,130 @@ logFreeMeta(__pmLogCtl *lcp) logFreeHashText(&lcp->hashtext); } +/* + * Open an existing PCP archive for appending additional records. + * + * Volume discovery uses __pmLogFindOpen (canonical directory scan via + * readdir + __pmLogAddVolume) which correctly sets lcp->minvol and + * lcp->maxvol. The resulting read-mode handles are used to validate + * labels and load the temporal index, then closed and reopened in r+ + * mode for subsequent appending: + * + * .meta - r+ read label + seek to end; metadata appended at end + * .index - r+ read temporal index for lcp->endtime + seek to end + * .N - r+ validate volume label + seek to end-of-file + * + * acp->ac_flags is set to PM_CTXFLAG_LAST_VOLUME following the + * __pmLogOpen convention to signal we are at the most recent volume. + * + * On success: lcp->label is populated; lcp->endtime holds the last + * timestamp already in the archive; all three file handles are at + * end-of-file ready for writing; lcp->state == PM_LOG_STATE_INIT. + * + * Returns 0 on success, negative PCP error code on failure. + */ +int +__pmLogOpenAppend(const char *base, __pmArchCtl *acp) +{ + __pmLogCtl *lcp = acp->ac_log; + __pmLogLabel label = {0}; + char fname[MAXPATHLEN]; + int sts; + + /* Initialise write-path hash tables and file handles (mirrors __pmLogCreate) */ + lcp->hashpmid.nodes = lcp->hashpmid.hsize = 0; + lcp->hashindom.nodes = lcp->hashindom.hsize = 0; + lcp->trimindom.nodes = lcp->trimindom.hsize = 0; + lcp->hashlabels.nodes = lcp->hashlabels.hsize = 0; + lcp->hashtext.nodes = lcp->hashtext.hsize = 0; + lcp->tifp = lcp->mdfp = acp->ac_mfp = NULL; + lcp->last_ti.sec = -1; + lcp->last_ti.nsec = -1; + + /* + * Use the canonical directory scan to discover all data volumes, + * setting lcp->name, lcp->minvol and lcp->maxvol correctly via + * __pmLogAddVolume. Also opens .meta and .index in read mode. + */ + if ((sts = __pmLogFindOpen(acp, base)) < 0) + return sts; + + /* Read and validate the .meta archive label */ + if ((sts = __pmLogChkLabel(acp, lcp->mdfp, &label, PM_LOG_VOL_META)) < 0) { + __pmLogFreeLabel(&label); + goto fail; + } + lcp->label = label; + + /* Validate the .index label before trusting its contents */ + if ((sts = __pmLogChkLabel(acp, lcp->tifp, &label, PM_LOG_VOL_TI)) < 0) { + __pmLogFreeLabel(&label); + goto fail; + } + __pmLogFreeLabel(&label); + + /* Load temporal index: populates lcp->endtime (last timestamp) */ + if ((sts = __pmLogLoadIndex(lcp)) < 0) + goto fail; + + /* Done with the read-mode handles from __pmLogFindOpen */ + __pmFclose(lcp->mdfp); + __pmFclose(lcp->tifp); + lcp->mdfp = lcp->tifp = NULL; + + /* Free the in-memory index array - not used by the write path */ + free(lcp->ti); + lcp->ti = NULL; + lcp->numti = 0; + + /* Reopen .meta in r+ - label already validated; position at end */ + __pmLogName_r(base, PM_LOG_VOL_META, fname, sizeof(fname)); + if ((lcp->mdfp = __pmFopen(fname, "r+")) == NULL) { + sts = -oserror(); + goto fail; + } + __pmSetvbuf(lcp->mdfp, NULL, _IONBF, 0); + __pmFseek(lcp->mdfp, 0, SEEK_END); + + /* Reopen .index in r+; position at end */ + __pmLogName_r(base, PM_LOG_VOL_TI, fname, sizeof(fname)); + if ((lcp->tifp = __pmFopen(fname, "r+")) == NULL) { + sts = -oserror(); + goto fail; + } + __pmSetvbuf(lcp->tifp, NULL, _IONBF, 0); + __pmFseek(lcp->tifp, 0, SEEK_END); + + /* + * Open the highest-numbered data volume (lcp->maxvol, set by + * __pmLogFindOpen) in r+ mode, validate its label for consistency + * with the archive, then position at end-of-file for appending. + * Set PM_CTXFLAG_LAST_VOLUME following the __pmLogOpen convention. + */ + __pmLogName_r(base, lcp->maxvol, fname, sizeof(fname)); + if ((acp->ac_mfp = __pmFopen(fname, "r+")) == NULL) { + sts = -oserror(); + goto fail; + } + __pmSetvbuf(acp->ac_mfp, NULL, _IONBF, 0); + + if ((sts = __pmLogChkLabel(acp, acp->ac_mfp, &label, lcp->maxvol)) < 0) { + __pmLogFreeLabel(&label); + goto fail; + } + __pmFseek(acp->ac_mfp, 0, SEEK_END); + + acp->ac_curvol = lcp->maxvol; + acp->ac_flags |= PM_CTXFLAG_LAST_VOLUME; + lcp->state = PM_LOG_STATE_INIT; + return 0; + +fail: + __pmLogClose(acp); + logFreeMeta(lcp); + return sts; +} + /* * Close the log files. * Free up the space used by __pmLogCtl. diff --git a/src/libpcp_import/src/archive.c b/src/libpcp_import/src/archive.c index 78b40f6ae9f..b4a431c73fb 100644 --- a/src/libpcp_import/src/archive.c +++ b/src/libpcp_import/src/archive.c @@ -20,6 +20,68 @@ static __pmTimestamp stamp; +/* + * Transition a CONTEXT_APPEND context to CONTEXT_ACTIVE by delegating + * all archive-format knowledge to __pmLogOpenAppend() in libpcp. + * After return the file handles in logctl/archctl are open and positioned + * at end-of-file; the caller's pmi_context fields are updated from the + * restored archive label and last timestamp. + */ +static int +check_context_append(pmi_context *current) +{ + __pmLogCtl *lcp = ¤t->logctl; + __pmArchCtl *acp = ¤t->archctl; + int sts; + + sts = __pmLogOpenAppend(current->archive, acp); + if (sts < 0) + return sts; + + /* + * Load all existing metric and instance-domain descriptors from .meta + * into the hash tables (hashpmid, hashindom). check_metric() will use + * __pmLogLookupDesc() to skip re-writing descriptors that are already + * present, preventing .meta from growing on every timer-driven invocation + * of a short-lived collector such as sadc. + * + * __pmLogOpenAppend() left mdfp positioned at end-of-file; rewind to the + * start so __pmLogLoadMeta() can read from the beginning of the file, then + * seek back to the end ready for subsequent appended writes. + */ + __pmFseek(lcp->mdfp, 0, SEEK_SET); + if ((sts = __pmLogLoadMeta(acp)) < 0) { + __pmLogClose(acp); + return sts; + } + __pmFseek(lcp->mdfp, 0, SEEK_END); + + /* Restore version from the archive label (may differ from the default) */ + current->version = __pmLogVersion(lcp); + + /* Use the archive's hostname/timezone unless the caller overrode them */ + if (current->hostname == NULL && lcp->label.hostname != NULL) + current->hostname = strdup(lcp->label.hostname); + if (current->timezone == NULL && lcp->label.timezone != NULL) + current->timezone = strdup(lcp->label.timezone); + + /* + * Seed last_stamp from the archive's end time so that the monotonicity + * check in _pmi_write() rejects out-of-order timestamps if a caller + * tries to write before the archive's existing last timestamp. + * + * Do NOT update 'stamp' here: _pmi_put_result() has already set it + * from result->timestamp (the correct current-write time) before + * calling check_context_start(). Overwriting stamp with lcp->endtime + * (the previous session's last timestamp) would produce a stale + * temporal index entry for the first record of this append session. + */ + current->last_stamp = lcp->endtime; + + current->state = CONTEXT_ACTIVE; + return 0; +} + static int check_context_start(pmi_context *current) { @@ -29,6 +91,18 @@ check_context_start(pmi_context *current) __pmArchCtl *acp; int sts; + if (current->state == CONTEXT_APPEND) { + sts = check_context_append(current); + if (sts != -ENOENT) + return sts; + /* + * Archive doesn't exist yet: fall through to create it normally. + * This makes PMI_APPEND safe to use unconditionally on first invocation + * of a timer-driven collector (e.g. sadc) before any archive exists. + */ + current->state = CONTEXT_START; + } + if (current->state != CONTEXT_START) return 0; /* ok */ @@ -116,12 +190,25 @@ check_metric(pmi_context *current, pmID pmid, int *needti) continue; if (current->metric[m].meta_done == 0) { char **namelist = ¤t->metric[m].name; + pmDesc existing; - if ((sts = __pmLogPutDesc(acp, ¤t->metric[m].desc, 1, namelist)) < 0) - return sts; + /* + * If the archive was opened for appending, __pmLogLoadMeta() will + * have populated hashpmid with all descriptors already on disk. + * Skip re-writing a descriptor that is already there — metric + * descriptors are immutable, so there is no need for duplicates + * that would cause .meta to grow on every short-lived invocation. + */ + if (__pmLogLookupDesc(acp, pmid, &existing) == 0) { + current->metric[m].meta_done = 1; + } + else { + if ((sts = __pmLogPutDesc(acp, ¤t->metric[m].desc, 1, namelist)) < 0) + return sts; - current->metric[m].meta_done = 1; - *needti = 1; + current->metric[m].meta_done = 1; + *needti = 1; + } } if (current->metric[m].desc.indom != PM_INDOM_NULL) { if ((sts = check_indom(current, current->metric[m].desc.indom, needti)) < 0) diff --git a/src/libpcp_import/src/import.c b/src/libpcp_import/src/import.c index 3ace054562a..0dbca020b3a 100644 --- a/src/libpcp_import/src/import.c +++ b/src/libpcp_import/src/import.c @@ -51,6 +51,9 @@ pmiDump(void) case CONTEXT_END: fprintf(f, "(end)"); break; + case CONTEXT_APPEND: + fprintf(f, "(append)"); + break; default: fprintf(f, "(BAD)"); break; @@ -316,7 +319,7 @@ pmiErrStr_r(int code, char *buf, int buflen) } int -pmiStart(const char *archive, int inherit) +pmiStart(const char *archive, int flags) { pmi_context *old_current; char *np; @@ -336,7 +339,7 @@ pmiStart(const char *archive, int inherit) old_current = &context_tab[c]; current = &context_tab[ncontext-1]; - current->state = CONTEXT_START; + current->state = (flags & PMI_APPEND) ? CONTEXT_APPEND : CONTEXT_START; current->version = archive_version; current->archive = strdup(archive); if (current->archive == NULL) { @@ -348,7 +351,7 @@ pmiStart(const char *archive, int inherit) memset((void *)¤t->logctl, 0, sizeof(current->logctl)); memset((void *)¤t->archctl, 0, sizeof(current->archctl)); __pmLogWriterInit(¤t->archctl, ¤t->logctl); - if (inherit && old_current != NULL) { + if ((flags & PMI_INHERIT) && old_current != NULL) { current->nmetric = old_current->nmetric; if (old_current->metric != NULL) { int m; diff --git a/src/libpcp_import/src/private.h b/src/libpcp_import/src/private.h index 24566428800..7fcf79e22a0 100644 --- a/src/libpcp_import/src/private.h +++ b/src/libpcp_import/src/private.h @@ -76,6 +76,7 @@ typedef struct { #define CONTEXT_START 1 #define CONTEXT_ACTIVE 2 #define CONTEXT_END 3 +#define CONTEXT_APPEND 4 /* open existing archive for appending */ #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(IS_MINGW) # define _PMI_HIDDEN __attribute__ ((visibility ("hidden"))) From b8a7fbb2b71ac00d91585bfff6672602bfe87e40 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 1 Jun 2026 16:49:44 +1000 Subject: [PATCH 02/15] libpcp_import: expose pmiWrite2 and pmiHighResWrite in public API pmiWrite2(int64_t sec, int usec) and pmiHighResWrite(int64_t sec, int nsec) were already implemented and exported from the shared library but were missing from the public import.h header, making them unusable by callers without forward-declaring them manually. Add declarations for both and deprecate pmiWrite(int, int) with a comment: its 32-bit seconds argument is not Y2038-safe and callers should migrate to pmiHighResWrite() for nanosecond-resolution timestamps or pmiWrite2() for microsecond resolution. Signed-off-by: Nathan Scott Co-Authored-By: Claude Sonnet 4.6 (1M context) --- src/include/pcp/import.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/include/pcp/import.h b/src/include/pcp/import.h index 419fed37dcb..2af09dd3468 100644 --- a/src/include/pcp/import.h +++ b/src/include/pcp/import.h @@ -45,7 +45,9 @@ PMI_CALL extern int pmiAddInstance(pmInDom, const char *, int); PMI_CALL extern int pmiPutValue(const char *, const char *, const char *); PMI_CALL extern int pmiGetHandle(const char *, const char *); PMI_CALL extern int pmiPutValueHandle(int, const char *); -PMI_CALL extern int pmiWrite(int, int); +PMI_CALL extern int pmiWrite(int, int); /* deprecated: not Y2038-safe, use pmiHighResWrite */ +PMI_CALL extern int pmiWrite2(int64_t, int); /* Y2038-safe, microsecond resolution */ +PMI_CALL extern int pmiHighResWrite(int64_t, int); /* Y2038-safe, nanosecond resolution */ PMI_CALL extern int pmiPutResult(const pmResult_v2 *); PMI_CALL extern int pmiPutMark(void); PMI_CALL extern int pmiPutText(unsigned int, unsigned int, unsigned int, const char *); From ec9d164178b1cc4a388bdc1dcd4d5968885c1b2a Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 2 Jun 2026 12:26:49 +1000 Subject: [PATCH 03/15] libpcp_import, libpcp: improve archive append mode and public API logutil.c: rework __pmLogOpenAppend() to use __pmLogFindOpen() for volume discovery. Previously we iterated using lcp->numti (temporal index count) as a starting hint; this bypassed the canonical readdir + __pmLogAddVolume path. Now: - __pmLogFindOpen() performs the directory scan, correctly setting lcp->name, lcp->minvol and lcp->maxvol via __pmLogAddVolume. - .meta and .index handles from __pmLogFindOpen (read mode) are used to validate the archive label and load the temporal index for lcp->endtime, then closed and reopened in r+ mode for writing. - The highest data volume (lcp->maxvol) is opened in r+ mode so its label is validated with __pmLogChkLabel before appending, matching the consistency checking done by __pmLogChangeVol in the read path. - acp->ac_flags |= PM_CTXFLAG_LAST_VOLUME signals that we are at the most recent volume, following the __pmLogOpen convention. import.h: expose pmiWrite2, pmiHighResWrite and pmiPutHighResResult as the preferred Y2038-safe interfaces. pmiWrite(int,int) is marked deprecated. pmiwrite.3: document pmiWrite, pmiWrite2 and pmiHighResWrite on one page; note pmiWrite as deprecated and pmiHighResWrite as preferred. pmiputresult.3: document pmiPutResult and pmiPutHighResResult together; note pmiPutHighResResult as the preferred nanosecond-resolution variant. Signed-off-by: Nathan Scott Co-Authored-By: Claude Sonnet 4.6 (1M context) --- man/man3/pmiputresult.3 | 56 +++++++++++++++++++++++-------------- man/man3/pmiwrite.3 | 60 +++++++++++++++++++++++++++++++--------- src/include/pcp/import.h | 3 +- 3 files changed, 84 insertions(+), 35 deletions(-) diff --git a/man/man3/pmiputresult.3 b/man/man3/pmiputresult.3 index f6de5458b1e..711a0ce79bf 100644 --- a/man/man3/pmiputresult.3 +++ b/man/man3/pmiputresult.3 @@ -16,7 +16,8 @@ .\" .TH PMIPUTRESULT 3 "" "Performance Co-Pilot" .SH NAME -\f3pmiPutResult\f1 \- add a data record to a LOGIMPORT archive +\f3pmiPutResult\f1, +\f3pmiPutHighResResult\f1 \- add a data record to a LOGIMPORT archive .SH "C SYNOPSIS" .ft 3 .ad l @@ -25,7 +26,9 @@ .br #include .sp -int pmiPutResult(const pmResult *\fIresult\fP); +int pmiPutResult(const pmResult_v2 *\fIresult\fP); +.br +int pmiPutHighResResult(const pmResult *\fIresult\fP); .sp cc ... \-lpcp_import \-lpcp .hy @@ -34,43 +37,53 @@ cc ... \-lpcp_import \-lpcp .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), -.B pmiPutResult -provides an interface for developers familiar with the internal +these routines provide an interface for developers familiar with the internal PCP data structures to create output archives directly. .PP -By building the +By building a .B pmResult -data structure directly, then calling -.B pmiPutResult -the developer avoids calls to +data structure directly and calling one of these routines, the developer +avoids the separate .BR pmiPutValue (3) and/or .BR pmiPutValueHandle (3) -followed by a call to -.BR pmiWrite (3) +calls followed by +.BR pmiHighResWrite (3) for each record written to the archive. .PP -Any metrics and instances appearing in the +.B pmiPutHighResResult +is the preferred interface. +It accepts a +.B pmResult +with a +.B struct timespec +timestamp, giving nanosecond resolution and Y2038-safe 64-bit seconds. +.PP +.B pmiPutResult +accepts the older +.B pmResult_v2 +type with a +.B struct timeval +timestamp (microsecond resolution). +.PP +Any metrics and instances appearing in .I result must have been defined by prior calls to .BR pmiAddMetric (3) and .BR pmiAddInstance (3). -.PP -.B pmiPutResult -will arrange for any new metadata (metrics and/or instance domain changes) -covered by +Both routines will arrange for any new metadata (metrics and/or instance +domain changes) covered by .I result -to be also written to the PCP archive. +to be written to the PCP archive. .PP Because of the complexity of the .B pmResult -data structure, this routine is not available in the Perl +data structure, neither routine is available in the Perl interface to the LOGIMPORT services. .SH DIAGNOSTICS -.B pmiPutResult -returns zero on success else a negative value that can be turned into an -error message by calling +Both routines return zero on success else a negative value that can be +turned into an error message by calling .BR pmiErrStr (3). .SH SEE ALSO .BR LOGIMPORT (3), @@ -82,6 +95,7 @@ error message by calling .BR pmiPutText (3), .BR pmiPutLabel (3), .BR pmiPutValueHandle (3), -.BR pmiSetTimezone (3) +.BR pmiSetTimezone (3), +.BR pmiHighResWrite (3) and .BR pmiWrite (3). diff --git a/man/man3/pmiwrite.3 b/man/man3/pmiwrite.3 index ef2a4c03455..8affe41c24d 100644 --- a/man/man3/pmiwrite.3 +++ b/man/man3/pmiwrite.3 @@ -1,7 +1,7 @@ '\"macro stdmacro .\" .\" Copyright (c) 2010 Ken McDonell. All Rights Reserved. -.\" Copyright (c) 2018 Red Hat. +.\" Copyright (c) 2018,2026 Red Hat. .\" .\" 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 @@ -16,7 +16,9 @@ .\" .TH PMIWRITE 3 "" "Performance Co-Pilot" .SH NAME -\f3pmiWrite\f1 \- flush data to a LOGIMPORT archive +\f3pmiWrite\f1, +\f3pmiWrite2\f1, +\f3pmiHighResWrite\f1 \- flush data to a LOGIMPORT archive .SH "C SYNOPSIS" .ft 3 .ad l @@ -26,6 +28,10 @@ #include .sp int pmiWrite(int \fIsec\fP, int \fIusec\fP); +.br +int pmiWrite2(int64_t \fIsec\fP, int \fIusec\fP); +.br +int pmiHighResWrite(int64_t \fIsec\fP, int \fInsec\fP); .sp cc ... \-lpcp_import \-lpcp .hy @@ -44,8 +50,7 @@ pmiWrite($\fIsec\fP, $\fIusec\fP); .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), -.B pmiWrite -forces accumulated data values out to the PCP archive. +these routines flush accumulated data values out to the PCP archive. .PP The data values and associated metadata have previously been built up using calls to @@ -55,17 +60,46 @@ built up using calls to and .BR pmiPutValueHandle (3). .PP -The current set of data values and any new metadata is written to the archive with -a timestamp of +The current set of data values and any new metadata is written to the archive +with the specified timestamp in the source timezone of the archive +(see +.BR pmiSetTimezone (3)). +.PP +.B pmiHighResWrite +is the preferred interface. +It accepts a nanosecond-resolution timestamp: seconds since the Unix epoch +as a 64-bit signed integer +.RI ( sec ) +and nanoseconds within that second +.RI ( nsec ). +Using a 64-bit .I sec -and -.I usec -in the source timezone of the archive, see -.BR pmiSetTimezone (3). -.SH DIAGNOSTICS +argument makes +.B pmiHighResWrite +safe beyond the year 2038, unlike +.BR pmiWrite . +.PP +.B pmiWrite2 +is equivalent to +.B pmiHighResWrite +except that the sub-second component is specified in microseconds +rather than nanoseconds. +.PP .B pmiWrite -returns zero on success else a negative value that can be turned into an -error message by calling +is deprecated. +Its 32-bit +.I sec +argument overflows in January 2038 and callers should migrate to +.B pmiHighResWrite +(or +.BR pmiWrite2 ). +Passing a negative value for +.I sec +to any of these routines causes the current wall-clock time to be +used as the timestamp. +.SH DIAGNOSTICS +All three routines return zero on success, else a negative value that +can be turned into an error message by calling .BR pmiErrStr (3). .SH SEE ALSO .BR LOGIMPORT (3), diff --git a/src/include/pcp/import.h b/src/include/pcp/import.h index 2af09dd3468..c55065fcdbc 100644 --- a/src/include/pcp/import.h +++ b/src/include/pcp/import.h @@ -45,10 +45,11 @@ PMI_CALL extern int pmiAddInstance(pmInDom, const char *, int); PMI_CALL extern int pmiPutValue(const char *, const char *, const char *); PMI_CALL extern int pmiGetHandle(const char *, const char *); PMI_CALL extern int pmiPutValueHandle(int, const char *); -PMI_CALL extern int pmiWrite(int, int); /* deprecated: not Y2038-safe, use pmiHighResWrite */ +PMI_CALL extern int pmiWrite(int, int); /* deprecated: not Y2038-safe, use either pmiWrite2 or pmiHighResWrite */ PMI_CALL extern int pmiWrite2(int64_t, int); /* Y2038-safe, microsecond resolution */ PMI_CALL extern int pmiHighResWrite(int64_t, int); /* Y2038-safe, nanosecond resolution */ PMI_CALL extern int pmiPutResult(const pmResult_v2 *); +PMI_CALL extern int pmiPutHighResResult(const pmResult *); PMI_CALL extern int pmiPutMark(void); PMI_CALL extern int pmiPutText(unsigned int, unsigned int, unsigned int, const char *); PMI_CALL extern int pmiPutLabel(unsigned int, unsigned int, unsigned int, const char *, const char *); From 91f772425c09f3d2aedffcf8f4dbe0ba88267fd5 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 4 Jun 2026 10:43:57 +1000 Subject: [PATCH 04/15] libpcp_import: add pmiPutAtomValueHandle to public API Add pmiPutAtomValueHandle(int handle, pmAtomValue *atom) as a binary counterpart to pmiPutValueHandle, passing values directly via the pmAtomValue union rather than as strings requiring parsing. Refactor stuff.c to extract _pmi_alloc_vp and _pmi_alloc_valblock static helpers, eliminating the duplicated result/vset/vp setup and pmValueBlock allocation that both _pmi_stuff_value and the new _pmi_stuff_atomvalue share. Update pmiputvaluehandle.3 and exercise the new function in qa/src/check_import.c covering the INSITU path (U32), DPTR path (64-bit), bad-handle and duplicate-value error cases. Co-Authored-By: Claude Sonnet 4.6 (1M context) Signed-off-by: Nathan Scott --- man/man3/pmiputvaluehandle.3 | 24 ++++- qa/1418.out | 21 ++++- qa/369.out | 21 ++++- qa/src/check_import.c | 18 ++++ src/include/pcp/import.h | 1 + src/libpcp_import/src/exports | 1 + src/libpcp_import/src/import.c | 13 ++- src/libpcp_import/src/private.h | 3 +- src/libpcp_import/src/stuff.c | 160 +++++++++++++++++++++++++------- 9 files changed, 217 insertions(+), 45 deletions(-) diff --git a/man/man3/pmiputvaluehandle.3 b/man/man3/pmiputvaluehandle.3 index 815f7ed0afe..8ee087951cc 100644 --- a/man/man3/pmiputvaluehandle.3 +++ b/man/man3/pmiputvaluehandle.3 @@ -1,7 +1,7 @@ '\"macro stdmacro .\" .\" Copyright (c) 2010 Ken McDonell. All Rights Reserved. -.\" Copyright (c) 2018 Red Hat. +.\" Copyright (c) 2018,2026 Red Hat. .\" .\" 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 @@ -16,6 +16,7 @@ .\" .TH PMIPUTVALUEHANDLE 3 "" "Performance Co-Pilot" .SH NAME +\f3pmiPutAtomValueHandle\f1, \f3pmiPutValueHandle\f1 \- add a value for a metric-instance pair via a handle .SH "C SYNOPSIS" .ft 3 @@ -25,6 +26,8 @@ .br #include .sp +int pmiPutAtomValueHandle(int \fIhandle\fP, pmAtomValue *\fIatom\fP); +.br int pmiPutValueHandle(int \fIhandle\fP, const char *\fIvalue\fP); .sp cc ... \-lpcp_import \-lpcp @@ -44,14 +47,24 @@ pmiPutValueHandle($\fIhandle\fP, $\fIvalue\fP); .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), +.B pmiPutAtomValueHandle +and .B pmiPutValueHandle -adds a single value to the current output record for a given +add a single value to the current output record for a given metric and instance, using the .I handle defined by an earlier call to .BR pmiGetHandle (3). .PP -The +With +.B pmiPutAtomValueHandle +the +.I atom +passes the binary value directly using a union of types. +.PP +In the case of +.B pmiPutValueHandle +the .I value should be in a format consistent with the metric's type as defined in the call to @@ -60,6 +73,7 @@ defined in the call to No data will be written until .BR pmiWrite (3) is called, so multiple calls to +.BR pmiPutAtomValueHandle , .B pmiPutValueHandle or .BR pmiPutValue (3) @@ -67,8 +81,10 @@ are typically used to accumulate data values for several metric-instance pairs before calling .BR pmiWrite (3). .SH DIAGNOSTICS +.B pmiPutAtomValueHandle +and .B pmiPutValueHandle -returns zero on success else a negative value that can be turned into an +return zero on success else a negative value that can be turned into an error message by calling .BR pmiErrStr (3). .SH SEE ALSO diff --git a/qa/1418.out b/qa/1418.out index 891d27d249f..a1cda24719e 100644 --- a/qa/1418.out +++ b/qa/1418.out @@ -40,9 +40,11 @@ pmiPutValue: OK pmiPutValue: OK pmiPutValue: OK pmiGetHandle: OK ->1 +pmiGetHandle: OK ->2 pmiGetHandle: Error: Unknown metric name pmiPutValueHandle: Error: Value already assigned for this metric-instance pmiPutValueHandle: Error: Illegal handle +pmiPutAtomValueHandle: Error: Illegal handle pmiPutText: OK pmiPutText: OK pmiPutText: OK @@ -124,6 +126,7 @@ pmiDump: context 0 of 1 archive: myarchive instance[1] eek (2) instance[2] blah (3) handle[0] metric=my.metric.foo (245.0.1) instance=-1 + handle[1] metric=my.metric.long (245.0.3) instance=-1 text[0] pmid=245.0.1 [One line text for my.metric.foo] text[1] pmid=245.0.1 Full help text for my.metric.foo @@ -170,13 +173,17 @@ pmiWrite: OK pmiPutValue: OK pmiWrite: OK pmiWrite: Error: No data to output +pmiPutAtomValueHandle: OK +pmiPutAtomValueHandle: OK +pmiPutAtomValueHandle: Error: Value already assigned for this metric-instance +pmiWrite: OK pmiPutMark: OK pmiEnd: OK pmiStart: OK ->2 pmiAddInstance: Error: Internal instance identifer already defined -pmiGetHandle: OK ->2 +pmiGetHandle: OK ->3 pmiPutValueHandle: OK -pmiPutValueHandle: Error: Illegal handle +pmiPutValueHandle: Error: Value already assigned for this metric-instance pmiDump: context 1 of 2 archive: myotherarchive state: 1 (start) hostname: timezone: metric[0] name=my.metric.foo pmid=245.0.1 @@ -205,7 +212,8 @@ pmiDump: context 1 of 2 archive: myotherarchive instance[1] eek (2) instance[2] blah (3) handle[0] metric=my.metric.foo (245.0.1) instance=-1 - handle[1] metric=my.metric.bar (245.0.2) instance=2 + handle[1] metric=my.metric.long (245.0.3) instance=-1 + handle[2] metric=my.metric.bar (245.0.2) instance=2 text[0] pmid=245.0.1 [One line text for my.metric.foo] text[1] pmid=245.0.1 Full help text for my.metric.foo @@ -290,7 +298,7 @@ TIMESTAMP 3 instances Temporal Index Log Vol end(meta) end(log) TIMESTAMP 0 808 808 -TIMESTAMP 0 2385 1256 +TIMESTAMP 0 2385 1332 [260 bytes] TIMESTAMP 7 metrics @@ -313,6 +321,11 @@ TIMESTAMP 2 metrics TIMESTAMP 1 metric 245.0.5 (my.metric.string): value "a third string value" +[76 bytes] +TIMESTAMP 2 metrics + 245.0.1 (my.metric.foo): value 55555 + 245.0.3 (my.metric.long): value 1234567890123 + [24 bytes] TIMESTAMP diff --git a/qa/369.out b/qa/369.out index a3e20de9a92..e36b7aac9bf 100644 --- a/qa/369.out +++ b/qa/369.out @@ -40,9 +40,11 @@ pmiPutValue: OK pmiPutValue: OK pmiPutValue: OK pmiGetHandle: OK ->1 +pmiGetHandle: OK ->2 pmiGetHandle: Error: Unknown metric name pmiPutValueHandle: Error: Value already assigned for this metric-instance pmiPutValueHandle: Error: Illegal handle +pmiPutAtomValueHandle: Error: Illegal handle pmiPutText: OK pmiPutText: OK pmiPutText: OK @@ -124,6 +126,7 @@ pmiDump: context 0 of 1 archive: myarchive instance[1] eek (2) instance[2] blah (3) handle[0] metric=my.metric.foo (245.0.1) instance=-1 + handle[1] metric=my.metric.long (245.0.3) instance=-1 text[0] pmid=245.0.1 [One line text for my.metric.foo] text[1] pmid=245.0.1 Full help text for my.metric.foo @@ -170,13 +173,17 @@ pmiWrite: OK pmiPutValue: OK pmiWrite: OK pmiWrite: Error: No data to output +pmiPutAtomValueHandle: OK +pmiPutAtomValueHandle: OK +pmiPutAtomValueHandle: Error: Value already assigned for this metric-instance +pmiWrite: OK pmiPutMark: OK pmiEnd: OK pmiStart: OK ->2 pmiAddInstance: Error: Internal instance identifer already defined -pmiGetHandle: OK ->2 +pmiGetHandle: OK ->3 pmiPutValueHandle: OK -pmiPutValueHandle: Error: Illegal handle +pmiPutValueHandle: Error: Value already assigned for this metric-instance pmiDump: context 1 of 2 archive: myotherarchive state: 1 (start) hostname: timezone: metric[0] name=my.metric.foo pmid=245.0.1 @@ -205,7 +212,8 @@ pmiDump: context 1 of 2 archive: myotherarchive instance[1] eek (2) instance[2] blah (3) handle[0] metric=my.metric.foo (245.0.1) instance=-1 - handle[1] metric=my.metric.bar (245.0.2) instance=2 + handle[1] metric=my.metric.long (245.0.3) instance=-1 + handle[2] metric=my.metric.bar (245.0.2) instance=2 text[0] pmid=245.0.1 [One line text for my.metric.foo] text[1] pmid=245.0.1 Full help text for my.metric.foo @@ -290,7 +298,7 @@ TIMESTAMP 3 instances Temporal Index Log Vol end(meta) end(log) TIMESTAMP 0 132 132 -TIMESTAMP 0 1677 564 +TIMESTAMP 0 1677 636 [256 bytes] TIMESTAMP 7 metrics @@ -313,6 +321,11 @@ TIMESTAMP 2 metrics TIMESTAMP 1 metric 245.0.5 (my.metric.string): value "a third string value" +[72 bytes] +TIMESTAMP 2 metrics + 245.0.1 (my.metric.foo): value 55555 + 245.0.3 (my.metric.long): value 1234567890123 + [20 bytes] TIMESTAMP diff --git a/qa/src/check_import.c b/qa/src/check_import.c index e86a675017a..79820238d37 100644 --- a/qa/src/check_import.c +++ b/qa/src/check_import.c @@ -27,6 +27,8 @@ main(int argc, char **argv) int ctx2; int hdl1; int hdl2; + int hdl3; + pmAtomValue av; int errflag = 0; int c; int Vflag = 0; @@ -139,12 +141,17 @@ main(int argc, char **argv) hdl1 = pmiGetHandle("my.metric.foo", ""); check(hdl1, "pmiGetHandle"); + hdl3 = pmiGetHandle("my.metric.long", ""); + check(hdl3, "pmiGetHandle"); sts = pmiGetHandle("my.bad", ""); check(sts, "pmiGetHandle"); sts = pmiPutValueHandle(hdl1, "321"); check(sts, "pmiPutValueHandle"); sts = pmiPutValueHandle(0, "error"); check(sts, "pmiPutValueHandle"); + av.ul = 0; + sts = pmiPutAtomValueHandle(0, &av); + check(sts, "pmiPutAtomValueHandle"); sts = pmiPutText(PM_TEXT_PMID, PM_TEXT_ONELINE, pmID_build(245,0,1), "One line text for my.metric.foo"); @@ -333,6 +340,17 @@ main(int argc, char **argv) check(sts, "pmiWrite"); sts = pmiWrite(-1, -1); check(sts, "pmiWrite"); + av.ul = 55555; + sts = pmiPutAtomValueHandle(hdl1, &av); /* U32: PM_VAL_INSITU path */ + check(sts, "pmiPutAtomValueHandle"); + av.ll = 1234567890123LL; + sts = pmiPutAtomValueHandle(hdl3, &av); /* 64-bit: PM_VAL_DPTR path */ + check(sts, "pmiPutAtomValueHandle"); + av.ul = 0; + sts = pmiPutAtomValueHandle(hdl1, &av); /* duplicate: PMI_ERR_DUPVALUE */ + check(sts, "pmiPutAtomValueHandle"); + sts = pmiWrite(-1, -1); + check(sts, "pmiWrite"); sts = pmiPutMark(); check(sts, "pmiPutMark"); diff --git a/src/include/pcp/import.h b/src/include/pcp/import.h index c55065fcdbc..ba10ef05168 100644 --- a/src/include/pcp/import.h +++ b/src/include/pcp/import.h @@ -45,6 +45,7 @@ PMI_CALL extern int pmiAddInstance(pmInDom, const char *, int); PMI_CALL extern int pmiPutValue(const char *, const char *, const char *); PMI_CALL extern int pmiGetHandle(const char *, const char *); PMI_CALL extern int pmiPutValueHandle(int, const char *); +PMI_CALL extern int pmiPutAtomValueHandle(int, pmAtomValue *); PMI_CALL extern int pmiWrite(int, int); /* deprecated: not Y2038-safe, use either pmiWrite2 or pmiHighResWrite */ PMI_CALL extern int pmiWrite2(int64_t, int); /* Y2038-safe, microsecond resolution */ PMI_CALL extern int pmiHighResWrite(int64_t, int); /* Y2038-safe, nanosecond resolution */ diff --git a/src/libpcp_import/src/exports b/src/libpcp_import/src/exports index 28a6b855688..370f6ca36e7 100644 --- a/src/libpcp_import/src/exports +++ b/src/libpcp_import/src/exports @@ -50,4 +50,5 @@ PCP_IMPORT_1.3 { PCP_IMPORT_1.4 { global: pmiExtraUnits; + pmiPutAtomValueHandle; } PCP_IMPORT_1.3; diff --git a/src/libpcp_import/src/import.c b/src/libpcp_import/src/import.c index 0dbca020b3a..457141ed587 100644 --- a/src/libpcp_import/src/import.c +++ b/src/libpcp_import/src/import.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2022 Red Hat. + * Copyright (c) 2013-2022,2026 Red Hat. * Copyright (c) 2010 Ken McDonell. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it @@ -888,6 +888,17 @@ pmiPutValueHandle(int handle, const char *value) return current->last_sts = _pmi_stuff_value(current, ¤t->handle[handle-1], value); } +int +pmiPutAtomValueHandle(int handle, pmAtomValue *atom) +{ + if (current == NULL) + return PM_ERR_NOCONTEXT; + if (handle <= 0 || handle > current->nhandle) + return current->last_sts = PMI_ERR_BADHANDLE; + + return current->last_sts = _pmi_stuff_atomvalue(current, ¤t->handle[handle-1], atom); +} + int pmiPutText(unsigned int type, unsigned int class, unsigned int id, const char *content) { diff --git a/src/libpcp_import/src/private.h b/src/libpcp_import/src/private.h index 7fcf79e22a0..9d8335fba75 100644 --- a/src/libpcp_import/src/private.h +++ b/src/libpcp_import/src/private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018,2021-2022 Red Hat. + * Copyright (c) 2013-2018,2021-2022,2026 Red Hat. * Copyright (c) 2010 Ken McDonell. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it @@ -84,6 +84,7 @@ typedef struct { # define _PMI_HIDDEN #endif +extern int _pmi_stuff_atomvalue(pmi_context *, pmi_handle *, pmAtomValue *) _PMI_HIDDEN; extern int _pmi_stuff_value(pmi_context *, pmi_handle *, const char *) _PMI_HIDDEN; extern int _pmi_put_result(pmi_context *, __pmResult *) _PMI_HIDDEN; extern int _pmi_put_text(pmi_context *) _PMI_HIDDEN; diff --git a/src/libpcp_import/src/stuff.c b/src/libpcp_import/src/stuff.c index 8a2fe83a0f5..479949f0415 100644 --- a/src/libpcp_import/src/stuff.c +++ b/src/libpcp_import/src/stuff.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2010 Ken McDonell. All Rights Reserved. - * Copyright (c) 2022 Red Hat. + * Copyright (c) 2022,2026 Red Hat. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,13 @@ #include "import.h" #include "private.h" -int -_pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) +/* + * Shared setup: find or create the pmValueSet slot for hp's metric in + * current->result, add one pmValue slot, and return pointers to both. + * Returns 0 on success, or a negative error code. + */ +static int +_pmi_alloc_vp(pmi_context *current, pmi_handle *hp, pmValueSet **vspp, pmValue **vpp) { __pmResult *rp; int i; @@ -27,13 +32,6 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) pmValueSet *vsp; pmValue *vp; pmi_metric *mp; - char *end; - int dsize; - void *data; - __int64_t ll; - __uint64_t ull; - float f; - double d; size_t size; mp = ¤t->metric[hp->midx]; @@ -42,7 +40,7 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) /* first time - do not use __pmAllocResult due to realloc requirement */ current->result = (__pmResult *)calloc(1, sizeof(__pmResult)); if (current->result == NULL) { - pmNoMem("_pmi_stuff_value: result calloc", sizeof(__pmResult), PM_FATAL_ERR); + pmNoMem("_pmi_alloc_vp: result calloc", sizeof(__pmResult), PM_FATAL_ERR); } } rp = current->result; @@ -61,11 +59,11 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) size = sizeof(__pmResult) + (rp->numpmid-1)*sizeof(pmValueSet *); rp = current->result = (__pmResult *)realloc(current->result, size); if (current->result == NULL) { - pmNoMem("_pmi_stuff_value: result realloc", size, PM_FATAL_ERR); + pmNoMem("_pmi_alloc_vp: result realloc", size, PM_FATAL_ERR); } rp->vset[rp->numpmid-1] = (pmValueSet *)malloc(sizeof(pmValueSet)); if (rp->vset[rp->numpmid-1] == NULL) { - pmNoMem("_pmi_stuff_value: vset alloc", sizeof(pmValueSet), PM_FATAL_ERR); + pmNoMem("_pmi_alloc_vp: vset alloc", sizeof(pmValueSet), PM_FATAL_ERR); } vsp = rp->vset[rp->numpmid-1]; vsp->pmid = pmid; @@ -89,18 +87,59 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) size = sizeof(pmValueSet) + (rp->vset[i]->numval-1)*sizeof(pmValue); vsp = rp->vset[i] = (pmValueSet *)realloc(rp->vset[i], size); if (rp->vset[i] == NULL) { - pmNoMem("_pmi_stuff_value: vset realloc", size, PM_FATAL_ERR); + pmNoMem("_pmi_alloc_vp: vset realloc", size, PM_FATAL_ERR); } } vp = &vsp->vlist[vsp->numval-1]; vp->inst = hp->inst; + *vspp = vsp; + *vpp = vp; + return 0; +} + +/* Shared pmValueBlock allocation for heap-stored types (64-bit, float, string, ...). */ +static void +_pmi_alloc_valblock(pmi_metric *mp, pmValue *vp, int dsize, void *data) +{ + int need = dsize + PM_VAL_HDR_SIZE; + + /* logic copied from stuffvalue.c in libpcp */ + vp->value.pval = (pmValueBlock *)malloc(need < sizeof(pmValueBlock) ? sizeof(pmValueBlock) : need); + if (vp->value.pval == NULL) { + pmNoMem("_pmi_alloc_valblock: pmValueBlock", need < sizeof(pmValueBlock) ? sizeof(pmValueBlock) : need, PM_FATAL_ERR); + } + vp->value.pval->vlen = (int)need; + vp->value.pval->vtype = mp->desc.type; + memcpy((void *)vp->value.pval->vbuf, data, dsize); +} + +int +_pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) +{ + int sts; + pmValueSet *vsp; + pmValue *vp; + pmi_metric *mp; + char *end; + int dsize; + void *data; + __int64_t ll; + __uint64_t ull; + float f; + double d; + + mp = ¤t->metric[hp->midx]; + + if ((sts = _pmi_alloc_vp(current, hp, &vsp, &vp)) != 0) + return sts; + dsize = -1; switch (mp->desc.type) { case PM_TYPE_32: vp->value.lval = (__int32_t)strtol(value, &end, 10); if (*end != '\0') { if (vsp->numval == 1) vsp->numval = PM_ERR_CONV; - else rp->vset[i]->numval--; + else vsp->numval--; return PM_ERR_CONV; } if (vsp->numval == 1) vsp->valfmt = PM_VAL_INSITU; @@ -110,7 +149,7 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) vp->value.lval = (__uint32_t)strtoul(value, &end, 10); if (*end != '\0') { if (vsp->numval == 1) vsp->numval = PM_ERR_CONV; - else rp->vset[i]->numval--; + else vsp->numval--; return PM_ERR_CONV; } if (vsp->numval == 1) vsp->valfmt = PM_VAL_INSITU; @@ -120,7 +159,7 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) ll = strtoint64(value, &end, 10); if (*end != '\0') { if (vsp->numval == 1) vsp->numval = PM_ERR_CONV; - else rp->vset[i]->numval--; + else vsp->numval--; return PM_ERR_CONV; } dsize = sizeof(ll); @@ -132,7 +171,7 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) ull = strtouint64(value, &end, 10); if (*end != '\0') { if (vsp->numval == 1) vsp->numval = PM_ERR_CONV; - else rp->vset[i]->numval--; + else vsp->numval--; return PM_ERR_CONV; } dsize = sizeof(ull); @@ -144,7 +183,7 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) f = strtof(value, &end); if (*end != '\0') { if (vsp->numval == 1) vsp->numval = PM_ERR_CONV; - else rp->vset[i]->numval--; + else vsp->numval--; return PM_ERR_CONV; } dsize = sizeof(f); @@ -156,7 +195,7 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) d = strtod(value, &end); if (*end != '\0') { if (vsp->numval == 1) vsp->numval = PM_ERR_CONV; - else rp->vset[i]->numval--; + else vsp->numval--; return PM_ERR_CONV; } dsize = sizeof(d); @@ -172,22 +211,81 @@ _pmi_stuff_value(pmi_context *current, pmi_handle *hp, const char *value) default: if (vsp->numval == 1) vsp->numval = PM_ERR_TYPE; - else rp->vset[i]->numval--; + else vsp->numval--; return PM_ERR_TYPE; } - if (dsize != -1) { - /* logic copied from stuffvalue.c in libpcp */ - int need = dsize + PM_VAL_HDR_SIZE; + if (dsize != -1) + _pmi_alloc_valblock(mp, vp, dsize, data); - vp->value.pval = (pmValueBlock *)malloc(need < sizeof(pmValueBlock) ? sizeof(pmValueBlock) : need); - if (vp->value.pval == NULL) { - pmNoMem("_pmi_stuff_value: pmValueBlock", need < sizeof(pmValueBlock) ? sizeof(pmValueBlock) : need, PM_FATAL_ERR); - } - vp->value.pval->vlen = (int)need; - vp->value.pval->vtype = mp->desc.type; - memcpy((void *)vp->value.pval->vbuf, data, dsize); + return 0; +} + +int +_pmi_stuff_atomvalue(pmi_context *current, pmi_handle *hp, pmAtomValue *atom) +{ + int sts; + pmValueSet *vsp; + pmValue *vp; + pmi_metric *mp; + int dsize; + void *data; + + mp = ¤t->metric[hp->midx]; + + if ((sts = _pmi_alloc_vp(current, hp, &vsp, &vp)) != 0) + return sts; + + dsize = -1; + switch (mp->desc.type) { + case PM_TYPE_32: + vp->value.lval = atom->l; + if (vsp->numval == 1) vsp->valfmt = PM_VAL_INSITU; + break; + + case PM_TYPE_U32: + vp->value.lval = atom->ul; + if (vsp->numval == 1) vsp->valfmt = PM_VAL_INSITU; + break; + + case PM_TYPE_64: + dsize = sizeof(atom->ll); + data = (void *)&atom->ll; + if (vsp->numval == 1) vsp->valfmt = PM_VAL_DPTR; + break; + + case PM_TYPE_U64: + dsize = sizeof(atom->ull); + data = (void *)&atom->ull; + if (vsp->numval == 1) vsp->valfmt = PM_VAL_DPTR; + break; + + case PM_TYPE_FLOAT: + dsize = sizeof(atom->f); + data = (void *)&atom->f; + if (vsp->numval == 1) vsp->valfmt = PM_VAL_DPTR; + break; + + case PM_TYPE_DOUBLE: + dsize = sizeof(atom->d); + data = (void *)&atom->d; + if (vsp->numval == 1) vsp->valfmt = PM_VAL_DPTR; + break; + + case PM_TYPE_STRING: + dsize = strlen(atom->cp)+1; + data = (void *)atom->cp; + if (vsp->numval == 1) vsp->valfmt = PM_VAL_DPTR; + break; + + default: + if (vsp->numval == 1) vsp->numval = PM_ERR_TYPE; + else vsp->numval--; + return PM_ERR_TYPE; } + if (dsize != -1) + _pmi_alloc_valblock(mp, vp, dsize, data); + return 0; } From 1de184d6b6d22ffae84199402798ca9fa209364a Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 4 Jun 2026 10:56:00 +1000 Subject: [PATCH 05/15] man: add Python SYNOPSIS to all pmi* man pages Add a Python SYNOPSIS section to each libpcp_import man page that has a Python binding in src/python/pcp/pmi.py. The Python API wraps the C library via the pmi.pmiLogImport class; methods are called on an instance. Multi-line call signatures use the same continuation-indent style as the existing Perl SYNOPSIS sections. pmiputresult.3 gains a Python-only synopsis (Perl has no binding for pmiPutResult/pmiPutHighResResult). pmisetversion.3 gains both Perl and Python synopses, fixing a pre-existing omission. pmiusecontext.3 and pmierrstr.3 are left without a Python synopsis as pmi.pmiLogImport handles context switching internally and surfaces errors as exceptions. Co-Authored-By: Claude Sonnet 4.6 (1M context) Signed-off-by: Nathan Scott --- man/man3/pmiaddinstance.3 | 10 ++++++++++ man/man3/pmiaddmetric.3 | 17 +++++++++++++++++ man/man3/pmiend.3 | 10 ++++++++++ man/man3/pmigethandle.3 | 10 ++++++++++ man/man3/pmiputlabel.3 | 16 ++++++++++++++++ man/man3/pmiputmark.3 | 10 ++++++++++ man/man3/pmiputresult.3 | 12 ++++++++++++ man/man3/pmiputtext.3 | 10 ++++++++++ man/man3/pmiputvalue.3 | 10 ++++++++++ man/man3/pmiputvaluehandle.3 | 10 ++++++++++ man/man3/pmisethostname.3 | 10 ++++++++++ man/man3/pmisettimezone.3 | 10 ++++++++++ man/man3/pmisetversion.3 | 8 ++++---- man/man3/pmistart.3 | 10 ++++++++++ man/man3/pmiunits.3 | 17 +++++++++++++++++ man/man3/pmiwrite.3 | 12 ++++++++++++ 16 files changed, 178 insertions(+), 4 deletions(-) diff --git a/man/man3/pmiaddinstance.3 b/man/man3/pmiaddinstance.3 index 3c98312e99e..836af75e00d 100644 --- a/man/man3/pmiaddinstance.3 +++ b/man/man3/pmiaddinstance.3 @@ -45,6 +45,16 @@ pmiAddInstance($\fIindom\fP, $\fIinstance\fP, $\fIinst\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiAddInstance(\fIindom\fP, \fIinstance\fP, \fIinstid\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiaddmetric.3 b/man/man3/pmiaddmetric.3 index 6d05e059879..11937790bfb 100644 --- a/man/man3/pmiaddmetric.3 +++ b/man/man3/pmiaddmetric.3 @@ -55,6 +55,23 @@ $\fIunits\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiAddMetric(\fIname\fP, +'in +\w'log.pmiAddMetric('u +\fIpmid\fP, +\fItype\fP, +\fIindom\fP, +\fIsem\fP, +\fIunits\fP) +.in +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiend.3 b/man/man3/pmiend.3 index 50aa51cca72..68ff8c1dc8b 100644 --- a/man/man3/pmiend.3 +++ b/man/man3/pmiend.3 @@ -40,6 +40,16 @@ pmiEnd(); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiEnd() +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmigethandle.3 b/man/man3/pmigethandle.3 index 07f613d1215..fdde6cba0bd 100644 --- a/man/man3/pmigethandle.3 +++ b/man/man3/pmigethandle.3 @@ -40,6 +40,16 @@ $\fIhandle\fP = pmiGetHandle($\fIname\fP, $\fIinstance\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +\fIhandle\fP = log.pmiGetHandle(\fIname\fP, \fIinstance\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiputlabel.3 b/man/man3/pmiputlabel.3 index 396586e692c..309106eb56b 100644 --- a/man/man3/pmiputlabel.3 +++ b/man/man3/pmiputlabel.3 @@ -54,6 +54,22 @@ $\fIvalue\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiPutLabel(\fItype\fP, +'in +\w'log.pmiPutLabel('u +\fIid\fP, +\fIinstance\fP, +\fIname\fP, +\fIvalue\fP) +.in +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiputmark.3 b/man/man3/pmiputmark.3 index 7f82d17470f..c915675c8dc 100644 --- a/man/man3/pmiputmark.3 +++ b/man/man3/pmiputmark.3 @@ -40,6 +40,16 @@ pmiPutMark(); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiPutMark() +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiputresult.3 b/man/man3/pmiputresult.3 index 711a0ce79bf..992ba8e731d 100644 --- a/man/man3/pmiputresult.3 +++ b/man/man3/pmiputresult.3 @@ -34,6 +34,18 @@ cc ... \-lpcp_import \-lpcp .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.put_result(\fIresult\fP) +.br +log.put_highres_result(\fIresult\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiputtext.3 b/man/man3/pmiputtext.3 index 55d3db397be..c65339ed1db 100644 --- a/man/man3/pmiputtext.3 +++ b/man/man3/pmiputtext.3 @@ -45,6 +45,16 @@ pmiPutText($\fItype\fP, $\fIclass\fP, $\fIid\fP, $\fIcontent\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiPutText(\fItype\fP, \fIcls\fP, \fIid\fP, \fIcontent\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiputvalue.3 b/man/man3/pmiputvalue.3 index f16128fdc1a..8c8a596a5a3 100644 --- a/man/man3/pmiputvalue.3 +++ b/man/man3/pmiputvalue.3 @@ -45,6 +45,16 @@ pmiPutValue($\fIname\fP, $\fIinstance\fP, $\fIvalue\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiPutValue(\fIname\fP, \fIinstance\fP, \fIvalue\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiputvaluehandle.3 b/man/man3/pmiputvaluehandle.3 index 8ee087951cc..db2c108df7b 100644 --- a/man/man3/pmiputvaluehandle.3 +++ b/man/man3/pmiputvaluehandle.3 @@ -44,6 +44,16 @@ pmiPutValueHandle($\fIhandle\fP, $\fIvalue\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiPutValueHandle(\fIhandle\fP, \fIvalue\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmisethostname.3 b/man/man3/pmisethostname.3 index a87e98604fb..d161d8c7b22 100644 --- a/man/man3/pmisethostname.3 +++ b/man/man3/pmisethostname.3 @@ -40,6 +40,16 @@ pmiSetHostname($\fIvalue\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiSetHostname(\fIvalue\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmisettimezone.3 b/man/man3/pmisettimezone.3 index 8bf9166e121..88c937d2183 100644 --- a/man/man3/pmisettimezone.3 +++ b/man/man3/pmisettimezone.3 @@ -40,6 +40,16 @@ pmiSetTimezone($\fIvalue\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiSetTimezone(\fIvalue\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmisetversion.3 b/man/man3/pmisetversion.3 index bd2313096d7..7e51655a746 100644 --- a/man/man3/pmisetversion.3 +++ b/man/man3/pmisetversion.3 @@ -16,7 +16,7 @@ .TH PMISETVERSION 3 "" "Performance Co-Pilot" .SH NAME \f3pmiSetVersion\f1 \- set the archive version for a LOGIMPORT archive -.SH C SYNOPSIS +.SH "C SYNOPSIS" .ft 3 .ad l .hy 0 @@ -30,7 +30,7 @@ cc ... \-lpcp_import \-lpcp .hy .ad .ft 1 -.SH PERL SYNOPSIS +.SH "Perl SYNOPSIS" .ft 3 .ad l .hy 0 @@ -40,13 +40,13 @@ pmiSetVersion($\fIvalue\fP); .hy .ad .ft 1 -.SH PYTHON SYNOPSIS +.SH "Python SYNOPSIS" .ft 3 .ad l .hy 0 from pcp import pmi .sp -log = pmi.pmiLogImport(\fIpath\fP).pmiSetVersion(\fIvalue\fP) +log.pmiSetVersion(\fIvalue\fP) .hy .ad .ft 1 diff --git a/man/man3/pmistart.3 b/man/man3/pmistart.3 index df0847780ee..4dbf3cc9a89 100644 --- a/man/man3/pmistart.3 +++ b/man/man3/pmistart.3 @@ -41,6 +41,16 @@ pmiStart($\fIarchive\fP, $\fIflags\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log = pmi.pmiLogImport(\fIarchive\fP, \fIflags\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiunits.3 b/man/man3/pmiunits.3 index 0e1ea38b084..ee5bb768ae7 100644 --- a/man/man3/pmiunits.3 +++ b/man/man3/pmiunits.3 @@ -88,6 +88,23 @@ $\fIextraScale\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +\fIpmid\fP = pmi.pmiLogImport.pmiID(\fIdomain\fP, \fIcluster\fP, \fIitem\fP) +.br +\fIindom\fP = pmi.pmiLogImport.pmiInDom(\fIdomain\fP, \fIserial\fP) +.br +\fIunits\fP = pmi.pmiLogImport.pmiUnits(\fIdim_space\fP, \fIdim_time\fP, \fIdim_count\fP, +'in +\w'pmi.pmiLogImport.pmiUnits('u +\fIscale_space\fP, \fIscale_time\fP, \fIscale_count\fP) +.in +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), diff --git a/man/man3/pmiwrite.3 b/man/man3/pmiwrite.3 index 8affe41c24d..ee5b9193344 100644 --- a/man/man3/pmiwrite.3 +++ b/man/man3/pmiwrite.3 @@ -47,6 +47,18 @@ pmiWrite($\fIsec\fP, $\fIusec\fP); .hy .ad .ft 1 +.SH "Python SYNOPSIS" +.ft 3 +.ad l +.hy 0 +from pcp import pmi +.sp +log.pmiWrite(\fIsec\fP, \fIusec\fP) +.br +log.pmiHighResWrite(\fIsec\fP, \fInsec\fP) +.hy +.ad +.ft 1 .SH DESCRIPTION As part of the Performance Co-Pilot Log Import API (see .BR LOGIMPORT (3)), From e0014ef6f728945828d91b8efea62f2faeedfe92 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 4 Jun 2026 11:04:27 +1000 Subject: [PATCH 06/15] pcp.pmi: add type annotations to pmiLogImport API Annotate all method signatures in the pmiLogImport class with PEP 484 type hints, compatible with the project's Python 3.6 minimum. Return types reflect actual Python-level values (int status, pmID, pmInDom, pmUnits, None). String parameters are annotated as str since bytes encoding is an internal detail. pmiPutValue/pmiGetHandle inst parameters are Optional[str] to reflect the None-for-singular-metric convention. pmiWrite sec is Union[int, float, datetime] matching its three-way dispatch. Imports Optional and Union from typing. Co-Authored-By: Claude Sonnet 4.6 (1M context) Signed-off-by: Nathan Scott --- src/python/pcp/pmi.py | 54 +++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/src/python/pcp/pmi.py b/src/python/pcp/pmi.py index 7b884c6e509..d970d58fbeb 100644 --- a/src/python/pcp/pmi.py +++ b/src/python/pcp/pmi.py @@ -55,6 +55,7 @@ from ctypes.util import find_library from datetime import datetime, timedelta, tzinfo from math import modf +from typing import Optional, Union # Performance Co-Pilot PMI library (C) LIBPCP_IMPORT = CDLL(find_library("pcp_import")) @@ -200,10 +201,10 @@ class pmiLogImport(object): ## # property read methods - def read_path(self): + def read_path(self) -> bytes: """ Property for archive path """ return self._path - def read_ctx(self): + def read_ctx(self) -> int: """ Property for log import context """ return self._ctx @@ -216,7 +217,7 @@ def read_ctx(self): ## # overloads - def __init__(self, path, inherit=0): + def __init__(self, path: Union[str, bytes], inherit: int = 0) -> None: if not isinstance(path, bytes): path = path.encode('utf-8') self._path = path # the archive path (file name) @@ -234,7 +235,7 @@ def __del__(self): ## # PMI Log Import Services - def pmiSetHostname(self, hostname): + def pmiSetHostname(self, hostname: str) -> int: """PMI - set the source host name for a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -246,7 +247,7 @@ def pmiSetHostname(self, hostname): raise pmiErr(status) return status - def pmiSetTimezone(self, timezone): + def pmiSetTimezone(self, timezone: str) -> int: """PMI - set the source timezone for a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) @@ -259,7 +260,7 @@ def pmiSetTimezone(self, timezone): raise pmiErr(status) return status - def pmiSetVersion(self, version): + def pmiSetVersion(self, version: int) -> int: """PMI - set the output archive version (2 or 3) """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) @@ -273,28 +274,29 @@ def pmiSetVersion(self, version): return status @staticmethod - def pmiID(domain, cluster, item): + def pmiID(domain: int, cluster: int, item: int) -> pmID: """PMI - construct a pmID data structure (helper routine) """ return LIBPCP_IMPORT.pmiID(domain, cluster, item) @staticmethod - def pmiCluster(domain, cluster): + def pmiCluster(domain: int, cluster: int) -> pmID: """PMI - construct a pmID data structure (helper routine) """ return LIBPCP_IMPORT.pmiCluster(domain, cluster) @staticmethod - def pmiInDom(domain, serial): + def pmiInDom(domain: int, serial: int) -> pmInDom: """PMI - construct a pmInDom data structure (helper routine) """ return LIBPCP_IMPORT.pmiInDom(domain, serial) @staticmethod - def pmiUnits(dim_space, dim_time, dim_count, - scale_space, scale_time, scale_count): + def pmiUnits(dim_space: int, dim_time: int, dim_count: int, + scale_space: int, scale_time: int, scale_count: int) -> pmUnits: """PMI - construct a pmiUnits data structure (helper routine) """ return LIBPCP_IMPORT.pmiUnits(dim_space, dim_time, dim_count, scale_space, scale_time, scale_count) - def pmiAddMetric(self, name, pmid, typed, indom, sem, units): + def pmiAddMetric(self, name: str, pmid: pmID, typed: int, + indom: pmInDom, sem: int, units: pmUnits) -> int: """PMI - add a new metric definition to a Log Import context """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -307,7 +309,7 @@ def pmiAddMetric(self, name, pmid, typed, indom, sem, units): raise pmiErr(status) return status - def pmiAddInstance(self, indom, instance, instid): + def pmiAddInstance(self, indom: pmInDom, instance: str, instid: int) -> int: """PMI - add element to an instance domain in a Log Import context """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -319,7 +321,7 @@ def pmiAddInstance(self, indom, instance, instid): raise pmiErr(status) return status - def pmiPutValue(self, name, inst, value): + def pmiPutValue(self, name: str, inst: Optional[str], value: str) -> int: """PMI - add a value for a metric-instance pair """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -339,7 +341,7 @@ def pmiPutValue(self, name, inst, value): raise pmiErr(status) return status - def pmiGetHandle(self, name, inst): + def pmiGetHandle(self, name: str, inst: Optional[str]) -> int: """PMI - define a handle for a metric-instance pair """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -356,7 +358,7 @@ def pmiGetHandle(self, name, inst): raise pmiErr(status) return status - def pmiPutValueHandle(self, handle, value): + def pmiPutValueHandle(self, handle: int, value: str) -> int: """PMI - add a value for a metric-instance pair via a handle """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -368,7 +370,7 @@ def pmiPutValueHandle(self, handle, value): raise pmiErr(status) return status - def pmiHighResWrite(self, sec, nsec): + def pmiHighResWrite(self, sec: int, nsec: int) -> int: """PMI - flush data to a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -378,7 +380,8 @@ def pmiHighResWrite(self, sec, nsec): raise pmiErr(status) return status - def pmiWrite(self, sec, usec=None): + def pmiWrite(self, sec: Union[int, float, datetime], + usec: Optional[int] = None) -> int: """PMI - flush data to a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -397,7 +400,7 @@ def pmiWrite(self, sec, usec=None): raise pmiErr(status) return status - def pmiPutMark(self): + def pmiPutMark(self) -> int: """PMI - write a record to a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -407,7 +410,7 @@ def pmiPutMark(self): raise pmiErr(status) return status - def put_result(self, result): + def put_result(self, result: pmResult_v2) -> int: """PMI - add a data record to a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -417,7 +420,7 @@ def put_result(self, result): raise pmiErr(status) return status - def put_highres_result(self, result): + def put_highres_result(self, result: pmResult) -> int: """PMI - add a data record to a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -427,7 +430,7 @@ def put_highres_result(self, result): raise pmiErr(status) return status - def pmiPutText(self, typ, cls, ident, content): + def pmiPutText(self, typ: int, cls: int, ident: int, content: str) -> int: """PMI - add a text record to a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -439,7 +442,8 @@ def pmiPutText(self, typ, cls, ident, content): raise pmiErr(status) return status - def pmiPutLabel(self, typ, ident, inst, name, content): + def pmiPutLabel(self, typ: int, ident: int, inst: int, + name: str, content: str) -> int: """PMI - add a label record to a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: @@ -454,11 +458,11 @@ def pmiPutLabel(self, typ, ident, inst, name, content): return status @staticmethod - def pmiDump(): + def pmiDump() -> None: """PMI - dump the current Log Import contexts (diagnostic) """ LIBPCP_IMPORT.pmiDump() - def pmiEnd(self): + def pmiEnd(self) -> int: """PMI - close current context and finish a Log Import archive """ status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: From af52c92d0181a3fa86b3a5db7f060bc69f2be19f Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 4 Jun 2026 13:01:20 +1000 Subject: [PATCH 07/15] qa: makefile cleanups, removing unneeded macros --- qa/src/GNUlocaldefs | 61 ++++++++------------------------------------- 1 file changed, 11 insertions(+), 50 deletions(-) diff --git a/qa/src/GNUlocaldefs b/qa/src/GNUlocaldefs index 38a0956219f..903e1dba8ac 100644 --- a/qa/src/GNUlocaldefs +++ b/qa/src/GNUlocaldefs @@ -1,5 +1,5 @@ # -# Copyright (c) 2012-2021 Red Hat. +# Copyright (c) 2012-2026 Red Hat. # Copyright (c) 2009 Aconex. All Rights Reserved. # Copyright (c) 1997-2002 Silicon Graphics, Inc. All Rights Reserved. # @@ -36,7 +36,8 @@ CFILES = disk_test.c exercise.c context_test.c chkoptfetch.c \ mmv2_genstats.c mmv2_instances.c mmv2_nostats.c mmv2_simple.c \ mmv3_simple.c mmv3_labels.c mmv3_bad_labels.c mmv3_nostats.c mmv3_genstats.c \ record.c record-setarg.c clientid.c grind_ctx.c \ - pmdacache.c check_import.c unpack.c hrunpack.c aggrstore.c atomstr.c \ + check_import_append.c check_import_name.c check_import.c \ + pmdacache.c unpack.c hrunpack.c aggrstore.c atomstr.c \ semstr.c grind_conv.c getconfig.c err.c torture_logmeta.c keycache.c \ keycache2.c pmdaqueue.c drain-server.c template.c anon-sa.c \ username.c rtimetest.c getcontexthost.c badpmda.c chklogputresult.c \ @@ -56,7 +57,13 @@ CFILES = disk_test.c exercise.c context_test.c chkoptfetch.c \ throttle.c throttle_timeout.c y2038.c bigpmcdpmids.c pdu-gadget.c \ strnfoo.c mmv_ondisk.c newcontext.c api_abi.c interp_bug3.c \ pmsetmode.c scanindex.c localtime.c httpcache.c unregister.c \ - genpmns.c undelta.c series_time_parse_test.c derived_control.c + genpmns.c undelta.c series_time_parse_test.c derived_control.c \ + multithread0.c multithread1.c multithread2.c multithread3.c \ + multithread4.c multithread5.c multithread6.c multithread7.c \ + multithread8.c multithread9.c multithread10.c multithread11.c \ + multithread12.c multithread13.c multithread14.c \ + exerlock.c hashwalk.c parsehostattrs.c parsehostspec.c getoptions.c + ifeq ($(shell test -f ../localconfig && echo 1), 1) include ../localconfig @@ -68,53 +75,7 @@ $(error Cannot make qa/localconfig) endif endif -ifeq ($(shell test $(PCP_VER) -ge 3600 && echo 1), 1) -CFILES += multithread0.c multithread1.c multithread2.c multithread3.c \ - multithread4.c multithread5.c multithread6.c multithread7.c \ - multithread8.c multithread9.c multithread10.c multithread11.c \ - multithread12.c multithread13.c multithread14.c \ - exerlock.c -else -MYFILES += multithread0.c multithread1.c multithread2.c multithread3.c \ - multithread4.c multithread5.c multithread6.c multithread7.c \ - multithread8.c multithread9.c multithread10.c multithread11.c \ - multithread12.c multithread13.c multithread14.c \ - exerlock.c -LDIRT += multithread0 multithread1 multithread2 multithread3 \ - multithread4 multithread5 multithread6 multithread7 \ - multithread8 multithread9 multithread10 multithread11 \ - multithread12 multithread13 multithread14 \ - exerlock -endif - -ifeq ($(shell test $(PCP_VER) -ge 3700 && echo 1), 1) -CFILES += hashwalk.c -else -MYFILES += hashwalk.c -LDIRT += hashwalk -endif - -ifeq ($(shell test $(PCP_VER) -ge 3800 && echo 1), 1) -CFILES += parsehostattrs.c parsehostspec.c check_import_name.c -else -MYFILES += parsehostattrs.c parsehostspec.c check_import_name.c -LDIRT += parsehostattrs parsehostspec check_import_name -endif - -ifeq ($(shell test $(PCP_VER) -ge 3802 && echo 1), 1) -POSIXFILES += chkacc4.c -else -MYFILES += chkacc4.c -LDIRT += chkacc4 -endif - -ifeq ($(shell test $(PCP_VER) -ge 3901 && echo 1), 1) -CFILES += getoptions.c XTRATARGETS += getoptions_v2 -else -MYFILES += getoptions.c -LDIRT += getoptions getoptions_v2 -endif ifeq ($(shell test -f /usr/include/pcp/fault.h && echo 1), 1) # only make these ones if the fault injection version of libpcp @@ -142,7 +103,7 @@ endif # POSIXFILES = \ ipc.c proc_test.c context_fd_leak.c arch_maxfd.c torture_trace.c \ - 779246.c killparent.c fetchloop.c chain.c spawn.c + 779246.c killparent.c fetchloop.c chain.c spawn.c chkacc4.c TRACEFILES = \ obs.c tstate.c tabort.c From 90d2c1846eae89616214e8b16eec9a795e5bd51e Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 4 Jun 2026 16:31:19 +1000 Subject: [PATCH 08/15] libpcp_import: address coderabbit review findings pmiPutAtomValueHandle: validate atom is non-NULL before passing to _pmi_stuff_atomvalue, returning PM_ERR_ARG to avoid a segfault on PM_TYPE_STRING metrics where atom->cp would be dereferenced. archive.c _pmi_do_desc: when a descriptor for this PMID already exists in the archive, verify it is compatible before skipping the write. A package upgrade may have corrected an incorrect type, semantics, instance domain or units for a metric, in which case the old archive cannot be extended with new data. Return PM_ERR_LOGCHANGETYPE, PM_ERR_LOGCHANGESEM, PM_ERR_LOGCHANGEINDOM or PM_ERR_LOGCHANGEUNITS as appropriate so the caller has a precise diagnosis. qa/group: add local group to qa/1670 so the standard local sweep picks up the new append-mode coverage. Signed-off-by: Nathan Scott Co-Authored-By: Claude Sonnet 4.6 (1M context) --- man/man3/pmistart.3 | 16 ++++++++++++++++ src/libpcp_import/src/archive.c | 17 ++++++++++++++--- src/libpcp_import/src/import.c | 13 +++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/man/man3/pmistart.3 b/man/man3/pmistart.3 index 4dbf3cc9a89..79bb69e3525 100644 --- a/man/man3/pmistart.3 +++ b/man/man3/pmistart.3 @@ -146,6 +146,22 @@ If the archive files do not yet exist, .B PMI_APPEND behaves identically to creating a new archive (no flags). .PP +.B PMI_APPEND +and +.B PMI_INHERIT +may be used together. +The inherited metric and instance-domain definitions are carried into +the new context, and when the archive is opened on the first +.BR pmiWrite (3) +call, each inherited descriptor is checked against what is already +on disk: compatible descriptors are silently skipped (no duplicate +written); incompatible ones are rejected with an appropriate error +(e.g. +.BR PM_ERR_LOGCHANGETYPE ). +When the previous context was writing to the same archive, every +inherited descriptor already exists on disk so the combination is +effectively a no-op beyond convenience. +.PP If .I flags is zero, or neither diff --git a/src/libpcp_import/src/archive.c b/src/libpcp_import/src/archive.c index b4a431c73fb..bb70279a475 100644 --- a/src/libpcp_import/src/archive.c +++ b/src/libpcp_import/src/archive.c @@ -195,11 +195,22 @@ check_metric(pmi_context *current, pmID pmid, int *needti) /* * If the archive was opened for appending, __pmLogLoadMeta() will * have populated hashpmid with all descriptors already on disk. - * Skip re-writing a descriptor that is already there — metric - * descriptors are immutable, so there is no need for duplicates - * that would cause .meta to grow on every short-lived invocation. + * Skip re-writing a descriptor that is already there, but first + * verify it is compatible with the registered metric — e.g. a + * package upgrade may have corrected a metric's type, semantics, + * instance domain or units, in which case the old archive cannot + * be extended with the new data. */ if (__pmLogLookupDesc(acp, pmid, &existing) == 0) { + if (existing.type != current->metric[m].desc.type) + return PM_ERR_LOGCHANGETYPE; + if (existing.sem != current->metric[m].desc.sem) + return PM_ERR_LOGCHANGESEM; + if (existing.indom != current->metric[m].desc.indom) + return PM_ERR_LOGCHANGEINDOM; + if (memcmp(&existing.units, ¤t->metric[m].desc.units, + sizeof(existing.units)) != 0) + return PM_ERR_LOGCHANGEUNITS; current->metric[m].meta_done = 1; } else { diff --git a/src/libpcp_import/src/import.c b/src/libpcp_import/src/import.c index 457141ed587..4b8978fa0e3 100644 --- a/src/libpcp_import/src/import.c +++ b/src/libpcp_import/src/import.c @@ -351,6 +351,17 @@ pmiStart(const char *archive, int flags) memset((void *)¤t->logctl, 0, sizeof(current->logctl)); memset((void *)¤t->archctl, 0, sizeof(current->archctl)); __pmLogWriterInit(¤t->archctl, ¤t->logctl); + /* + * PMI_APPEND and PMI_INHERIT may be used together: the inherited + * metric and indom definitions are carried into the new context, and + * when the append archive is opened on the first pmiWrite() call, + * each inherited descriptor is checked against what is already on + * disk. Compatible descriptors are silently skipped (no duplicate + * written); incompatible ones are rejected with PM_ERR_LOGCHANGE*. + * In the common case -- inheriting from a context that was writing + * to the same archive -- every inherited descriptor already exists + * and the combination is effectively a no-op beyond convenience. + */ if ((flags & PMI_INHERIT) && old_current != NULL) { current->nmetric = old_current->nmetric; if (old_current->metric != NULL) { @@ -895,6 +906,8 @@ pmiPutAtomValueHandle(int handle, pmAtomValue *atom) return PM_ERR_NOCONTEXT; if (handle <= 0 || handle > current->nhandle) return current->last_sts = PMI_ERR_BADHANDLE; + if (atom == NULL) + return current->last_sts = PM_ERR_ARG; return current->last_sts = _pmi_stuff_atomvalue(current, ¤t->handle[handle-1], atom); } From 63b681aeeb4bed12861309b55db5aa9f96d943bc Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 4 Jun 2026 17:10:59 +1000 Subject: [PATCH 09/15] pcp.pmi: fix pmiWrite when sec=0 and usec is omitted The condition 'if sec and not usec' fails when sec==0 because 0 is falsy, leaving usec as None and causing pmiWrite2(0, None) to raise TypeError against its c_int argtypes. Change to 'if usec is None' so the datetime/float dispatch and the usec=0 fallback always run when usec was not supplied by the caller. Add a pmiWrite(0) call at the start of qa/src/test_pmi.python to cover this path, and update qa/708.out accordingly. Signed-off-by: Nathan Scott Co-Authored-By: Claude Sonnet 4.6 (1M context) --- qa/708.out | 3 ++- qa/src/test_pmi.python | 6 ++++++ src/python/pcp/pmi.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qa/708.out b/qa/708.out index e13993394dd..800a0c54242 100644 --- a/qa/708.out +++ b/qa/708.out @@ -5,6 +5,7 @@ pmiSetTimezone: UTC pmid 251.1.1 units pmiAddMetric: qa.one +pmiPutValue: qa.one (epoch) pmiPutValue: qa.one pmid 251.1.2 indom 251.3 @@ -26,7 +27,7 @@ Note: timezone set to local timezone of host "fu.bar.com" from archive qa.one Data Type: 32-bit unsigned int InDom: PM_INDOM_NULL 0x........ Semantics: discrete Units: none - value 42 + value 1 qa.two Data Type: float InDom: 251.3 0x........ diff --git a/qa/src/test_pmi.python b/qa/src/test_pmi.python index cf76af03972..7cd16ac591d 100755 --- a/qa/src/test_pmi.python +++ b/qa/src/test_pmi.python @@ -52,6 +52,12 @@ def test_pmi(self, path = OUTFILE, inherit = 0): print("pmiAddMetric: qa.one") self.assertTrue(code >= 0) + # exercise pmiWrite(0) - sec=0 with no usec previously raised TypeError + code = log.pmiPutValue("qa.one", "", "1") + print("pmiPutValue: qa.one (epoch)") + self.assertTrue(code >= 0) + log.pmiWrite(0) + # give it a value code = log.pmiPutValue("qa.one", "", "42") print("pmiPutValue: qa.one") diff --git a/src/python/pcp/pmi.py b/src/python/pcp/pmi.py index d970d58fbeb..ab6173d85cd 100644 --- a/src/python/pcp/pmi.py +++ b/src/python/pcp/pmi.py @@ -386,7 +386,7 @@ def pmiWrite(self, sec: Union[int, float, datetime], status = LIBPCP_IMPORT.pmiUseContext(self._ctx) if status < 0: raise pmiErr(status) - if sec and not usec: + if usec is None: if isinstance(sec, datetime): sec = float((sec - self._epoch).total_seconds()) if isinstance(sec, float): From d8a186ab6be04b793db158c6c2643355b486996c Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Wed, 17 Jun 2026 14:08:06 +1000 Subject: [PATCH 10/15] libpcp_import: add pmiSetVolumeSize() for automatic data volume rotation Add pmiSetVolumeSize(size_t max_bytes, void (*on_rotate)(const char *)) to libpcp_import. After each successful pmiHighResWrite() or pmiWrite() call, if the current data volume file size meets or exceeds max_bytes the library closes the current volume, opens the next numbered volume (writing a new label), and invokes the caller's callback with the path of the just-closed volume so compression or other post-processing can be arranged. Passing max_bytes=0 disables rotation (the default). Guard: pmiSetVolumeSize() rejects a threshold at or below the on-disk label size for the configured archive version. Accepting a sub-label threshold would cause a rotation cascade since every new volume's label immediately exceeds the threshold. The check uses the public pmapi.h field-width constants to avoid a dependency on the file-static __pmLabel_v2/v3 types. Also: replace the magic number 100000 in _pmi_put_result() with the named constant PMI_FLUSH_INTERVAL throughout archive.c. Also: pair consecutive int fields in pmi_context (private.h) to eliminate four bytes of alignment padding before each pointer on 64-bit platforms. The struct is private to libpcp_import so there is no ABI constraint. QA: check_volsize.c exercises rotation, callback, size-bound and label-size guard; wired into qa/1693 (the existing PMI_APPEND test) with a pmlogcheck step to verify multi-volume archive integrity. Signed-off-by: Nathan Scott --- man/man3/pmisetvolumesize.3 | 124 ++++++++++++++++++++++++++ qa/1693 | 8 ++ qa/1693.out | 19 ++++ qa/src/.gitignore | 1 + qa/src/GNUlocaldefs | 6 +- qa/src/check_volsize.c | 148 ++++++++++++++++++++++++++++++++ src/include/pcp/import.h | 1 + src/libpcp_import/src/archive.c | 39 ++++++++- src/libpcp_import/src/exports | 1 + src/libpcp_import/src/import.c | 37 ++++++++ src/libpcp_import/src/private.h | 13 ++- 11 files changed, 390 insertions(+), 7 deletions(-) create mode 100644 man/man3/pmisetvolumesize.3 create mode 100644 qa/src/check_volsize.c diff --git a/man/man3/pmisetvolumesize.3 b/man/man3/pmisetvolumesize.3 new file mode 100644 index 00000000000..471af7c67c2 --- /dev/null +++ b/man/man3/pmisetvolumesize.3 @@ -0,0 +1,124 @@ +'\"macro stdmacro +.\" +.\" Copyright (c) 2026 Red Hat. +.\" +.\" 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 2 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. +.\" +.\" +.TH PMISETVOLUMESIZE 3 "" "Performance Co-Pilot" +.SH NAME +\f3pmiSetVolumeSize\f1 \- configure automatic data volume rotation for a LOGIMPORT archive +.SH "C SYNOPSIS" +.ft 3 +.ad l +.hy 0 +#include +.br +#include +.sp +int pmiSetVolumeSize(size_t \fImax_bytes\fP, void (*\fIon_rotate\fP)(const char *)); +.sp +cc ... \-lpcp_import \-lpcp +.hy +.ad +.ft 1 +.SH DESCRIPTION +As part of the Performance Co-Pilot Log Import API (see +.BR LOGIMPORT (3)), +.B pmiSetVolumeSize +configures automatic data volume rotation for the archive associated +with the current context. +.PP +After each successful call to +.BR pmiHighResWrite (3) +or +.BR pmiWrite (3), +if the current data volume file size meets or exceeds +.IR max_bytes , +the library closes the current data volume, opens the next numbered +volume, and writes a new volume label. +Volume files are named +.IB archive .0 , +.IB archive .1 , +and so on, where +.I archive +is the base path given to +.BR pmiStart (3). +The +.I .meta +and +.I .index +files are shared across all volumes and remain open throughout. +.PP +If +.I on_rotate +is not NULL, it is called immediately after the old volume is closed +and before the function returns. +The single argument is the full path of the just-closed volume file +(e.g.\& +.IR /var/log/sa/pcp16/pcp16.0 ). +The caller may use this callback to compress the completed volume or +perform any other post-rotation work. +The callback is invoked synchronously; long-running operations should +be deferred to a child process. +.PP +Passing +.I max_bytes +as zero disables volume rotation (the default). +.PP +.B pmiSetVolumeSize +interacts with the existing +.B PCP_LOGIMPORT_MAXLOGSZ +environment variable: both mechanisms trigger +.BR newvolume () +independently, so if both are active the smaller threshold governs. +.SH EXAMPLE +The following fragment opens a PCP archive, configures 100\ MB +volume rotation, and compresses each completed volume: +.PP +.nf +.ft 3 +static void +on_vol(const char *path) +{ + char cmd[MAXPATHLEN + 32]; + pmsprintf(cmd, sizeof(cmd), "xz %s &", path); + system(cmd); +} + +pmiStart("/var/log/sa/pcp16/pcp16", 0); +pmiSetVolumeSize(100 * 1024 * 1024, on_vol); +.ft 1 +.fi +.SH DIAGNOSTICS +.B pmiSetVolumeSize +returns zero on success. +If there is no current context, +.B PM_ERR_NOCONTEXT +is returned. +If +.I max_bytes +is greater than zero but does not exceed the on-disk label size for the +configured archive version (124 bytes for v2, 800 bytes for v3), +.B PM_ERR_CONV +is returned. +A threshold at or below the label size would cause the new volume's label +to immediately exceed the threshold on every write, triggering a +rotation cascade. +.SH SEE ALSO +.BR LOGIMPORT (3), +.BR pmiEnd (3), +.BR pmiErrStr (3), +.BR pmiHighResWrite (3), +.BR pmiStart (3), +.BR pmiWrite (3) +and +.BR pmlogcheck (1). diff --git a/qa/1693 b/qa/1693 index 558fde099aa..9f79aff8134 100755 --- a/qa/1693 +++ b/qa/1693 @@ -44,5 +44,13 @@ echo echo "=== fallback archive created ===" pmlogcheck appendnew +echo +echo "=== Phase 4: pmiSetVolumeSize ===" +$here/src/check_volsize 2>&1 + +echo +echo "=== multi-volume archive integrity ===" +pmlogcheck volsizetest + # success, all done exit diff --git a/qa/1693.out b/qa/1693.out index 427e42ac99b..804541c1054 100644 --- a/qa/1693.out +++ b/qa/1693.out @@ -43,3 +43,22 @@ TIMESTAMP 0 922 960 TIMESTAMP 0 922 1112 === fallback archive created === + +=== Phase 4: pmiSetVolumeSize === +pmiStart: OK ->1 +pmiSetHostname: OK +pmiSetTimezone: OK +pmiAddMetric: OK +pmiGetHandle: OK ->1 +pmiSetVolumeSize: OK +pmiHighResWrite loop: OK +pmiEnd: OK +volume rotation: OK +volsizetest.0: present +volsizetest.1: present +volume size bound: OK +callback path: OK +label size guard: OK +pmiSetVolumeSize(0) disable: OK + +=== multi-volume archive integrity === diff --git a/qa/src/.gitignore b/qa/src/.gitignore index b7561d8d3a1..4382406cc82 100644 --- a/qa/src/.gitignore +++ b/qa/src/.gitignore @@ -35,6 +35,7 @@ check_import_name check_import.pl check_pmiend_fdleak check_pmi_errconv +check_volsize checkstructs chkacc1 chkacc2 diff --git a/qa/src/GNUlocaldefs b/qa/src/GNUlocaldefs index 903e1dba8ac..033d4b7082b 100644 --- a/qa/src/GNUlocaldefs +++ b/qa/src/GNUlocaldefs @@ -36,7 +36,7 @@ CFILES = disk_test.c exercise.c context_test.c chkoptfetch.c \ mmv2_genstats.c mmv2_instances.c mmv2_nostats.c mmv2_simple.c \ mmv3_simple.c mmv3_labels.c mmv3_bad_labels.c mmv3_nostats.c mmv3_genstats.c \ record.c record-setarg.c clientid.c grind_ctx.c \ - check_import_append.c check_import_name.c check_import.c \ + check_import_append.c check_import_name.c check_import.c check_volsize.c \ pmdacache.c unpack.c hrunpack.c aggrstore.c atomstr.c \ semstr.c grind_conv.c getconfig.c err.c torture_logmeta.c keycache.c \ keycache2.c pmdaqueue.c drain-server.c template.c anon-sa.c \ @@ -1407,6 +1407,10 @@ check_import_append: check_import_append.c rm -f $@ $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import +check_volsize: check_volsize.c + rm -f $@ + $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import + check_pmiend_fdleak: check_pmiend_fdleak.c rm -f $@ $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import diff --git a/qa/src/check_volsize.c b/qa/src/check_volsize.c new file mode 100644 index 00000000000..6600afcf2e6 --- /dev/null +++ b/qa/src/check_volsize.c @@ -0,0 +1,148 @@ +/* + * Exercise pmiSetVolumeSize() - write enough records to trigger at least + * one volume rotation, verify the callback fires with the correct path, + * and confirm that pmiSetVolumeSize rejects a threshold at or below the + * archive label size. + * + * The test is written to produce deterministic pass/fail output regardless + * of the exact rotation count (which depends on internal record sizes that + * may vary between PCP versions). pmlogcheck in the QA shell script is + * the authoritative check for multi-volume archive integrity. + * + * Copyright (c) 2026 Red Hat. All Rights Reserved. + */ + +#include +#include +#include +#include +#include +#include + +static int rotate_count; +static char first_rotated[MAXPATHLEN]; + +static void +on_rotate(const char *vol_path) +{ + rotate_count++; + if (rotate_count == 1) + strncpy(first_rotated, vol_path, sizeof(first_rotated) - 1); + /* callbacks are not printed — rotation count is non-deterministic */ +} + +static void +check(int sts, const char *name) +{ + if (sts < 0) + fprintf(stderr, "%s: Error: %s\n", name, pmiErrStr(sts)); + else { + fprintf(stderr, "%s: OK", name); + if (sts != 0) fprintf(stderr, " ->%d", sts); + fputc('\n', stderr); + } +} + +int +main(int argc, char **argv) +{ + int sts; + int ctx; + int i; + int handle; + struct stat st; + /* + * Threshold must exceed the archive label size (v2=124, v3=800). + * 1500 bytes produces several rotations across 50 writes of a u32 + * counter without being so small that every write rotates. + */ + size_t threshold = 1500; + + pmSetProgname(argv[0]); + + /* === Phase 1: basic volume rotation === */ + ctx = pmiStart("volsizetest", 0); + check(ctx, "pmiStart"); + + sts = pmiSetHostname("testhost.example.com"); + check(sts, "pmiSetHostname"); + + sts = pmiSetTimezone("UTC"); + check(sts, "pmiSetTimezone"); + + sts = pmiAddMetric("qa.volsize.counter", + PM_ID_NULL, PM_TYPE_U32, PM_INDOM_NULL, + PM_SEM_COUNTER, pmiUnits(0, 0, 0, 0, 0, 0)); + check(sts, "pmiAddMetric"); + + handle = pmiGetHandle("qa.volsize.counter", NULL); + check(handle, "pmiGetHandle"); + + sts = pmiSetVolumeSize(threshold, on_rotate); + check(sts, "pmiSetVolumeSize"); + + for (i = 1; i <= 50; i++) { + pmAtomValue av; + + av.ul = (unsigned int)i; + sts = pmiPutAtomValueHandle(handle, &av); + if (sts < 0) { check(sts, "pmiPutAtomValueHandle"); break; } + sts = pmiHighResWrite((int64_t)i * 10, 0); + if (sts < 0) { check(sts, "pmiHighResWrite"); break; } + } + check(0, "pmiHighResWrite loop"); + + sts = pmiEnd(); + check(sts, "pmiEnd"); + + if (rotate_count == 0) { + fprintf(stderr, "FAIL: no volume rotation triggered\n"); + exit(1); + } + fprintf(stderr, "volume rotation: OK\n"); + + if (stat("volsizetest.0", &st) != 0) { + fprintf(stderr, "FAIL: volsizetest.0 not found\n"); + exit(1); + } + fprintf(stderr, "volsizetest.0: present\n"); + + if (stat("volsizetest.1", &st) != 0) { + fprintf(stderr, "FAIL: volsizetest.1 not found\n"); + exit(1); + } + fprintf(stderr, "volsizetest.1: present\n"); + + /* Each completed volume must not grossly exceed the threshold */ + if ((size_t)st.st_size > threshold * 3) { + fprintf(stderr, "FAIL: volume size %lld far exceeds threshold %zu\n", + (long long)st.st_size, threshold); + exit(1); + } + fprintf(stderr, "volume size bound: OK\n"); + + if (strstr(first_rotated, "volsizetest.0") == NULL) { + fprintf(stderr, "FAIL: first callback path '%s' missing 'volsizetest.0'\n", + first_rotated); + exit(1); + } + fprintf(stderr, "callback path: OK\n"); + + /* === Phase 2: label-size guard — threshold at/below label must fail === */ + ctx = pmiStart("guardtest", 0); + if (ctx < 0) { check(ctx, "pmiStart (guard)"); exit(1); } + + sts = pmiSetVolumeSize(1, on_rotate); + if (sts >= 0) { + fprintf(stderr, "FAIL: pmiSetVolumeSize(1) should have failed\n"); + exit(1); + } + fprintf(stderr, "label size guard: OK\n"); + + sts = pmiSetVolumeSize(0, NULL); + check(sts, "pmiSetVolumeSize(0) disable"); + + pmiEnd(); + + exit(0); +} diff --git a/src/include/pcp/import.h b/src/include/pcp/import.h index ba10ef05168..33d026487d9 100644 --- a/src/include/pcp/import.h +++ b/src/include/pcp/import.h @@ -40,6 +40,7 @@ PMI_CALL extern int pmiEnd(void); PMI_CALL extern int pmiSetHostname(const char *); PMI_CALL extern int pmiSetTimezone(const char *); PMI_CALL extern int pmiSetVersion(int); +PMI_CALL extern int pmiSetVolumeSize(size_t, void (*)(const char *)); PMI_CALL extern int pmiAddMetric(const char *, pmID, int, pmInDom, int, pmUnits); PMI_CALL extern int pmiAddInstance(pmInDom, const char *, int); PMI_CALL extern int pmiPutValue(const char *, const char *, const char *); diff --git a/src/libpcp_import/src/archive.c b/src/libpcp_import/src/archive.c index bb70279a475..769fe9073e4 100644 --- a/src/libpcp_import/src/archive.c +++ b/src/libpcp_import/src/archive.c @@ -254,7 +254,14 @@ newvolume(pmi_context *current) __pmFflush(acp->ac_mfp); } -static off_t flushsize = 100000; +/* + * Approximate byte interval between temporal index entries within a + * data volume. Smaller values improve seek performance at the cost + * of a slightly larger index; 100000 bytes is the historical default. + */ +#define PMI_FLUSH_INTERVAL ((off_t)100000) + +static off_t flushsize = PMI_FLUSH_INTERVAL; int _pmi_put_result(pmi_context *current, __pmResult *result) @@ -312,7 +319,7 @@ _pmi_put_result(pmi_context *current, __pmResult *result) off = __pmFtell(acp->ac_mfp) + ((__pmPDUHdr *)pb)->len - sizeof(__pmPDUHdr) + 2*sizeof(int); if (off >= max_logsz) { newvolume(current); - flushsize = 100000; + flushsize = PMI_FLUSH_INTERVAL; needti = 1; } @@ -328,7 +335,7 @@ _pmi_put_result(pmi_context *current, __pmResult *result) __pmLogPutIndex(acp, &stamp); /* and restore metadata seek pointer */ __pmFseek(lcp->mdfp, new_meta_offset, SEEK_SET); - flushsize = __pmFtell(acp->ac_mfp) + 100000; + flushsize = __pmFtell(acp->ac_mfp) + PMI_FLUSH_INTERVAL; } sts = current->version >= PM_LOG_VERS03 ? @@ -338,6 +345,32 @@ _pmi_put_result(pmi_context *current, __pmResult *result) if (sts < 0) return sts; + + /* + * User-API volume rotation: if pmiSetVolumeSize() was called, check + * the current data volume size after each successful write. When the + * threshold is reached, rotate to the next volume and invoke the + * caller's callback with the path of the just-closed volume so it can + * arrange compression or other post-processing. + * + * This is deliberately checked *after* the write so the completed + * volume contains a full, consistent record set. + */ + if (current->max_volume_bytes > 0 && + (size_t)__pmFtell(acp->ac_mfp) >= current->max_volume_bytes) { + int old_vol = acp->ac_curvol; + char vol_path[MAXPATHLEN]; + + newvolume(current); + flushsize = PMI_FLUSH_INTERVAL; + + if (current->on_volume_rotate) { + pmsprintf(vol_path, sizeof(vol_path), "%s.%d", + current->archive, old_vol); + current->on_volume_rotate(vol_path); + } + } + return 0; } diff --git a/src/libpcp_import/src/exports b/src/libpcp_import/src/exports index 370f6ca36e7..bc598d49209 100644 --- a/src/libpcp_import/src/exports +++ b/src/libpcp_import/src/exports @@ -51,4 +51,5 @@ PCP_IMPORT_1.4 { global: pmiExtraUnits; pmiPutAtomValueHandle; + pmiSetVolumeSize; } PCP_IMPORT_1.3; diff --git a/src/libpcp_import/src/import.c b/src/libpcp_import/src/import.c index 4b8978fa0e3..13cd3775072 100644 --- a/src/libpcp_import/src/import.c +++ b/src/libpcp_import/src/import.c @@ -562,6 +562,43 @@ pmiSetVersion(int version) return current->last_sts; } +int +pmiSetVolumeSize(size_t max_bytes, void (*on_rotate)(const char *)) +{ + if (current == NULL) + return PM_ERR_NOCONTEXT; + /* + * Reject a threshold below the archive label size for the current + * archive version — a value smaller than the label would trigger + * a rotation cascade on every write since each new volume begins + * with a label that immediately exceeds the threshold. + * __pmLogLabelSize() returns the correct fixed on-disk size for + * both v2 (124 bytes) and v3 (800 bytes) archives. + */ + if (max_bytes > 0) { + /* + * Use the context's configured archive version to determine the + * on-disk label size. __pmLogLabelSize() reads the label magic + * which is not yet set on a fresh context, so derive the size + * directly from the version: v2=124, v3=800 (fixed-width structs). + * The version field defaults to PM_LOG_VERS02 after pmiStart(). + */ + size_t label_size; + label_size = (current->version >= PM_LOG_VERS03) + ? (size_t)(32 + PM_MAX_HOSTNAMELEN + + PM_MAX_TIMEZONELEN + PM_MAX_ZONEINFOLEN) + : (size_t)(20 + PM_LOG_MAXHOSTLEN + PM_TZ_MAXLEN); + if (max_bytes <= label_size) { + current->last_sts = PM_ERR_CONV; + return PM_ERR_CONV; + } + } + current->max_volume_bytes = max_bytes; + current->on_volume_rotate = on_rotate; + current->last_sts = 0; + return 0; +} + static int valid_pmns_name(const char *name) { diff --git a/src/libpcp_import/src/private.h b/src/libpcp_import/src/private.h index 9d8335fba75..6b3b1957ca3 100644 --- a/src/libpcp_import/src/private.h +++ b/src/libpcp_import/src/private.h @@ -59,18 +59,25 @@ typedef struct { __pmLogCtl logctl; __pmArchCtl archctl; __pmResult *result; + /* + * Pair consecutive int fields to avoid 4-byte padding before each + * pointer on 64-bit platforms (private struct, no ABI constraint). + */ int nmetric; - pmi_metric *metric; int nindom; + pmi_metric *metric; pmi_indom *indom; int nhandle; - pmi_handle *handle; int ntext; + pmi_handle *handle; pmi_text *text; int nlabel; - pmi_label *label; int last_sts; + pmi_label *label; __pmTimestamp last_stamp; + /* optional volume rotation: 0 = disabled, callback may be NULL */ + size_t max_volume_bytes; + void (*on_volume_rotate)(const char *vol_path); } pmi_context; #define CONTEXT_START 1 From 930460a76fff623cd47574434835c69f561f85d9 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 18 Jun 2026 10:51:15 +1000 Subject: [PATCH 11/15] libpcp_import: add pmiSetZoneinfo() for v3 archive Olson timezone PCP v3 archives have a 'zoneinfo' label field for the full Olson database timezone identifier (e.g. "Australia/Brisbane"), which gives tools DST-correct replay without ambiguity. pmiSetTimezone() only sets the POSIX abbreviated form ("AEST-10") and was incorrectly clearing zoneinfo when applying it to the label. Add pmiSetZoneinfo(const char *value) which sets the zoneinfo field independently, modelled on pmiSetTimezone(). Passing NULL auto-detects the local Olson name via __pmZoneinfo() (libpcp tz.c), which handles both the /etc/localtime symlink case and the recursive file-content matching fallback. Signed-off-by: Nathan Scott Co-Authored-By: Claude Sonnet 4.6 (1M context) --- src/include/pcp/import.h | 1 + src/libpcp_import/src/archive.c | 8 ++++++-- src/libpcp_import/src/exports | 1 + src/libpcp_import/src/import.c | 31 +++++++++++++++++++++++++++++++ src/libpcp_import/src/private.h | 1 + 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/include/pcp/import.h b/src/include/pcp/import.h index 33d026487d9..742494cbf76 100644 --- a/src/include/pcp/import.h +++ b/src/include/pcp/import.h @@ -39,6 +39,7 @@ PMI_CALL extern int pmiUseContext(int); PMI_CALL extern int pmiEnd(void); PMI_CALL extern int pmiSetHostname(const char *); PMI_CALL extern int pmiSetTimezone(const char *); +PMI_CALL extern int pmiSetZoneinfo(const char *); PMI_CALL extern int pmiSetVersion(int); PMI_CALL extern int pmiSetVolumeSize(size_t, void (*)(const char *)); PMI_CALL extern int pmiAddMetric(const char *, pmID, int, pmInDom, int, pmUnits); diff --git a/src/libpcp_import/src/archive.c b/src/libpcp_import/src/archive.c index 769fe9073e4..0cebddfc16b 100644 --- a/src/libpcp_import/src/archive.c +++ b/src/libpcp_import/src/archive.c @@ -59,11 +59,13 @@ check_context_append(pmi_context *current) /* Restore version from the archive label (may differ from the default) */ current->version = __pmLogVersion(lcp); - /* Use the archive's hostname/timezone unless the caller overrode them */ + /* Use the archive's hostname/timezone/zoneinfo unless the caller overrode them */ if (current->hostname == NULL && lcp->label.hostname != NULL) current->hostname = strdup(lcp->label.hostname); if (current->timezone == NULL && lcp->label.timezone != NULL) current->timezone = strdup(lcp->label.timezone); + if (current->zoneinfo == NULL && lcp->label.zoneinfo != NULL) + current->zoneinfo = strdup(lcp->label.zoneinfo); /* * Seed last_stamp from the archive's end time so that the monotonicity @@ -123,8 +125,10 @@ check_context_start(pmi_context *current) if (current->timezone != NULL) { free(lcp->label.timezone); lcp->label.timezone = strdup(current->timezone); + } + if (current->zoneinfo != NULL) { free(lcp->label.zoneinfo); - lcp->label.zoneinfo = NULL; + lcp->label.zoneinfo = strdup(current->zoneinfo); } pmNewZone(lcp->label.timezone); current->state = CONTEXT_ACTIVE; diff --git a/src/libpcp_import/src/exports b/src/libpcp_import/src/exports index bc598d49209..0187d57a014 100644 --- a/src/libpcp_import/src/exports +++ b/src/libpcp_import/src/exports @@ -52,4 +52,5 @@ PCP_IMPORT_1.4 { pmiExtraUnits; pmiPutAtomValueHandle; pmiSetVolumeSize; + pmiSetZoneinfo; } PCP_IMPORT_1.3; diff --git a/src/libpcp_import/src/import.c b/src/libpcp_import/src/import.c index 13cd3775072..81ba6b94b65 100644 --- a/src/libpcp_import/src/import.c +++ b/src/libpcp_import/src/import.c @@ -347,6 +347,7 @@ pmiStart(const char *archive, int flags) } current->hostname = NULL; current->timezone = NULL; + current->zoneinfo = NULL; current->result = NULL; memset((void *)¤t->logctl, 0, sizeof(current->logctl)); memset((void *)¤t->archctl, 0, sizeof(current->archctl)); @@ -548,6 +549,36 @@ pmiSetTimezone(const char *value) return current->last_sts; } +int +pmiSetZoneinfo(const char *value) +{ + char *detected; + + if (current == NULL) + return PM_ERR_NOCONTEXT; + + if (value == NULL) { + /* Auto-detect Olson name via __pmZoneinfo() (libpcp tz.c) */ + detected = __pmZoneinfo(); + if (detected == NULL) + return current->last_sts = 0; /* no zoneinfo available */ + value = detected; + } else { + detected = NULL; + } + + free(current->zoneinfo); + current->zoneinfo = strdup(value); + free(detected); + if (current->zoneinfo == NULL) { + pmNoMem("pmiSetZoneinfo", strlen(value)+1, PM_RECOV_ERR); + current->last_sts = -ENOMEM; + } else { + current->last_sts = 0; + } + return current->last_sts; +} + int pmiSetVersion(int version) { diff --git a/src/libpcp_import/src/private.h b/src/libpcp_import/src/private.h index 6b3b1957ca3..00d71a0abc1 100644 --- a/src/libpcp_import/src/private.h +++ b/src/libpcp_import/src/private.h @@ -56,6 +56,7 @@ typedef struct { char *archive; char *hostname; char *timezone; + char *zoneinfo; __pmLogCtl logctl; __pmArchCtl archctl; __pmResult *result; From 1f5019adf948adf34bd65bc8c90906e1d7005b32 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Fri, 19 Jun 2026 18:41:57 +1000 Subject: [PATCH 12/15] libpcp_import: eliminate .meta bloat in append-mode archives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three sources of repeated metadata writes in PMI_APPEND mode: Indoms: check_indom() had no dedup check so every append session re-wrote all indom records regardless of whether membership had changed. For timer-driven collectors like sadc this caused O(N×S) .meta growth where N is the number of processes and S is the number of sessions per day. Fix: compare the registered indom against the most recent entry in hashindom (populated by __pmLogLoadMeta on append open). For v3 archives use pmaDeltaInDom() — the same helper pmlogger uses — to write a compact TYPE_INDOM_DELTA record when membership changes, and update the hash with the full indom afterwards so the next comparison starts from the correct state. For v2 archives use pmaSameInDom() and fall back to full indom writes. Link -lpcp_archive for access to pmaDeltaInDom() and pmaSameInDom(). Help text: _pmi_put_text() reset meta_done=0 each session via pmiStart inherit, causing all help text to be re-written on every append. Fix: check __pmLogLookupText() before writing; skip if content is unchanged. Signed-off-by: Nathan Scott --- qa/src/GNUlocaldefs | 12 ++--- qa/src/GNUmakefile | 1 + src/GNUmakefile | 5 +- src/collectl2pcp/GNUmakefile | 2 +- src/include/builddefs.in | 2 +- src/libpcp_import/src/GNUmakefile | 2 +- src/libpcp_import/src/archive.c | 62 ++++++++++++++++++++++- src/libpcp_import/src/libpcp_import.pc.in | 2 +- src/perl/LogImport/Makefile.PL | 6 +-- src/pmlogpaste/GNUmakefile | 2 +- src/python/distutils-setup.py | 2 +- src/python/setup.py | 2 +- 12 files changed, 81 insertions(+), 19 deletions(-) diff --git a/qa/src/GNUlocaldefs b/qa/src/GNUlocaldefs index 033d4b7082b..5bf6b624ed4 100644 --- a/qa/src/GNUlocaldefs +++ b/qa/src/GNUlocaldefs @@ -1395,30 +1395,30 @@ sortinst: sortinst.c check_import: check_import.c rm -f $@ - $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import + $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_archive -lpcp_import $(LINKER_MAKERULE) check_import_name: check_import_name.c rm -f $@ - $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import + $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_archive -lpcp_import $(LINKER_MAKERULE) check_import_append: check_import_append.c rm -f $@ - $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import + $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_archive -lpcp_import check_volsize: check_volsize.c rm -f $@ - $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import + $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_archive -lpcp_import check_pmiend_fdleak: check_pmiend_fdleak.c rm -f $@ - $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import + $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_archive -lpcp_import $(LINKER_MAKERULE) check_pmi_errconv: check_pmi_errconv.c rm -f $@ - $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_import + $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_archive -lpcp_import $(LINKER_MAKERULE) # --- need libpcp_web diff --git a/qa/src/GNUmakefile b/qa/src/GNUmakefile index 663c5352dd4..0bfe182ffb1 100644 --- a/qa/src/GNUmakefile +++ b/qa/src/GNUmakefile @@ -14,6 +14,7 @@ LLDFLAGS = \ -L$(TOPDIR)/src/libpcp_mmv/$(LIBPCP_ABIDIR) \ -L$(TOPDIR)/src/libpcp_web/$(LIBPCP_ABIDIR) \ -L$(TOPDIR)/src/libpcp_trace/$(LIBPCP_ABIDIR) \ + -L$(TOPDIR)/src/libpcp_archive/$(LIBPCP_ABIDIR) \ -L$(TOPDIR)/src/libpcp_import/$(LIBPCP_ABIDIR) NVIDIACFLAGS = -I$(TOPDIR)/src/pmdas/nvidia diff --git a/src/GNUmakefile b/src/GNUmakefile index 16a71792638..c60557cef50 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -20,14 +20,16 @@ include $(TOPDIR)/src/include/builddefs INCLUDE_SUBDIR = include PMNS_SUBDIR = pmns LIBPCP_SUBDIR = libpcp libpcp_static +LIBPCP_ARCHIVE_SUBDIR = libpcp_archive +LIBPCP_IMPORT_SUBDIR = libpcp_import LIBS_SUBDIRS = \ libpcp_pmda \ libpcp_trace \ libpcp_pmcd \ libpcp_gui \ libpcp_mmv \ - libpcp_import \ libpcp_archive \ + libpcp_import \ libpcp_qed \ libpcp_qmc \ libpcp_qwt \ @@ -171,4 +173,5 @@ install_pcp : $(SUBDIRS) $(LIBPCP_SUBDIR): $(INCLUDE_SUBDIR) $(PMNS_SUBDIR): $(LIBPCP_SUBDIR) $(LIBS_SUBDIRS): $(PMNS_SUBDIR) +$(LIBPCP_IMPORT_SUBDIR): $(LIBPCP_ARCHIVE_SUBDIR) $(OTHER_SUBDIRS): $(LIBS_SUBDIRS) diff --git a/src/collectl2pcp/GNUmakefile b/src/collectl2pcp/GNUmakefile index 616b74fc5c7..4064f4a20a2 100644 --- a/src/collectl2pcp/GNUmakefile +++ b/src/collectl2pcp/GNUmakefile @@ -19,7 +19,7 @@ CFILES = collectl2pcp.c cpu.c disk.c net.c load.c timestamp.c util.c \ metrics.c header.c generic.c proc.c CMDTARGET = collectl2pcp$(EXECSUFFIX) -LLDLIBS = -L$(TOPDIR)/src/libpcp_import/src -lpcp_import $(PCPLIB) +LLDLIBS = -L$(TOPDIR)/src/libpcp_archive/src -lpcp_archive -L$(TOPDIR)/src/libpcp_import/src -lpcp_import $(PCPLIB) # LCFLAGS += -pg # diff --git a/src/include/builddefs.in b/src/include/builddefs.in index 61400e1132e..0aeea5c7292 100644 --- a/src/include/builddefs.in +++ b/src/include/builddefs.in @@ -720,7 +720,7 @@ endif PYTHON_PREFIX=@python_prefix@ SETUP_PY_BUILD_OPTIONS = -DENABLE_PYTHON3 SETUP_PY_BUILD_OPTIONS += --include-dirs=$(TOPDIR)/src/include:$(TOPDIR)/src/include/pcp$(EXTRA_PY_INCLUDES) -SETUP_PY_BUILD_OPTIONS += --library-dirs=$(TOPDIR)/src/libpcp/src:$(TOPDIR)/src/libpcp_pmda/src:$(TOPDIR)/src/libpcp_gui/src:$(TOPDIR)/src/libpcp_import/src:$(TOPDIR)/src/libpcp_mmv/src +SETUP_PY_BUILD_OPTIONS += --library-dirs=$(TOPDIR)/src/libpcp/src:$(TOPDIR)/src/libpcp_pmda/src:$(TOPDIR)/src/libpcp_gui/src:$(TOPDIR)/src/libpcp_archive/src:$(TOPDIR)/src/libpcp_import/src:$(TOPDIR)/src/libpcp_mmv/src SETUP_PY_INSTALL_OPTIONS = --skip-build SETUP_PY_INSTALL_OPTIONS += --root="$${DIST_ROOT:-/}" ifeq "$(PYTHON_PREFIX)" "/usr" diff --git a/src/libpcp_import/src/GNUmakefile b/src/libpcp_import/src/GNUmakefile index 77711c4d610..68e1ebb7be2 100644 --- a/src/libpcp_import/src/GNUmakefile +++ b/src/libpcp_import/src/GNUmakefile @@ -41,7 +41,7 @@ SYMTARGET = endif LCFLAGS = -DPMI_INTERNAL -LLDLIBS = -lpcp +LLDLIBS = -lpcp -lpcp_archive LDIRT = $(SYMTARGET) domain.h $(LIBCONFIG) DOMAIN = PMI_DOMAIN diff --git a/src/libpcp_import/src/archive.c b/src/libpcp_import/src/archive.c index 0cebddfc16b..491d913b01d 100644 --- a/src/libpcp_import/src/archive.c +++ b/src/libpcp_import/src/archive.c @@ -17,6 +17,7 @@ #include "libpcp.h" #include "import.h" #include "private.h" +#include "archive.h" static __pmTimestamp stamp; @@ -155,11 +156,16 @@ check_context_start(pmi_context *current) static int check_indom(pmi_context *current, pmInDom indom, int *needti) { - int i; + int i, n; int sts = 0; __pmArchCtl *acp = ¤t->archctl; int type = current->version == PM_LOG_VERS03 ? TYPE_INDOM : TYPE_INDOM_V2; - __pmLogInDom lid; + __pmLogInDom lid; + __pmLogInDom old; + __pmLogInDom new_delta; + int *instlist; + char **namelist; + int needindom; for (i = 0; i < current->nindom; i++) { if (indom == current->indom[i].indom) { @@ -170,6 +176,46 @@ check_indom(pmi_context *current, pmInDom indom, int *needti) lid.instlist = current->indom[i].inst; lid.namelist = current->indom[i].name; lid.alloc = 0; + pmaSortInDom(&lid); + + n = __pmLogGetInDom(acp, indom, NULL, &instlist, &namelist); + if (n >= 0) { + old.numinst = n; + old.instlist = instlist; + old.namelist = namelist; + /* + * pmaDeltaInDom() returns: + * 0 = identical, skip write (stable indoms: CPUs, disks, etc.) + * 1 = changed, write full indom + * 2 = changed, delta record is smaller (v3 only) + */ + if (current->version == PM_LOG_VERS03) + needindom = pmaDeltaInDom(&old, &lid, &new_delta); + else + needindom = pmaSameInDom(&old, &lid) ? 0 : 1; + + if (needindom == 0) { + current->indom[i].meta_done = 1; + continue; + } + if (needindom == 2) { + new_delta.stamp = stamp; + new_delta.indom = indom; + if ((sts = __pmLogPutInDom(acp, TYPE_INDOM_DELTA, &new_delta)) < 0) + return sts; + /* + * Update hash with full indom so the next comparison + * starts from the correct full state, not the delta. + */ + if ((sts = __pmLogAddInDom(acp, TYPE_INDOM, &lid, NULL)) < 0) + return sts; + current->indom[i].meta_done = 1; + *needti = 1; + continue; + } + } + + /* first write, v2, or full indom change */ if ((sts = __pmLogPutInDom(acp, type, &lid)) < 0) return sts; @@ -384,6 +430,7 @@ _pmi_put_text(pmi_context *current) int sts; __pmArchCtl *acp = ¤t->archctl; pmi_text *tp; + char *existing; int t; int needti; @@ -422,6 +469,17 @@ _pmi_put_text(pmi_context *current) return sts; } + /* + * Skip re-writing text that is already present and unchanged in the + * archive (loaded into hashtext by __pmLogLoadMeta on append open). + */ + existing = NULL; + if (__pmLogLookupText(acp, tp->id, tp->type, &existing) == 0 && + strcmp(existing, tp->content) == 0) { + tp->meta_done = 1; + continue; + } + /* * Now write out the text record. * libpcp, via __pmLogPutText(), makes a copy of the storage pointed diff --git a/src/libpcp_import/src/libpcp_import.pc.in b/src/libpcp_import/src/libpcp_import.pc.in index 64266b55b68..b260f42cf91 100644 --- a/src/libpcp_import/src/libpcp_import.pc.in +++ b/src/libpcp_import/src/libpcp_import.pc.in @@ -6,5 +6,5 @@ includedir=@INCDIR@ Name: libpcp_import Description: The Performance Metrics archive import library Version: @VERSION@ -Libs: -L${libdir} -lpcp -lpcp_import +Libs: -L${libdir} -lpcp -lpcp_archive -lpcp_import Cflags: -I${includedir} diff --git a/src/perl/LogImport/Makefile.PL b/src/perl/LogImport/Makefile.PL index 359bbc83404..126e5a5c861 100644 --- a/src/perl/LogImport/Makefile.PL +++ b/src/perl/LogImport/Makefile.PL @@ -8,14 +8,14 @@ my $lddlflags; my $cccdlflags; if ($ENV{TARGET_OS} eq "mingw") { - $ldfrom = "-L$ENV{PCP_TOPDIR}/src/libpcp/src -L$ENV{PCP_TOPDIR}/src/libpcp_import/src -L$ENV{PCP_DIR}\\local\\bin -lpcp_import -lpcp LogImport.o", + $ldfrom = "-L$ENV{PCP_TOPDIR}/src/libpcp/src -L$ENV{PCP_TOPDIR}/src/libpcp_archive/src -L$ENV{PCP_TOPDIR}/src/libpcp_import/src -L$ENV{PCP_DIR}\\local\\bin -lpcp_import -lpcp_archive -lpcp LogImport.o", $inc = "-I$ENV{PCP_TOPDIR}/src/include/pcp -I/usr/include/pcp -I$ENV{PCP_DIR}\\include\\pcp -I$ENV{PCP_DIR}\\c\\include"; - $libs = ["-L$ENV{PCP_DIR}\\local\\bin", '-lpcp_import', '-lpcp']; + $libs = ["-L$ENV{PCP_DIR}\\local\\bin", '-lpcp_import', '-lpcp_archive', '-lpcp']; } else { $ldfrom = "LogImport.o", $inc = "-I$ENV{PCP_TOPDIR}/src/include/pcp -I/usr/include/pcp"; - $libs = ["-L$ENV{PCP_TOPDIR}/src/libpcp/src -L$ENV{PCP_TOPDIR}/src/libpcp_import/src -lpcp_import -lpcp"]; + $libs = ["-L$ENV{PCP_TOPDIR}/src/libpcp/src -L$ENV{PCP_TOPDIR}/src/libpcp_archive/src -L$ENV{PCP_TOPDIR}/src/libpcp_import/src -lpcp_import -lpcp_archive -lpcp"]; } if ($ENV{TARGET_OS} eq "darwin") { $lddlflags = "-bundle -undefined dynamic_lookup"; diff --git a/src/pmlogpaste/GNUmakefile b/src/pmlogpaste/GNUmakefile index b0052a58d56..d714d440c51 100644 --- a/src/pmlogpaste/GNUmakefile +++ b/src/pmlogpaste/GNUmakefile @@ -17,7 +17,7 @@ include $(TOPDIR)/src/include/builddefs CFILES = pmlogpaste.c CMDTARGET = pmlogpaste$(EXECSUFFIX) -LLDLIBS = -L$(TOPDIR)/src/libpcp_import/src -lpcp_import $(PCPLIB) +LLDLIBS = -L$(TOPDIR)/src/libpcp_archive/src -lpcp_archive -L$(TOPDIR)/src/libpcp_import/src -lpcp_import $(PCPLIB) default: $(CMDTARGET) diff --git a/src/python/distutils-setup.py b/src/python/distutils-setup.py index 91143a59c95..a9b8a03dfc7 100644 --- a/src/python/distutils-setup.py +++ b/src/python/distutils-setup.py @@ -32,7 +32,7 @@ Extension('cpmapi', ['pmapi.c'], libraries = ['pcp']), Extension('cpmda', ['pmda.c'], libraries = ['pcp_pmda', 'pcp']), Extension('cpmgui', ['pmgui.c'], libraries = ['pcp_gui']), - Extension('cpmi', ['pmi.c'], libraries = ['pcp_import']), + Extension('cpmi', ['pmi.c'], libraries = ['pcp_import', 'pcp_archive']), Extension('cmmv', ['mmv.c'], libraries = ['pcp_mmv']), ], platforms = [ 'Windows', 'Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'Solaris', 'macOS', 'AIX' ], diff --git a/src/python/setup.py b/src/python/setup.py index 0f9def6cf27..a5b0729d0b9 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -42,7 +42,7 @@ Extension('cpmapi', ['pmapi.c'], libraries = ['pcp']), Extension('cpmda', ['pmda.c'], libraries = ['pcp_pmda', 'pcp']), Extension('cpmgui', ['pmgui.c'], libraries = ['pcp_gui', 'pcp']), - Extension('cpmi', ['pmi.c'], libraries = ['pcp_import', 'pcp']), + Extension('cpmi', ['pmi.c'], libraries = ['pcp_import', 'pcp_archive', 'pcp']), Extension('cmmv', ['mmv.c'], libraries = ['pcp_mmv', 'pcp']), ], keywords = ['performance', 'analysis', 'monitoring' ], From e379b2ec1ff17127e7ad212aad08960e6d40038e Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 22 Jun 2026 10:57:36 +1000 Subject: [PATCH 13/15] libpcp_import: add pmiSetImportProgram() for import tool registration pmiSetImportProgram(tool, version, args, archive) writes tool identity to PCP_IMPORT_DIR/{tool} so pmdapmimport can serve pmimport.* metrics. PCP_IMPORT_DIR is a new pcp.conf variable (configure --with-importdir, default /run/pmimport) that is created root:root 0755 by packaging. The file is opened with O_NOFOLLOW|O_CLOEXEC to prevent symlink substitution and fd leakage; O_TRUNC handles restart after unclean exit. pmiEnd() removes the file on clean archive close so pmimport.* metrics accurately reflect which tools are currently recording. Signed-off-by: Nathan Scott --- configure.ac | 13 +++++++++ src/include/pcp.conf.in | 4 +++ src/include/pcp/import.h | 1 + src/libpcp_import/src/archive.c | 9 +++++++ src/libpcp_import/src/exports | 1 + src/libpcp_import/src/import.c | 48 +++++++++++++++++++++++++++++++++ src/libpcp_import/src/private.h | 2 ++ 7 files changed, 78 insertions(+) diff --git a/configure.ac b/configure.ac index b91ceeb892d..7c8421abb43 100644 --- a/configure.ac +++ b/configure.ac @@ -3609,6 +3609,19 @@ pcp_run_dir=`eval echo $pcp_run_dir` AC_SUBST(pcp_run_dir) AC_MSG_NOTICE([pcp_run_dir=$pcp_run_dir]) +AC_ARG_WITH(importdir,[AS_HELP_STRING([--with-importdir],[PCP import tool directory [/var/run/pmimport]])], + [pcp_import_dir=$withval], [ +if test -d /run +then + pcp_import_dir="/run/pmimport" +else + pcp_import_dir="$localstatedir/run/pmimport" +fi]) +pcp_import_dir=`eval echo $pcp_import_dir` +pcp_import_dir=`eval echo $pcp_import_dir` +AC_SUBST(pcp_import_dir) +AC_MSG_NOTICE([pcp_import_dir=$pcp_import_dir]) + dnl world-writeable temporary files directory AC_ARG_WITH(tmpdir,[AS_HELP_STRING([--with-tmpdir],[tmp directory [LOCALSTATEDIR/tmp]])], [pcp_tmpfile_dir=$withval], diff --git a/src/include/pcp.conf.in b/src/include/pcp.conf.in index de157f3c903..dbed53b0478 100644 --- a/src/include/pcp.conf.in +++ b/src/include/pcp.conf.in @@ -134,6 +134,10 @@ PCP_PMDASADM_DIR=@pcp_pmdasadm_dir@ # Standard path: /var/run/pcp PCP_RUN_DIR=@pcp_run_dir@ +# directory for PCP import tool status files +# Standard path: /var/run/pmimport +PCP_IMPORT_DIR=@pcp_import_dir@ + # directory for PCP daemon log files # Standard path: /var/log/pcp # Subdirectories: pmcd pmlogger pmie diff --git a/src/include/pcp/import.h b/src/include/pcp/import.h index 742494cbf76..b8bb1f51629 100644 --- a/src/include/pcp/import.h +++ b/src/include/pcp/import.h @@ -42,6 +42,7 @@ PMI_CALL extern int pmiSetTimezone(const char *); PMI_CALL extern int pmiSetZoneinfo(const char *); PMI_CALL extern int pmiSetVersion(int); PMI_CALL extern int pmiSetVolumeSize(size_t, void (*)(const char *)); +PMI_CALL extern int pmiSetImportProgram(const char *, const char *, const char *, const char *); PMI_CALL extern int pmiAddMetric(const char *, pmID, int, pmInDom, int, pmUnits); PMI_CALL extern int pmiAddInstance(pmInDom, const char *, int); PMI_CALL extern int pmiPutValue(const char *, const char *, const char *); diff --git a/src/libpcp_import/src/archive.c b/src/libpcp_import/src/archive.c index 491d913b01d..d75a295bec9 100644 --- a/src/libpcp_import/src/archive.c +++ b/src/libpcp_import/src/archive.c @@ -576,6 +576,15 @@ _pmi_end(pmi_context *current) __pmLogClose(¤t->archctl); + /* Remove the pmimport sidecar file written by pmiSetImportInfo() */ + if (current->tool_name[0] != '\0') { + char path[MAXPATHLEN]; + pmsprintf(path, sizeof(path), "%s/%s", + pmGetConfig("PCP_IMPORT_DIR"), current->tool_name); + unlink(path); + current->tool_name[0] = '\0'; + } + current->state = CONTEXT_END; return 0; } diff --git a/src/libpcp_import/src/exports b/src/libpcp_import/src/exports index 0187d57a014..1c14a977e33 100644 --- a/src/libpcp_import/src/exports +++ b/src/libpcp_import/src/exports @@ -51,6 +51,7 @@ PCP_IMPORT_1.4 { global: pmiExtraUnits; pmiPutAtomValueHandle; + pmiSetImportProgram; pmiSetVolumeSize; pmiSetZoneinfo; } PCP_IMPORT_1.3; diff --git a/src/libpcp_import/src/import.c b/src/libpcp_import/src/import.c index 81ba6b94b65..bf8f5d4b30a 100644 --- a/src/libpcp_import/src/import.c +++ b/src/libpcp_import/src/import.c @@ -630,6 +630,54 @@ pmiSetVolumeSize(size_t max_bytes, void (*on_rotate)(const char *)) return 0; } +int +pmiSetImportProgram(const char *tool, const char *version, + const char *args, const char *archive) +{ + char path[MAXPATHLEN]; + int oflags; + int fd; + FILE *fp; + + if (current == NULL) + return PM_ERR_NOCONTEXT; + + if (tool == NULL || tool[0] == '\0') + return current->last_sts = PM_ERR_CONV; + + /* PCP_IMPORT_DIR is root:root 0755, created by packaging. + * O_NOFOLLOW defeats a symlink pre-placed at the target path; + * O_TRUNC overwrites a stale file left by an unclean exit. */ + pmsprintf(path, sizeof(path), "%s/%s", + pmGetConfig("PCP_IMPORT_DIR"), tool); + + oflags = O_CREAT | O_WRONLY | O_TRUNC; +#ifdef O_NOFOLLOW + oflags |= O_NOFOLLOW; +#endif +#ifdef O_CLOEXEC + oflags |= O_CLOEXEC; +#endif + fd = open(path, oflags, 0644); + if (fd < 0) + return current->last_sts = -oserror(); + if ((fp = fdopen(fd, "w")) == NULL) { + close(fd); + return current->last_sts = -oserror(); + } + + if (version && version[0]) + fprintf(fp, "version=%s\n", version); + if (args && args[0]) + fprintf(fp, "args=%s\n", args); + if (archive && archive[0]) + fprintf(fp, "archive=%s\n", archive); + fclose(fp); + + pmstrncpy(current->tool_name, sizeof(current->tool_name), tool); + return current->last_sts = 0; +} + static int valid_pmns_name(const char *name) { diff --git a/src/libpcp_import/src/private.h b/src/libpcp_import/src/private.h index 00d71a0abc1..79186e4ede4 100644 --- a/src/libpcp_import/src/private.h +++ b/src/libpcp_import/src/private.h @@ -79,6 +79,8 @@ typedef struct { /* optional volume rotation: 0 = disabled, callback may be NULL */ size_t max_volume_bytes; void (*on_volume_rotate)(const char *vol_path); + /* import tool identity for PCP_RUN_DIR/pmimport/{tool} sidecar */ + char tool_name[64]; } pmi_context; #define CONTEXT_START 1 From a6c5e2ef897d4be5c0dc2a86996602790cd717e7 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 22 Jun 2026 11:58:49 +1000 Subject: [PATCH 14/15] pcp.pmi, LogImport: add wrappers for pmiSetZoneinfo and pmiSetImportProgram Add Python ctypes declarations and method implementations for the two new single-context pmiSet* APIs added on this branch: pmiSetZoneinfo(zoneinfo) - set Olson timezone from zoneinfo string pmiSetImportProgram(tool, ...) - register import program with pmdapmimport Add Perl XS declarations for the same two functions. pmiSetVolumeSize is omitted from Perl as its callback argument has no natural XS mapping. Signed-off-by: Nathan Scott --- src/perl/LogImport/LogImport.xs | 11 ++++++++++ src/python/pcp/pmi.py | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/perl/LogImport/LogImport.xs b/src/perl/LogImport/LogImport.xs index 155fa4a000f..3fb2fcada86 100644 --- a/src/perl/LogImport/LogImport.xs +++ b/src/perl/LogImport/LogImport.xs @@ -119,6 +119,17 @@ int pmiSetVersion(value) int value; +int +pmiSetZoneinfo(value) + char *value; + +int +pmiSetImportProgram(tool, version, args, archive) + char *tool; + char *version; + char *args; + char *archive; + int pmiAddMetric(name, pmid, type, indom, sem, units) const char *name; diff --git a/src/python/pcp/pmi.py b/src/python/pcp/pmi.py index ab6173d85cd..64f4ef2ab2e 100644 --- a/src/python/pcp/pmi.py +++ b/src/python/pcp/pmi.py @@ -101,6 +101,12 @@ LIBPCP_IMPORT.pmiSetVersion.restype = c_int LIBPCP_IMPORT.pmiSetVersion.argtypes = [c_int] +LIBPCP_IMPORT.pmiSetZoneinfo.restype = c_int +LIBPCP_IMPORT.pmiSetZoneinfo.argtypes = [c_char_p] + +LIBPCP_IMPORT.pmiSetImportProgram.restype = c_int +LIBPCP_IMPORT.pmiSetImportProgram.argtypes = [c_char_p, c_char_p, c_char_p, c_char_p] + LIBPCP_IMPORT.pmiAddMetric.restype = c_int LIBPCP_IMPORT.pmiAddMetric.argtypes = [ c_char_p, pmID, c_int, pmInDom, c_int, pmUnits] @@ -273,6 +279,39 @@ def pmiSetVersion(self, version: int) -> int: raise pmiErr(status) return status + def pmiSetZoneinfo(self, zoneinfo: str) -> int: + """PMI - set the Olson timezone (zoneinfo) for a Log Import archive + """ + status = LIBPCP_IMPORT.pmiUseContext(self._ctx) + if status < 0: + raise pmiErr(status) + if not isinstance(zoneinfo, bytes): + zoneinfo = zoneinfo.encode('utf-8') + status = LIBPCP_IMPORT.pmiSetZoneinfo(c_char_p(zoneinfo)) + if status < 0: + raise pmiErr(status) + return status + + def pmiSetImportProgram(self, tool: str, version: str, args: str, archive: str) -> int: + """PMI - register import program with PCP tool discovery mechanism + """ + status = LIBPCP_IMPORT.pmiUseContext(self._ctx) + if status < 0: + raise pmiErr(status) + if not isinstance(tool, bytes): + tool = tool.encode('utf-8') + if not isinstance(version, bytes): + version = version.encode('utf-8') + if not isinstance(args, bytes): + args = args.encode('utf-8') + if not isinstance(archive, bytes): + archive = archive.encode('utf-8') + status = LIBPCP_IMPORT.pmiSetImportProgram( + c_char_p(tool), c_char_p(version), c_char_p(args), c_char_p(archive)) + if status < 0: + raise pmiErr(status) + return status + @staticmethod def pmiID(domain: int, cluster: int, item: int) -> pmID: """PMI - construct a pmID data structure (helper routine) """ From 451e5366e4f57c373da73e08d9ab0776f7967a39 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 23 Jun 2026 08:52:30 +1000 Subject: [PATCH 15/15] libpcp_import: build, docs, qa and comments updates on code review --- build/rpm/pcp.spec.in | 7 +- build/rpm/redhat.spec | 7 +- configure | 2879 ++++++++++++------- configure.ac | 2 +- debian/libpcp-import1.install | 2 + man/man3/pmisetvolumesize.3 | 4 +- qa/1418.out | 4 + qa/1693 | 3 - qa/369.out | 4 + src/include/builddefs.in | 2 + src/libpcp_import/src/.gitignore | 7 +- src/libpcp_import/src/GNUmakefile | 14 +- src/libpcp_import/src/archive.c | 4 +- src/libpcp_import/src/import.c | 6 +- src/libpcp_import/src/libpcp_import.conf.in | 4 + src/perl/LogImport/LogImport.pm | 3 +- 16 files changed, 1835 insertions(+), 1117 deletions(-) create mode 100644 src/libpcp_import/src/libpcp_import.conf.in diff --git a/build/rpm/pcp.spec.in b/build/rpm/pcp.spec.in index 4bdb2146a7e..90f85ff573a 100755 --- a/build/rpm/pcp.spec.in +++ b/build/rpm/pcp.spec.in @@ -2254,13 +2254,13 @@ sed -i '/\/man\//d' pcp-devel-files sed -i '/\/include\//d' pcp-devel-files %ifarch x86_64 ppc64 ppc64le aarch64 s390x riscv64 -sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-files +sed -i -e '/\.so/s/usr\/lib\//usr\/lib64\//' pcp-libs-files sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-devel-files sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-devel-files %endif %ifarch ia64 %if "%{_vendor}" != "suse" -sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-files +sed -i -e '/\.so/s/usr\/lib\//usr\/lib64\//' pcp-libs-files sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-devel-files sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-devel-files %endif @@ -2302,6 +2302,7 @@ dso_files=$(awk '/^[^#]/{print $5}' $RPM_BUILD_ROOT@pcp_sysconf_dir@/local.conf | xargs -I{} basename {} | sort -u | tr '\n' '|' | sed 's/|$//') basic_manifest | grep -E "/($dso_files)$" \ | grep -v "^@pcp_pmdas_dir@/" >>pcp-libs-files +echo @pcp_import_dir@ >>pcp-libs-files # # Files for the various subpackages. We use these subpackages @@ -2496,7 +2497,7 @@ BEGIN { f=p"-files.rpm"; } $1 == "d" { - if (match ($5, "'$PCP_RUN_DIR'")) { + if (match ($5, "'$PCP_RUN_DIR'") || match ($5, "'$PCP_IMPORT_DIR'")) { printf ("%%%%ghost ") >> f; } if (match ($5, "'$PCP_VAR_DIR'/testsuite")) { diff --git a/build/rpm/redhat.spec b/build/rpm/redhat.spec index 744d2582864..9cf9b0a233a 100644 --- a/build/rpm/redhat.spec +++ b/build/rpm/redhat.spec @@ -2368,13 +2368,13 @@ sed -i '/\/man\//d' pcp-devel-files sed -i '/\/include\//d' pcp-devel-files %ifarch x86_64 ppc64 ppc64le aarch64 s390x riscv64 -sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-files +sed -i -e '/\.so/s/usr\/lib\//usr\/lib64\//' pcp-libs-files sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-devel-files sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-devel-files %endif %ifarch ia64 %if "%{_vendor}" != "suse" -sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-files +sed -i -e '/\.so/s/usr\/lib\//usr\/lib64\//' pcp-libs-files sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-devel-files sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-devel-files %endif @@ -2416,6 +2416,7 @@ dso_files=$(awk '/^[^#]/{print $5}' $RPM_BUILD_ROOT%{_sysconfdir}/pcp/local.conf | xargs -I{} basename {} | sort -u | tr '\n' '|' | sed 's/|$//') basic_manifest | grep -E "/($dso_files)$" \ | grep -v "^%{_pmdasdir}/" >>pcp-libs-files +echo %{_rundir}/pmimport >>pcp-libs-files # # Files for the various subpackages. We use these subpackages @@ -2610,7 +2611,7 @@ BEGIN { f=p"-files.rpm"; } $1 == "d" { - if (match ($5, "'$PCP_RUN_DIR'")) { + if (match ($5, "'$PCP_RUN_DIR'") || match ($5, "'$PCP_IMPORT_DIR'")) { printf ("%%%%ghost ") >> f; } if (match ($5, "'$PCP_VAR_DIR'/testsuite")) { diff --git a/configure b/configure index 88e0cac4bb9..b3ba79c52aa 100755 --- a/configure +++ b/configure @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71. +# Generated by GNU Autoconf 2.72. # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -15,7 +15,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -24,12 +23,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -101,7 +101,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -131,15 +131,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -147,12 +146,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -170,8 +170,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -185,14 +186,15 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -225,12 +227,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -252,7 +255,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -271,7 +274,8 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -310,14 +314,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -386,11 +382,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -404,29 +401,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -500,6 +482,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -548,7 +532,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -560,9 +543,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -587,10 +570,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1258,7 +1245,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1471,7 +1458,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1487,7 +1474,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1517,8 +1504,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1526,7 +1513,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1576,7 +1563,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1644,7 +1631,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1672,7 +1659,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. +'configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1686,11 +1673,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1698,10 +1685,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1816,6 +1803,8 @@ Optional Packages: --with-sysconfigdir sysconfig directory [SYSCONFDIR/sysconfig] --with-logdir log directory [LOCALSTATEDIR/log/pcp] --with-rundir run directory [LOCALSTATEDIR/run/pcp] + --with-importdir PCP import tool directory + [LOCALSTATEDIR/run/pmimport] --with-tmpdir tmp directory [LOCALSTATEDIR/tmp] --with-docdir docs directory [DOCDIR/pcp-VERSION] --with-demosdir run directory [DATADIR/pcp/demos] @@ -1835,12 +1824,12 @@ Some influential environment variables: you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. + YACC The 'Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: 'bison -y', 'byacc', + 'yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. + default value of '-d' given by some make applications. gperftools_CFLAGS C compiler flags for gperftools, overriding pkg-config gperftools_LIBS @@ -1901,7 +1890,7 @@ Some influential environment variables: C compiler flags for cmocka, overriding pkg-config cmocka_LIBS linker flags for cmocka, overriding pkg-config -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. @@ -1969,9 +1958,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -2010,11 +1999,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -2052,11 +2042,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -2096,11 +2087,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -2119,8 +2111,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -2128,10 +2120,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2167,11 +2161,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -2189,15 +2184,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) 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. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -2208,7 +2203,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* 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. */ @@ -2227,11 +2222,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2252,8 +2249,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -2283,12 +2280,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2327,12 +2326,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -2364,7 +2364,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2610,10 +2610,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2649,9 +2649,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2665,6 +2663,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2692,16 +2705,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2751,7 +2767,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2817,6 +2832,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2838,7 +2855,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -3247,8 +3264,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -3276,12 +3294,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -3290,18 +3308,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -3317,11 +3335,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -3351,8 +3369,9 @@ fi if test ${with_optimization+y} then : withval=$with_optimization; use_optimization=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-optimization=$withval" -else $as_nop - use_optimizaton=yes +else case e in #( + e) use_optimizaton=yes ;; +esac fi @@ -3361,8 +3380,9 @@ fi if test ${with_non_debug+y} then : withval=$with_non_debug; use_ndebug=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-non-debug=$withval" -else $as_nop - use_ndebug=no +else case e in #( + e) use_ndebug=no ;; +esac fi @@ -3371,8 +3391,9 @@ fi if test ${with_gperftools+y} then : withval=$with_gperftools; use_gperftools=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-gperftools=$withval" -else $as_nop - use_gperftools=no +else case e in #( + e) use_gperftools=no ;; +esac fi @@ -3381,8 +3402,9 @@ fi if test ${with_sanitizer+y} then : withval=$with_sanitizer; use_sanitizer=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-sanitizer=$withval" -else $as_nop - use_sanitizer=no +else case e in #( + e) use_sanitizer=no ;; +esac fi @@ -3391,8 +3413,9 @@ fi if test ${with_threads+y} then : withval=$with_threads; do_threads=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-threads=$withval" -else $as_nop - do_threads=check +else case e in #( + e) do_threads=check ;; +esac fi @@ -3401,8 +3424,9 @@ fi if test ${with_secure_sockets+y} then : withval=$with_secure_sockets; do_secure=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-secure-sockets=$withval" -else $as_nop - do_secure=check +else case e in #( + e) do_secure=check ;; +esac fi @@ -3411,8 +3435,9 @@ fi if test ${with_static_probes+y} then : withval=$with_static_probes; do_probes=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-static-probes=$withval" -else $as_nop - do_probes=check +else case e in #( + e) do_probes=check ;; +esac fi @@ -3421,8 +3446,9 @@ fi if test ${with_infiniband+y} then : withval=$with_infiniband; do_infiniband=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-infiniband=$withval" -else $as_nop - do_infiniband=check +else case e in #( + e) do_infiniband=check ;; +esac fi @@ -3431,8 +3457,9 @@ fi if test ${with_user+y} then : withval=$with_user; pcp_user=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-user-account=$withval" -else $as_nop - pcp_user=pcp +else case e in #( + e) pcp_user=pcp ;; +esac fi @@ -3442,8 +3469,9 @@ fi if test ${with_group+y} then : withval=$with_group; pcp_group=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-group-account=$withval" -else $as_nop - pcp_group=pcp +else case e in #( + e) pcp_group=pcp ;; +esac fi @@ -3453,8 +3481,9 @@ fi if test ${with_systemd+y} then : withval=$with_systemd; do_systemd=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-systemd=$withval" -else $as_nop - do_systemd=check +else case e in #( + e) do_systemd=check ;; +esac fi @@ -3463,8 +3492,9 @@ fi if test ${with_selinux+y} then : withval=$with_selinux; do_selinux=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-selinux=$withval" -else $as_nop - do_selinux=check +else case e in #( + e) do_selinux=check ;; +esac fi @@ -3473,8 +3503,9 @@ fi if test ${with_qt+y} then : withval=$with_qt; do_qt=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-qt=$withval" -else $as_nop - do_qt=check +else case e in #( + e) do_qt=check ;; +esac fi @@ -3483,8 +3514,9 @@ fi if test ${with_qt3d+y} then : withval=$with_qt3d; do_qt3d=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-qt3d=$withval" -else $as_nop - do_qt3d=check +else case e in #( + e) do_qt3d=check ;; +esac fi @@ -3493,8 +3525,9 @@ fi if test ${with_perl+y} then : withval=$with_perl; do_perl=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-perl=$withval" -else $as_nop - do_perl=check +else case e in #( + e) do_perl=check ;; +esac fi @@ -3503,8 +3536,9 @@ fi if test ${with_python3+y} then : withval=$with_python3; do_python3=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-python3=$withval" -else $as_nop - do_python3=check +else case e in #( + e) do_python3=check ;; +esac fi @@ -3513,8 +3547,9 @@ fi if test ${with_dstat_symlink+y} then : withval=$with_dstat_symlink; do_dstat_symlink=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-dstat-symlink=$withval" -else $as_nop - do_dstat_symlink=check +else case e in #( + e) do_dstat_symlink=check ;; +esac fi @@ -3523,8 +3558,9 @@ fi if test ${with_perfevent+y} then : withval=$with_perfevent; do_perfevent=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-perfevent=$withval" -else $as_nop - do_perfevent=check +else case e in #( + e) do_perfevent=check ;; +esac fi @@ -3533,8 +3569,9 @@ fi if test ${with_pmdagfs2+y} then : withval=$with_pmdagfs2; do_pmdagfs2=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdagfs2=$withval" -else $as_nop - do_pmdagfs2=check +else case e in #( + e) do_pmdagfs2=check ;; +esac fi @@ -3543,8 +3580,9 @@ fi if test ${with_pmdastatsd+y} then : withval=$with_pmdastatsd; do_pmdastatsd=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdastatsd=$withval" -else $as_nop - do_pmdastatsd=check +else case e in #( + e) do_pmdastatsd=check ;; +esac fi @@ -3553,8 +3591,9 @@ fi if test ${with_pmdabpf+y} then : withval=$with_pmdabpf; do_pmdabpf=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdabpf=$withval" -else $as_nop - do_pmdabpf=check +else case e in #( + e) do_pmdabpf=check ;; +esac fi @@ -3563,8 +3602,9 @@ fi if test ${with_pmdabpftrace+y} then : withval=$with_pmdabpftrace; do_pmdabpftrace=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdabpftrace=$withval" -else $as_nop - do_pmdabpftrace=check +else case e in #( + e) do_pmdabpftrace=check ;; +esac fi @@ -3573,8 +3613,9 @@ fi if test ${with_pmdajson+y} then : withval=$with_pmdajson; do_pmdajson=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdajson=$withval" -else $as_nop - do_pmdajson=check +else case e in #( + e) do_pmdajson=check ;; +esac fi @@ -3583,8 +3624,9 @@ fi if test ${with_pmdamongodb+y} then : withval=$with_pmdamongodb; do_pmdamongodb=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdamongodb=$withval" -else $as_nop - do_pmdamongodb=check +else case e in #( + e) do_pmdamongodb=check ;; +esac fi @@ -3593,8 +3635,9 @@ fi if test ${with_pmdamysql+y} then : withval=$with_pmdamysql; do_pmdamysql=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdamysql=$withval" -else $as_nop - do_pmdamysql=check +else case e in #( + e) do_pmdamysql=check ;; +esac fi @@ -3603,8 +3646,9 @@ fi if test ${with_pmdanutcracker+y} then : withval=$with_pmdanutcracker; do_pmdanutcracker=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdanutcracker=$withval" -else $as_nop - do_pmdanutcracker=check +else case e in #( + e) do_pmdanutcracker=check ;; +esac fi @@ -3613,8 +3657,9 @@ fi if test ${with_pmdasnmp+y} then : withval=$with_pmdasnmp; do_pmdasnmp=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdasnmp=$withval" -else $as_nop - do_pmdasnmp=check +else case e in #( + e) do_pmdasnmp=check ;; +esac fi @@ -3624,8 +3669,9 @@ fi if test ${with_make+y} then : withval=$with_make; MAKE=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-make=$withval" -else $as_nop - MAKE='' +else case e in #( + e) MAKE='' ;; +esac fi @@ -3634,8 +3680,9 @@ fi if test ${with_tar+y} then : withval=$with_tar; TAR=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-tar=$withval" -else $as_nop - TAR='' +else case e in #( + e) TAR='' ;; +esac fi @@ -3644,8 +3691,9 @@ fi if test ${with_zip+y} then : withval=$with_zip; ZIP=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-zip=$withval" -else $as_nop - ZIP='' +else case e in #( + e) ZIP='' ;; +esac fi @@ -3654,8 +3702,9 @@ fi if test ${with_transparent_decompression+y} then : withval=$with_transparent_decompression; do_decompression=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-transparent-decompression=$withval" -else $as_nop - do_decompression=check +else case e in #( + e) do_decompression=check ;; +esac fi @@ -3673,15 +3722,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -3708,14 +3758,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -3742,14 +3793,15 @@ printf %s "checking target system type... " >&6; } if test ${ac_cv_target+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$target_alias" = x; then +else case e in #( + e) if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 printf "%s\n" "$ac_cv_target" >&6; } @@ -3960,8 +4012,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PKG_CONFIG in +else case e in #( + e) case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; @@ -3986,6 +4038,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG @@ -4008,8 +4061,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_PKG_CONFIG in +else case e in #( + e) case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; @@ -4034,6 +4087,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG @@ -4103,8 +4157,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4126,7 +4180,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4152,8 +4207,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4175,7 +4230,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4204,10 +4260,10 @@ esac fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4279,8 +4335,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -4300,7 +4356,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -4311,8 +4367,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -4321,13 +4378,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -4351,10 +4409,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -4364,11 +4422,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4384,6 +4443,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -4423,26 +4484,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4474,16 +4536,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -4494,8 +4558,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4512,12 +4576,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -4535,8 +4601,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -4554,8 +4620,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4570,8 +4636,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4588,12 +4654,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -4620,8 +4689,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4638,25 +4707,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4666,8 +4738,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4684,25 +4756,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4712,8 +4787,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4730,25 +4805,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -4767,8 +4845,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_CCPATH+y} then : printf %s "(cached) " >&6 -else $as_nop - case $CCPATH in +else case e in #( + e) case $CCPATH in [\\/]* | ?:[\\/]*) ac_cv_path_CCPATH="$CCPATH" # Let the user override the test with a path. ;; @@ -4794,6 +4872,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_CCPATH" && ac_cv_path_CCPATH="$CC" ;; +esac ;; esac fi CCPATH=$ac_cv_path_CCPATH @@ -4876,12 +4955,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Compiling with gcc -fstack-protector-all et al." >&5 printf "%s\n" "$as_me: Compiling with gcc -fstack-protector-all et al." >&6;} PCFLAGS="$PCFLAGS -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Compiler does not support -fstack-protector-all et al." >&5 printf "%s\n" "$as_me: Compiler does not support -fstack-protector-all et al." >&6;} CFLAGS="$save_CFLAGS" - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -5065,13 +5145,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Compiling with gcc pie et al." >&5 printf "%s\n" "$as_me: Compiling with gcc pie et al." >&6;} -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Compiler does not support -pie et al." >&5 printf "%s\n" "$as_me: Compiler does not support -pie et al." >&6;} PIECFLAGS="" PIELDFLAGS="" - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -5104,12 +5185,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Compiling DSO PMDAs with gcc -fvisibility=hidden" >&5 printf "%s\n" "$as_me: Compiling DSO PMDAs with gcc -fvisibility=hidden" >&6;} -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Compiler does not support -fvisibility." >&5 printf "%s\n" "$as_me: Compiler does not support -fvisibility." >&6;} INVISIBILITY="" - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$save_CFLAGS" @@ -5140,10 +5222,11 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - C99_CFLAGS="" + C99_CFLAGS="" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$save_CFLAGS" @@ -5176,8 +5259,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX"; then +else case e in #( + e) if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5199,7 +5282,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then @@ -5225,8 +5309,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then +else case e in #( + e) if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5248,7 +5332,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then @@ -5308,8 +5393,8 @@ printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5326,12 +5411,14 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } @@ -5349,8 +5436,8 @@ printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag +else case e in #( + e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" @@ -5368,8 +5455,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" +else case e in #( + e) CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5384,8 +5471,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag +else case e in #( + e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5402,12 +5489,15 @@ if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } @@ -5434,8 +5524,8 @@ printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx11=no +else case e in #( + e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5452,25 +5542,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" + CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 + ac_prog_cxx_stdcxx=cxx11 ;; +esac fi fi if test x$ac_prog_cxx_stdcxx = xno @@ -5480,8 +5573,8 @@ printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx98=no +else case e in #( + e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5498,25 +5591,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" + CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 + ac_prog_cxx_stdcxx=cxx98 ;; +esac fi fi @@ -5552,10 +5648,11 @@ if ac_fn_cxx_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - cxx="" + cxx="" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c @@ -5569,8 +5666,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test ${enable_shared+y} then : enableval=$enable_shared; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --disable-shared=$withval" -else $as_nop - enable_shared=false +else case e in #( + e) enable_shared=false ;; +esac fi @@ -5583,8 +5681,9 @@ then : printf "%s\n" "#define HAVE_MULTILIB 1" >>confdefs.h enable_multilib=true -else $as_nop - enable_multilib=false +else case e in #( + e) enable_multilib=false ;; +esac fi @@ -5599,8 +5698,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - case $AWK in +else case e in #( + e) case $AWK in [\\/]* | ?:[\\/]*) ac_cv_path_AWK="$AWK" # Let the user override the test with a path. ;; @@ -5625,6 +5724,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi AWK=$ac_cv_path_AWK @@ -5660,8 +5760,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 -else $as_nop - case $SED in +else case e in #( + e) case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; @@ -5687,6 +5787,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_SED" && ac_cv_path_SED="/bin/sed" ;; +esac ;; esac fi SED=$ac_cv_path_SED @@ -5714,8 +5815,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ECHO+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ECHO in +else case e in #( + e) case $ECHO in [\\/]* | ?:[\\/]*) ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path. ;; @@ -5741,6 +5842,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_ECHO" && ac_cv_path_ECHO="/bin/echo" ;; +esac ;; esac fi ECHO=$ac_cv_path_ECHO @@ -5768,8 +5870,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_FIND+y} then : printf %s "(cached) " >&6 -else $as_nop - case $FIND in +else case e in #( + e) case $FIND in [\\/]* | ?:[\\/]*) ac_cv_path_FIND="$FIND" # Let the user override the test with a path. ;; @@ -5795,6 +5897,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="/usr/bin/find" ;; +esac ;; esac fi FIND=$ac_cv_path_FIND @@ -5822,8 +5925,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_WHICH+y} then : printf %s "(cached) " >&6 -else $as_nop - case $WHICH in +else case e in #( + e) case $WHICH in [\\/]* | ?:[\\/]*) ac_cv_path_WHICH="$WHICH" # Let the user override the test with a path. ;; @@ -5849,6 +5952,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_WHICH" && ac_cv_path_WHICH="/usr/bin/which" ;; +esac ;; esac fi WHICH=$ac_cv_path_WHICH @@ -5878,8 +5982,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - case $AR in +else case e in #( + e) case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; @@ -5904,6 +6008,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi AR=$ac_cv_path_AR @@ -5936,8 +6041,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LEX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$LEX"; then +else case e in #( + e) if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5959,7 +6064,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then @@ -6017,8 +6123,8 @@ printf %s "checking for lex output file root... " >&6; } if test ${ac_cv_prog_lex_root+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ac_cv_prog_lex_root=unknown { { ac_try="$LEX conftest.l" case "(($ac_try" in @@ -6035,7 +6141,8 @@ if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 printf "%s\n" "$ac_cv_prog_lex_root" >&6; } @@ -6050,15 +6157,15 @@ LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test ${LEXLIB+y} then : -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 printf %s "checking for lex library... " >&6; } if test ${ac_cv_lib_lex+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ac_save_LIBS="$LIBS" ac_found=false for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do @@ -6088,7 +6195,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ fi done LIBS="$ac_save_LIBS" - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 printf "%s\n" "$ac_cv_lib_lex" >&6; } @@ -6100,10 +6208,12 @@ printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LE elif test "$ac_cv_lib_lex" = 'none needed' then : LEXLIB='' -else $as_nop - LEXLIB=$ac_cv_lib_lex +else case e in #( + e) LEXLIB=$ac_cv_lib_lex ;; +esac fi - + ;; +esac fi @@ -6115,8 +6225,8 @@ printf %s "checking whether yytext is a pointer... " >&6; } if test ${ac_cv_prog_lex_yytext_pointer+y} then : printf %s "(cached) " >&6 -else $as_nop - # POSIX says lex can declare yytext either as a pointer or an array; the +else case e in #( + e) # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no @@ -6131,7 +6241,8 @@ then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } @@ -6162,8 +6273,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$YACC"; then +else case e in #( + e) if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6185,7 +6296,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then @@ -6222,8 +6334,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RAGEL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RAGEL"; then +else case e in #( + e) if test -n "$RAGEL"; then ac_cv_prog_RAGEL="$RAGEL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6245,7 +6357,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RAGEL=$ac_cv_prog_RAGEL if test -n "$RAGEL"; then @@ -6314,8 +6427,8 @@ printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then +else case e in #( + e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6334,9 +6447,10 @@ do as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in +case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -6371,7 +6485,8 @@ IFS=$as_save_IFS else ac_cv_path_GREP=$GREP fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } @@ -6383,8 +6498,8 @@ printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -6406,9 +6521,10 @@ do as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in +case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -6444,12 +6560,15 @@ else ac_cv_path_EGREP=$EGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if USDT probes should be used" >&5 @@ -6475,9 +6594,10 @@ fi printf "%s\n" "#define HAVE_STATIC_PROBES $result" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -6557,8 +6677,8 @@ See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. @@ -6568,7 +6688,7 @@ and gperftools_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else gperftools_CFLAGS=$pkg_cv_gperftools_CFLAGS gperftools_LIBS=$pkg_cv_gperftools_LIBS @@ -6616,8 +6736,9 @@ SYSTEMD_TMPFILESDIR=$pkg_cv_SYSTEMD_TMPFILESDIR if test "x$SYSTEMD_TMPFILESDIR" = x"" then : pcp_systemdtmpfiles_dir=$pcp_lib32_dir/tmpfiles.d -else $as_nop - pcp_systemdtmpfiles_dir=$SYSTEMD_TMPFILESDIR +else case e in #( + e) pcp_systemdtmpfiles_dir=$SYSTEMD_TMPFILESDIR ;; +esac fi @@ -6643,8 +6764,9 @@ SYSTEMD_SYSUSERSDIR=$pkg_cv_SYSTEMD_SYSUSERSDIR if test "x$SYSTEMD_SYSUSERSDIR" = x"" then : pcp_systemdsysusers_dir=$pcp_lib32_dir/sysusers.d -else $as_nop - pcp_systemdsysusers_dir=$SYSTEMD_SYSUSERSDIR +else case e in #( + e) pcp_systemdsysusers_dir=$SYSTEMD_SYSUSERSDIR ;; +esac fi @@ -6670,8 +6792,9 @@ SYSTEMD_SYSTEMUNITDIR=$pkg_cv_SYSTEMD_SYSTEMUNITDIR if test "x$SYSTEMD_SYSTEMUNITDIR" = x"" then : enable_systemd=false -else $as_nop - pcp_systemdunit_dir=$SYSTEMD_SYSTEMUNITDIR +else case e in #( + e) pcp_systemdunit_dir=$SYSTEMD_SYSTEMUNITDIR ;; +esac fi if test -z "$pcp_systemdunit_dir" @@ -6732,8 +6855,9 @@ if test "x$ac_cv_header_systemd_sd_daemon_h" = xyes then : printf "%s\n" "#define HAVE_SYSTEMD_SD_DAEMON_H 1" >>confdefs.h have_sd_daemon=true -else $as_nop - have_sd_daemon=false +else case e in #( + e) have_sd_daemon=false ;; +esac fi done @@ -6794,8 +6918,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -6825,14 +6949,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -6922,7 +7046,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -6931,12 +7054,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -7008,7 +7132,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -7037,7 +7161,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -7077,11 +7200,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -7095,11 +7219,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -7182,9 +7307,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -7265,10 +7390,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -7284,7 +7411,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7315,7 +7442,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -7348,10 +7475,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -7410,8 +7537,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -7419,8 +7546,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -7477,7 +7604,7 @@ do "src/libpcp3/src/include/pcp/platform_defs.h") CONFIG_FILES="$CONFIG_FILES src/libpcp3/src/include/pcp/platform_defs.h" ;; "src/libpcp3/src/include/pcp/platformsz.h") CONFIG_FILES="$CONFIG_FILES src/libpcp3/src/include/pcp/platformsz.h" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -7496,7 +7623,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -7520,7 +7647,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -7678,13 +7805,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -7794,7 +7921,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -7816,19 +7943,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -7952,7 +8079,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -7981,9 +8108,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -8067,8 +8194,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_GIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$GIT"; then +else case e in #( + e) if test -n "$GIT"; then ac_cv_prog_GIT="$GIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8090,7 +8217,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi GIT=$ac_cv_prog_GIT if test -n "$GIT"; then @@ -8116,8 +8244,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PYLINT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PYLINT"; then +else case e in #( + e) if test -n "$PYLINT"; then ac_cv_prog_PYLINT="$PYLINT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8139,7 +8267,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PYLINT=$ac_cv_prog_PYLINT if test -n "$PYLINT"; then @@ -8189,8 +8318,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PYTHON3+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PYTHON3 in +else case e in #( + e) case $PYTHON3 in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON3="$PYTHON3" # Let the user override the test with a path. ;; @@ -8215,6 +8344,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi PYTHON3=$ac_cv_path_PYTHON3 @@ -8310,13 +8440,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found in $PY_INCLUDE_DIRS" >&5 printf "%s\n" "found in $PY_INCLUDE_DIRS" >&6; } -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } echo WARNING: Python version $PY_MAJOR.$PY_MINOR header file may be missing. echo Proceeding with the Python $PY_MAJOR installation found, regardless. - + ;; +esac fi done @@ -8626,8 +8757,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_CLANG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $CLANG in +else case e in #( + e) case $CLANG in [\\/]* | ?:[\\/]*) ac_cv_path_CLANG="$CLANG" # Let the user override the test with a path. ;; @@ -8652,6 +8783,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi CLANG=$ac_cv_path_CLANG @@ -8687,8 +8819,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_LLVM_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - case $LLVM_STRIP in +else case e in #( + e) case $LLVM_STRIP in [\\/]* | ?:[\\/]*) ac_cv_path_LLVM_STRIP="$LLVM_STRIP" # Let the user override the test with a path. ;; @@ -8713,6 +8845,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi LLVM_STRIP=$ac_cv_path_LLVM_STRIP @@ -8818,8 +8951,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PERL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PERL"; then +else case e in #( + e) if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8841,7 +8974,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then @@ -8919,8 +9053,9 @@ printf "%s\n" "no" >&6; } fi fi -else $as_nop - have_perl=false +else case e in #( + e) have_perl=false ;; +esac fi @@ -9278,8 +9413,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_QMAKE+y} then : printf %s "(cached) " >&6 -else $as_nop - case $QMAKE in +else case e in #( + e) case $QMAKE in [\\/]* | ?:[\\/]*) ac_cv_path_QMAKE="$QMAKE" # Let the user override the test with a path. ;; @@ -9305,6 +9440,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi QMAKE=$ac_cv_path_QMAKE @@ -9330,8 +9466,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_QMAKE+y} then : printf %s "(cached) " >&6 -else $as_nop - case $QMAKE in +else case e in #( + e) case $QMAKE in [\\/]* | ?:[\\/]*) ac_cv_path_QMAKE="$QMAKE" # Let the user override the test with a path. ;; @@ -9357,6 +9493,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi QMAKE=$ac_cv_path_QMAKE @@ -9450,8 +9587,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MAKE+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAKE in +else case e in #( + e) case $MAKE in [\\/]* | ?:[\\/]*) ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path. ;; @@ -9476,6 +9613,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi MAKE=$ac_cv_path_MAKE @@ -9540,8 +9678,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -9559,9 +9697,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -9575,15 +9714,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -9592,7 +9732,8 @@ fi done ac_cv_prog_CPP=$CPP - + ;; +esac fi CPP=$ac_cv_prog_CPP else @@ -9615,9 +9756,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -9631,24 +9773,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -9669,8 +9813,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $LD in +else case e in #( + e) case $LD in [\\/]* | ?:[\\/]*) ac_cv_path_LD="$LD" # Let the user override the test with a path. ;; @@ -9696,6 +9840,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_LD" && ac_cv_path_LD="/usr/bin/ld" ;; +esac ;; esac fi LD=$ac_cv_path_LD @@ -9743,8 +9888,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_TAR+y} then : printf %s "(cached) " >&6 -else $as_nop - case $TAR in +else case e in #( + e) case $TAR in [\\/]* | ?:[\\/]*) ac_cv_path_TAR="$TAR" # Let the user override the test with a path. ;; @@ -9769,6 +9914,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi TAR=$ac_cv_path_TAR @@ -9801,8 +9947,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ZIP+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ZIP in +else case e in #( + e) case $ZIP in [\\/]* | ?:[\\/]*) ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path. ;; @@ -9828,6 +9974,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_ZIP" && ac_cv_path_ZIP="/bin/gzip" ;; +esac ;; esac fi ZIP=$ac_cv_path_ZIP @@ -9856,8 +10003,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_BZIP2+y} then : printf %s "(cached) " >&6 -else $as_nop - case $BZIP2 in +else case e in #( + e) case $BZIP2 in [\\/]* | ?:[\\/]*) ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path. ;; @@ -9883,6 +10030,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_BZIP2" && ac_cv_path_BZIP2="/bin/bzip2" ;; +esac ;; esac fi BZIP2=$ac_cv_path_BZIP2 @@ -9911,8 +10059,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_LZMA+y} then : printf %s "(cached) " >&6 -else $as_nop - case $LZMA in +else case e in #( + e) case $LZMA in [\\/]* | ?:[\\/]*) ac_cv_path_LZMA="$LZMA" # Let the user override the test with a path. ;; @@ -9938,6 +10086,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_LZMA" && ac_cv_path_LZMA="/bin/lzma" ;; +esac ;; esac fi LZMA=$ac_cv_path_LZMA @@ -9966,8 +10115,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_XZ+y} then : printf %s "(cached) " >&6 -else $as_nop - case $XZ in +else case e in #( + e) case $XZ in [\\/]* | ?:[\\/]*) ac_cv_path_XZ="$XZ" # Let the user override the test with a path. ;; @@ -9993,6 +10142,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_XZ" && ac_cv_path_XZ="/bin/xz" ;; +esac ;; esac fi XZ=$ac_cv_path_XZ @@ -10021,8 +10171,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_HDIUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - case $HDIUTIL in +else case e in #( + e) case $HDIUTIL in [\\/]* | ?:[\\/]*) ac_cv_path_HDIUTIL="$HDIUTIL" # Let the user override the test with a path. ;; @@ -10047,6 +10197,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi HDIUTIL=$ac_cv_path_HDIUTIL @@ -10071,8 +10222,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MKINSTALLP+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MKINSTALLP in +else case e in #( + e) case $MKINSTALLP in [\\/]* | ?:[\\/]*) ac_cv_path_MKINSTALLP="$MKINSTALLP" # Let the user override the test with a path. ;; @@ -10097,6 +10248,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi MKINSTALLP=$ac_cv_path_MKINSTALLP @@ -10121,8 +10273,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKGMK+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PKGMK in +else case e in #( + e) case $PKGMK in [\\/]* | ?:[\\/]*) ac_cv_path_PKGMK="$PKGMK" # Let the user override the test with a path. ;; @@ -10147,6 +10299,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi PKGMK=$ac_cv_path_PKGMK @@ -10171,8 +10324,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - case $DLLTOOL in +else case e in #( + e) case $DLLTOOL in [\\/]* | ?:[\\/]*) ac_cv_path_DLLTOOL="$DLLTOOL" # Let the user override the test with a path. ;; @@ -10197,6 +10350,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi DLLTOOL=$ac_cv_path_DLLTOOL @@ -10221,8 +10375,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_RPMBUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $RPMBUILD in +else case e in #( + e) case $RPMBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_RPMBUILD="$RPMBUILD" # Let the user override the test with a path. ;; @@ -10247,6 +10401,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi RPMBUILD=$ac_cv_path_RPMBUILD @@ -10272,8 +10427,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_RPM+y} then : printf %s "(cached) " >&6 -else $as_nop - case $RPM in +else case e in #( + e) case $RPM in [\\/]* | ?:[\\/]*) ac_cv_path_RPM="$RPM" # Let the user override the test with a path. ;; @@ -10298,6 +10453,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi RPM=$ac_cv_path_RPM @@ -10331,8 +10487,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_POD2MAN+y} then : printf %s "(cached) " >&6 -else $as_nop - case $POD2MAN in +else case e in #( + e) case $POD2MAN in [\\/]* | ?:[\\/]*) ac_cv_path_POD2MAN="$POD2MAN" # Let the user override the test with a path. ;; @@ -10357,6 +10513,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi POD2MAN=$ac_cv_path_POD2MAN @@ -10380,8 +10537,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_TRUEPROG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $TRUEPROG in +else case e in #( + e) case $TRUEPROG in [\\/]* | ?:[\\/]*) ac_cv_path_TRUEPROG="$TRUEPROG" # Let the user override the test with a path. ;; @@ -10406,6 +10563,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi TRUEPROG=$ac_cv_path_TRUEPROG @@ -10427,8 +10585,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MAKEDEPEND+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAKEDEPEND in +else case e in #( + e) case $MAKEDEPEND in [\\/]* | ?:[\\/]*) ac_cv_path_MAKEDEPEND="$MAKEDEPEND" # Let the user override the test with a path. ;; @@ -10454,6 +10612,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_MAKEDEPEND" && ac_cv_path_MAKEDEPEND="$TRUEPROG" ;; +esac ;; esac fi MAKEDEPEND=$ac_cv_path_MAKEDEPEND @@ -10478,8 +10637,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MD5SUM+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MD5SUM in +else case e in #( + e) case $MD5SUM in [\\/]* | ?:[\\/]*) ac_cv_path_MD5SUM="$MD5SUM" # Let the user override the test with a path. ;; @@ -10505,6 +10664,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_MD5SUM" && ac_cv_path_MD5SUM="$TRUEPROG" ;; +esac ;; esac fi MD5SUM=$ac_cv_path_MD5SUM @@ -10529,8 +10689,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DPKG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $DPKG in +else case e in #( + e) case $DPKG in [\\/]* | ?:[\\/]*) ac_cv_path_DPKG="$DPKG" # Let the user override the test with a path. ;; @@ -10555,6 +10715,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi DPKG=$ac_cv_path_DPKG @@ -10579,8 +10740,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MAKEPKG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAKEPKG in +else case e in #( + e) case $MAKEPKG in [\\/]* | ?:[\\/]*) ac_cv_path_MAKEPKG="$MAKEPKG" # Let the user override the test with a path. ;; @@ -10605,6 +10766,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi MAKEPKG=$ac_cv_path_MAKEPKG @@ -10661,14 +10823,14 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 printf %s "checking for $ac_hdr that defines DIR... " >&6; } if eval test \${$as_ac_Header+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> @@ -10685,10 +10847,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_ac_Header=yes" -else $as_nop - eval "$as_ac_Header=no" +else case e in #( + e) eval "$as_ac_Header=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$as_ac_Header { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -10696,7 +10860,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -10710,15 +10874,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) 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. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -10749,11 +10919,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -10770,15 +10942,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) 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. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -10809,11 +10987,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -10832,8 +11012,8 @@ printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if test ${ac_cv_header_sys_wait_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -10857,10 +11037,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_sys_wait_h=yes -else $as_nop - ac_cv_header_sys_wait_h=no +else case e in #( + e) ac_cv_header_sys_wait_h=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } @@ -11349,9 +11531,10 @@ then : printf "%s\n" "#define HAVE_SYS_ENDIAN_H 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -11377,9 +11560,10 @@ then : printf "%s\n" "#define HAVE_MACHINE_ENDIAN_H 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -11406,9 +11590,10 @@ then : printf "%s\n" "#define HAVE_SYS_ENDIAN_H 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -11417,16 +11602,22 @@ printf %s "checking for regcomp in -lregex... " >&6; } if test ${ac_cv_lib_regex_regcomp+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lregex $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. */ -char regcomp (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char regcomp (void); int main (void) { @@ -11438,12 +11629,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_regex_regcomp=yes -else $as_nop - ac_cv_lib_regex_regcomp=no +else case e in #( + e) ac_cv_lib_regex_regcomp=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_regex_regcomp" >&5 printf "%s\n" "$ac_cv_lib_regex_regcomp" >&6; } @@ -11541,16 +11734,22 @@ printf %s "checking for BIO_write_ex in -lcrypto... " >&6; } if test ${ac_cv_lib_crypto_BIO_write_ex+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $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. */ -char BIO_write_ex (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char BIO_write_ex (void); int main (void) { @@ -11562,12 +11761,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_crypto_BIO_write_ex=yes -else $as_nop - ac_cv_lib_crypto_BIO_write_ex=no +else case e in #( + e) ac_cv_lib_crypto_BIO_write_ex=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_BIO_write_ex" >&5 printf "%s\n" "$ac_cv_lib_crypto_BIO_write_ex" >&6; } @@ -11577,8 +11778,9 @@ then : LIBS="-lcrypto $LIBS" -else $as_nop - have_openssl=false +else case e in #( + e) have_openssl=false ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_trace in -lssl" >&5 @@ -11586,16 +11788,22 @@ printf %s "checking for SSL_trace in -lssl... " >&6; } if test ${ac_cv_lib_ssl_SSL_trace+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $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. */ -char SSL_trace (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char SSL_trace (void); int main (void) { @@ -11607,12 +11815,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ssl_SSL_trace=yes -else $as_nop - ac_cv_lib_ssl_SSL_trace=no +else case e in #( + e) ac_cv_lib_ssl_SSL_trace=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_trace" >&5 printf "%s\n" "$ac_cv_lib_ssl_SSL_trace" >&6; } @@ -11955,16 +12165,22 @@ printf %s "checking for uv_pipe_chmod in -luv... " >&6; } if test ${ac_cv_lib_uv_uv_pipe_chmod+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-luv $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. */ -char uv_pipe_chmod (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char uv_pipe_chmod (void); int main (void) { @@ -11976,12 +12192,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_uv_uv_pipe_chmod=yes -else $as_nop - ac_cv_lib_uv_uv_pipe_chmod=no +else case e in #( + e) ac_cv_lib_uv_uv_pipe_chmod=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uv_uv_pipe_chmod" >&5 printf "%s\n" "$ac_cv_lib_uv_uv_pipe_chmod" >&6; } @@ -11991,8 +12209,9 @@ then : printf "%s\n" "#define HAVE_UV_PIPE_CHMOD 1" >>confdefs.h have_uv_pipe_chmod=true -else $as_nop - have_uv_pipe_chmod=false +else case e in #( + e) have_uv_pipe_chmod=false ;; +esac fi @@ -12001,16 +12220,22 @@ printf %s "checking for ini_parse in -linih... " >&6; } if test ${ac_cv_lib_inih_ini_parse+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-linih $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. */ -char ini_parse (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char ini_parse (void); int main (void) { @@ -12022,12 +12247,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_inih_ini_parse=yes -else $as_nop - ac_cv_lib_inih_ini_parse=no +else case e in #( + e) ac_cv_lib_inih_ini_parse=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inih_ini_parse" >&5 printf "%s\n" "$ac_cv_lib_inih_ini_parse" >&6; } @@ -12036,11 +12263,12 @@ then : have_libinih=true lib_for_inih="-linih" -else $as_nop - have_libinih=false +else case e in #( + e) have_libinih=false lib_for_inih="" - + ;; +esac fi HAVE_LIBINIH=$have_libinih @@ -12375,10 +12603,11 @@ then : have_devmapper=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - have_devmapper=false +else case e in #( + e) have_devmapper=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -12574,8 +12803,9 @@ if test "x$ac_cv_header_infiniband_verbs_h" = xyes then : printf "%s\n" "#define HAVE_INFINIBAND_VERBS_H 1" >>confdefs.h have_ibverbs=true -else $as_nop - have_ibverbs=false +else case e in #( + e) have_ibverbs=false ;; +esac fi done @@ -12584,16 +12814,22 @@ printf %s "checking for madrpc_init in -libmad... " >&6; } if test ${ac_cv_lib_ibmad_madrpc_init+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-libmad $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. */ -char madrpc_init (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char madrpc_init (void); int main (void) { @@ -12605,12 +12841,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ibmad_madrpc_init=yes -else $as_nop - ac_cv_lib_ibmad_madrpc_init=no +else case e in #( + e) ac_cv_lib_ibmad_madrpc_init=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ibmad_madrpc_init" >&5 printf "%s\n" "$ac_cv_lib_ibmad_madrpc_init" >&6; } @@ -12627,16 +12865,22 @@ printf %s "checking for umad_init in -libumad... " >&6; } if test ${ac_cv_lib_ibumad_umad_init+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-libumad $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. */ -char umad_init (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char umad_init (void); int main (void) { @@ -12648,12 +12892,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ibumad_umad_init=yes -else $as_nop - ac_cv_lib_ibumad_umad_init=no +else case e in #( + e) ac_cv_lib_ibumad_umad_init=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ibumad_umad_init" >&5 printf "%s\n" "$ac_cv_lib_ibumad_umad_init" >&6; } @@ -12670,16 +12916,22 @@ printf %s "checking for ibv_get_device_list in -libverbs... " >&6; } if test ${ac_cv_lib_ibverbs_ibv_get_device_list+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-libverbs $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. */ -char ibv_get_device_list (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char ibv_get_device_list (void); int main (void) { @@ -12691,12 +12943,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ibverbs_ibv_get_device_list=yes -else $as_nop - ac_cv_lib_ibverbs_ibv_get_device_list=no +else case e in #( + e) ac_cv_lib_ibverbs_ibv_get_device_list=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ibverbs_ibv_get_device_list" >&5 printf "%s\n" "$ac_cv_lib_ibverbs_ibv_get_device_list" >&6; } @@ -12720,8 +12974,14 @@ printf %s "checking for port_performance_query_via... " >&6; } /* 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. */ -char port_performance_query_via (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char port_performance_query_via (void); int main (void) { @@ -12738,10 +12998,11 @@ printf "%s\n" "#define HAVE_PORT_PERFORMANCE_QUERY_VIA 1" >>confdefs.h have_port_performance_query_via=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - have_port_performance_query_via=false +else case e in #( + e) have_port_performance_query_via=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -12752,8 +13013,14 @@ printf %s "checking for pma_query_via... " >&6; } /* 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. */ -char pma_query_via (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pma_query_via (void); int main (void) { @@ -12770,10 +13037,11 @@ printf "%s\n" "#define HAVE_PMA_QUERY_VIA 1" >>confdefs.h have_pma_query_via=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - have_pma_query_via=false +else case e in #( + e) have_pma_query_via=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -12830,16 +13098,22 @@ printf %s "checking for pfm_get_os_event_encoding in -lpfm... " >&6; } if test ${ac_cv_lib_pfm_pfm_get_os_event_encoding+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpfm $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. */ -char pfm_get_os_event_encoding (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pfm_get_os_event_encoding (void); int main (void) { @@ -12851,20 +13125,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pfm_pfm_get_os_event_encoding=yes -else $as_nop - ac_cv_lib_pfm_pfm_get_os_event_encoding=no +else case e in #( + e) ac_cv_lib_pfm_pfm_get_os_event_encoding=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pfm_pfm_get_os_event_encoding" >&5 printf "%s\n" "$ac_cv_lib_pfm_pfm_get_os_event_encoding" >&6; } if test "x$ac_cv_lib_pfm_pfm_get_os_event_encoding" = xyes then : pfm_libs="-lpfm" -else $as_nop - enable_perfevent=false +else case e in #( + e) enable_perfevent=false ;; +esac fi for ac_header in perfmon/pfmlib_perf_event.h @@ -12874,8 +13151,9 @@ if test "x$ac_cv_header_perfmon_pfmlib_perf_event_h" = xyes then : printf "%s\n" "#define HAVE_PERFMON_PFMLIB_PERF_EVENT_H 1" >>confdefs.h -else $as_nop - enable_perfevent=false +else case e in #( + e) enable_perfevent=false ;; +esac fi done @@ -12903,16 +13181,22 @@ printf %s "checking for hdr_init in -lhdr_histogram... " >&6; } if test ${ac_cv_lib_hdr_histogram_hdr_init+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lhdr_histogram $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. */ -char hdr_init (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char hdr_init (void); int main (void) { @@ -12924,12 +13208,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_hdr_histogram_hdr_init=yes -else $as_nop - ac_cv_lib_hdr_histogram_hdr_init=no +else case e in #( + e) ac_cv_lib_hdr_histogram_hdr_init=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdr_histogram_hdr_init" >&5 printf "%s\n" "$ac_cv_lib_hdr_histogram_hdr_init" >&6; } @@ -12945,16 +13231,22 @@ printf %s "checking for chan_init in -lchan... " >&6; } if test ${ac_cv_lib_chan_chan_init+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lchan $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. */ -char chan_init (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char chan_init (void); int main (void) { @@ -12966,12 +13258,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_chan_chan_init=yes -else $as_nop - ac_cv_lib_chan_chan_init=no +else case e in #( + e) ac_cv_lib_chan_chan_init=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_chan_chan_init" >&5 printf "%s\n" "$ac_cv_lib_chan_chan_init" >&6; } @@ -13032,8 +13326,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_QSHAPE+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$QSHAPE"; then +else case e in #( + e) if test -n "$QSHAPE"; then ac_cv_prog_QSHAPE="$QSHAPE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13056,7 +13350,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi QSHAPE=$ac_cv_prog_QSHAPE if test -n "$QSHAPE"; then @@ -13582,16 +13877,22 @@ printf %s "checking for backtrace in -lexecinfo... " >&6; } if test ${ac_cv_lib_execinfo_backtrace+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lexecinfo $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. */ -char backtrace (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char backtrace (void); int main (void) { @@ -13603,12 +13904,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_execinfo_backtrace=yes -else $as_nop - ac_cv_lib_execinfo_backtrace=no +else case e in #( + e) ac_cv_lib_execinfo_backtrace=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5 printf "%s\n" "$ac_cv_lib_execinfo_backtrace" >&6; } @@ -13665,9 +13968,10 @@ printf "%s\n" "#define HAVE___EXECUTABLE_START 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13694,9 +13998,10 @@ printf "%s\n" "#define HAVE___ETEXT 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13723,9 +14028,10 @@ printf "%s\n" "#define HAVE__ETEXT 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13752,9 +14058,10 @@ printf "%s\n" "#define HAVE_ETEXT 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13769,50 +14076,55 @@ then if test "x$ac_cv_type___int32_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __int32_t int32_t" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "__uint32_t" "ac_cv_type___uint32_t" "$ac_includes_default" if test "x$ac_cv_type___uint32_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __uint32_t uint32_t" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "__int64_t" "ac_cv_type___int64_t" "$ac_includes_default" if test "x$ac_cv_type___int64_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __int64_t int64_t" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "__uint64_t" "ac_cv_type___uint64_t" "$ac_includes_default" if test "x$ac_cv_type___uint64_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __uint64_t uint64_t" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default" if test "x$ac_cv_type_uint_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define uint_t u_int32_t" >>confdefs.h - + ;; +esac fi else @@ -13820,50 +14132,55 @@ else if test "x$ac_cv_type___int32_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __int32_t int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "__uint32_t" "ac_cv_type___uint32_t" "$ac_includes_default" if test "x$ac_cv_type___uint32_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __uint32_t unsigned int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "__int64_t" "ac_cv_type___int64_t" "$ac_includes_default" if test "x$ac_cv_type___int64_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __int64_t long long" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "__uint64_t" "ac_cv_type___uint64_t" "$ac_includes_default" if test "x$ac_cv_type___uint64_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __uint64_t unsigned long long" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default" if test "x$ac_cv_type_uint_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define uint_t unsigned int" >>confdefs.h - + ;; +esac fi fi @@ -13891,9 +14208,10 @@ then : printf "%s\n" "#define HAVE___PSINT_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13921,9 +14239,10 @@ then : printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13952,9 +14271,10 @@ then : printf "%s\n" "#define HAVE_UID_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gid_t " >&5 @@ -13982,9 +14302,10 @@ then : printf "%s\n" "#define HAVE_GID_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SID " >&5 @@ -14010,9 +14331,10 @@ then : printf "%s\n" "#define HAVE_SID 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -14040,9 +14362,10 @@ then : printf "%s\n" "#define HAVE_SOCKLEN_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -14113,9 +14436,10 @@ then : printf "%s\n" "#define HAVE_PR_TERMCHILD 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -14142,37 +14466,35 @@ then : printf "%s\n" "#define HAVE_PR_SET_PDEATHSIG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether termios.h defines TIOCGWINSZ" >&5 printf %s "checking whether termios.h defines TIOCGWINSZ... " >&6; } if test ${ac_cv_sys_tiocgwinsz_in_termios_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +$ac_includes_default #include -#ifdef TIOCGWINSZ - yes -#endif +const int tiocgwinsz = TIOCGWINSZ; _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 +if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_tiocgwinsz_in_termios_h=yes -else $as_nop - ac_cv_sys_tiocgwinsz_in_termios_h=no +else case e in #( + e) ac_cv_sys_tiocgwinsz_in_termios_h=no ;; +esac fi -rm -rf conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 printf "%s\n" "$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } @@ -14183,25 +14505,23 @@ printf %s "checking whether sys/ioctl.h defines TIOCGWINSZ... " >&6; } if test ${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +$ac_includes_default #include -#ifdef TIOCGWINSZ - yes -#endif +const int tiocgwinsz = TIOCGWINSZ; _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 +if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes -else $as_nop - ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no +else case e in #( + e) ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no ;; +esac fi -rm -rf conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 printf "%s\n" "$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; } @@ -14234,11 +14554,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } rdynamic_flag=-rdynamic -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } rdynamic_flag= - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14669,13 +14990,14 @@ if test "x$ac_cv_header_pthread_h" = xyes then : printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h -else $as_nop - +else case e in #( + e) if test "$do_threads" = "yes" then as_fn_error $? "cannot enable multi-threaded mode - no pthread.h" "$LINENO" 5 fi - + ;; +esac fi done @@ -14699,8 +15021,8 @@ then : printf "%s\n" "#define HAVE_PTHREAD_MUTEX_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - +else case e in #( + e) if test "$do_threads" = "yes" then as_fn_error $? "cannot enable multi-threaded mode - no mutexes" "$LINENO" 5 @@ -14708,7 +15030,8 @@ else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -14795,9 +15118,10 @@ then : printf "%s\n" "#define HAVE___THREAD 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext else @@ -14819,9 +15143,10 @@ then : printf "%s\n" "#define HAVE___THREAD 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -14845,9 +15170,10 @@ then : printf "%s\n" "#define HAVE_PTHREAD_BARRIER_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -15098,16 +15424,22 @@ printf %s "checking for basename in -lgen... " >&6; } if test ${ac_cv_lib_gen_basename+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $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. */ -char basename (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char basename (void); int main (void) { @@ -15119,12 +15451,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_gen_basename=yes -else $as_nop - ac_cv_lib_gen_basename=no +else case e in #( + e) ac_cv_lib_gen_basename=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_basename" >&5 printf "%s\n" "$ac_cv_lib_gen_basename" >&6; } @@ -15166,16 +15500,22 @@ printf %s "checking for clock_gettime in -lrt... " >&6; } if test ${ac_cv_lib_rt_clock_gettime+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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. */ -char clock_gettime (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (void); int main (void) { @@ -15187,12 +15527,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_rt_clock_gettime=yes -else $as_nop - ac_cv_lib_rt_clock_gettime=no +else case e in #( + e) ac_cv_lib_rt_clock_gettime=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; } @@ -15229,16 +15571,22 @@ printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -15250,12 +15598,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } @@ -15292,16 +15642,22 @@ printf %s "checking for flog10 in -lm... " >&6; } if test ${ac_cv_lib_m_flog10+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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. */ -char flog10 (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char flog10 (void); int main (void) { @@ -15313,12 +15669,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_flog10=yes -else $as_nop - ac_cv_lib_m_flog10=no +else case e in #( + e) ac_cv_lib_m_flog10=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_flog10" >&5 printf "%s\n" "$ac_cv_lib_m_flog10" >&6; } @@ -15356,16 +15714,22 @@ printf %s "checking for pow in -lm... " >&6; } if test ${ac_cv_lib_m_pow+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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. */ -char pow (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pow (void); int main (void) { @@ -15377,12 +15741,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_pow=yes -else $as_nop - ac_cv_lib_m_pow=no +else case e in #( + e) ac_cv_lib_m_pow=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 printf "%s\n" "$ac_cv_lib_m_pow" >&6; } @@ -15489,16 +15855,22 @@ printf %s "checking for isnan in -lm... " >&6; } if test ${ac_cv_lib_m_isnan+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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. */ -char isnan (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char isnan (void); int main (void) { @@ -15510,12 +15882,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_isnan=yes -else $as_nop - ac_cv_lib_m_isnan=no +else case e in #( + e) ac_cv_lib_m_isnan=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isnan" >&5 printf "%s\n" "$ac_cv_lib_m_isnan" >&6; } @@ -15549,16 +15923,22 @@ printf %s "checking for isnanf in -lm... " >&6; } if test ${ac_cv_lib_m_isnanf+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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. */ -char isnanf (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char isnanf (void); int main (void) { @@ -15570,12 +15950,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_isnanf=yes -else $as_nop - ac_cv_lib_m_isnanf=no +else case e in #( + e) ac_cv_lib_m_isnanf=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isnanf" >&5 printf "%s\n" "$ac_cv_lib_m_isnanf" >&6; } @@ -15724,13 +16106,148 @@ have_stat_type=false have_stat_name=false if test $have_stat_name = false then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[ ]st_mtimespec" >/dev/null 2>&1 + $EGREP_TRADITIONAL "[ ]st_mtimespec" >/dev/null 2>&1 then : have_stat_name=true; @@ -15748,7 +16265,7 @@ then _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[ ]st_mtime" >/dev/null 2>&1 + $EGREP_TRADITIONAL "[ ]st_mtime" >/dev/null 2>&1 then : have_stat_name=true; @@ -15766,7 +16283,7 @@ then _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "timestruc_t[ ][ ]*st_mtim" >/dev/null 2>&1 + $EGREP_TRADITIONAL "timestruc_t[ ][ ]*st_mtim" >/dev/null 2>&1 then : have_stat_type=true; @@ -15784,7 +16301,7 @@ then _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "timespec_t[ ][ ]*st_mtim" >/dev/null 2>&1 + $EGREP_TRADITIONAL "timespec_t[ ][ ]*st_mtim" >/dev/null 2>&1 then : have_stat_type=true; @@ -15802,7 +16319,7 @@ then _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "timespec[ ][ ]*st_mtim" >/dev/null 2>&1 + $EGREP_TRADITIONAL "timespec[ ][ ]*st_mtim" >/dev/null 2>&1 then : have_stat_type=true; @@ -15820,7 +16337,7 @@ then _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "time_t[ ][ ]*st_mtim" >/dev/null 2>&1 + $EGREP_TRADITIONAL "time_t[ ][ ]*st_mtim" >/dev/null 2>&1 then : have_stat_type=true; @@ -15913,8 +16430,9 @@ pcp_lib32_dir=`echo $pcp_lib_dir | sed -e s,64,, -e s,//,/,` if test ${with_perl_installdirs+y} then : withval=$with_perl_installdirs; perl_installdirs=$withval -else $as_nop - perl_installdirs=vendor +else case e in #( + e) perl_installdirs=vendor ;; +esac fi perl_installdirs=`eval echo $perl_installdirs` @@ -15925,8 +16443,9 @@ perl_installdirs=`eval echo $perl_installdirs` if test ${with_perl_install_base+y} then : withval=$with_perl_install_base; perl_install_base=$withval -else $as_nop - perl_install_base=$prefix +else case e in #( + e) perl_install_base=$prefix ;; +esac fi perl_install_base=`eval echo $perl_install_base` @@ -15938,8 +16457,9 @@ perl_install_base=`eval echo $perl_install_base` if test ${with_python_prefix+y} then : withval=$with_python_prefix; python_prefix=$withval -else $as_nop - python_prefix=$prefix +else case e in #( + e) python_prefix=$prefix ;; +esac fi python_prefix=`eval echo $python_prefix` @@ -15956,7 +16476,7 @@ then : withval=$with_x; fi -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +# $have_x is 'yes', 'no', 'disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled @@ -15966,8 +16486,8 @@ else *,NONE | NONE,*) if test ${ac_cv_have_x+y} then : printf %s "(cached) " >&6 -else $as_nop - # One or both of the vars are not set, and there is no cached value. +else case e in #( + e) # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no # Do we need to do anything special at all? @@ -16090,13 +16610,14 @@ if ac_fn_c_try_cpp "$LINENO" then : # We can compile using X headers with no special include directory. ac_x_includes= -else $as_nop - for ac_dir in $ac_x_header_dirs; do +else case e in #( + e) for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi -done +done ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no @@ -16123,8 +16644,8 @@ then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= -else $as_nop - LIBS=$ac_save_LIBS +else case e in #( + e) LIBS=$ac_save_LIBS for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! @@ -16134,7 +16655,8 @@ do break 2 fi done -done +done ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16151,6 +16673,7 @@ case $ac_x_includes,$ac_x_libraries in #( ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" ;; +esac ;; esac fi ;; #( @@ -16212,8 +16735,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" -else $as_nop - LIBS="$ac_xsave_LIBS -R $x_libraries" +else case e in #( + e) LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16230,12 +16753,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 -printf "%s\n" "neither works" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +printf "%s\n" "neither works" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16259,8 +16784,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ /* 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. */ -char XOpenDisplay (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (void); int main (void) { @@ -16272,22 +16803,28 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 printf %s "checking for dnet_ntoa in -ldnet... " >&6; } if test ${ac_cv_lib_dnet_dnet_ntoa+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $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. */ -char dnet_ntoa (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (void); int main (void) { @@ -16299,12 +16836,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_dnet_ntoa=yes -else $as_nop - ac_cv_lib_dnet_dnet_ntoa=no +else case e in #( + e) ac_cv_lib_dnet_dnet_ntoa=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_dnet_ntoa" >&6; } @@ -16319,16 +16858,22 @@ printf %s "checking for dnet_ntoa in -ldnet_stub... " >&6; } if test ${ac_cv_lib_dnet_stub_dnet_ntoa+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $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. */ -char dnet_ntoa (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (void); int main (void) { @@ -16340,12 +16885,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_stub_dnet_ntoa=yes -else $as_nop - ac_cv_lib_dnet_stub_dnet_ntoa=no +else case e in #( + e) ac_cv_lib_dnet_stub_dnet_ntoa=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } @@ -16354,7 +16901,8 @@ then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi - fi + fi ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16380,16 +16928,22 @@ printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $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. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -16401,12 +16955,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes -else $as_nop - ac_cv_lib_nsl_gethostbyname=no +else case e in #( + e) ac_cv_lib_nsl_gethostbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } @@ -16421,16 +16977,22 @@ printf %s "checking for gethostbyname in -lbsd... " >&6; } if test ${ac_cv_lib_bsd_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $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. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -16442,12 +17004,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bsd_gethostbyname=yes -else $as_nop - ac_cv_lib_bsd_gethostbyname=no +else case e in #( + e) ac_cv_lib_bsd_gethostbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_bsd_gethostbyname" >&6; } @@ -16478,16 +17042,22 @@ printf %s "checking for connect in -lsocket... " >&6; } if test ${ac_cv_lib_socket_connect+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_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. */ -char connect (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char connect (void); int main (void) { @@ -16499,12 +17069,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_connect=yes -else $as_nop - ac_cv_lib_socket_connect=no +else case e in #( + e) ac_cv_lib_socket_connect=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 printf "%s\n" "$ac_cv_lib_socket_connect" >&6; } @@ -16528,16 +17100,22 @@ printf %s "checking for remove in -lposix... " >&6; } if test ${ac_cv_lib_posix_remove+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $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. */ -char remove (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char remove (void); int main (void) { @@ -16549,12 +17127,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_posix_remove=yes -else $as_nop - ac_cv_lib_posix_remove=no +else case e in #( + e) ac_cv_lib_posix_remove=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 printf "%s\n" "$ac_cv_lib_posix_remove" >&6; } @@ -16578,16 +17158,22 @@ printf %s "checking for shmat in -lipc... " >&6; } if test ${ac_cv_lib_ipc_shmat+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $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. */ -char shmat (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shmat (void); int main (void) { @@ -16599,12 +17185,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ipc_shmat=yes -else $as_nop - ac_cv_lib_ipc_shmat=no +else case e in #( + e) ac_cv_lib_ipc_shmat=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 printf "%s\n" "$ac_cv_lib_ipc_shmat" >&6; } @@ -16630,16 +17218,22 @@ printf %s "checking for IceConnectionNumber in -lICE... " >&6; } if test ${ac_cv_lib_ICE_IceConnectionNumber+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_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. */ -char IceConnectionNumber (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char IceConnectionNumber (void); int main (void) { @@ -16651,12 +17245,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ICE_IceConnectionNumber=yes -else $as_nop - ac_cv_lib_ICE_IceConnectionNumber=no +else case e in #( + e) ac_cv_lib_ICE_IceConnectionNumber=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 printf "%s\n" "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } @@ -16802,8 +17398,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_INKSCAPE+y} then : printf %s "(cached) " >&6 -else $as_nop - case $INKSCAPE in +else case e in #( + e) case $INKSCAPE in [\\/]* | ?:[\\/]*) ac_cv_path_INKSCAPE="$INKSCAPE" # Let the user override the test with a path. ;; @@ -16828,6 +17424,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi INKSCAPE=$ac_cv_path_INKSCAPE @@ -16861,8 +17458,8 @@ pcp_desktop_dir=`eval echo $pcp_desktop_dir` if test ${with_rcdir+y} then : withval=$with_rcdir; pcp_rc_dir=$withval -else $as_nop - +else case e in #( + e) if $enable_systemd then pcp_rc_dir="$pcp_libadm_dir" @@ -16874,7 +17471,8 @@ then pcp_rc_dir="/etc/rc.d" else pcp_rc_dir="$pcp_etc_dir/init.d" -fi +fi ;; +esac fi @@ -16884,8 +17482,9 @@ fi if test ${with_servicesdir+y} then : withval=$with_servicesdir; pcp_services_dir=$withval -else $as_nop - pcp_services_dir=$libexecdir/pcp/services +else case e in #( + e) pcp_services_dir=$libexecdir/pcp/services ;; +esac fi pcp_services_dir=`eval echo $pcp_services_dir` @@ -16903,8 +17502,9 @@ printf "%s\n" "$as_me: pcp_services_dir=$pcp_services_dir" >&6;} if test ${with_sysconfigdir+y} then : withval=$with_sysconfigdir; pcp_sysconfig_dir=$withval -else $as_nop - pcp_sysconfig_dir=$pcp_etc_dir/sysconfig +else case e in #( + e) pcp_sysconfig_dir=$pcp_etc_dir/sysconfig ;; +esac fi @@ -16914,8 +17514,9 @@ fi if test ${with_logdir+y} then : withval=$with_logdir; pcp_log_dir=$withval -else $as_nop - pcp_log_dir=$localstatedir/log/pcp +else case e in #( + e) pcp_log_dir=$localstatedir/log/pcp ;; +esac fi pcp_log_dir=`eval echo $pcp_log_dir` @@ -16943,14 +17544,15 @@ fi if test ${with_rundir+y} then : withval=$with_rundir; pcp_run_dir=$withval -else $as_nop - +else case e in #( + e) if test -d /run then pcp_run_dir="/run/pcp" else pcp_run_dir="$localstatedir/run/pcp" -fi +fi ;; +esac fi pcp_run_dir=`eval echo $pcp_run_dir` @@ -16960,12 +17562,35 @@ pcp_run_dir=`eval echo $pcp_run_dir` printf "%s\n" "$as_me: pcp_run_dir=$pcp_run_dir" >&6;} +# Check whether --with-importdir was given. +if test ${with_importdir+y} +then : + withval=$with_importdir; pcp_import_dir=$withval +else case e in #( + e) +if test -d /run +then + pcp_import_dir="/run/pmimport" +else + pcp_import_dir="$localstatedir/run/pmimport" +fi ;; +esac +fi + +pcp_import_dir=`eval echo $pcp_import_dir` +pcp_import_dir=`eval echo $pcp_import_dir` + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: pcp_import_dir=$pcp_import_dir" >&5 +printf "%s\n" "$as_me: pcp_import_dir=$pcp_import_dir" >&6;} + + # Check whether --with-tmpdir was given. if test ${with_tmpdir+y} then : withval=$with_tmpdir; pcp_tmpfile_dir=$withval -else $as_nop - pcp_tmpfile_dir=$localstatedir/tmp +else case e in #( + e) pcp_tmpfile_dir=$localstatedir/tmp ;; +esac fi pcp_tmpfile_dir=`eval echo $pcp_tmpfile_dir` @@ -16980,8 +17605,9 @@ pcp_tmp_dir=`eval echo $pcp_var_dir/tmp` if test ${with_docdir+y} then : withval=$with_docdir; pcp_doc_dir=$withval -else $as_nop - PACKAGE=pcp-${PACKAGE_VERSION}; pcp_doc_dir=$docdir +else case e in #( + e) PACKAGE=pcp-${PACKAGE_VERSION}; pcp_doc_dir=$docdir ;; +esac fi pcp_doc_dir=`eval echo $pcp_doc_dir` @@ -16993,8 +17619,9 @@ pcp_doc_dir=`eval echo $pcp_doc_dir` if test ${with_demosdir+y} then : withval=$with_demosdir; pcp_demos_dir=$withval -else $as_nop - pcp_demos_dir=$pcp_share_dir/demos +else case e in #( + e) pcp_demos_dir=$pcp_share_dir/demos ;; +esac fi @@ -17008,8 +17635,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_xconfirm_prog+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ac_xconfirm_prog in +else case e in #( + e) case $ac_xconfirm_prog in [\\/]* | ?:[\\/]*) ac_cv_path_ac_xconfirm_prog="$ac_xconfirm_prog" # Let the user override the test with a path. ;; @@ -17035,6 +17662,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_ac_xconfirm_prog" && ac_cv_path_ac_xconfirm_prog="$pcp_bin_dir/pmconfirm" ;; +esac ;; esac fi ac_xconfirm_prog=$ac_cv_path_ac_xconfirm_prog @@ -17074,9 +17702,10 @@ printf "%s\n" "#define HAVE_FNDELAY 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -17107,9 +17736,10 @@ printf "%s\n" "#define HAVE_ZPOOL_VDEV_NAME_5ARG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17137,9 +17767,10 @@ printf "%s\n" "#define HAVE_ZPOOL_VDEV_NAME_4ARG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -17169,9 +17800,10 @@ printf "%s\n" "#define HAVE_ZFS_ITER_SNAPSHOTS_4ARG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17198,9 +17830,10 @@ printf "%s\n" "#define HAVE_ZFS_ITER_SNAPSHOTS_3ARG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -17210,16 +17843,22 @@ printf %s "checking for __atomic_fetch_add_4 in -latomic... " >&6; } if test ${ac_cv_lib_atomic___atomic_fetch_add_4+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-latomic $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. */ -char __atomic_fetch_add_4 (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char __atomic_fetch_add_4 (void); int main (void) { @@ -17231,12 +17870,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_atomic___atomic_fetch_add_4=yes -else $as_nop - ac_cv_lib_atomic___atomic_fetch_add_4=no +else case e in #( + e) ac_cv_lib_atomic___atomic_fetch_add_4=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atomic___atomic_fetch_add_4" >&5 printf "%s\n" "$ac_cv_lib_atomic___atomic_fetch_add_4" >&6; } @@ -17328,16 +17969,22 @@ printf %s "checking for lzma_index_stream_flags in -llzma... " >&6; } if test ${ac_cv_lib_lzma_lzma_index_stream_flags+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-llzma $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. */ -char lzma_index_stream_flags (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char lzma_index_stream_flags (void); int main (void) { @@ -17349,20 +17996,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_lzma_lzma_index_stream_flags=yes -else $as_nop - ac_cv_lib_lzma_lzma_index_stream_flags=no +else case e in #( + e) ac_cv_lib_lzma_lzma_index_stream_flags=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_index_stream_flags" >&5 printf "%s\n" "$ac_cv_lib_lzma_lzma_index_stream_flags" >&6; } if test "x$ac_cv_lib_lzma_lzma_index_stream_flags" = xyes then : lib_for_lzma="-llzma" -else $as_nop - enable_lzma=false +else case e in #( + e) enable_lzma=false ;; +esac fi @@ -17375,8 +18025,9 @@ if test "x$ac_cv_header_lzma_h" = xyes then : printf "%s\n" "#define HAVE_LZMA_H 1" >>confdefs.h -else $as_nop - enable_lzma=false +else case e in #( + e) enable_lzma=false ;; +esac fi done @@ -17442,9 +18093,10 @@ then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_UN 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17475,9 +18127,10 @@ then : printf "%s\n" "#define HAVE_STRUCT_UCRED 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17502,9 +18155,10 @@ then : printf "%s\n" "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17529,9 +18183,10 @@ then : printf "%s\n" "#define HAVE_ALTZONE 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17541,8 +18196,8 @@ if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -17565,12 +18220,14 @@ then : printf "%s\n" "#define HAVE_STRFTIME_z 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -17593,9 +18250,10 @@ then : printf "%s\n" "#define HAVE_STRERROR_R_PTR 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17607,23 +18265,29 @@ ac_fn_c_check_func "$LINENO" "readline" "ac_cv_func_readline" if test "x$ac_cv_func_readline" = xyes then : -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 printf %s "checking for readline in -lreadline... " >&6; } if test ${ac_cv_lib_readline_readline+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $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. */ -char readline (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char readline (void); int main (void) { @@ -17635,12 +18299,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_readline_readline=yes -else $as_nop - ac_cv_lib_readline_readline=no +else case e in #( + e) ac_cv_lib_readline_readline=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 printf "%s\n" "$ac_cv_lib_readline_readline" >&6; } @@ -17650,23 +18316,29 @@ then : LIBS="-lreadline $LIBS" -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for add_history in -lreadline" >&5 printf %s "checking for add_history in -lreadline... " >&6; } if test ${ac_cv_lib_readline_add_history+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -lcurses $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. */ -char add_history (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char add_history (void); int main (void) { @@ -17678,12 +18350,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_readline_add_history=yes -else $as_nop - ac_cv_lib_readline_add_history=no +else case e in #( + e) ac_cv_lib_readline_add_history=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_add_history" >&5 printf "%s\n" "$ac_cv_lib_readline_add_history" >&6; } @@ -17695,10 +18369,12 @@ then : fi - + ;; +esac fi - + ;; +esac fi if test $ac_cv_func_readline = yes @@ -17895,9 +18571,10 @@ then : printf "%s\n" "#define HAVE_AI_ADDRCONFIG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17906,8 +18583,8 @@ printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -17971,10 +18648,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes -else $as_nop - ac_cv_c_const=no +else case e in #( + e) ac_cv_c_const=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } @@ -17989,8 +18668,8 @@ printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test ${ac_cv_struct_tm+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -18008,10 +18687,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_struct_tm=time.h -else $as_nop - ac_cv_struct_tm=sys/time.h +else case e in #( + e) ac_cv_struct_tm=sys/time.h ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 printf "%s\n" "$ac_cv_struct_tm" >&6; } @@ -18026,8 +18707,8 @@ printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_inline=no +else case e in #( + e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18045,7 +18726,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } @@ -18073,10 +18755,11 @@ else if test "x$ac_cv_type_off_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define off_t long int" >>confdefs.h - + ;; +esac fi @@ -18085,8 +18768,8 @@ fi if test "x$ac_cv_type_pid_t" = xyes then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ @@ -18105,14 +18788,16 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' +else case e in #( + e) ac_pid_type='__int64' ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - + ;; +esac fi @@ -18120,10 +18805,11 @@ fi if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi fi @@ -18145,8 +18831,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -18176,14 +18862,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -18273,7 +18959,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -18282,12 +18967,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -18359,7 +19045,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -18388,7 +19074,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -18428,11 +19113,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -18446,11 +19132,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -18533,9 +19220,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -18616,10 +19303,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -18635,7 +19324,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18666,7 +19355,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -18699,10 +19388,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -18761,8 +19450,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -18770,8 +19459,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -18838,7 +19527,7 @@ do "build/GNUlocaldefs") CONFIG_FILES="$CONFIG_FILES build/GNUlocaldefs" ;; "build/mac/uninstall-pcp") CONFIG_FILES="$CONFIG_FILES build/mac/uninstall-pcp" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -18857,7 +19546,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -18881,7 +19570,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -19039,13 +19728,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -19155,7 +19844,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -19177,19 +19866,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -19313,7 +20002,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -19342,9 +20031,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/configure.ac b/configure.ac index 7c8421abb43..c2d0bae3e2f 100644 --- a/configure.ac +++ b/configure.ac @@ -3609,7 +3609,7 @@ pcp_run_dir=`eval echo $pcp_run_dir` AC_SUBST(pcp_run_dir) AC_MSG_NOTICE([pcp_run_dir=$pcp_run_dir]) -AC_ARG_WITH(importdir,[AS_HELP_STRING([--with-importdir],[PCP import tool directory [/var/run/pmimport]])], +AC_ARG_WITH(importdir,[AS_HELP_STRING([--with-importdir],[PCP import tool directory [LOCALSTATEDIR/run/pmimport]])], [pcp_import_dir=$withval], [ if test -d /run then diff --git a/debian/libpcp-import1.install b/debian/libpcp-import1.install index 3e47c3fda3c..7055d34d430 100644 --- a/debian/libpcp-import1.install +++ b/debian/libpcp-import1.install @@ -1 +1,3 @@ +run/pmimport usr/lib/*/libpcp_import.so.1 +usr/lib/tmpfiles.d/libpcp_import.conf diff --git a/man/man3/pmisetvolumesize.3 b/man/man3/pmisetvolumesize.3 index 471af7c67c2..554c3593658 100644 --- a/man/man3/pmisetvolumesize.3 +++ b/man/man3/pmisetvolumesize.3 @@ -64,7 +64,7 @@ is not NULL, it is called immediately after the old volume is closed and before the function returns. The single argument is the full path of the just-closed volume file (e.g.\& -.IR /var/log/sa/pcp16/pcp16.0 ). +.IR myarchive.0 ). The caller may use this callback to compress the completed volume or perform any other post-rotation work. The callback is invoked synchronously; long-running operations should @@ -94,7 +94,7 @@ on_vol(const char *path) system(cmd); } -pmiStart("/var/log/sa/pcp16/pcp16", 0); +pmiStart("myarchive", 0); pmiSetVolumeSize(100 * 1024 * 1024, on_vol); .ft 1 .fi diff --git a/qa/1418.out b/qa/1418.out index a1cda24719e..9e5a4038933 100644 --- a/qa/1418.out +++ b/qa/1418.out @@ -425,8 +425,10 @@ Perl wrapper version ... *PCP::LogImport::pmiPutValue *PCP::LogImport::pmiPutValueHandle *PCP::LogImport::pmiSetHostname +*PCP::LogImport::pmiSetImportProgram *PCP::LogImport::pmiSetTimezone *PCP::LogImport::pmiSetVersion +*PCP::LogImport::pmiSetZoneinfo *PCP::LogImport::pmiStart *PCP::LogImport::pmiUnits *PCP::LogImport::pmiUseContext @@ -529,8 +531,10 @@ pmiPutText pmiPutValue pmiPutValueHandle pmiSetHostname +pmiSetImportProgram pmiSetTimezone pmiSetVersion +pmiSetZoneinfo pmiStart pmiUnits pmiUseContext diff --git a/qa/1693 b/qa/1693 index 9f79aff8134..e45b3ad4986 100755 --- a/qa/1693 +++ b/qa/1693 @@ -13,9 +13,6 @@ echo "QA output created by $seq" . ./common.filter . ./common.check -[ -f ${PCP_LIB_DIR}/libpcp_import.${DSO_SUFFIX} ] || \ - _notrun "No support for libpcp_import" - status=0 # success is the default! trap "cd $here; rm -rf $tmp; exit \$status" 0 1 2 3 15 diff --git a/qa/369.out b/qa/369.out index e36b7aac9bf..126aabb9e81 100644 --- a/qa/369.out +++ b/qa/369.out @@ -425,8 +425,10 @@ Perl wrapper version ... *PCP::LogImport::pmiPutValue *PCP::LogImport::pmiPutValueHandle *PCP::LogImport::pmiSetHostname +*PCP::LogImport::pmiSetImportProgram *PCP::LogImport::pmiSetTimezone *PCP::LogImport::pmiSetVersion +*PCP::LogImport::pmiSetZoneinfo *PCP::LogImport::pmiStart *PCP::LogImport::pmiUnits *PCP::LogImport::pmiUseContext @@ -529,8 +531,10 @@ pmiPutText pmiPutValue pmiPutValueHandle pmiSetHostname +pmiSetImportProgram pmiSetTimezone pmiSetVersion +pmiSetZoneinfo pmiStart pmiUnits pmiUseContext diff --git a/src/include/builddefs.in b/src/include/builddefs.in index 0aeea5c7292..a7af71514e3 100644 --- a/src/include/builddefs.in +++ b/src/include/builddefs.in @@ -251,6 +251,8 @@ PCP_ICONS_DIR = @pcp_icons_dir@ PCP_DESKTOP_DIR = @pcp_desktop_dir@ PCP_PMNS_DIR = @pcp_pmns_dir@ PCP_PMNSADM_DIR = @pcp_pmnsadm_dir@ +PCP_IMPORT_DIR = @pcp_import_dir@ +PCP_SYSTEMDTMPFILES_DIR = @pcp_systemdtmpfiles_dir@ PCP_SELINUX_DIR = @pcp_selinux_dir@ PCP_BASHSHARE_DIR = @pcp_bashshare_dir@ diff --git a/src/libpcp_import/src/.gitignore b/src/libpcp_import/src/.gitignore index 605b91bad67..0929dba494d 100644 --- a/src/libpcp_import/src/.gitignore +++ b/src/libpcp_import/src/.gitignore @@ -1,8 +1,9 @@ domain.h libpcp_import.a +libpcp_import.conf +libpcp_import.dll +libpcp_import.dylib +libpcp_import.pc libpcp_import.so libpcp_import.so.1 libpcp_import.1.dylib -libpcp_import.dylib -libpcp_import.dll -libpcp_import.pc diff --git a/src/libpcp_import/src/GNUmakefile b/src/libpcp_import/src/GNUmakefile index 68e1ebb7be2..ee7108e43ad 100644 --- a/src/libpcp_import/src/GNUmakefile +++ b/src/libpcp_import/src/GNUmakefile @@ -21,6 +21,7 @@ CFILES = import.c stuff.c archive.c HFILES = private.h LIBCONFIG = libpcp_import.pc +TMPFILESCONF = libpcp_import.conf VERSION_SCRIPT = exports STATICLIBTARGET = libpcp_import.a @@ -42,17 +43,23 @@ endif LCFLAGS = -DPMI_INTERNAL LLDLIBS = -lpcp -lpcp_archive -LDIRT = $(SYMTARGET) domain.h $(LIBCONFIG) +LDIRT = $(SYMTARGET) domain.h $(LIBCONFIG) $(TMPFILESCONF) DOMAIN = PMI_DOMAIN -default: $(LIBTARGET) $(SYMTARGET) $(STATICLIBTARGET) $(LIBCONFIG) +default: $(LIBTARGET) $(SYMTARGET) $(STATICLIBTARGET) $(LIBCONFIG) $(TMPFILESCONF) $(OBJECTS): $(HFILES) domain.h include $(BUILDRULES) install: default +ifneq ($(PCP_SYSTEMDTMPFILES_DIR),) + $(INSTALL) -m 644 $(TMPFILESCONF) $(PCP_SYSTEMDTMPFILES_DIR)/$(TMPFILESCONF) +endif +ifneq ($(PCP_IMPORT_DIR),) + $(INSTALL) -m 755 -d $(PCP_IMPORT_DIR) +endif ifneq ($(LIBTARGET),) $(INSTALL) -m 755 $(LIBTARGET) $(PCP_LIB_DIR)/$(LIBTARGET) ifneq ($(DEB_HOST_MULTIARCH),) @@ -88,6 +95,9 @@ $(LIBCONFIG): $(LIBCONFIG).in -e's|@VERSION@|$(PCP_VERSION)|g' <$? >$@ endif +$(TMPFILESCONF): $(TMPFILESCONF).in + @sed -e's|@PCP_IMPORT_DIR@|$(PCP_IMPORT_DIR)|g' <$< >$@ + domain.h: $(TOPDIR)/src/pmns/stdpmid $(DOMAIN_MAKERULE) diff --git a/src/libpcp_import/src/archive.c b/src/libpcp_import/src/archive.c index d75a295bec9..e4c6d94e2d4 100644 --- a/src/libpcp_import/src/archive.c +++ b/src/libpcp_import/src/archive.c @@ -44,7 +44,7 @@ check_context_append(pmi_context *current) * into the hash tables (hashpmid, hashindom). check_metric() will use * __pmLogLookupDesc() to skip re-writing descriptors that are already * present, preventing .meta from growing on every timer-driven invocation - * of a short-lived collector such as sadc. + * of a short-lived collector that runs on a timer. * * __pmLogOpenAppend() left mdfp positioned at end-of-file; rewind to the * start so __pmLogLoadMeta() can read from the beginning of the file, then @@ -101,7 +101,7 @@ check_context_start(pmi_context *current) /* * Archive doesn't exist yet: fall through to create it normally. * This makes PMI_APPEND safe to use unconditionally on first invocation - * of a timer-driven collector (e.g. sadc) before any archive exists. + * of a timer-driven collector before any archive exists. */ current->state = CONTEXT_START; } diff --git a/src/libpcp_import/src/import.c b/src/libpcp_import/src/import.c index bf8f5d4b30a..b9ac0849334 100644 --- a/src/libpcp_import/src/import.c +++ b/src/libpcp_import/src/import.c @@ -645,9 +645,11 @@ pmiSetImportProgram(const char *tool, const char *version, if (tool == NULL || tool[0] == '\0') return current->last_sts = PM_ERR_CONV; - /* PCP_IMPORT_DIR is root:root 0755, created by packaging. + /* + * PCP_IMPORT_DIR is root:root 0755, created by packaging. * O_NOFOLLOW defeats a symlink pre-placed at the target path; - * O_TRUNC overwrites a stale file left by an unclean exit. */ + * O_TRUNC overwrites a stale file left by an unclean exit. + */ pmsprintf(path, sizeof(path), "%s/%s", pmGetConfig("PCP_IMPORT_DIR"), tool); diff --git a/src/libpcp_import/src/libpcp_import.conf.in b/src/libpcp_import/src/libpcp_import.conf.in new file mode 100644 index 00000000000..b0d5d5d6186 --- /dev/null +++ b/src/libpcp_import/src/libpcp_import.conf.in @@ -0,0 +1,4 @@ +# tmpfiles.d(5) config for PCP import tool registration directory +# +# Path Mode User Group Age Argument +D @PCP_IMPORT_DIR@ 0755 root root - - diff --git a/src/perl/LogImport/LogImport.pm b/src/perl/LogImport/LogImport.pm index 5c2440c2630..4863da8c848 100644 --- a/src/perl/LogImport/LogImport.pm +++ b/src/perl/LogImport/LogImport.pm @@ -10,7 +10,8 @@ our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); @ISA = qw( Exporter DynaLoader ); @EXPORT = qw( - pmiStart pmiUseContext pmiEnd pmiSetHostname pmiSetTimezone pmiSetVersion + pmiStart pmiUseContext pmiEnd pmiSetHostname pmiSetImportProgram + pmiSetTimezone pmiSetVersion pmiSetZoneinfo pmiAddMetric pmiAddInstance pmiPutValue pmiGetHandle pmiPutValueHandle pmiWrite pmiPutText pmiPutLabel pmiPutMark pmiDump pmiErrStr pmiUnits pmiExtraUnits