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]

[toplevel PATCH 2/7] Pass Ada flags down from the toplevel


Arnaud Charlet complained that the new bootstrapping targets lost the ability to pass ADAFLAGS and BOOT_ADAFLAGS. A previous patch to fix this had to be reverted, and Arnaud suggested to take a look at the definition of EXTRA_GCC_FLAGS. This has lines like this one

"`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \

that pass a variable only if the user has overridden it on the command line. This patch extends this scheme so that it can be used for BASE_FLAGS_TO_PASS as well.

A related bug is that GCC did not define LDFLAGS. So, passing -mminimal-toc on AIX worked when building from the toplevel, but not when building from the GCC directory. David Edelsohn tested this fix.

I also garbage-collected BUILD_PREFIX and BUILD_PREFIX_1, which were in EXTRA_GCC_FLAGS but have been unused for a long time.

Ok for mainline?

:ADDPATCH toplevel:

Paolo


2005-01-28  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.def (ADAFLAGS, BOOT_ADAFLAGS, LANGUAGES): New flags_to_pass.
	* Makefile.tpl (BASE_FLAGS_TO_PASS): Support optional flags_to_pass.
	(EXTRA_GCC_FLAGS): Remove ADAFLAGS, BOOT_ADAFLAGS, LANGUAGES,
	BUILD_PREFIX, BUILD_PREFIX_1.
	* Makefile.in: Regenerate.
	* configure.in: (BUILD_PREFIX, BUILD_PREFIX_1): Don't substitute.
	* configure: Regenerate.

gcc:
2005-01-28  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.in (LDFLAGS): Define from autoconf substitution.

Index: Makefile.def
===================================================================
--- Makefile.def	(revision 110266)
+++ Makefile.def	(working copy)
@@ -206,7 +206,9 @@ flags_to_pass = { flag= SHELL ; };
 flags_to_pass = { flag= YACC ; };
 
 // Host tools
+flags_to_pass = { flag= ADAFLAGS ; optional=true ; };
 flags_to_pass = { flag= AR_FLAGS ; };
+flags_to_pass = { flag= BOOT_ADAFLAGS ; optional=true ; };
 flags_to_pass = { flag= BOOT_CFLAGS ; };
 flags_to_pass = { flag= BOOT_LDFLAGS ; };
 flags_to_pass = { flag= CFLAGS ; };
@@ -240,6 +242,7 @@ flags_to_pass = { flag= STRIP_FOR_TARGET
 flags_to_pass = { flag= WINDRES_FOR_TARGET ; };
 
 // Miscellaneous
+flags_to_pass = { flag= LANGUAGES ; optional=true ; };
 flags_to_pass = { flag= LEAN ; };
 
 // Inter-module dependencies
Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 110266)
+++ Makefile.tpl	(working copy)
@@ -389,8 +389,9 @@ HOST_LIB_PATH_[+module+] = \
 [+ ENDIF lib_path +][+ ENDFOR host_modules +]
 
 # Flags to pass down to all sub-makes.
-BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\
-	"[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\
+BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
+	"`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
+	"[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +] \
 	"CONFIG_SHELL=$(SHELL)" \
 	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" 
 
@@ -457,16 +458,12 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_P
 # The BUILD_* variables are a special case, which are used for the gcc
 # cross-building scheme.
 EXTRA_GCC_FLAGS = \
-	'BUILD_PREFIX=$(BUILD_PREFIX)' \
-	'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
 	"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
-	"`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
 	"`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
 	"`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
 	"`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
 	"`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
-	"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
-	"`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
+	"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
 
 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
 
Index: configure.in
===================================================================
--- configure.in	(revision 110266)
+++ configure.in	(working copy)
@@ -1041,8 +1044,6 @@ if test "${build}" != "${host}" ; then
   CXX=${CXX-${host_alias}-c++}
   CXXFLAGS=${CXXFLAGS-"-g -O2"}
   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
-  BUILD_PREFIX=${build_alias}-
-  BUILD_PREFIX_1=${build_alias}-
 
 else
   # Set reasonable default values for some tools even if not Canadian.
@@ -1054,9 +1055,6 @@ else
   # This is all going to change when we autoconfiscate...
 
   CC_FOR_BUILD="\$(CC)"
-  BUILD_PREFIX=
-  BUILD_PREFIX_1=loser-
-
   AC_PROG_CC
 
   # We must set the default linker to the linker used by gcc for the correct
@@ -2141,8 +2139,6 @@ AC_SUBST_FILE(ospace_frag)
 
 # Miscellanea: directories, flags, etc.
 AC_SUBST(RPATH_ENVVAR)
-AC_SUBST(BUILD_PREFIX)
-AC_SUBST(BUILD_PREFIX_1)
 AC_SUBST(tooldir)
 AC_SUBST(build_tooldir)
 AC_SUBST(CONFIGURE_GDB_TK)
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 110266)
+++ gcc/Makefile.in	(working copy)
@@ -150,6 +150,7 @@ BOOT_LANGUAGES = c @all_boot_languages@
 XCFLAGS =
 TCFLAGS =
 CFLAGS = -g
+LDFLAGS = @LDFLAGS@
 STAGE1_CFLAGS = -g @stage1_cflags@
 STAGE1_CHECKING = -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING
 BOOT_CFLAGS = -g -O2



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