Bug 28633

Summary: Fixes for glob.h and fnmatch.h on non-GNU systems
Product: [Retired] Red Hat Linux Reporter: Joe Orton <jorton>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-22 16:33:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for glob.h
none
Patch for fnmatch.h none

Description Joe Orton 2001-02-21 17:44:31 UTC
fnmatch.h and glob.h are included only if --with-glob is
enabled.  Whilst it appears that they come from glibc directly,
the checks for POSIX_C_SOURCE and whatnot aren't strictly
necessary and actually defeat the purpose of bundling them. rpm
uses the GNU #defines, but they only kick in if the compiler
sets POSIX_C_SOURCE and/or GNU_SOURCE to something valid.

These checks are redundant given the limited scope of the header
files, and if the compiler or pre-processor don't define
POSIX_C_SOURCE or GNU_SOURCE, then they aren't included at all
thereby breaking the build process.

Comment 1 Joe Orton 2001-02-21 18:01:31 UTC
Created attachment 10660 [details]
Patch for glob.h

Comment 2 Joe Orton 2001-02-21 18:02:05 UTC
Created attachment 10661 [details]
Patch for fnmatch.h

Comment 3 Jeff Johnson 2001-02-22 16:26:31 UTC
FWIW, these are exact copies of what was in glibc, stolen for portability
retrofitting on non-GNU
systems,  presumably as portable as glibc is (i.e. failrly portable).

What's worng with simply adding -D_GNU_SOURCE when compiling rpm always, as that
is
essentially what is intended (i.e. GNU extensions to globbing) even though the
includes are
in the rpm tree rather than the glibc tree on non-GNU systems?

Comment 4 Joe Orton 2001-02-22 16:33:14 UTC
That sounds like a better fix, I'll give it a go, thanks!

Comment 5 Jeff Johnson 2001-02-22 17:55:01 UTC
OK, reopen if adding -D_GNU_SOURCE doesn't work for you.

BTW, some instructions on what you're doing wrto LDFLAGS, CFLAGS, etc
to build rpm on non-linuc platforms would be gratefully received. I'll even
write
it up if you just send me the output of a build for each platform.