Hi Dave,
Following up on something we were discussing earlier, off-list,
here's a patch which (I think) resolves the issue around adding
explicit -I directives for NSS/NSPR to all PCP sources. This
became particularly problematic once it started leaking out to
the installed PMDA makefiles, because it means every existing
PMDA "out there" would not build with the PCP release where the
NSS/NSPR support was added. And probably any custom monitoring
tools (hmm, yeah, including the pcp-gui tools).
It turned out to be more difficult than I anticipated, as I did
not initially pick up on the significance of the problem around
the way different platforms install their headers into different
places (nss/nss3 and nspr/nspr4).
Anyway, happily, it seems resolvable. This patch should apply
to git://sourceware.org/git/pcpfans.git brolley/nssmerge branch.
It uses the old C trick of forward declaring a struct and then
only using pointers to it in publicly visible places, for those
types which need to switch depending on whether NSS/NSPR in use
*and* which need to know details from the NSS/NSPR header files.
The pmcd and pmproxy Client structures were a bit problematic as
they try really hard to allocate their per-client structures in
a single contiguous allocation (and over-allocate), so having a
second-level pointer really didn't fit into that model. Solved
with another dodgey C trick, using a zero-length char array for
the inaddr struct (at the end of the Client struct).
There's also a little tweak around the IPC table (was needed to
keep all NSS/NSPR type usage within the ausconnect.c isolation
chamber).
Compile tested only at this stage ... keen to hear your thoughts
on this approach though & any review comments you might have on
this patch. Thanks!
cheers.
--
Nathan
configure.in | 116 ++++++------
qa/src/chkacc1.c | 11 -
qa/src/chkacc2.c | 10 -
qa/src/chkacc3.c | 13 -
src/include/builddefs.in | 10 -
src/include/pcp/impl.h | 64 ++----
src/include/pcp/platform_header.h.in | 3
src/libpcp/src/GNUmakefile | 9
src/libpcp/src/access.c | 26 +-
src/libpcp/src/auxconnect.c | 328 +++++++++++++++++++++--------------
src/libpcp/src/ipc.c | 29 +--
src/libpcp/src/logconnect.c | 28 +-
src/libpcp_gui/src/timeclient.c | 15 +
src/libpcp_pmcd/src/client.c | 12 -
src/libpcp_pmda/src/open.c | 19 +-
src/perl/PMDA/local.c | 41 ++--
src/pmcd/src/client.c | 21 +-
src/pmcd/src/client.h | 4
src/pmcd/src/config.c | 34 ++-
src/pmcd/src/pmcd.c | 21 +-
src/pmlogger/ports.c | 56 +++--
src/pmproxy/client.c | 30 ++-
src/pmproxy/pmproxy.c | 18 +
src/pmproxy/pmproxy.h | 2
24 files changed, 535 insertions(+), 385 deletions(-)
nssmerge2.patch
Description: Text Data
|