Patchwork Quoting fixes in GLIBCXX_ENABLE

login
register
mail settings
Submitter Andreas Schwab
Date Sept. 30, 2010, 9:42 a.m.
Message ID <m3wrq34let.fsf@hase.home>
Download mbox | patch
Permalink /patch/66142/
State New
Headers show

Comments

Andreas Schwab - Sept. 30, 2010, 9:42 a.m.
The definition of GLIBCXX_ENABLE has some quoting problems which results
in square brackets around optional arguments in the help text being lost
during autoconf processing.

OK?

Andreas.

2010-09-30  Andreas Schwab  <schwab@redhat.com>

	* acinclude.m4 (GLIBCXX_ENABLE): Properly quote argument to
	AC_HELP_STRING.  Double quote expansion of _g_help.
	(GLIBCXX_ENABLE_LIBSTDCXX_TIME): Double quote third argument of
	GLIBCXX_ENABLE.
	(GLIBCXX_ENABLE_CHEADERS): Likewise.
	(GLIBCXX_ENABLE_CLOCALE): Likewise.
	(GLIBCXX_ENABLE_ALLOCATOR): Likewise.
	(GLIBCXX_ENABLE_CSTDIO): Likewise.
	(GLIBCXX_ENABLE_SYMVERS): Likewise.
	* configure: Regenerate.
Paolo Carlini - Sept. 30, 2010, 10:16 a.m.
Hi,
> The definition of GLIBCXX_ENABLE has some quoting problems which results
> in square brackets around optional arguments in the help text being lost
> during autoconf processing.
>
> OK?
>   
I would say yes right away, but please wait just a few hours in case
Ralf has comments.

Thanks a lot,
Paolo.
Ralf Wildenhues - Sept. 30, 2010, 7:50 p.m.
Hello,

* Andreas Schwab wrote on Thu, Sep 30, 2010 at 11:42:50AM CEST:
> 	* acinclude.m4 (GLIBCXX_ENABLE): Properly quote argument to
> 	AC_HELP_STRING.  Double quote expansion of _g_help.
> 	(GLIBCXX_ENABLE_LIBSTDCXX_TIME): Double quote third argument of
> 	GLIBCXX_ENABLE.
> 	(GLIBCXX_ENABLE_CHEADERS): Likewise.
> 	(GLIBCXX_ENABLE_CLOCALE): Likewise.
> 	(GLIBCXX_ENABLE_ALLOCATOR): Likewise.
> 	(GLIBCXX_ENABLE_CSTDIO): Likewise.
> 	(GLIBCXX_ENABLE_SYMVERS): Likewise.
> 	* configure: Regenerate.

I can't approve this, and the patch looks right, but ...

> --- libstdc++/acinclude.m4	(revision 164746)
> +++ libstdc++/acinclude.m4	(working copy)

> @@ -1710,7 +1710,7 @@
>  dnl Default is generic.
>  dnl
>  AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
> -  GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
> +  GLIBCXX_ENABLE(clocale,auto,[[[=MODEL]]],

... why move away from quadrigraphs?  They are the most robust spelling
wrt. quoting.  Ah, ok, Autoconf 2.64 m4_text_wrap still treated them as
four not one characters, so alignment is wrong; but this has been fixed
in newer Autoconf.  FWIW, I intend to propose moving GCC to 2.68 for
4.6.

Cheers,
Ralf
Andreas Schwab - Oct. 1, 2010, 7:44 a.m.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:

> I can't approve this, and the patch looks right, but ...
>
>> --- libstdc++/acinclude.m4	(revision 164746)
>> +++ libstdc++/acinclude.m4	(working copy)
>
>> @@ -1710,7 +1710,7 @@
>>  dnl Default is generic.
>>  dnl
>>  AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
>> -  GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
>> +  GLIBCXX_ENABLE(clocale,auto,[[[=MODEL]]],
>
> ... why move away from quadrigraphs?

I find them less readable and prefer the real characters as long as they
properly pair.

Andreas.
Paolo Carlini - Oct. 2, 2010, 8:23 a.m.
On 10/01/2010 09:44 AM, Andreas Schwab wrote:
>>>  dnl
>>>  AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
>>> -  GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
>>> +  GLIBCXX_ENABLE(clocale,auto,[[[=MODEL]]],
>>>       
>> ... why move away from quadrigraphs?
>>     
> I find them less readable and prefer the real characters as long as they
> properly pair.
>   
Andreas, the patch is OK as-is then.

Thanks again,
Paolo.

Patch

Index: libstdc++/acinclude.m4
===================================================================
--- libstdc++/acinclude.m4	(revision 164746)
+++ libstdc++/acinclude.m4	(working copy)
@@ -776,8 +776,8 @@ 
 dnl
 m4_define([GLIBCXX_ENABLE],[dnl
 m4_define([_g_switch],[--enable-$1])dnl
-m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
- AC_ARG_ENABLE($1,_g_help,
+m4_define([_g_help],[AC_HELP_STRING([_g_switch$3],[$4 @<:@default=$2@:>@])])dnl
+ AC_ARG_ENABLE([$1],m4_dquote(_g_help),
   m4_bmatch([$5],
    [^permit ],
      [[
@@ -1072,7 +1072,7 @@ 
 AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
 
   AC_MSG_CHECKING([for clock_gettime, nanosleep and sched_yield])
-  GLIBCXX_ENABLE(libstdcxx-time,$1,[=KIND],
+  GLIBCXX_ENABLE(libstdcxx-time,$1,[[[=KIND]]],
     [use KIND for check type],
     [permit yes|no|rt])
 
@@ -1684,7 +1684,7 @@ 
 dnl       Where DEFAULT is either 'c' or 'c_std' or 'c_global'.
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_CHEADERS], [
-  GLIBCXX_ENABLE(cheaders,$1,[=KIND],
+  GLIBCXX_ENABLE(cheaders,$1,[[[=KIND]]],
     [construct "C" headers for g++], [permit c|c_std|c_global])
   AC_MSG_NOTICE("C" header strategy set to $enable_cheaders)
 
@@ -1710,7 +1710,7 @@ 
 dnl Default is generic.
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
-  GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
+  GLIBCXX_ENABLE(clocale,auto,[[[=MODEL]]],
     [use MODEL for target locale package],
     [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
 
@@ -1915,7 +1915,7 @@ 
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [
   AC_MSG_CHECKING([for std::allocator base class])
-  GLIBCXX_ENABLE(libstdcxx-allocator,auto,[=KIND],
+  GLIBCXX_ENABLE(libstdcxx-allocator,auto,[[[=KIND]]],
     [use KIND for target std::allocator base],
     [permit new|malloc|mt|bitmap|pool|yes|no|auto])
 
@@ -2022,7 +2022,7 @@ 
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_CSTDIO], [
   AC_MSG_CHECKING([for underlying I/O to use])
-  GLIBCXX_ENABLE(cstdio,stdio,[=PACKAGE],
+  GLIBCXX_ENABLE(cstdio,stdio,[[[=PACKAGE]]],
     [use target-specific I/O package], [permit stdio])
 
   # Now that libio has been removed, you can have any color you want as long
@@ -2812,7 +2812,7 @@ 
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_SYMVERS], [
 
-GLIBCXX_ENABLE(symvers,$1,[=STYLE],
+GLIBCXX_ENABLE(symvers,$1,[[[=STYLE]]],
   [enables symbol versioning of the shared library],
   [permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export|sun])
 
Index: libstdc++/configure
===================================================================
--- libstdc++/configure	(revision 164746)
+++ libstdc++/configure	(working copy)
@@ -1492,14 +1492,16 @@ 
                           [default=auto]
   --enable-libstdcxx-pch  build pre-compiled libstdc++ headers
                           [default=$is_hosted]
-  --enable-cstdio=PACKAGE use target-specific I/O package [default=stdio]
+  --enable-cstdio[=PACKAGE]
+                          use target-specific I/O package [default=stdio]
   --enable-clocale[=MODEL]
                           use MODEL for target locale package [default=auto]
   --enable-nls            use Native Language Support (default)
-  --enable-libstdcxx-allocator=KIND
+  --enable-libstdcxx-allocator[=KIND]
                           use KIND for target std::allocator base
                           [default=auto]
-  --enable-cheaders=KIND  construct "C" headers for g++ [default=$c_model]
+  --enable-cheaders[=KIND]
+                          construct "C" headers for g++ [default=$c_model]
   --enable-long-long      enable template specializations for 'long long'
                           [default=yes]
   --enable-wchar_t        enable template specializations for 'wchar_t'
@@ -1516,12 +1518,13 @@ 
   --enable-fully-dynamic-string
                           do not put empty strings in per-process static
                           memory [default=no]
-  --enable-libstdcxx-time=KIND
+  --enable-libstdcxx-time[=KIND]
                           use KIND for check type [default=no]
   --enable-tls            Use thread-local storage [default=yes]
   --disable-rpath         do not hardcode runtime library paths
   --enable-linux-futex    use the Linux futex system call [default=default]
-  --enable-symvers=STYLE  enables symbol versioning of the shared library
+  --enable-symvers[=STYLE]
+                          enables symbol versioning of the shared library
                           [default=yes]
   --enable-visibility     enables visibility safe usage [default=yes]
   --enable-version-specific-runtime-libs
@@ -11466,7 +11469,7 @@ 
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11469 "configure"
+#line 11472 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11572,7 +11575,7 @@ 
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11575 "configure"
+#line 11578 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14912,7 +14915,7 @@ 
     #
     # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
     cat > conftest.$ac_ext << EOF
-#line 14915 "configure"
+#line 14918 "configure"
 struct S { ~S(); };
 void bar();
 void foo()
@@ -15280,7 +15283,7 @@ 
   # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 15283 "configure"
+#line 15286 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -15317,7 +15320,7 @@ 
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15320 "configure"
+#line 15323 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -15354,7 +15357,7 @@ 
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15357 "configure"
+#line 15360 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -15392,7 +15395,7 @@ 
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15395 "configure"
+#line 15398 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -15468,7 +15471,7 @@ 
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 15471 "configure"
+#line 15474 "configure"
 int main()
 {
   _Decimal32 d1;