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 RFA: Build system: Check lang_requires_boot_languages


This patch adds a new feature to gcc's config-lang.in files: if the
config-lang.in file for language L1 sets lang_requires_boot_languages to
L2, L3, ..., then if L1 is enabled, then L2, L3, ... are automatically
enabled during stage 1.  This is necessary to bootstrap a frontend which
is not written in C.  This feature will be used by the Go frontend when
it is committed.

Bootstrapped on x86_64-unknown-linux-gnu.  OK for mainline?

Ian


2010-11-03  Ian Lance Taylor  <iant@google.com>

	* configure.ac: Check for lang_requires_boot_languages in
	config-lang.in files.
	* configure: Rebuild.


Index: configure.ac
===================================================================
--- configure.ac	(revision 166249)
+++ configure.ac	(working copy)
@@ -1735,9 +1735,11 @@ if test -d ${srcdir}/gcc; then
       # an apparent bug in bash 1.12 on linux.
       ${srcdir}/gcc/[[*]]/config-lang.in) ;;
       *)
-        # From the config-lang.in, get $language, $lang_requires
+        # From the config-lang.in, get $language, $lang_requires, and
+        # $lang_requires_boot_languages.
         language=
         lang_requires=
+        lang_requires_boot_languages=
         . ${lang_frag}
         for other in ${lang_requires} ; do
           case ,${enable_languages}, in
@@ -1749,6 +1751,22 @@ if test -d ${srcdir}/gcc; then
 	      ;;
 	  esac
         done
+	for other in ${lang_requires_boot_languages} ; do
+	  if test "$other" != "c"; then
+	    case ,${enable_stage1_languages}, in
+	      *,$other,*) ;;
+	      *,all,*) ;;
+	      *)
+		case ,${enable_languages}, in
+		  *,$language,*)
+		    echo " '$other' language required by '$language' in stage 1; enabling" 1>&2
+		    enable_stage1_languages="$enable_stage1_languages,${other}"
+		    ;;
+		esac
+		;;
+	    esac
+          fi
+        done
         ;;
     esac
   done

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