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]
Other format: [Raw text]

[patch] Split config.build out from config.gcc


This helps eliminate, and prevent in the future, the annoying
'pass-through' problems on all cross configurations, where code intended for
target X gets run for build X.  I will follow up with a similar patch to
create config.host.

This does create a certain amount of code duplication, but I think it's
quite definitely better than the previous situation due to the 'pass-through'
problems mentioned above.  It should also theoretically speed things up
a bit.

I resorted the stuff in config.build so as to sort it by features, in
preferred vaguely-autoconf-like style.

I probably didn't delete everything that could be deleted in config.gcc,
but will try to do so in a followup patch.

Bootstrapped i686-pc-linux-gnu.

I eliminated quite a few things which were 'passed through' because they
seemed evidently bogus.  I left some which I was not so sure about; notably,
alpha-vms's bizarre setting of 'prefix' and 'local_prefix', which seems
entirely wrong.  If it is right, it's not clear to me whether it should
be set for build, host, or target...

Apart from eliminating the bogus passthrough variables, this was a very
careful preservation of the preexisting logic.

Alex, DJ, opinions?  Is this OK?

	* config.build: New file.
	* config.gcc: Remove some build-specific stuff.
	* configure.in: Use config.build.
	* configure: Regnerate.

Index: config.build
===================================================================
RCS file: config.build
diff -N config.build
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ config.build	29 Aug 2003 21:55:03 -0000
@@ -0,0 +1,147 @@
+# GCC build-specific configuration file.
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+
+#This file is part of GCC.
+
+#GCC is free software; you can redistribute it and/or modify it under
+#the terms of the GNU General Public License as published by the Free
+#Software Foundation; either version 2, or (at your option) any later
+#version.
+
+#GCC is distributed in the hope that it will be useful, but WITHOUT
+#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GCC; see the file COPYING.  If not, write to the Free
+#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+#02111-1307, USA.
+
+# This is the GCC build-specific configuration file
+# where a configuration type is mapped to different system-specific
+# definitions and files.  This is invoked by the autoconf-generated
+# configure script.  Putting it in a separate shell file lets us skip
+# running autoconf when modifying build-specific information.
+
+# This file switches on the shell variable ${build}.  As much of this
+# as possible should be replaced with autoconf tests in the future.
+
+# This file sets the following shell variables for use by the
+# autoconf-generated configure script:
+#
+#  build_xm_defines	List of macros to define when compiling for the
+#			build machine.
+#
+#  build_xm_file	List of files to include when compiling for the
+#			build machine.
+#
+#  build_install_headers_dir
+#			Target to use when installing header files.
+#
+#  build_exeext		Set to the suffix, if the build machine requires
+#			executables to have a file name suffix.
+
+# Set build_install_headers_dir.
+case ${build} in
+  alpha*-dec-*vms*)
+    build_install_headers_dir=install-headers-cp
+    ;;
+  alpha*-dec-osf4*)
+    # Some versions of OSF4 (specifically X4.0-9 296.7) have
+    # a broken tar, so we use cpio instead.
+    build_install_headers_dir=install-headers-cpio
+    ;;
+  hppa1.0-*-hpux1[01]* | \
+  hppa*64*-*-hpux11* | \
+  hppa1.1-*-hpux11* | \
+  hppa2*-*-hpux11* )
+    build_install_headers_dir=install-headers-cpio
+    ;;
+  m68000-hp-hpux* | m68k-hp-hpux*) # HP 9000 series 300
+    build_install_headers_dir=install-headers-cpio
+    ;;
+  i[34567]86-sequent-ptx4*)
+    build_install_headers_dir=install-headers-cpio
+    ;;
+  i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5
+    build_install_headers_dir=install-headers-cpio
+    ;;
+  *-*-sysv*)
+    build_install_headers_dir=install-headers-cpio
+    ;;
+  i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit
+    build_install_headers_dir=install-headers-cpio
+    ;;
+  *) # Default for all other systems
+    build_install_headers_dir=install-headers-tar
+    ;;
+esac
+
+# Set build_exeext.
+build_exeext=
+case $build in
+  alpha*-dec-*vms*)
+    build_exeext=.exe
+    ;;
+  i[34567]86-pc-msdosdjgpp*)
+    build_exeext=.exe
+    ;;
+  i[34567]86-*-pe | i[34567]86-*-cygwin*)
+    build_exeext=.exe
+    ;;
+  i[34567]86-*-mingw32*)
+    build_exeext=.exe
+    ;;
+  i[34567]86-*-uwin*)
+    build_exeext=.exe
+    ;;
+esac
+
+# Set everything else.
+build_xm_file=
+build_xm_defines=
+case $build in
+  alpha*-dec-*vms*)
+    build_xm_file=alpha/xm-vms.h
+    prefix=/gnu
+    local_prefix=/gnu
+    ;;
+  i370-*-opened* | i370-*-mvs* )  # IBM 360/370/390 Architecture
+    build_xm_defines='FATAL_EXIT_CODE=12'
+    ;;
+  i[34567]86-ncr-sysv4*)		# NCR 3000 - ix86 running system V.4
+    build_xm_defines="SMALL_ARG_MAX"
+    ;;
+  i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4*)
+    build_xm_defines="SMALL_ARG_MAX"
+    ;;
+  i[34567]86-pc-msdosdjgpp*)
+    build_xm_file=i386/xm-djgpp.h
+    ;;
+  i[34567]86-*-solaris2*)
+    build_xm_defines="SMALL_ARG_MAX"
+    ;;
+  i[34567]86-*-sysv4*)		# Intel 80386's running system V.4
+    build_xm_defines="SMALL_ARG_MAX"
+    ;;
+  i386-*-vsta)			# Intel 80386's running VSTa kernel
+    build_xm_file="i386/xm-vsta.h"
+    ;;
+  i[34567]86-*-pe | i[34567]86-*-cygwin*)
+    build_xm_file=i386/xm-cygwin.h
+    ;;
+  i[34567]86-*-mingw32*)
+    build_xm_file=i386/xm-mingw32.h
+    ;;
+  i860-*-sysv4*)
+    build_xm_defines="USG SVR3"
+    ;;
+  mips-sgi-irix6*o32)		# SGI System V.4., IRIX 6, O32 ABI
+    build_xm_file=mips/xm-iris5.h
+    ;;
+  mips-sgi-irix5*)		# SGI System V.4., IRIX 5
+    build_xm_file=mips/xm-iris5.h
+    ;;
+esac
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.348
diff -u -r1.348 config.gcc
--- config.gcc	29 Aug 2003 21:49:34 -0000	1.348
+++ config.gcc	29 Aug 2003 21:55:29 -0000
@@ -1,4 +1,4 @@
-# GCC build-, host- and target-specific configuration file.
+# GCC host- and target-specific configuration file.
 # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
 # Free Software Foundation, Inc.
 
@@ -19,13 +19,13 @@
 #Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #02111-1307, USA.
 
-# This is the GCC build-, host- and target-specific configuration file
+# This is the GCC host- and target-specific configuration file
 # where a configuration type, as recognized and generated by config.bfd,
 # is mapped to different system-specific definitions and files.  This is
-# invoked by the autoconf-generated configure script, called for build,
+# invoked by the autoconf-generated configure script, called for
 # host and target in that order, setting ${machine} to each.  Putting it
 # in a separate shell file lets us skip running autoconf when modifying
-# build-, host- and target-specific information.
+# host- and target-specific information.
 
 # This file switches on the shell variable ${machine}, and also uses the
 # following shell variables:
@@ -114,12 +114,6 @@
 #
 #  target_gtfiles       List of extra source files with type information.
 #
-#  build_xm_defines	List of macros to define when compiling for the
-#			build machine.
-#
-#  build_xm_file	List of files to include when compiling for the
-#			build machine.
-#
 #  host_xm_defines	List of macros to define when compiling for the
 #			host machine.
 #
@@ -137,16 +131,10 @@
 #
 #  target_cpu_default	Set to override the default target model.
 #
-#  build_install_headers_dir
-#			Target to use when installing header files.
-#
 #  gdb_needs_out_file_path
 #			Set to yes if gdb needs a dir command with
 #			`dirname $out_file`.
 #
-#  build_exeext		Set to the suffix, if the build machine requires
-#			executables to have a file name suffix.
-#
 #  host_exeext		Set to the suffix, if the host machine requires
 #			executables to have a file name suffix.
 #
@@ -179,8 +167,7 @@
 #  host_hook_obj	An object file that provides the host hooks.
 #
 #  install_headers_dir	Makefile-target for how the header file directory
-#			is installed, when this system is a build system,
-#			for build_install_headers_dir.
+#			is installed.
 #
 #  exeext		The suffix for executables on this system.
 #
@@ -2736,29 +2723,16 @@
 	fi
 fi
 
-# Save data on machine being used to compile GCC in build_xm_file.
 # Save data on host machine in vars host_xm_file and host_xmake_file.
-if test x$pass1done = x
-then
-	if test x$xm_file != x
-	then build_xm_file=$xm_file
-	fi
-	build_xm_defines=$xm_defines
-	build_install_headers_dir=$install_headers_dir
-	build_exeext=$exeext
-	pass1done=yes
-else
-	if test x$pass2done = x
-	then
-		if test x$xm_file != x
-		then host_xm_file=$xm_file
-		fi
-		host_xm_defines=$xm_defines
-		host_xmake_file="$xmake_file"
-		host_extra_gcc_objs=$extra_gcc_objs
-		host_extra_objs=$extra_host_objs
-		host_exeext=$exeext
-		out_host_hook_obj=$host_hook_obj
-		pass2done=yes
-	fi
+if test x$pass2done = x ; then
+  if test x$xm_file != x ; then
+    host_xm_file=$xm_file
+  fi
+  host_xm_defines=$xm_defines
+  host_xmake_file="$xmake_file"
+  host_extra_gcc_objs=$extra_gcc_objs
+  host_extra_objs=$extra_host_objs
+  host_exeext=$exeext
+  out_host_hook_obj=$host_hook_obj
+  pass2done=yes
 fi
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.718
diff -u -r1.718 configure.in
--- configure.in	21 Aug 2003 02:19:32 -0000	1.718
+++ configure.in	29 Aug 2003 21:56:25 -0000
@@ -962,11 +962,10 @@
 # Build, host, and target specific configuration fragments
 # --------------------------------------------------------
 
+# Collect build-machine-specific information.
+. ${srcdir}/config.build
+
 target_gtfiles=
-build_xm_file=
-build_xm_defines=
-build_install_headers_dir=install-headers-tar
-build_exeext=
 host_xm_file=
 host_xm_defines=
 host_xmake_file=
@@ -976,7 +975,7 @@
 # For the host machine, we save the xm_file variable as host_xm_file;
 # then we decode the target machine and forget everything else
 # that came from the host machine.
-for machine in $build $host $target; do
+for machine in $host $target; do
 	. ${srcdir}/config.gcc
 done
 

-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html


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