From Bugzilla Helper:
User-Agent: Mozilla/4.72 [en] (X11; U; OSF1 V5.0 alpha)
rpm 4.0.2 fails to build on alpha-dec-osf, and I'm guessing the same will
on at least HP-UX and IRIX, possibly elsewhere.
The problem is that configure correctly determines that the included
needed, but the glob.h and fnmatch.h protect some of the needed constants
tests against _POSIX_C_SOURCE and other symbols. There's no way to satisfy
the protections in those two header files and still get functions, defines,
are needed by the rest of RPM.
It's really the "guards" that are at fault, and this problem is seen on
for every package that uses GNU fnmatch (i.e. a lot of packages).
My recommendation would be that since configure has already determined that
the misc/fnmatch.c and misc/glob.c are going to be used instead of the
fnmatch/glob routines, there's no good reason to protect the various
fnmatch.h and glob.h -- we need them, and we've decided we want the GNU
extended routines, not POSIX conformant fnmatch()/glob().
Steps to Reproduce:
on alpha-dec-osf (and I'm betting elsewhere)
Actual Results: Errors because of undeclared symbols:
In fnmatch.h, I would just remove the guard:
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
In glob.h, remove the similar guard that protects the GLOB_ symbols
What happens if you add -D_GNU_SOURCE to the compile? That is, in fact , the
intent of the guards, and the internalization of GNU glob, etc. and so should be
added to your CFLAGS.
That does indeed work, and doesn't appear to cause problems elsewhere (I haven't
through the entire source yet because of another problem I'll be reporting in a
bit with db3
Adding -D_GNU_SOURCE is a little unintuitive to me, but it's a reasonable
workaround for the
problem. I'll continue to test 4.0.2 and try testing on HP-UX and IRIX too. I
may submit a patch
for the README, so that others don't stumble in the same place I did.