This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: FreeBSD port (37): avoiding dependencies towards /usr/include
Roland McGrath wrote:
> > Why? Any #include <limits.h>
> > includes glibc-xxxx/include/limits.h
> > which does #include_next gcc-3.2's private include/limits.h
> > which does #include_next /usr/include/limits.h.
>
> Something is wrong if this happens. GCC's limits.h does not use #include_next
> unless _GCC_NEXT_LIMITS_H is defined. The only place that defines that is
> GCC's syslimits.h, which is not used under _LIBC_LIMITS_H.
Indeed, I had a typo whereby I wrote #include <syslimits.h> instead of
#include <sys/syslimits.h>...
> > Here is a fix.
>
> That change is completely wrong. Without that -isystem flag, GCC's own
> files will not be found as they should. Things like float.h and stdarg.h
> must come from GCC.
The -isystem flag right after -nostdinc ensures that things like float.h
and stdarg.h will be found.
The change makes building glibc more reliable, because it ensures that
/usr/include headers won't be used by accident (or if there is a mistake
in the configuration of glibc).
2002-09-04 Bruno Haible <bruno@clisp.org>
* configure.in (SYSINCLUDES): When --with-headers is not given,
exclude gcc's standard include dir from the include search path.
diff -r -c3 glibc-20020910.bak/configure.in glibc-20020910/configure.in
*** glibc-20020910.bak/configure.in Thu Sep 5 15:21:25 2002
--- glibc-20020910/configure.in Tue Sep 17 02:22:02 2002
***************
*** 637,645 ****
# if using special system headers, find out the compiler's sekrit
# header directory and add that to the list. NOTE: Only does the right
# thing on a system that doesn't need fixincludes. (Not presently a problem.)
if test -n "$sysheaders"; then
- ccheaders=`$CC -print-file-name=include`
SYSINCLUDES="-nostdinc -isystem $ccheaders -isystem $sysheaders"
fi
AC_SUBST(SYSINCLUDES)
--- 637,647 ----
# if using special system headers, find out the compiler's sekrit
# header directory and add that to the list. NOTE: Only does the right
# thing on a system that doesn't need fixincludes. (Not presently a problem.)
+ ccheaders=`$CC -print-file-name=include`
if test -n "$sysheaders"; then
SYSINCLUDES="-nostdinc -isystem $ccheaders -isystem $sysheaders"
+ else
+ SYSINCLUDES="-nostdinc -isystem $ccheaders"
fi
AC_SUBST(SYSINCLUDES)