From 349c31669777d87db0e7ec437d8b5bd5499d74d6 Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Wed, 14 May 2008 13:20:43 +0000 Subject: [PATCH] configure.ac: Add support for a "gcc_subdir" variable in config-lang.in... * configure.ac: Add support for a "gcc_subdir" variable in config-lang.in, to denote a subdirectory where the language/GCC integration files are to be found. * configure: Regenerate. Co-Authored-By: Nicolas Roche From-SVN: r135292 --- gcc/ChangeLog | 8 ++++++++ gcc/configure | 43 ++++++++++++++++++++++++++++++++----------- gcc/configure.ac | 43 ++++++++++++++++++++++++++++++++----------- 3 files changed, 72 insertions(+), 22 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9e151ea6984..1f8a441be5a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2008-05-14 Olivier Hainque + Nicolas Roche + + * configure.ac: Add support for a "gcc_subdir" variable in + config-lang.in, to denote a subdirectory where the language/GCC + integration files are to be found. + * configure: Regenerate. + 2008-05-14 Ira Rosen PR tree-optimization/36098 diff --git a/gcc/configure b/gcc/configure index c8351e02ca0..9f8cf5f19b9 100755 --- a/gcc/configure +++ b/gcc/configure @@ -23548,11 +23548,32 @@ do fi subdir="`echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" subdirs="$subdirs $subdir" + + # $gcc_subdir is where the gcc integration files are to be found + # for a language, both for internal compiler purposes (compiler + # sources implementing front-end to GCC tree converters), and for + # build infrastructure purposes (Make-lang.in, etc.) + # + # This will be (relative to $srcdir) if a line like + # gcc_subdir="" or gcc_subdir= + # is found in /config-lang.in, and will remain + # otherwise. + # + # Except for the language alias (fetched above), the regular + # "config-lang.in" contents are always retrieved from $gcc_subdir, + # so a /config-lang.in setting gcc_subdir typically sets + # only this and the language alias. + + gcc_subdir=`sed -n -e 's,^gcc_subdir=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^gcc_subdir=\([^ ]*\).*$,\1,p' $lang` + if [ "$gcc_subdir" = "" ]; then + gcc_subdir="$subdir" + fi + case ",$enable_languages," in *,$lang_alias,*) all_selected_languages="$all_selected_languages $lang_alias" - if test -f $srcdir/$subdir/lang-specs.h; then - lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h" + if test -f $srcdir/$gcc_subdir/lang-specs.h; then + lang_specs_files="$lang_specs_files $srcdir/$gcc_subdir/lang-specs.h" fi ;; esac @@ -23563,10 +23584,10 @@ do outputs= gtfiles= subdir_requires= - . ${srcdir}/$subdir/config-lang.in + . ${srcdir}/$gcc_subdir/config-lang.in if test "x$language" = x then - echo "${srcdir}/$subdir/config-lang.in doesn't set \$language." 1>&2 + echo "${srcdir}/$gcc_subdir/config-lang.in doesn't set \$language." 1>&2 exit 1 fi @@ -23583,15 +23604,15 @@ do esac $ok || continue - all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$subdir/Make-lang.in" - if test -f $srcdir/$subdir/lang.opt; then - lang_opt_files="$lang_opt_files $srcdir/$subdir/lang.opt" + all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$gcc_subdir/Make-lang.in" + if test -f $srcdir/$gcc_subdir/lang.opt; then + lang_opt_files="$lang_opt_files $srcdir/$gcc_subdir/lang.opt" fi - if test -f $srcdir/$subdir/$subdir-tree.def; then - lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def" + if test -f $srcdir/$gcc_subdir/$subdir-tree.def; then + lang_tree_files="$lang_tree_files $srcdir/$gcc_subdir/$subdir-tree.def" fi - if test -f ${srcdir}/$subdir/Makefile.in - then all_lang_makefiles="$subdir/Makefile" + if test -f ${srcdir}/$gcc_subdir/Makefile.in + then all_lang_makefiles="$gcc_subdir/Makefile" fi all_languages="$all_languages $language" all_compilers="$all_compilers $compilers" diff --git a/gcc/configure.ac b/gcc/configure.ac index 8a53d59326e..001ff503aaf 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3581,11 +3581,32 @@ changequote(,)dnl fi subdir="`echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" subdirs="$subdirs $subdir" + + # $gcc_subdir is where the gcc integration files are to be found + # for a language, both for internal compiler purposes (compiler + # sources implementing front-end to GCC tree converters), and for + # build infrastructure purposes (Make-lang.in, etc.) + # + # This will be (relative to $srcdir) if a line like + # gcc_subdir="" or gcc_subdir= + # is found in /config-lang.in, and will remain + # otherwise. + # + # Except for the language alias (fetched above), the regular + # "config-lang.in" contents are always retrieved from $gcc_subdir, + # so a /config-lang.in setting gcc_subdir typically sets + # only this and the language alias. + + gcc_subdir=`sed -n -e 's,^gcc_subdir=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^gcc_subdir=\([^ ]*\).*$,\1,p' $lang` + if [ "$gcc_subdir" = "" ]; then + gcc_subdir="$subdir" + fi + case ",$enable_languages," in *,$lang_alias,*) all_selected_languages="$all_selected_languages $lang_alias" - if test -f $srcdir/$subdir/lang-specs.h; then - lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h" + if test -f $srcdir/$gcc_subdir/lang-specs.h; then + lang_specs_files="$lang_specs_files $srcdir/$gcc_subdir/lang-specs.h" fi ;; esac @@ -3597,10 +3618,10 @@ changequote([,])dnl outputs= gtfiles= subdir_requires= - . ${srcdir}/$subdir/config-lang.in + . ${srcdir}/$gcc_subdir/config-lang.in if test "x$language" = x then - echo "${srcdir}/$subdir/config-lang.in doesn't set \$language." 1>&2 + echo "${srcdir}/$gcc_subdir/config-lang.in doesn't set \$language." 1>&2 exit 1 fi @@ -3617,15 +3638,15 @@ changequote([,])dnl esac $ok || continue - all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$subdir/Make-lang.in" - if test -f $srcdir/$subdir/lang.opt; then - lang_opt_files="$lang_opt_files $srcdir/$subdir/lang.opt" + all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$gcc_subdir/Make-lang.in" + if test -f $srcdir/$gcc_subdir/lang.opt; then + lang_opt_files="$lang_opt_files $srcdir/$gcc_subdir/lang.opt" fi - if test -f $srcdir/$subdir/$subdir-tree.def; then - lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def" + if test -f $srcdir/$gcc_subdir/$subdir-tree.def; then + lang_tree_files="$lang_tree_files $srcdir/$gcc_subdir/$subdir-tree.def" fi - if test -f ${srcdir}/$subdir/Makefile.in - then all_lang_makefiles="$subdir/Makefile" + if test -f ${srcdir}/$gcc_subdir/Makefile.in + then all_lang_makefiles="$gcc_subdir/Makefile" fi all_languages="$all_languages $language" all_compilers="$all_compilers $compilers" -- 2.30.2