diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 22db9d3f2..5b60c579c 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2002-04-25 Thomas Fitzsimmons + + * configure.in (CC_FOR_BUILD): Set to gcc whether + cross-compiling or not. + (CC): Add -isystem's for targ-include and libc/include when they + do not already appear in CC. + 2002-04-24 Thomas Fitzsimmons * Makefile.am (check-DEJAGNU): New target. diff --git a/newlib/README b/newlib/README index e07d29b9c..c32a5f06e 100644 --- a/newlib/README +++ b/newlib/README @@ -158,6 +158,25 @@ you can use it to test your guesses on abbreviations--for example: % sh config.sub i786v Invalid configuration `i786v': machine `i786v' not recognized +The Build, Host and Target Concepts in newlib +============================================= + +The build, host and target concepts are defined for gcc as follows: + +build: the platform on which gcc is built. +host: the platform on which gcc is run. +target: the platform for which gcc generates code. + +Since newlib is a library, the target concept does not apply to it, and the +build, host, and target options given to the top-level configure script must +be changed for newlib's use. + +The options are shifted according to these correspondences: + +gcc's build platform has no equivalent in newlib. +gcc's host platform is newlib's build platform. +gcc's target platform is newlib's host platform. +and as mentioned before, newlib has no concept of target. `configure' options =================== diff --git a/newlib/configure b/newlib/configure index 38b6c49f3..5bece9525 100755 --- a/newlib/configure +++ b/newlib/configure @@ -2448,14 +2448,16 @@ fi # Put a plausible default for CC_FOR_BUILD in Makefile. if test -z "$CC_FOR_BUILD"; then - if test "x$cross_compiling" = "xno"; then - CC_FOR_BUILD='$(CC)' - else - CC_FOR_BUILD=gcc - fi + CC_FOR_BUILD=gcc fi +# These get added in the top-level configure.in, except in the case where +# newlib is being built natively. +if test -z `echo ${CC} | grep \/libc\/include`; then + CC="${CC} -isystem $PWD/targ-include -isystem ${newlib_basedir}/libc/include" +fi + if test "${multilib}" = "yes"; then multilib_arg="--enable-multilib" else diff --git a/newlib/configure.in b/newlib/configure.in index 9c62a1b8f..372d8fb9d 100644 --- a/newlib/configure.in +++ b/newlib/configure.in @@ -98,14 +98,16 @@ AC_SUBST(UNIX_OBJECTLIST) # Put a plausible default for CC_FOR_BUILD in Makefile. if test -z "$CC_FOR_BUILD"; then - if test "x$cross_compiling" = "xno"; then - CC_FOR_BUILD='$(CC)' - else - CC_FOR_BUILD=gcc - fi + CC_FOR_BUILD=gcc fi AC_SUBST(CC_FOR_BUILD) +# These get added in the top-level configure.in, except in the case where +# newlib is being built natively. +if test -z `echo ${CC} | grep \/libc\/include`; then + CC="${CC} -isystem $PWD/targ-include -isystem ${newlib_basedir}/libc/include" +fi + if test "${multilib}" = "yes"; then multilib_arg="--enable-multilib" else