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 be true on at least HP-UX and IRIX, possibly elsewhere. The problem is that configure correctly determines that the included glob/fnmatch is needed, but the glob.h and fnmatch.h protect some of the needed constants with 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, etc. that are needed by the rest of RPM. It's really the "guards" that are at fault, and this problem is seen on these platforms 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 system fnmatch/glob routines, there's no good reason to protect the various symbols in fnmatch.h and glob.h -- we need them, and we've decided we want the GNU extended routines, not POSIX conformant fnmatch()/glob(). Reproducible: Always Steps to Reproduce: ./configure; make on alpha-dec-osf (and I'm betting elsewhere) Actual Results: Errors because of undeclared symbols: FNM_CASEFOLD FNM_FILE_NAME FNM_LEADING_DIR GLOB_BRACE GLOB_NOMAGIC GLOB_TILDE GLOB_TILDE_CHECK GLOB_ALTDIRFUNC GLOB_ONLYDIR GLOB_MAGCHAR GLOB_NOMAGIC In fnmatch.h, I would just remove the guard: #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE . . . #endif In glob.h, remove the similar guard that protects the GLOB_ symbols mentioned above.
Hi Tim! 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 gotten through the entire source yet because of another problem I'll be reporting in a bit with db3 header finding). 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.