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]

[PATCH] Top-level configure.in: safety checks for --enable-languages


On Mon, Nov 05, 2001 at 02:55:12PM -0500, Phil Edwards wrote:
> On Mon, Nov 05, 2001 at 02:47:54PM -0500, DJ Delorie wrote:
> > Has anyone considered *accepting* whitespace, instead of rejecting it?
> > That would be a simple sed command, and no need for that case
> > statement.
> 
> I thought about while writing the patch... it's what we do if the --enable
> switch isn't given, but the old LANGUAGES variable is set.  LANGUAGES is
> ws-separated.

It seems reasonable, why not?  This silently accepts and converts whitespace.
I changed the LANGUAGES bit to use the same code, and we should warn on
LANGUAGES as well, since it "might go away" someday.  Tested various values
for both --enable-languages and LANGUAGES.

Okay to apply?


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	5 Nov 2001 23:21:44 -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'`
+		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'`
 fi
 
 # First scan to see if an enabled language requires some other language.


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