This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Top-level configure.in: safety checks for --enable-languages
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Top-level configure.in: safety checks for --enable-languages
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: Fri, 26 Oct 2001 18:14:27 -0400
After getting some shell advice (thanks again), here's a working patch.
First, this detects spaces in the list of languages, prints an error
and exits.
Secondly, while testing, I discovered that the check for an empty list
("--enable-languages") needs to be smarter, as the variable is set
to 'yes' rather than an empty string. Probably a difference between
--enable-languages and --enable-languages= but I consider the former
more likely.
Opinions? Okay to apply?
Index: configure.in
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/configure.in,v
retrieving revision 1.111
diff -u -3 -p -r1.111 configure.in
--- configure.in 11 Oct 2001 16:40:29 -0000 1.111
+++ configure.in 26 Oct 2001 21:52:18 -0000
@@ -1037,9 +1037,19 @@ if test x"${enable_languages+set}" != xs
enable_languages=all
fi
else
- if test x"${enable_languages}" = x; then
+ if test x"${enable_languages}" = x ||
+ test x"${enable_languages}" = xyes;
+ then
echo configure.in: --enable-languages needs at least one argument 1>&2
exit 1
+ else
+ # embedded tab -- do not untabify
+ case "${enable_languages}" in
+ *[\ \ ]*) echo configure.in: --enable-languages arguments should be comma-separated, not whitespace-separated 1>&2
+ exit 1
+ ;;
+ *) ;;
+ esac
fi
fi