FreeBSD port (37): avoiding dependencies towards /usr/include
Bruno Haible
bruno@clisp.org
Thu Sep 5 05:08:00 GMT 2002
On FreeBSD, configure is called without --with-headers option. Currently,
this has the effect that many .o files are built against /usr/include/limits.h.
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.
You can see this by doing "grep /usr/include builddir/*/*.d".
This has two negative effects:
- During "make", a wrong limits.h is used,
- During "make install", since limits.h is one of the first few files to
be installed, 40% of glibc files are rebuilt, which increases the
"make install" time from 5 min. to 20 minutes.
Here is a fix.
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-20020828.bak/configure.in glibc-20020828/configure.in
*** glibc-20020828.bak/configure.in Wed Aug 28 21:41:55 2002
--- glibc-20020828/configure.in Wed Sep 4 23:43:46 2002
***************
*** 635,643 ****
# 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)
--- 635,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.)
+ 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)
More information about the Libc-alpha
mailing list