This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA] Re: [PATCH] Top-level configure.in: safety checks for --enable-languages
On Mon, Nov 05, 2001 at 06:46:58PM -0500, DJ Delorie wrote:
>
> I was thinking of s/[\s\t,][\s\t+,]*/,/g (with real space/tab of course).
Egads, who would generate a list like that? :-) If we're going to catch
multiple commas, let's catch trailing ones too.
So, final effects:
- accept pathological formats in --enable-languages list (tested with
things like "f77,,c c++\t\t,,,,java,")
- likewise for LANGUAGES
- warn on LANGUAGES
- make test for empty --enable-languages list smarter
If nobody objects, I'll just apply this sometime tomorrow. Somebody else
(DJ?) will need to push it to the src repo, where I don't see that it'll
affect anything anyhow.
Index: configure.in
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/configure.in,v
retrieving revision 1.112
diff -u -3 -p -r1.112 configure.in
--- configure.in 3 Nov 2001 22:00:58 -0000 1.112
+++ configure.in 7 Nov 2001 17:59:21 -0000
@@ -1033,17 +1033,22 @@ fi
# 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="`echo ${LANGUAGES} | tr ' ' ','`"
+ enable_languages=`echo "${LANGUAGES}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
+ echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
else
enable_languages=all
fi
else
- if test x"${enable_languages}" = x; then
- echo configure.in: --enable-languages needs at least one argument 1>&2
+ 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
+ enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
fi
# First scan to see if an enabled language requires some other language.