diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2006-12-29 16:58:48 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2006-12-29 16:58:48 +0000 |
commit | e1888513cc227fe59260c383b6280f37c2fd126a (patch) | |
tree | 7a89dd826f917a75c725386e96745adbbeb9c7c5 /configure.in | |
parent | 53b88b731c34c6fc15c31fd6bdb96d5e8657372a (diff) | |
download | gcc-e1888513cc227fe59260c383b6280f37c2fd126a.zip gcc-e1888513cc227fe59260c383b6280f37c2fd126a.tar.gz gcc-e1888513cc227fe59260c383b6280f37c2fd126a.tar.bz2 |
configure.in: Reorganize recognition of languages.
2006-12-29 Paolo Bonzini <bonzini@gnu.org>
* configure.in: Reorganize recognition of languages. Add
--enable-stage1-languages. Show supported languages for the chosen
target rather than all recognized languages.
* configure: Regenerate.
From-SVN: r120271
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 115 |
1 files changed, 80 insertions, 35 deletions
diff --git a/configure.in b/configure.in index e8face1..6cae156 100644 --- a/configure.in +++ b/configure.in @@ -1153,8 +1153,7 @@ AC_SUBST(gmplibs) AC_SUBST(gmpinc) # By default, C is the only stage 1 language. -stage1_languages=c -AC_SUBST(stage1_languages) +stage1_languages=,c, # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use @@ -1216,9 +1215,9 @@ if test -d ${srcdir}/gcc; then esac done - new_enable_languages=c + new_enable_languages=,c, missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` - potential_languages=c + potential_languages=,c, for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do case ${lang_frag} in @@ -1233,32 +1232,22 @@ if test -d ${srcdir}/gcc; then target_libs= lang_dirs= subdir_requires= - boot_language= - build_by_default= + boot_language=no + build_by_default=yes . ${lang_frag} - potential_languages="${potential_languages},${language}" - # This is quite sensitive to the ordering of the case statement arms. - case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in - *::*:*) - echo "${lang_frag} doesn't set \$language." 1>&2 - exit 1 - ;; - *:ada:no:*) - # Ada was requested with no preexisting GNAT. Disable unconditionally. - add_this_lang=no - ;; - *,${language},*:*:*:*) + if test x${language} = x; then + echo "${lang_frag} doesn't set \$language." 1>&2 + exit 1 + fi + + case ,${enable_languages}, in + *,${language},*) # Language was explicitly selected; include it. add_this_lang=yes ;; - *,all,*:*:*:no) - # 'all' was selected, but this is not a default language - # so do not include it. - add_this_lang=no - ;; - *,all,*:*:*:*) - # 'all' was selected and this is a default language; include it. - add_this_lang=yes + *,all,*) + # 'all' was selected, select it if it is a default language + add_this_lang=${build_by_default} ;; *) add_this_lang=no @@ -1275,30 +1264,48 @@ if test -d ${srcdir}/gcc; then ;; *) # Silently disable. - add_this_lang=no + add_this_lang=unsupported ;; esac done + # Disable Ada if no preexisting GNAT is available. + case ,${enable_languages},:${language}:${have_gnat} in + *,${language},*:ada:no) + # Specifically requested language; tell them. + AC_MSG_ERROR([GNAT is required to build $language]) + ;; + *:ada:no) + # Silently disable. + add_this_lang=unsupported + ;; + esac + # Disable a language that is unsupported by the target. case " $unsupported_languages " in *" $language "*) - add_this_lang=no + add_this_lang=unsupported ;; esac case $add_this_lang in - no) + unsupported) # Remove language-dependent dirs. eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" ;; - *) - new_enable_languages="$new_enable_languages,$language" + no) + # Remove language-dependent dirs; still show language as supported. + eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" + potential_languages="${potential_languages}${language}," + ;; + yes) + new_enable_languages="${new_enable_languages}${language}," + potential_languages="${potential_languages}${language}," missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"` case ${boot_language} in yes) # Add to (comma-separated) list of stage 1 languages. - stage1_languages="${stage1_languages},${language}" + stage1_languages="${stage1_languages}${language}," ;; esac ;; @@ -1307,17 +1314,55 @@ if test -d ${srcdir}/gcc; then esac done + AC_ARG_ENABLE(stage1-languages, +[ --enable-stage1-languages[=all] choose additional languages to build during + stage1. Mostly useful for compiler development.], + [case ,${enable_stage1_languages}, in + ,no,|,,) + # Set it to something that will have no effect in the loop below + enable_stage1_languages=c ;; + ,yes,) + enable_stage1_languages=`echo $new_enable_languages | \ + sed -e "s/^,//" -e "s/,$//" ` ;; + *,all,*) + enable_stage1_languages=`echo ,$enable_stage1_languages, | \ + sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;; + esac + + # Add "good" languages from enable_stage1_languages to stage1_languages, + # while "bad" languages go in missing_languages. Leave no duplicates. + for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do + case $potential_languages in + *,$i,*) + case $stage1_languages in + *,$i,*) ;; + *) stage1_languages="$stage1_languages$i," ;; + esac ;; + *) + case $missing_languages in + *,$i,*) ;; + *) missing_languages="$missing_languages$i," ;; + esac ;; + esac + done]) + + # Remove leading/trailing commas that were added for simplicity + potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"` missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` + stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"` + new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"` + if test "x$missing_languages" != x; then AC_MSG_ERROR([ The following requested languages could not be built: ${missing_languages} -Recognised languages are: ${potential_languages}]) +Supported languages are: ${potential_languages}]) fi - if test "x$new_enable_languages" != "x$enable_languages"; then echo The following languages will be built: ${new_enable_languages} + enable_languages="$new_enable_languages" fi - enable_languages="$new_enable_languages" + + AC_SUBST(stage1_languages) ac_configure_args=`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[[^ ]]*//' -e 's/$/ --enable-languages='"$enable_languages"/ ` fi |