Bug 15079

Summary: aix build error: using the included GNU glob still includes system's glob.h
Product: [Retired] Red Hat Linux Reporter: Jimi X <jimix>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 6.2CC: jimix
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-08-06 23:23:23 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:

Description Jimi X 2000-08-01 22:18:50 UTC
Bug fleshed out while trying to build rpm for AIX.

Source seems to depend on the header guards (i.e. _GLOB_H) being the same.

relavent configure lines:
...
checking for glob.h... yes
...
checking for glob... yes
checking for GNU extensions to glob... no
    --> using the included GNU glob instead.
...

here is the build error. Also note that the #define macros used with glob
have different values in AIX.

gcc -DHAVE_CONFIG_H -I. -I/u/jimix/work/rpm/rpm-3.0.5/build -I..
-I/u/jimix/work/rpm/rpm-3.0.5 -I/u/jimix/work/rpm/rpm-3.0.5/lib
-I/u/jimix/work/rpm/rpm-3.0.5/popt -I../misc -I/u/jimix/local/include
-I/u/jimix/local/BerkeleyDB/include -I/usr/contrib/include -g -O2
-D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes
-Wmissing-prototypes -Wno-char-subscripts -c
/u/jimix/work/rpm/rpm-3.0.5/build/build.c -o build.o
In file included from /u/jimix/work/rpm/rpm-3.0.5/lib/rpmio.h:7,
                 from /u/jimix/work/rpm/rpm-3.0.5/lib/rpmlib.h:8,
                 from /u/jimix/work/rpm/rpm-3.0.5/build/rpmbuild.h:8,
                 from /u/jimix/work/rpm/rpm-3.0.5/build/build.c:7:
/usr/include/glob.h:47: warning: `GLOB_APPEND' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:72: warning: this is the location
of the previous definition
/usr/include/glob.h:48: warning: `GLOB_DOOFFS' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:70: warning: this is the location
of the previous definition
/usr/include/glob.h:49: warning: `GLOB_ERR' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:67: warning: this is the location
of the previous definition
/usr/include/glob.h:50: warning: `GLOB_MARK' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:68: warning: this is the location
of the previous definition
/usr/include/glob.h:51: warning: `GLOB_NOCHECK' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:71: warning: this is the location
of the previous definition
/usr/include/glob.h:52: warning: `GLOB_NOSORT' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:69: warning: this is the location
of the previous definition
/usr/include/glob.h:53: warning: `GLOB_NOESCAPE' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:73: warning: this is the location
of the previous definition
/usr/include/glob.h:57: warning: `GLOB_ABORTED' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:98: warning: this is the location
of the previous definition
/usr/include/glob.h:58: warning: `GLOB_NOSPACE' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:97: warning: this is the location
of the previous definition
/usr/include/glob.h:59: warning: `GLOB_NOMATCH' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:99: warning: this is the location
of the previous definition
/usr/include/glob.h:60: warning: `GLOB_NOSYS' redefined
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:100: warning: this is the location
of the previous definition
In file included from /u/jimix/work/rpm/rpm-3.0.5/system.h:279,
                 from /u/jimix/work/rpm/rpm-3.0.5/build/build.c:5:
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:53: warning: redefinition of
`size_t'
/usr/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/include/sys/types.h:129:
warning: `size_t' previously declared here
In file included from /u/jimix/work/rpm/rpm-3.0.5/lib/rpmio.h:7,
                 from /u/jimix/work/rpm/rpm-3.0.5/lib/rpmlib.h:8,
                 from /u/jimix/work/rpm/rpm-3.0.5/build/rpmbuild.h:8,
                 from /u/jimix/work/rpm/rpm-3.0.5/build/build.c:7:
/usr/include/glob.h:68: conflicting types for `glob_t'
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:125: previous declaration of
`glob_t'
/usr/include/glob.h:76: conflicting types for `glob'
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:157: previous declaration of `glob'
/usr/include/glob.h:77: conflicting types for `globfree'
/u/jimix/work/rpm/rpm-3.0.5/misc/glob.h:160: previous declaration of
`globfree'


Simple workaround:

$ diff -Nau rpm-3.0.5/misc/glob.h.orig rpm-3.0.5/misc/glob.h
--- rpm-3.0.5/misc/glob.h.orig	Wed Jun 14 08:34:31 2000
+++ rpm-3.0.5/misc/glob.h	Tue Aug  1 18:15:18 2000
@@ -18,6 +18,10 @@
 #ifndef	_GLOB_H
 #define	_GLOB_H	1
 
+#ifdef _AIX
+#define _H_GLOB
+#endif
+
 #ifdef	__cplusplus
 extern "C" {
 #endif

Comment 1 Jeff Johnson 2000-08-06 23:23:21 UTC
An alternative is to have rpmio.h do
	#include "glob.h"	/* note use of "glob.h" rather than <glob.h> */
as -I../misc precedes /usr/include and, I believe, the Right Thing Should
Happen.

Can you confirm whether "glob.h" fixes the compile problem on AIX?

Comment 2 Jeff Johnson 2001-02-25 18:14:29 UTC
rpm-4.0.2 and later includes a patch that is reported to compile on AIX. You
will need to add
-D_GNU_SOURCE, needed by the internal copy of GNU glob.