On 05/30/2014 03:01 AM, Noel Grandin wrote:

> It would be really handy if we could we modify the following error message:
> 
>    configure: error: invalid feature name: debug
> 
> so it reads something like
> 
>   configure: error: invalid feature name: 'debug '

Thanks for the report.  I'll be pushing this patch, which matches with
the error reporting we already do elsewhere for invalid shell variable
names.  (I don't like the fact that this uses `' instead of '' quoting,
but making autoconf consistent to modern GNU Coding Standards is a patch
for another day, while this one is at least consistent with the rest of
the file).

From da84360b9775510f219c6022514fe390c4fadf44 Mon Sep 17 00:00:00 2001
From: Eric Blake <ebl...@redhat.com>
Date: Fri, 30 May 2014 08:55:10 -0600
Subject: [PATCH] AC_INIT: quote invalid feature names

Changes:
   configure: error: invalid feature name: debug
to
   configure: error: invalid feature name: `debug '
to make it obvious if trailing space is the reason why a feature
name was rejected.

* lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE2): Add quotes.
Reported by Noel Grandin.

Signed-off-by: Eric Blake <ebl...@redhat.com>
---
 lib/autoconf/general.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index e2e9b6a..696a9a1 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -998,8 +998,8 @@ m4_define([_AC_INIT_PARSE_ENABLE2],
     ac_useropt=`expr "x$ac_option" : 'x-*$1-\(m4_if([$1], [$2],
[[[^=]]], [.])*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : "[.*[^-+._$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR(
-       [invalid ]m4_if([$2], [with], [package], [feature])[ name: $ac_useropt])
+      AC_MSG_ERROR([invalid ]m4_if([$2], [with],
+        [package], [feature])[ name: `$ac_useropt'])
     ac_useropt_orig=$ac_useropt
     ac_useropt=`AS_ECHO(["$ac_useropt"]) | sed 's/[[-+.]]/_/g'`
     case $ac_user_opts in
-- 
1.9.3



-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to