This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Top-level Makefile.in


On Jul 28, 2000, DJ Delorie <dj@delorie.com> wrote:

> I can't cross-host from linux to Cygwin; it tries to use
> ../gcc/xgcc.exe to build newlib, except that ../gcc/xgcc.exe is a
> cygwin program and won't run on linux (it's supposed to use
> i686-pc-cygwin-gcc).

> I noticed you just changed the top-level makefile.in's GCC_FOR_TARGET,
> and configure.in also.  I also note you check for host==target,
> but that won't work if build != host.  You can only use
> ../gcc/xgcc when build==host, regardless of the target.

I see.  The problem is that configure would set all of *_FOR_TARGET
when build != host, but then the new code in configure.in would
override it.

DJ, does the attached patch fix the problem for you?  It's probably
not enough.  We should probably not add any -B flags to
FLAGS_FOR_TARGET in case host != build.  Anyway, that may go in a
separate patch.  Ok to install this one?

Index: ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* configure.in (CC_FOR_TARGET, CHILL_FOR_TARGET, CXX_FOR_TARGET):
	Do not override if already set in the environment or in configure.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/configure.in,v
retrieving revision 1.54
diff -u -r1.54 configure.in
--- configure.in	2000/07/28 02:10:47	1.54
+++ configure.in	2000/07/28 20:05:47
@@ -1253,7 +1253,9 @@
   FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
 fi
 
-if test -d ${topsrcdir}/gcc; then
+if test "x${CC_FOR_TARGET+set}" = xset; then
+  :
+elif test -d ${topsrcdir}/gcc; then
   CC_FOR_TARGET='$$r/gcc/xgcc'
 elif test "$host" = "$target"; then
   CC_FOR_TARGET='$(CC)'
@@ -1262,7 +1264,9 @@
 fi
 CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)'
 
-if test -d ${topsrcdir}/gcc &&
+if test "x${CHILL_FOR_TARGET+set}" = xset; then
+  :
+elif test -d ${topsrcdir}/gcc &&
    echo ",${enable_languages-${LANGUAGES-CHILL}}," |
    grep ,CHILL, > /dev/null ; then
   CHILL_FOR_TARGET='$$r/gcc/xgcc -L$$r/gcc/ch/runtime/'
@@ -1273,7 +1277,9 @@
 fi
 CHILL_FOR_TARGET=$CHILL_FOR_TARGET' $(FLAGS_FOR_TARGET)'
 
-if test -d ${topsrcdir}/gcc &&
+if test "x${CXX_FOR_TARGET+set}" = xset; then
+  :
+elif test -d ${topsrcdir}/gcc &&
    echo ",${enable_languages-${LANGUAGES-c++}}," |
    grep ',c[+][+],' > /dev/null ; then
   CXX_FOR_TARGET='$$r/gcc/g++ -nostdinc++ '$libstdcxx_flags

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]