Patchwork [gccgo] Check for lang_requires_boot_language

login
register
mail settings
Submitter Ian Taylor
Date Oct. 29, 2010, 11:13 p.m.
Message ID <mcrbp6c4mo8.fsf@google.com>
Download mbox | patch
Permalink /patch/69641/
State New
Headers show

Comments

Ian Taylor - Oct. 29, 2010, 11:13 p.m.
This patch to the top level configure.ac adds a test for whether any
config-lang.in sets lang_requires_boot_language.  If an enabled language
sets this shell variable, then the specified language(s) are added as
languages to be built in stage 1.

This patch then removes the special case making c++ a boot language if
Go is enabled, as that case is now handled by the above.

Committed to gccgo branch.

Ian

Patch

Index: configure.ac
===================================================================
--- configure.ac	(revision 166055)
+++ configure.ac	(working copy)
@@ -1865,9 +1865,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_language.
         language=
         lang_requires=
+        lang_requires_boot_language=
         . ${lang_frag}
         for other in ${lang_requires} ; do
           case ,${enable_languages}, in
@@ -1879,6 +1881,22 @@  if test -d ${srcdir}/gcc; then
 	      ;;
 	  esac
         done
+	for other in ${lang_requires_boot_language} ; 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
@@ -1928,16 +1946,6 @@  if test -d ${srcdir}/gcc; then
 	  boot_language=yes
 	fi
 
-	# FIXME: A general mechanism for specifying the language of a
-	# frontend would be nice.
-	case ,${enable_languages}, in
-	  *,go,*)
-	    if test "$language" = "c++"; then
-	      boot_language=yes
-	    fi
-	    ;;
-	esac
-
         case ,${enable_languages}, in
           *,${language},*)
             # Language was explicitly selected; include it.
Index: configure
===================================================================
--- configure	(revision 166055)
+++ configure	(working copy)
@@ -6763,9 +6763,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_language.
         language=
         lang_requires=
+        lang_requires_boot_language=
         . ${lang_frag}
         for other in ${lang_requires} ; do
           case ,${enable_languages}, in
@@ -6777,6 +6779,22 @@  if test -d ${srcdir}/gcc; then
 	      ;;
 	  esac
         done
+	for other in ${lang_requires_boot_language} ; 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
@@ -6826,16 +6844,6 @@  if test -d ${srcdir}/gcc; then
 	  boot_language=yes
 	fi
 
-	# FIXME: A general mechanism for specifying the language of a
-	# frontend would be nice.
-	case ,${enable_languages}, in
-	  *,go,*)
-	    if test "$language" = "c++"; then
-	      boot_language=yes
-	    fi
-	    ;;
-	esac
-
         case ,${enable_languages}, in
           *,${language},*)
             # Language was explicitly selected; include it.