This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[resubmit] Move --enable-languages logic to the toplevel


I included an earlier and incomplete version of the patch which strips
one hunk too much.  Bootstrapped on i686-pc-linux-gnu, specifying
--enable-languages=all even if I do not have an Ada compiler.

Ok for mainline? If so, would you please commit it for me to both gcc
and src, since I do not have CVS access to the latter?

Paolo

Updated version of the patch to move detection of the Ada compiler
to the toplevel.

See also http://gcc.gnu.org/ml/gcc/2004-02/msg00755.html

Ok for mainline?

Paolo

2004-03-01  Paolo Bonzini  <bonzini@gnu.org>

	PR ada/14131

	Move language detection to the toplevel.
	* 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.
	* gcc/configure.ac: Remove code to detect languages,
	it now lives exclusively in the toplevel.
	* gcc/aclocal.m4 (gcc_AC_PROG_GNAT): Move...
	* config/acx.m4 (ACX_PROG_GNAT): ... here.
	* gcc/ada/config-lang.in: Build by default.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.270
diff -u -r1.270 configure.in
--- configure.in	11 Feb 2004 17:31:24 -0000	1.270
+++ configure.in	1 Mar 2004 11:53:36 -0000
@@ -744,97 +744,276 @@
   *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
 esac
 
+if test "${build}" != "${host}" ; then
+  # If we are doing a Canadian Cross, in which the host and build systems
+  # are not the same, we set reasonable default values for the tools.
+
+  BISON=${BISON-bison}
+  CC=${CC-${host_alias}-gcc}
+  CFLAGS=${CFLAGS-"-g -O2"}
+  CXX=${CXX-${host_alias}-c++}
+  CXXFLAGS=${CXXFLAGS-"-g -O2"}
+  CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
+  CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
+  CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
+  GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
+  GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
+  BUILD_PREFIX=${build_alias}-
+  BUILD_PREFIX_1=${build_alias}-
+  MAKEINFO=${MAKEINFO-makeinfo}
+
+  if test -z "${YACC}" ; then
+    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
+    for dir in $PATH; do
+      test -z "$dir" && dir=.
+      if test -f $dir/bison; then
+	YACC="bison -y"
+	break
+      fi
+      if test -f $dir/byacc; then
+	YACC=byacc
+	break
+      fi
+      if test -f $dir/yacc; then
+	YACC=yacc
+	break
+      fi
+    done
+    IFS="$save_ifs"
+    if test -z "${YACC}" ; then
+      YACC="bison -y"
+    fi
+  fi
+
+  if test -z "${LEX}" ; then
+    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
+    for dir in $PATH; do
+      test -z "$dir" && dir=.
+      if test -f $dir/flex; then
+	LEX=flex
+	break
+      fi
+      if test -f $dir/lex; then
+	LEX=lex
+	break
+      fi
+    done
+    IFS="$save_ifs"
+    LEX=${LEX-flex}
+  fi
+
+else
+  # Set reasonable default values for some tools even if not Canadian.
+  # Of course, these are different reasonable default values, originally
+  # specified directly in the Makefile.
+  # We don't export, so that autoconf can do its job.
+  # Note that all these settings are above the fragment inclusion point
+  # in Makefile.in, so can still be overridden by fragments.
+  # This is all going to change when we autoconfiscate...
+
+  BISON="\$(USUAL_BISON)"
+  CC_FOR_BUILD="\$(CC)"
+  GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)"
+  BUILD_PREFIX=
+  BUILD_PREFIX_1=loser-
+  MAKEINFO="\$(USUAL_MAKEINFO)"
+  LEX="\$(USUAL_LEX)"
+  YACC="\$(USUAL_YACC)"
+
+  # If CC is still not set, try to get gcc.
+  cc_prog_is_gcc=
+  if test -z "${CC}" ; then
+    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
+    for dir in $PATH; do
+      test -z "$dir" && dir=.
+      if test -f $dir/gcc; then
+	CC="gcc"
+	cc_prog_is_gcc=yes
+	echo 'void f(){}' > conftest.c
+	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
+	  CFLAGS=${CFLAGS-"-g -O2"}
+	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
+	else
+	  CFLAGS=${CFLAGS-"-O2"}
+	  CXXFLAGS=${CXXFLAGS-"-O2"}
+	fi
+	rm -f conftest*
+	break
+      fi
+    done
+    IFS="$save_ifs"
+    CC=${CC-cc}
+  else
+    # Determine if we are using gcc.
+    cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+    if ${CC} -E conftest.c | grep yes >/dev/null 2>&1; then
+      cc_prog_is_gcc=yes
+    fi
+    rm -f conftest.c
+    if test -z "${CFLAGS}"; then
+      # Here CC is set but CFLAGS is not.  Use a quick hack to use -O2 if CC
+      # is set to a version of gcc.
+      if test "$cc_prog_is_gcc" = yes; then
+	echo 'void f(){}' > conftest.c
+	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
+	  CFLAGS=${CFLAGS-"-g -O2"}
+	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
+	else
+	  CFLAGS=${CFLAGS-"-O2"}
+	  CXXFLAGS=${CXXFLAGS-"-O2"}
+	fi
+	rm -f conftest*
+      fi
+    fi
+  fi
+
+  # We must set the default linker to the linker used by gcc for the correct
+  # operation of libtool.  If LD is not defined and we are using gcc, try to
+  # set the LD default to the ld used by gcc.
+  if test -z "$LD"; then
+    if test "$cc_prog_is_gcc" = yes; then
+      case $build in
+      *-*-mingw*)
+	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
+      *)
+	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
+      esac
+      case $gcc_prog_ld in
+      # Accept absolute paths.
+      [[\\/]* | [A-Za-z]:[\\/]*)]
+        LD="$gcc_prog_ld" ;;
+      esac
+    fi
+  fi
+
+  CXX=${CXX-"c++"}
+  CFLAGS=${CFLAGS-"-g"}
+  CXXFLAGS=${CXXFLAGS-"-g -O2"}
+fi
+
+ACX_PROG_GNAT
+
 # 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}"
-      echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
+if test -d ${srcdir}/gcc; then
+  if test x"${enable_languages+set}" != xset; then
+    if test x"${LANGUAGES+set}" = xset; then
+      enable_languages="${LANGUAGES}"
+        echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
+    else
+      enable_languages=all
+    fi
   else
-    enable_languages=all
-  fi
-else
-  if test x"${enable_languages}" = x ||
-     test x"${enable_languages}" = xyes;
-     then
-    echo configure.in: --enable-languages needs at least one language argument 1>&2
-    exit 1
+    if test x"${enable_languages}" = x ||
+       test x"${enable_languages}" = xyes;
+       then
+      echo configure.in: --enable-languages needs at least one language argument 1>&2
+      exit 1
+    fi
   fi
-fi
-enable_languages=`echo "${enable_languages}" | sed -e 's/[[ 	,]][[ 	,]]*/,/g' -e 's/,$//'`
+  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_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
-  case ${lang_frag} in
-    ..) ;;
-    # The odd quoting in the next line works around
-    # an apparent bug in bash 1.12 on linux.
-    ${srcdir}/gcc/[[*]]/config-lang.in) ;;
-    *)
-      # From the config-lang.in, get $language, $lang_requires
-      language=
-      lang_requires=
-      . ${lang_frag}
-      for other in ${lang_requires} ; do
-        case ,${enable_languages}, in
-	  *,$other,*) ;;
-	  *,all,*) ;;
-	  *,$language,*)
-	    echo " \`$other' language required by \`$language'; enabling" 1>&2
-	    enable_languages="${enable_languages},${other}"
-	    ;;
-	esac
-      done
-      ;;
-  esac
-done
+  # 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_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
+    case ${lang_frag} in
+      ..) ;;
+      # The odd quoting in the next line works around
+      # an apparent bug in bash 1.12 on linux.
+      ${srcdir}/gcc/[[*]]/config-lang.in) ;;
+      *)
+        # From the config-lang.in, get $language, $lang_requires
+        language=
+        lang_requires=
+        . ${lang_frag}
+        for other in ${lang_requires} ; do
+          case ,${enable_languages}, in
+	    *,$other,*) ;;
+	    *,all,*) ;;
+	    *,$language,*)
+	      echo " \`$other' language required by \`$language'; enabling" 1>&2
+	      enable_languages="${enable_languages},${other}"
+	      ;;
+	  esac
+        done
+        ;;
+    esac
+  done
 
-for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
-  case ${lang_frag} in
-    ..) ;;
-    # The odd quoting in the next line works around
-    # an apparent bug in bash 1.12 on linux.
-    ${srcdir}/gcc/[[*]]/config-lang.in) ;;
-    *)
-      # From the config-lang.in, get $language, $target_libs, 
-      # $lang_dirs, and $build_by_default
-      language=
-      target_libs=
-      lang_dirs=
-      build_by_default=
-      . ${lang_frag}
-      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,*)
-          # 'all' was selected; include 'default' languages.
-          case ${build_by_default} in
-            no) add_this_lang=no ;;
-            *) add_this_lang=yes ;;
-          esac 
-          ;;
-        *) add_this_lang=no ;;
-      esac
-      case ${add_this_lang} in
-        no)
+  new_enable_languages=c
+  missing_languages="`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `"
+
+  for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
+    case ${lang_frag} in
+      ..) ;;
+      # The odd quoting in the next line works around
+      # an apparent bug in bash 1.12 on linux.
+      ${srcdir}/gcc/[[*]]/config-lang.in) ;;
+      *)
+        # From the config-lang.in, get $language, $target_libs, 
+        # $lang_dirs, and $build_by_default
+        language=
+        target_libs=
+        lang_dirs=
+        build_by_default=
+        . ${lang_frag}
+        # 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},*:*:*:*)
+            # Language was explicitly selected; include it.
+            add_this_lang=yes
+            ;;
+          *,all,*:*:*:no)
+            # 'all' was selected and this is not a default language; include it.
+            add_this_lang=no
+	    ;;
+          *,all,*:*:*:*)
+            # 'all' was selected and this is a default language; include it.
+            add_this_lang=yes
+            ;;
+          *)
+            add_this_lang=no
+            ;;
+        esac
+        if test $add_this_lang = no; then
           # Remove language-dependent dirs.
           eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
-          ;;
-      esac
-      ;;
-  esac
-done
+        else
+	  new_enable_languages="$new_enable_languages,$language"
+	  missing_languages="`echo "$missing_languages" | sed "s/,$language,/,/"`"
+        fi
+        ;;
+    esac
+  done
+
+  missing_languages="`echo "$missing_languages" | sed -e s/^,// -e s/,$//`"
+  if test "x$missing_languages" != x; then
+    AC_MSG_ERROR([
+The following requested languages were not found: ${missing_languages}])
+  fi
+
+  if test "x$new_enable_languages" != "x$enable_languages"; then
+    echo The following languages will be built: ${new_enable_languages}
+  fi
+  enable_languages="$new_enable_languages"
+  ac_configure_args="`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[[^ ]]*//' -e 's/$/ --enable-languages='"$enable_languages"/ `"
+fi
 
 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
 # $target_configdirs.
@@ -1356,157 +1535,6 @@
 
   test -n "$DEFAULT_LEX" && break
 done
-
-if test "${build}" != "${host}" ; then
-  # If we are doing a Canadian Cross, in which the host and build systems
-  # are not the same, we set reasonable default values for the tools.
-
-  BISON=${BISON-bison}
-  CC=${CC-${host_alias}-gcc}
-  CFLAGS=${CFLAGS-"-g -O2"}
-  CXX=${CXX-${host_alias}-c++}
-  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-  CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
-  CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
-  CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
-  GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
-  GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
-  BUILD_PREFIX=${build_alias}-
-  BUILD_PREFIX_1=${build_alias}-
-  MAKEINFO=${MAKEINFO-makeinfo}
-
-  if test -z "${YACC}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/bison; then
-	YACC="bison -y"
-	break
-      fi
-      if test -f $dir/byacc; then
-	YACC=byacc
-	break
-      fi
-      if test -f $dir/yacc; then
-	YACC=yacc
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    if test -z "${YACC}" ; then
-      YACC="bison -y"
-    fi
-  fi
-
-  if test -z "${LEX}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/flex; then
-	LEX=flex
-	break
-      fi
-      if test -f $dir/lex; then
-	LEX=lex
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    LEX=${LEX-flex}
-  fi
-
-else
-  # Set reasonable default values for some tools even if not Canadian.
-  # Of course, these are different reasonable default values, originally
-  # specified directly in the Makefile.
-  # We don't export, so that autoconf can do its job.
-  # Note that all these settings are above the fragment inclusion point
-  # in Makefile.in, so can still be overridden by fragments.
-  # This is all going to change when we autoconfiscate...
-
-  BISON="\$(USUAL_BISON)"
-  CC_FOR_BUILD="\$(CC)"
-  GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)"
-  BUILD_PREFIX=
-  BUILD_PREFIX_1=loser-
-  MAKEINFO="\$(USUAL_MAKEINFO)"
-  LEX="\$(USUAL_LEX)"
-  YACC="\$(USUAL_YACC)"
-
-  # If CC is still not set, try to get gcc.
-  cc_prog_is_gcc=
-  if test -z "${CC}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/gcc; then
-	CC="gcc"
-	cc_prog_is_gcc=yes
-	echo 'void f(){}' > conftest.c
-	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
-	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-	else
-	  CFLAGS=${CFLAGS-"-O2"}
-	  CXXFLAGS=${CXXFLAGS-"-O2"}
-	fi
-	rm -f conftest*
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    CC=${CC-cc}
-  else
-    # Determine if we are using gcc.
-    cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
-#endif
-EOF
-    if ${CC} -E conftest.c | grep yes >/dev/null 2>&1; then
-      cc_prog_is_gcc=yes
-    fi
-    rm -f conftest.c
-    if test -z "${CFLAGS}"; then
-      # Here CC is set but CFLAGS is not.  Use a quick hack to use -O2 if CC
-      # is set to a version of gcc.
-      if test "$cc_prog_is_gcc" = yes; then
-	echo 'void f(){}' > conftest.c
-	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
-	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-	else
-	  CFLAGS=${CFLAGS-"-O2"}
-	  CXXFLAGS=${CXXFLAGS-"-O2"}
-	fi
-	rm -f conftest*
-      fi
-    fi
-  fi
-
-  # We must set the default linker to the linker used by gcc for the correct
-  # operation of libtool.  If LD is not defined and we are using gcc, try to
-  # set the LD default to the ld used by gcc.
-  if test -z "$LD"; then
-    if test "$cc_prog_is_gcc" = yes; then
-      case $build in
-      *-*-mingw*)
-	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
-      *)
-	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
-      esac
-      case $gcc_prog_ld in
-      # Accept absolute paths.
-      [[\\/]* | [A-Za-z]:[\\/]*)]
-        LD="$gcc_prog_ld" ;;
-      esac
-    fi
-  fi
-
-  CXX=${CXX-"c++"}
-  CFLAGS=${CFLAGS-"-g"}
-  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-fi
 
 # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
 # Set up the list of links to be made.
Index: gcc/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.19
diff -u -r2.19 configure.ac
--- gcc/configure.ac	29 Feb 2004 22:50:19 -0000	2.19
+++ gcc/configure.ac	1 Mar 2004 11:53:37 -0000
@@ -300,13 +300,6 @@
   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 @@
 [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
 # -------------------------
@@ -2651,131 +2691,6 @@
    && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
   AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include",
 [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.
Index: gcc/aclocal.m4
===================================================================
RCS file: /cvs/gcc/gcc/gcc/aclocal.m4,v
retrieving revision 1.88
diff -u -r1.88 aclocal.m4
--- gcc/aclocal.m4	3 Jan 2004 18:59:32 -0000	1.88
+++ gcc/aclocal.m4	1 Mar 2004 11:53:37 -0000
@@ -295,41 +295,6 @@
 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],
Index: config/acx.m4
===================================================================
RCS file: /cvs/gcc/gcc/config/acx.m4,v
retrieving revision 1.4
diff -u -r1.4 acx.m4
--- config/acx.m4	25 Sep 2003 14:27:52 -0000	1.4
+++ config/acx.m4	1 Mar 2004 11:53:37 -0000
@@ -155,3 +155,38 @@
 [AC_REQUIRE([AC_PROG_CPP])dnl
 m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_OLD]))
 ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR
+
+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([ACX_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],
+		 acx_cv_cc_gcc_supports_ada,
+[cat >conftest.adb <<EOF
+procedure conftest is begin null; end conftest;
+EOF
+acx_cv_cc_gcc_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
+  acx_cv_cc_gcc_supports_ada=yes
+  break
+fi
+rm -f conftest.*])
+
+if test x$GNATBIND != xno && test x$acx_cv_gcc_supports_ada != xno; then
+  have_gnat=yes
+else
+  have_gnat=no
+fi
+])
Index: gcc/ada/config-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/config-lang.in,v
retrieving revision 1.11
diff -u -r1.11 config-lang.in
--- gcc/ada/config-lang.in	13 Feb 2004 18:42:09 -0000	1.11
+++ gcc/ada/config-lang.in	1 Mar 2004 11:53:37 -0000
@@ -39,9 +39,3 @@
 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]