+2008-05-14 Olivier Hainque <hainque@adacore.com>
+ Nicolas Roche <roche@adacore.com>
+
+ * 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 <irar@il.ibm.com>
PR tree-optimization/36098
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 <subdir> (relative to $srcdir) if a line like
+ # gcc_subdir="<subdir>" or gcc_subdir=<subdir>
+ # is found in <langdir>/config-lang.in, and will remain <langdir>
+ # otherwise.
+ #
+ # Except for the language alias (fetched above), the regular
+ # "config-lang.in" contents are always retrieved from $gcc_subdir,
+ # so a <langdir>/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
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
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"
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 <subdir> (relative to $srcdir) if a line like
+ # gcc_subdir="<subdir>" or gcc_subdir=<subdir>
+ # is found in <langdir>/config-lang.in, and will remain <langdir>
+ # otherwise.
+ #
+ # Except for the language alias (fetched above), the regular
+ # "config-lang.in" contents are always retrieved from $gcc_subdir,
+ # so a <langdir>/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
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
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"