This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[semi-related patch] Re: issues with configuring the trunk to build Fortran
On Wed, Aug 25, 2004 at 02:49:43PM -0700, Joe Buck wrote:
> On Wed, Aug 25, 2004 at 02:08:16PM -0700, Andrew Pinski wrote:
> > Should people read the installation instructions?
>
> Won't help. Installation instructions often say that at least version
> xyz of library foo is required; it is the usual practice to detect
> violations of this in ./configure where this is feasible.
>
> The issue is that an incorrect diagnostic is emitted. The configure
> script tests for prerequisite X, and if it is not found, it should say
> so. It should not issue a message indicating that the language is
> missing, because it is not.
I ran into the same problem just today. Fortunately, someone else had
just complained about something GMP-related on the IRC channel, so I had
a good guess as to what was missing.
I then stumbled over something else, which is what this patch addresses.
I'd been reading gcc/fortran/config-lang.in, which uses the names "f95",
"gfortran", and "g95" in various places. My sleep-deprived brain remembered
the wrong name when typing the --enable-languages list; I was mightly
confused when configure told me that "the requested language was not found"
when I had just been looking at its config-lang file ten seconds earlier.
If the user asks for something impossible, let's gently remind him of what
/is/ possible:
$ ..../configure --enable-languages=c++,ffgfgfgfgfgfgf
....
checking for correct version of gmp.h... yes
checking for MPFR... yes
configure: error:
The following requested languages were not found: ffgfgfgfgfgfgf
The available languages are: c,c++,f95,java
2004-08-25 Phil Edwards <phil@codesourcery.com>
* configure.in: Print a list of available language front-ends if
a requested one is missing. Tidy stray tab characters.
* configure: Regenerated.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.310
diff -u -p -r1.310 configure.in
--- configure.in 17 Aug 2004 22:06:44 -0000 1.310
+++ configure.in 25 Aug 2004 23:41:39 -0000
@@ -1161,6 +1161,7 @@ if test -d ${srcdir}/gcc; then
new_enable_languages=c
missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
+ potential_languages=c
for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
case ${lang_frag} in
@@ -1176,14 +1177,15 @@ if test -d ${srcdir}/gcc; then
lang_dirs=
boot_language=
build_by_default=
- need_gmp=
+ need_gmp=
. ${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
@@ -1194,9 +1196,9 @@ if test -d ${srcdir}/gcc; then
;;
*,all,*:*:*:no)
# 'all' was selected, but this is not a default language
- # so do not include it.
+ # 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
@@ -1234,7 +1236,8 @@ if test -d ${srcdir}/gcc; then
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}])
+The following requested languages were not found: ${missing_languages}
+The available languages are: ${potential_languages}])
fi
if test "x$new_enable_languages" != "x$enable_languages"; then