[pcp] pcp chroot build broken

Mark Goodwin mgoodwin at redhat.com
Thu Feb 2 21:25:52 CST 2012


This commit breaks a chroot build where pcp headers are not installed:

   commit 878062a4532dd31328f7f3595bf99202b2407ba1
   Author: Ken McDonell <kenj at internode.on.net>
   Date:   Wed Dec 28 10:25:33 2011 +1100

     Drive a stake into the heart of the symlinked <pcp> in the build

     We don't need
         ln -s $(TOPDIR)/src/include pcp
     throughout the build.

     There was a previous attempt to clean this up, but some of the PMDAs
     were apparently spared ... no such mercy this time!


I agree it's time this cruft was purged, but for now it's busted - the
rpmbuild driven chroot build fails in src/pmdas/simple/simple.h :

=== simple ===
gcc  -fpic -fno-strict-aliasing -D_GNU_SOURCE -I. -Wall -g -DPCP_DEBUG 
-DPCP_VERSION=\"3.5.12\" -DASYNC_API -I../../../src/include   -c -o simple.o 
simple.c
simple.c:21:23: fatal error: pcp/pmapi.h: No such file or directory
compilation terminated.
gmake[3]: *** [simple.o] Error 1
gmake[2]: *** [default_pcp] Error 2
gmake[1]: *** [default_pcp] Error 2
gmake[1]: Leaving directory `/builddir/build/BUILD/pcp-3.5.12/src'
make: *** [default_pcp] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.TBb4cw (%build)

It would also fail in a non-chroot build on a system that doesn't have
pcp-libs-devel installed.

There are a few ways to finally fix this :

(a) move src/include/*.h to src/include/pcp/*.h and then change all
     code to e.g. #include <pcp/pmapi.h>, or

(b) change all affected code to e.g. #include "pmapi.h" rather than
     #include <pcp/pmapi.h>, or

(c) in src/include, symlink pcp -> . (see attached patch).

We need to fix this - at the moment we're exposed to subtle errors
where some code is including /usr/include/pcp/*.h yet other code is
including those headers directly from the source tree.

I prefer (a), at least because our demo code is clean and consistent.

Thoughts?

-- Mark


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_pcp_include.patch
Type: text/x-patch
Size: 883 bytes
Desc: not available
URL: <http://oss.sgi.com/pipermail/pcp/attachments/20120203/ba09a6aa/attachment.patch>


More information about the pcp mailing list