Order-of-includes issue building newlib [ RE: Build error CVS head ]
Brian Dessent
brian@dessent.net
Sun Jun 17 04:53:00 GMT 2007
Dave Korn wrote:
> although it's also possible that the intention of configure.host is that
> cygwin include headers are /meant/ to override newlib's own ones, in which
> case Corinna's patch should have kept the private stuff.
Yes, I always thought that was the intention, at least from the comments
below from toplevel configure.ac which is responsible for setting the
CC="gcc -isystem foo -isystem bar" when descending into newlib dir for
multilib:
FLAGS_FOR_TARGET=
case " $target_configdirs " in
*" newlib "*)
case " $target_configargs " in
*" --with-newlib "*)
case "$target" in
*-cygwin*)
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup
-L$$r/$(TARGET_SUBDIR)/winsup/cygwin
-L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$
s/winsup/include -isystem $$s/winsup/cygwin/include -isystem
$$s/winsup/w32api/include' ;;
esac
# If we're not building GCC, don't discard standard headers.
if test -d ${srcdir}/gcc; then
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
if test "${build}" != "${host}"; then
# On Canadian crosses, CC_FOR_TARGET will have already been set
# by `configure', so we won't have an opportunity to add -Bgcc/
# to it. This is right: we don't want to search that directory
# for binaries, but we want the header files in there, so add
# them explicitly.
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem
$$r/$(HOST_SUBDIR)/gcc/include'
# Someone might think of using the pre-installed headers on
# Canadian crosses, in case the installed compiler is not fully
# compatible with the compiler being built. In this case, it
# would be better to flag an error than risking having
# incompatible object files being constructed. We can't
# guarantee that an error will be flagged, but let's hope the
# compiler will do it, when presented with incompatible header
# files.
fi
fi
case "${target}-${is_cross_compiler}" in
i[[3456789]]86-*-linux*-no)
# Here host == target, so we don't need to build gcc,
# so we don't want to discard standard headers.
FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/
-nostdinc / /'`
;;
*)
# If we're building newlib, use its generic headers last, but
search
# for any libc-related directories first (so make it the last -B
# switch).
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/
-isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem
$$s/newlib/libc/include'
;;
esac
;;
esac
;;
esac
case "$target" in
*-mingw*)
# Can't be handled as Cygwin above since Mingw does not use newlib.
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET'
-L$$r/$(TARGET_SUBDIR)/winsup/mingw
-L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem
$$s/winsup/mingw/include -isystem $$
s/winsup/w32api/include' ;;
esac
Brian
More information about the Newlib
mailing list