Configure tries to run cross-compiled programs (when buildingcrossgcc under cygwin)

Dan Kegel dank@kegel.com
Thu Aug 22 22:30:00 GMT 2002


Dan Kegel wrote:
> 
> Ralf Corsepius wrote:
> > You can try to preset the target's config.cache.
> >
> > Eg. use something like this:
> >
> > mkdir powerpc-linux
> > echo "ac_cv_prog_cc_cross=yes" > powerpc-linux/config.cache
> > <pathtosources>/configure --target=powerpc-linux [...]
> 
> No joy.  libiberty's configure doesn't check the cache for
> things like AC_PROG_CC_WORKS.

OK, I patched autoconf, reinstalled it, then regenerated libiberty's configure,
and overrode ac_cv_prog_cc_cross (both your way and via the
environment when running 'make' -- belt and suspenders.)
That helped!  libstdc++-v3/ltconfig still misbehaves, but at least
I only had to click one dialog box instead of twenty.  See below
for the patch.

I suspect overriding cross_compiling to 'yes' in the environment
when running 'make' would convince ltconfig to not misbehave. 
I'll try it as soon as this build finishes.

(That may be a while; building gcc on an 800MHz Celeron running Win2K and Cygnus
takes about five times longer than on a nice dual 1.2GHz Linux machine...)
- Dan

--- /usr/share/autoconf2.13/acgeneral.m4.orig	Thu Aug 22 18:26:58 2002
+++ acgeneral.m4	Thu Aug 22 19:03:12 2002
@@ -1510,11 +1510,13 @@
 EOF
 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
   [$2]=yes
-  # If we can't run a trivial program, we are probably using a cross compiler.
-  if (./conftest; exit) 2>/dev/null; then
-    [$3]=no
-  else
-    [$3]=yes
+  if test "$[$3]" != yes; then
+    # If we can't run a trivial program, we are probably using a cross compiler.
+    if (./conftest; exit) 2>/dev/null; then
+      [$3]=no
+    else
+      [$3]=yes
+    fi
   fi
 else
   echo "configure: failed program was:" >&AC_FD_CC

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list