summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorneroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-11 05:01:17 +0000
committerneroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-11 05:01:17 +0000
commitc24c5e46f0222cab89e53b842d16843ac87f43be (patch)
tree5754cfb1e4fb54f59bd27aff97cdfe79c44ce77f /gcc
parentd48f614187803806fbab0b3c008f141c532afff8 (diff)
downloadgcc-c24c5e46f0222cab89e53b842d16843ac87f43be.tar.gz
(top level)
2004-03-08 Paolo Bonzini <bonzini@gnu.org> PR ada/14131 Move language detection to the top level. * configure.in: Find default values for the tools as soon as possible. Disable ada if GNAT is not found. Emit error message about missing languages. Expand --enable-languages=all for the gcc subdirectory. (config) 2004-03-08 Paolo Bonzini <bonzini@gnu.org> PR ada/14131 Move language detection to the top level. * acx.m4 (ACX_PROG_GNAT): New macro, moved here from the gcc subdirectory. (gcc) 2004-03-08 Paolo Bonzini <bonzini@gnu.org> PR ada/14131 Move language detection to the top level. * configure.ac: Remove code to detect languages, it now lives exclusively in the top level. * aclocal.m4 (gcc_AC_PROG_GNAT): Moved to the top level, renamed to ACX_PROG_GNAT. (gcc/ada) 2004-03-08 Paolo Bonzini <bonzini@gnu.org> PR ada/14131 Move language detection to the top level. * config-lang.in: Build by default. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79299 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/aclocal.m435
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/config-lang.in6
-rw-r--r--gcc/configure.ac179
5 files changed, 62 insertions, 173 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4dd705f425c..22cd3bc32c0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2004-03-08 Paolo Bonzini <bonzini@gnu.org>
+
+ PR ada/14131
+ Move language detection to the top level.
+ * configure.ac: Remove code to detect languages,
+ it now lives exclusively in the top level.
+ * aclocal.m4 (gcc_AC_PROG_GNAT): Moved to the
+ top level, renamed to ACX_PROG_GNAT.
+
2004-03-10 Richard Henderson <rth@redhat.com>
* c-pch.c (c_common_no_more_pch): Update for gt_pch_use_address
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 054a2bb3ec7..4ed2f083254 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -295,41 +295,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
AC_SUBST(INSTALL_DATA)dnl
])
-dnl Test for GNAT.
-dnl We require the gnatbind program, and a compiler driver that
-dnl understands Ada. We use the user's CC setting, already found.
-dnl
-dnl Sets the shell variable have_gnat to yes or no as appropriate, and
-dnl substitutes GNATBIND.
-AC_DEFUN([gcc_AC_PROG_GNAT],
-[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
-AC_REQUIRE([AC_PROG_CC])
-AC_CHECK_TOOL(GNATBIND, gnatbind, no)
-AC_CACHE_CHECK([whether compiler driver understands Ada],
- gcc_cv_cc_supports_ada,
-[cat >conftest.adb <<EOF
-procedure conftest is begin null; end conftest;
-EOF
-gcc_cv_cc_supports_ada=no
-# There is a bug in old released versions of GCC which causes the
-# driver to exit successfully when the appropriate language module
-# has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
-# Therefore we must check for the error message as well as an
-# unsuccessful exit.
-errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
-if test x"$errors" = x; then
- gcc_cv_cc_supports_ada=yes
- break
-fi
-rm -f conftest.*])
-
-if test x$GNATBIND != xno && test x$gcc_cv_supports_ada != xno; then
- have_gnat=yes
-else
- have_gnat=no
-fi
-])
-
dnl GCC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]])
dnl like AC_PATH_PROG but use other cache variables
AC_DEFUN([GCC_PATH_PROG],
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b41f0200ffc..dcb898c4684 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-08 Paolo Bonzini <bonzini@gnu.org>
+
+ PR ada/14131
+ Move language detection to the top level.
+ * config-lang.in: Build by default.
+
2004-03-05 Robert Dewar <dewar@gnat.com>
* 56taprop.adb, 5ataprop.adb: Remove unneeded unchecked conversions
diff --git a/gcc/ada/config-lang.in b/gcc/ada/config-lang.in
index 331032bfbab..9a9599dbf1b 100644
--- a/gcc/ada/config-lang.in
+++ b/gcc/ada/config-lang.in
@@ -39,9 +39,3 @@ gtfiles="\$(srcdir)/ada/ada-tree.h \$(srcdir)/ada/gigi.h \$(srcdir)/ada/decl.c \
outputs=ada/Makefile
target_libs="target-libada"
-
-# The logic for determining whether there is a bootstrap Ada compiler
-# available needs to be moved from gcc/configure to the toplevel configure,
-# so that target-libada is not built when there is no bootstrap Ada compiler.
-# Until then disable building this language by default.
-build_by_default=no
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 9d406787598..775be55690a 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -300,13 +300,6 @@ if test $ac_cv_c___int64 = yes; then
AC_COMPILE_CHECK_SIZEOF(__int64)
fi
-# -----------------
-# Find Ada compiler
-# -----------------
-
-# See if GNAT has been installed
-gcc_AC_PROG_GNAT
-
# ---------------------
# Warnings and checking
# ---------------------
@@ -613,6 +606,53 @@ esac],
[onestep=""])
AC_SUBST(onestep)
+# Sanity check enable_languages in case someone does not run the toplevel
+# configure # script.
+AC_ARG_ENABLE(languages,
+[ --enable-languages=LIST specify which front-ends to build],
+[case ,${enable_languages}, in
+ ,,|,yes,)
+ # go safe -- we cannot be much sure without the toplevel
+ # configure's
+ # analysis of which target libs are present and usable
+ enable_languages=c
+ ;;
+ *,all,*)
+ AC_MSG_ERROR([only the toplevel supports --enable-languages=all])
+ ;;
+ *,c,*)
+ ;;
+ *)
+ enable_languages=c,${enable_languages}
+ ;;
+esac],
+[enable_languages=c])
+
+subdirs=
+for lang in ${srcdir}/*/config-lang.in
+do
+ case $lang in
+ # The odd quoting in the next line works around
+ # an apparent bug in bash 1.12 on linux.
+changequote(,)dnl
+ ${srcdir}/[*]/config-lang.in) ;;
+ *)
+ lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
+ if test "x$lang_alias" = x
+ then
+ echo "$lang doesn't set \$language." 1>&2
+ exit 1
+ fi
+ case ",$enable_languages," in
+ *,$lang_alias,*)
+ subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" ;;
+ esac
+ ;;
+changequote([,])dnl
+ esac
+done
+
+
# -------------------------
# Checks for other programs
# -------------------------
@@ -2661,131 +2701,6 @@ if test x$with_sysroot = x && test x$host = x$target \
[Define to PREFIX/include if cpp should also search that directory.])
fi
-# Figure out what language subdirectories are present.
-# Look if the user specified --enable-languages="..."; if not, use
-# the environment variable $LANGUAGES if defined. $LANGUAGES might
-# go away some day.
-# NB: embedded tabs in this IF block -- do not untabify
-if test x"${enable_languages+set}" != xset; then
- if test x"${LANGUAGES+set}" = xset; then
- enable_languages="${LANGUAGES}"
- AC_MSG_WARN([setting LANGUAGES is deprecated, use --enable-languages instead])
-
- else
- enable_languages=all
- fi
-else
- if test x"${enable_languages}" = x \
- || test x"${enable_languages}" = xyes;
- then
- AC_MSG_ERROR([--enable-languages needs at least one language argument])
- fi
-fi
-enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
-
-# First scan to see if an enabled language requires some other language.
-# We assume that a given config-lang.in will list all the language
-# front ends it requires, even if some are required indirectly.
-for lang in ${srcdir}/*/config-lang.in
-do
- case $lang in
- # The odd quoting in the next line works around
- # an apparent bug in bash 1.12 on linux.
-changequote(,)dnl
- ${srcdir}/[*]/config-lang.in)
- ;;
- *)
- lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
- this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
- for other in $this_lang_requires
- do
- case ,${enable_languages}, in
- *,$other,*)
- ;;
- *,all,*)
- ;;
- *,$lang_alias,*)
- enable_languages="$enable_languages,$other"
- ;;
- esac
- done
- ;;
-changequote([,])dnl
- esac
-done
-
-expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'`
-found_languages=
-subdirs=
-for lang in ${srcdir}/*/config-lang.in
-do
- case $lang in
- # The odd quoting in the next line works around
- # an apparent bug in bash 1.12 on linux.
-changequote(,)dnl
- ${srcdir}/[*]/config-lang.in) ;;
- *)
- lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
- this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
- build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
- if test "x$lang_alias" = x
- then
- echo "$lang doesn't set \$language." 1>&2
- exit 1
- fi
- case ${build_by_default},${enable_languages}, in
- *,$lang_alias,*) add_this_lang=yes ;;
- no,*) add_this_lang=no ;;
- *,all,*) add_this_lang=yes ;;
- *) add_this_lang=no ;;
- esac
- found_languages="${found_languages} ${lang_alias}"
- if test x"${add_this_lang}" = xyes; then
- case $lang in
- ${srcdir}/ada/config-lang.in)
- if test x$have_gnat = xyes ; then
- subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
- fi
- ;;
- *)
- subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
- ;;
- esac
- fi
- ;;
-changequote([,])dnl
- esac
-done
-
-missing_languages=
-for expected_language in ${expected_languages} ..
-do
- if test "${expected_language}" != ..; then
- missing_language="${expected_language}"
- if test "${expected_language}" = "c" \
- || test "${expected_language}" = "all"; then
- missing_language=
- fi
- for found_language in ${found_languages} ..
- do
- if test "${found_language}" != ..; then
- if test "${expected_language}" = "${found_language}"; then
- missing_language=
- fi
- fi
- done
- if test "x${missing_language}" != x; then
- missing_languages="${missing_languages} ${missing_language}"
- fi
- fi
-done
-
-if test "x$missing_languages" != x; then
- AC_MSG_ERROR([
-The following requested languages were not found:${missing_languages}
-The following languages were available: c${found_languages}])
-fi
-
# Find out what GC implementation we want, or may, use.
AC_ARG_WITH(gc,
[ --with-gc={page,zone} choose the garbage collection mechanism to use