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]

Fold cross-make and build-make into configure


cross-make and build-make are hangovers from the old pre-autoconf
configure script.  The only reason to keep them around is to to trip
up people who think they know where to look for stuff.  The appended
patch folds them into the configure script.  It doesn't make this area
of the build process that much easier to understand, but at least
there are two fewer places to look.

I also expunged all.build, install-build, install-cross-rest,
install-float-h-cross, and @extra_c_flags@.  These have not been used
since 1998 (except @extra_c_flags@, which has only not been used since
August 2000).

Bootstrapped i586-linux.  I've lost track of the current set of
expected unexpected failures so I'm appending the result to this
message.  I'm running a i586-linux -> powerpc-eabisim cross compile
test now, and will try a build!=host test if that doesn't work.

The changes to ch/Makefile.in are untested.  Whatever happened to
maybe dumping gcc/ch and libchill from the source tree?

Ada folks, any time frame on converting your front end to use
nonrecursive make like all the other live languages do?

zw

		=== libstdc++-v3 tests ===
XPASS: 22_locale/collate_members_wchar_t.cc execution test
		=== libstdc++-v3 Summary ===
# of expected passes		342
# of unexpected successes	1
# of expected failures		27
		=== libjava tests ===
FAIL: register run
FAIL: Primes output from source compiled test
FAIL: Primes output from bytecode->native test
FAIL: Primes -O output from source compiled test
FAIL: Primes -O output from bytecode->native test
XPASS: stringconst output from bytecode->native test
XPASS: stringconst -O output from bytecode->native test
FAIL: PR3096 output from source compiled test
FAIL: PR3096 -O output from source compiled test
		=== libjava Summary ===
# of expected passes		1897
# of unexpected failures	7
# of unexpected successes	2
# of expected failures		16
# of untested testcases		17
		=== gcc tests ===
FAIL: gcc.c-torture/compile/20011114-1.c,  -O0  
FAIL: gcc.c-torture/compile/20011114-1.c,  -O1  
FAIL: gcc.c-torture/compile/20011114-1.c,  -O2  
FAIL: gcc.c-torture/compile/20011114-1.c,  -O3 -fomit-frame-pointer  
FAIL: gcc.c-torture/compile/20011114-1.c,  -O3 -g  
FAIL: gcc.c-torture/compile/20011114-1.c,  -Os  
FAIL: gcc.c-torture/execute/930603-1.c compilation,  -O3 -fomit-frame-pointer 
FAIL: gcc.c-torture/execute/930603-1.c compilation,  -O3 -g 
FAIL: gcc.dg/c99-intconst-1.c (test for excess errors)
		=== gcc Summary ===
# of expected passes		16420
# of unexpected failures	9
# of expected failures		61
# of unresolved testcases	2
# of unsupported tests		26
		=== g++ tests ===
FAIL: g++.other/enum5.C (test for excess errors)
XPASS: g++.pt/decl2.C ICE - (test for errors, line 8)
XPASS: g++.robertl/eb17.C  Execution test
		=== g++ Summary ===
# of expected passes		6742
# of unexpected failures	1
# of unexpected successes	2
# of expected failures		94
# of untested testcases		9
		=== g77 tests ===
FAIL: g77.f-torture/execute/auto1.f execution,  -O0 
FAIL: g77.f-torture/execute/auto1.f execution,  -O1 
FAIL: g77.f-torture/execute/auto1.f execution,  -O2 
FAIL: g77.f-torture/execute/auto1.f execution,  -O3 -fomit-frame-pointer 
FAIL: g77.f-torture/execute/auto1.f execution,  -O3 -fomit-frame-pointer -funroll-loops 
FAIL: g77.f-torture/execute/auto1.f execution,  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions 
FAIL: g77.f-torture/execute/auto1.f execution,  -O3 -g 
FAIL: g77.f-torture/execute/auto1.f execution,  -Os 
		=== g77 Summary ===
# of expected passes		1352
# of unexpected failures	8
		=== objc tests ===
FAIL: objc/execute/formal_protocol-6.m execution,  -O 
		=== objc Summary ===
# of expected passes		209
# of unexpected failures	1


	* build-make, cross-make: Delete file.
	* configure.in: Set and substitute CROSS, ALL,
	SYSTEM_HEADER_DIR, HOST_PREFIX, HOST_PREFIX_1, HOST_CC,
	HOST_CFLAGS, STMP_FIXINC, and STMP_FIXPROTO depending on
	whether build == host and host == target.  Do not
	AC_SUBST_FILE build_overrides or cross_overrides.  Do not
	AC_SUBST cross_defines or extra_c_flags.
	* Makefile.in (NATIVE_SYSTEM_HEADER_DIR): New.
	(SYSTEM_HEADER_DIR, HOST_PREFIX, HOST_CC, HOST_PREFIX,
	HOST_PREFIX_1, HOST_CFLAGS, ALL, INTERNAL_CFLAGS): Set
	partially or completely with autoconf-substituted @variable@
	notation.
	(INSTALL_TARGET, @cross_defines@, @cross_overrides@,
	@build_overrides@, @extra_c_flags@, all.build, install-build,
	install-cross-rest, install-float-h-cross): Deleted.
	(install-normal): Rename to install.  Delete old "install"
	indirection rule.
	* ada/Makefile.in, ch/Makefile.in: Don't set ALL.  Delete
	@cross_defines@, @cross_overrides@, @build_overrides@ stanzas.
	INTERNAL_CFLAGS is now @CROSS@ -DIN_GCC; update comment.

===================================================================
Index: Makefile.in
--- Makefile.in	2001/11/30 04:38:41	1.796
+++ Makefile.in	2001/12/02 02:58:07
@@ -224,18 +224,20 @@ NM_FOR_TARGET = ` \
     fi; \
   fi`
 
-# Dir to search for system headers.  Overridden by cross-make.
-SYSTEM_HEADER_DIR = /usr/include
-
 # Where to find some libiberty headers.
 HASHTAB_H   = $(srcdir)/../include/hashtab.h
 OBSTACK_H   = $(srcdir)/../include/obstack.h
 SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
 FIBHEAP_H   = $(srcdir)/../include/fibheap.h
 
+# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
+NATIVE_SYSTEM_HEADER_DIR = /usr/include
 # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
 CROSS_SYSTEM_HEADER_DIR = $(build_tooldir)/sys-include
 
+# autoconf sets SYSTEM_HEADER_DIR to one of the above.
+SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
+
 # Control whether to run fixproto and fixincludes.
 STMP_FIXPROTO = stmp-fixproto
 STMP_FIXINC = stmp-fixinc
@@ -457,16 +459,17 @@ DIR = ../gcc
 # Flags to use when cross-building GCC.
 # Prefix to apply to names of object files when using them
 # to run on the machine we are compiling on.
-HOST_PREFIX=
+HOST_PREFIX = @HOST_PREFIX@
 # Prefix to apply to names of object files when compiling them
 # to run on the machine we are compiling on.
 # The default for this variable is chosen to keep these rules
 # out of the way of the other rules for compiling the same source files.
-HOST_PREFIX_1=loser-
-HOST_CC=$(CC)
-# If you change any of the following variables, check whether a
-# similar change is needed in build-make.
-HOST_CFLAGS=$(ALL_CFLAGS) -DGENERATOR_FILE
+HOST_PREFIX_1 = @HOST_PREFIX_1@
+# Native compiler for the build machine and its switches.
+HOST_CC = @HOST_CC@
+HOST_CFLAGS= @HOST_CFLAGS@ -DGENERATOR_FILE
+
+# Native linker and preprocessor flags.  For x-fragment overrides.
 HOST_LDFLAGS=$(LDFLAGS)
 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
 
@@ -485,12 +488,10 @@ CPP_CROSS_NAME = `echo cpp|sed '$(progra
 PROTOIZE_CROSS_NAME = `echo protoize|sed '$(program_transform_cross_name)'`
 UNPROTOIZE_CROSS_NAME = `echo unprotoize|sed '$(program_transform_cross_name)'`
 
-# Choose the real default target.
-ALL=all.internal
+# Set by autoconf to "all.internal" for a native build, or
+# "all.cross" to build a cross compiler.
+ALL = @ALL@
 
-# Choose the real install target.
-INSTALL_TARGET=install-normal
-
 # Setup the testing framework, if you have one
 EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
             echo $${rootme}/../expect/expect ; \
@@ -569,20 +570,15 @@ CPPLIB_H = cpplib.h line-map.h
 
 ####host overrides
 @host_overrides@
-
-####cross overrides
-@cross_defines@
-@cross_overrides@
-
-####build overrides
-@build_overrides@
 #
 # Now figure out from those variables how to compile and link.
 
 all.indirect: $(ALL)
 
-# IN_GCC tells various files that system.h, toplev.c, etc are available.
-INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
+# IN_GCC distinguishes between code compiled into GCC itself and other
+# programs built during a bootstrap.
+# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
+INTERNAL_CFLAGS = -DIN_GCC @CROSS@
 
 # This is the variable actually used when we compile.
 # If you change this line, you probably also need to change the definition
@@ -794,7 +790,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udi
 
 # The following targets define the interface between us and the languages.
 #
-# all.build, all.cross, start.encap, rest.encap,
+# all.cross, start.encap, rest.encap,
 # info, dvi,
 # install-normal, install-common, install-info, install-man,
 # uninstall,
@@ -913,8 +909,6 @@ all.internal: start.encap rest.encap doc
 # although we can't run it on this machine.
 all.cross: native gcc-cross cpp$(exeext) specs \
 	$(LIBGCC) $(EXTRA_PARTS) lang.all.cross doc
-# This is what to compile if making gcc with a cross-compiler.
-all.build: native xgcc$(exeext) cpp$(exeext) $(EXTRA_PARTS) lang.all.build
 # This is what must be made before installing GCC and converting libraries.
 start.encap: native xgcc$(exeext) cpp$(exeext) specs \
 	xlimits.h lang.start.encap
@@ -2462,29 +2456,13 @@ maintainer-clean:
 # Entry points `install' and `uninstall'.
 # Also use `install-collect2' to install collect2 when the config files don't.
 
-# The semicolon is to prevent the install.sh -> install default rule
-# from doing anything.  Having it run true helps avoid problems and
-# noise from versions of make which don't like to have null commands.
-install: $(INSTALL_TARGET) ; @true
-
 # Copy the compiler files into directories where they will be run.
 # Install the driver last so that the window when things are
 # broken is small.
-install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
+install: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
     $(INSTALL_CPP) install-man install-info intl.install install-@POSUB@ \
     lang.install-normal install-driver
 
-# Do nothing while making gcc with a cross-compiler. The person who
-# makes gcc for the target machine has to know how to put a complete
-# gcc together by hand.
-install-build: force
-	@echo You have to install gcc on your target machine by hand.
-
-# Run this on the target machine
-# to finish installation of cross compiler.
-# This is not used anymore now that float.h does not depend on enquire.
-install-cross-rest: install-float-h-cross
-
 # Handle cpp installation.
 install-cpp: cpp$(exeext)
 	-if [ -f gcc-cross$(exeext) ] ; then \
@@ -2510,18 +2488,6 @@ uninstall-cpp:
 	  rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
 	  rm -f $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
 	else true; fi
-
-# Install float.h for cross compiler.
-# Run this on the target machine!
-# This is not used anymore now that float.h does not depend on enquire.
-install-float-h-cross: installdirs
-#	if [ -f enquire ] ; then true; else false; fi
-# Note: don't use -.  We should fail right away if enquire was not made.
-	./enquire -f > $(tmpdir)/float.h
-	-rm -f $(libsubdir)/include/float.h
-	$(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
-	-rm -f $(tmpdir)/float.h
-	chmod a-x $(libsubdir)/include/float.h
 
 # Create the installation directories.
 installdirs:
===================================================================
Index: build-make
--- build-make	Sat Dec  1 18:58:13 2001
+++ build-make	Tue May  5 13:32:27 1998
@@ -1,27 +0,0 @@
-# Need those to compile binaries running on host machine.
-# It is configured by
-#
-# configure --host=target_cpu-target_os \
-#	--target=target_cpu-target_os --build=host_cpu-host_os
-#
-# That HOST stuff has to be taken care of very carefully.
-HOST_PREFIX=l-
-HOST_PREFIX_1=$(HOST_PREFIX)
-HOST_CC=$(CC_FOR_BUILD)
-HOST_CFLAGS=$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) \
-	    $(XCFLAGS) -DGENERATOR_FILE
-HOST_LDFLAGS=$(LDFLAGS)
-HOST_CPPFLAGS=$(ALL_CPPFLAGS)
-
-# To build the native compiler with the cross compiler, the headers 
-# for the target are already fixed. And /usr/include is for host, not
-# target.
-STMP_FIXINC =
-STMP_FIXPROTO =
-
-# Cause installation using install-build. We do nothing here.
-#INSTALL_TARGET = install-build
-
-# Don't try to compile the things we can't compile or we have made
-# while making gcc with the cross-compiler.
-#ALL = all.build
===================================================================
Index: configure.in
--- configure.in	2001/12/01 01:57:26	1.562
+++ configure.in	2001/12/02 02:58:09
@@ -1066,15 +1066,16 @@ for f in $build_xm_file; do
   esac
 done
 
-# Define macro CROSS_COMPILE in compilation
-# if this is a cross-compiler.
-# Also use all.cross instead of all.internal
-# and add cross-make to Makefile.
-cross_overrides="/dev/null"
+# Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
+# Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
+CROSS=						AC_SUBST(CROSS)
+ALL=all.internal				AC_SUBST(ALL)
+SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)'	AC_SUBST(SYSTEM_HEADER_DIR)
 if test x$host != x$target
 then
-	cross_defines="CROSS=-DCROSS_COMPILE"
-	cross_overrides="${topdir}/cross-make"
+	CROSS="-DCROSS_COMPILE"
+	ALL=all.cross
+	SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
 fi
 
 # If this is a cross-compiler that does not
@@ -1094,13 +1095,31 @@ else
 fi
 AC_SUBST(inhibit_libc)
 
-# When building gcc with a cross-compiler, we need to fix a few things.
-# This must come after cross-make as we want all.build to override
-# all.cross.
-build_overrides="/dev/null"
+# When building gcc with a cross-compiler, we need to adjust things so
+# that the generator programs are still built with the native compiler.
+# Also, we cannot run fixincludes or fix-header.
+# Note that the terminology here is wrong; it should be BUILD_* throughout.
+# FIXME.
+
+# These are the normal (build=host) settings:
+HOST_PREFIX=			AC_SUBST(HOST_PREFIX)
+HOST_PREFIX_1=ignore-		AC_SUBST(HOST_PREFIX_1)
+HOST_CC='$(CC)'			AC_SUBST(HOST_CC)
+HOST_CFLAGS='$(ALL_CFLAGS)'	AC_SUBST(HOST_CFLAGS)
+
+STMP_FIXINC=stmp-fixinc		AC_SUBST(STMP_FIXINC)
+STMP_FIXPROTO=stmp-fixproto	AC_SUBST(STMP_FIXPROTO)
+
+# And these apply if build != host.
 if test x$build != x$host
 then
-	build_overrides="${topdir}/build-make"
+    HOST_PREFIX=build-
+    HOST_PREFIX_1=build-
+    HOST_CC='$(CC_FOR_BUILD)'
+    HOST_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
+
+    STMP_FIXINC=
+    STMP_FIXPROTO=
 fi
 
 # Expand extra_headers to include complete path.
@@ -2168,7 +2187,6 @@ AC_SUBST(quoted_cc_set_by_configure)
 AC_SUBST(cpp_install_dir)
 AC_SUBST(dep_host_xmake_file)
 AC_SUBST(dep_tmake_file)
-AC_SUBST(extra_c_flags)
 AC_SUBST(extra_headers_list)
 AC_SUBST(extra_objs)
 AC_SUBST(extra_parts)
@@ -2210,9 +2228,6 @@ AC_SUBST(target_cpu_default)
 
 AC_SUBST_FILE(target_overrides)
 AC_SUBST_FILE(host_overrides)
-AC_SUBST(cross_defines)
-AC_SUBST_FILE(cross_overrides)
-AC_SUBST_FILE(build_overrides)
 AC_SUBST_FILE(language_fragments)
 AC_SUBST_FILE(language_hooks)
 
@@ -2313,8 +2328,5 @@ SET_MAKE='${SET_MAKE}'
 target_list='${target_list}'
 target_overrides='${target_overrides}'
 host_overrides='${host_overrides}'
-cross_defines='${cross_defines}'
-cross_overrides='${cross_overrides}'
-build_overrides='${build_overrides}'
 cpp_install_dir='${cpp_install_dir}'
 ])
===================================================================
Index: cross-make
--- cross-make	Sat Dec  1 18:58:13 2001
+++ cross-make	Tue May  5 13:32:27 1998
@@ -1,6 +0,0 @@
-# Dir to search for system headers.  Normally /usr/include.
-# Use CROSS_INCLUDE_DIR not TOOL_INCLUDE_DIR for other vendor's headers.
-SYSTEM_HEADER_DIR = $(CROSS_SYSTEM_HEADER_DIR)
-
-# Don't try to compile the things we can't compile.
-ALL = all.cross
===================================================================
Index: ada/Makefile.in
--- ada/Makefile.in	2001/12/01 02:11:25	1.12
+++ ada/Makefile.in	2001/12/02 02:58:10
@@ -192,9 +192,6 @@ INTLLIBS = @INTLLIBS@
 # Any system libraries needed just for GNAT.
 SYSLIBS = @GNAT_LIBEXC@
 
-# Choose the real default target.
-ALL=all
-
 # List of extra object files linked in with various programs.
 EXTRA_GNAT1_OBJS = ../prefix.o
 EXTRA_GNATBIND_OBJS = ../prefix.o
@@ -221,23 +218,15 @@ all: all.indirect
 
 ####host overrides
 @host_overrides@
-
-####cross overrides
-@cross_defines@
-@cross_overrides@
-
-####build overrides
-@build_overrides@
-
-# Now figure out from those variables how to compile and link.
-
 
 # Now figure out from those variables how to compile and link.
 
 all.indirect: Makefile ../gnat1$(exeext)
 
-# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
-INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
+# IN_GCC distinguishes between code compiled into GCC itself and other
+# programs built during a bootstrap.
+# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
+INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
 
 # This is the variable actually used when we compile.
 LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
===================================================================
Index: ch/Makefile.in
--- ch/Makefile.in	2001/07/19 06:22:04	1.34
+++ ch/Makefile.in	2001/12/02 02:58:10
@@ -103,9 +103,6 @@ INTLLIBS = @INTLLIBS@
 # Additional system libraries to link with.
 CLIB=
 
-# Choose the real default target.
-ALL=all
-
 # End of variables for you to override.
 
 # Definition of `all' is here so that new rules inserted by sed
@@ -118,22 +115,18 @@ all: all.indirect
 # sed inserts variable overrides after the following line.
 ####target overrides
 @target_overrides@
+
 ####host overrides
 @host_overrides@
-####cross overrides
-@cross_defines@
-@cross_overrides@
-####build overrides
-@build_overrides@
-####site overrides
-# @site_overrides@
 #
 # Now figure out from those variables how to compile and link.
 
 all.indirect: Makefile ../chill ../cc1chill$(exeext)
 
-# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
-INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
+# IN_GCC distinguishes between code compiled into GCC itself and other
+# programs built during a bootstrap.
+# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
+INTERNAL_CFLAGS = -DIN_GCC @CROSS@
 
 # This is the variable actually used when we compile.
 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)


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