gas=yes issues in configure

Jim Wilson wilson@cygnus.com
Wed Apr 8 02:13:00 GMT 1998


	The use of gas=yes in the big target switch is broken for cross
	builds.  Forcing gas=yes is clearly only desired when configuring
	the target, yet we wind up doing it as well for the build and host
	machines as well.

The reason for setting gas in the first place is so that the big switch
can test it.  Setting gas during the big switch, or after the big switch,
doesn't make all that much sense at first.

I see however that we actually have 5 different switches in configure now, and
gas is being set in the second one so that the fifth one can test the value.

We don't really need gas after that though, but since the target pass is the
last pass, it will have the right value after the loop anyways.

Renaming gas to target_gas inside the loop would be OK, but is a lot of
changes.  It would be simpler to rename the single use outside the loop,
the AC_ARG_WITH reference at the top.  Or alternatively, moving the AC_ARG_WITH
call inside the loop would work too, so that gas is reinitialized for every
loop iteration, but that is less elegant.

Here is my only partly tested patch suggestion.

Tue Apr  7 18:10:52 1998  Jim Wilson  <wilson@cygnus.com>

	* configure.in (gnu_ld): Rename to gnu_ld_flag before main loop.
	Set gnu_ld to gnu_ld_flag inside main loop.
	(gas): Likewise.

Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.81
diff -p -r1.81 configure.in
*** configure.in	1998/04/06 22:17:05	1.81
--- configure.in	1998/04/08 01:25:38
*************** copy=cp
*** 34,47 ****
  # With GNU ld
  AC_ARG_WITH(gnu-ld,
  [  --with-gnu-ld           arrange to work with GNU ld.],
! gnu_ld="$with_gnu_ld",
! gnu_ld=no)
  
  # With GNU as
  AC_ARG_WITH(gnu-as,
  [  --with-gnu-as           arrange to work with GNU as.],
! gas="$with_gnu_as",
! gas=no)
  
  # With stabs
  AC_ARG_WITH(stabs,
--- 34,47 ----
  # With GNU ld
  AC_ARG_WITH(gnu-ld,
  [  --with-gnu-ld           arrange to work with GNU ld.],
! gnu_ld_flag="$with_gnu_ld",
! gnu_ld_flag=no)
  
  # With GNU as
  AC_ARG_WITH(gnu-as,
  [  --with-gnu-as           arrange to work with GNU as.],
! gas_flag="$with_gnu_as",
! gas_flag=no)
  
  # With stabs
  AC_ARG_WITH(stabs,
*************** for machine in $build $host $target; do
*** 237,242 ****
--- 237,246 ----
  	exeext=
  	# Set this to control which thread package will be used.
  	thread_file=
+ 	# Reinitialize these from the flag values every loop pass, since some
+ 	# configure entries modify them.
+ 	gas="$gas_flag"
+ 	gnu_ld="$gnu_ld_flag"
  
  	# Set default cpu_type, tm_file and xm_file so it can be updated in
  	# each machine entry.



More information about the Gcc mailing list