Re: Make AX_DEFINE_DIR obsolete?

2011-09-16 Thread Reuben Thomas
On 16 September 2011 22:36, Eric Blake  wrote:
> On 09/16/2011 03:30 PM, Eric Blake wrote:
>>
>> On 09/16/2011 03:28 PM, Reuben Thomas wrote:
>>>
>>> On 16 September 2011 22:27, Eric Blake wrote:

 I'd keep this as:

 @item
 Use @code{AC_DEFINE} but have @command{configure} compute the literal
 value of @code{datadir} and others.

 This solution does not conform to the GNU Coding Standards.

 that is, just remove the mention of the obsolete archive macro.
>>>
>>> Why document a solution that is non-GCS compliant when there are
>>> GCS-compliant solutions?
>>
>> For teaching purposes. Look at the context - this is part of a larger
>> list of @items, each giving pros and cons about potential solutions,
>> before settling on WHY we picked the last bullet as our preferred
>> solution.
>
> But to be honest, we could reorder that list a bit: float the @item on
> AC_DEFIN to the front of the list, since it's the worst solution, split the
> @item about compile-time substitutions into two (one using -D, and one using
> a dedicated header), all before settling on the last @item of computing
> runtime relativity to $prefix.

I agree with most of this, but:

1. Drop the AC_DEFINE item, as it's a dead end (and, being non-GCS,
unusable) not a logical refinement of a developing technique (I do
agree that gradually building up complex techniques, with motivation
and explanation, is a good feature of GNU manuals).

2. The paragraph before the list makes it sound like a list of
alternatives, not the development of a solution ("There
are several means to achieve a similar goal"). This needs fixing.

3. The last bullet point doesn't really belong in the list, since it's
not really a solution (or at best, it's a solution left as an exercise
to the reader). I suggest breaking it out into a final paragraph.

4. The remaining bullet points need then to be rewritten to show why
each successive refiinement is needed.

5. Actually, the current second bullet point is a special case
solution. (It says it is suitable "when compiling a program".)

-- 
http://rrt.sc3d.org



Re: Make AX_DEFINE_DIR obsolete?

2011-09-16 Thread Eric Blake

On 09/16/2011 03:30 PM, Eric Blake wrote:

On 09/16/2011 03:28 PM, Reuben Thomas wrote:

On 16 September 2011 22:27, Eric Blake wrote:


I'd keep this as:

@item
Use @code{AC_DEFINE} but have @command{configure} compute the literal
value of @code{datadir} and others.

This solution does not conform to the GNU Coding Standards.

that is, just remove the mention of the obsolete archive macro.


Why document a solution that is non-GCS compliant when there are
GCS-compliant solutions?


For teaching purposes. Look at the context - this is part of a larger
list of @items, each giving pros and cons about potential solutions,
before settling on WHY we picked the last bullet as our preferred solution.


But to be honest, we could reorder that list a bit: float the @item on 
AC_DEFIN to the front of the list, since it's the worst solution, split 
the @item about compile-time substitutions into two (one using -D, and 
one using a dedicated header), all before settling on the last @item of 
computing runtime relativity to $prefix.


--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



Re: Make AX_DEFINE_DIR obsolete?

2011-09-16 Thread Eric Blake

On 09/16/2011 03:28 PM, Reuben Thomas wrote:

On 16 September 2011 22:27, Eric Blake  wrote:


I'd keep this as:

@item
Use @code{AC_DEFINE} but have @command{configure} compute the literal
value of @code{datadir} and others.

This solution does not conform to the GNU Coding Standards.

that is, just remove the mention of the obsolete archive macro.


Why document a solution that is non-GCS compliant when there are
GCS-compliant solutions?


For teaching purposes.  Look at the context - this is part of a larger 
list of @items, each giving pros and cons about potential solutions, 
before settling on WHY we picked the last bullet as our preferred solution.


--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



Re: Make AX_DEFINE_DIR obsolete?

2011-09-16 Thread Reuben Thomas
On 16 September 2011 22:27, Eric Blake  wrote:
>
> I'd keep this as:
>
> @item
> Use @code{AC_DEFINE} but have @command{configure} compute the literal
> value of @code{datadir} and others.
>
> This solution does not conform to the GNU Coding Standards.
>
> that is, just remove the mention of the obsolete archive macro.

Why document a solution that is non-GCS compliant when there are
GCS-compliant solutions?

-- 
http://rrt.sc3d.org



Re: Make AX_DEFINE_DIR obsolete?

2011-09-16 Thread Eric Blake

On 09/16/2011 03:25 PM, Reuben Thomas wrote:

Following, a patch to autoconf git head to remove the mention of
AC_DEFINE_DIR from the manual:

+
+   docs: remove mention of non-GCS-compliant AC_DEFINE_DIR.
+   * doc/autoconf.texi (Defining Directories): Update.  The macro was
+   in any case renamed AX_DEFINE_DIR, and is now obsolete in
+   autoconf-archive.


I agree that we need to prune text, but think you went too far.



  @item
-Use @code{AC_DEFINE} but have @command{configure} compute the literal
-value of @code{datadir} and others.  Many people have wrapped macros to
-automate this task; for an example, see the macro @code{AC_DEFINE_DIR} from
-the @uref{http://@/www.gnu.org/@/software/@/autoconf-archive/, Autoconf Macro
-Archive}.
-
-This solution does not conform to the GNU Coding Standards.


I'd keep this as:

@item
Use @code{AC_DEFINE} but have @command{configure} compute the literal
value of @code{datadir} and others.

This solution does not conform to the GNU Coding Standards.

that is, just remove the mention of the obsolete archive macro.

--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



Re: Make AX_DEFINE_DIR obsolete?

2011-09-16 Thread Reuben Thomas
On 16 September 2011 22:21, Reuben Thomas  wrote:
> On 16 September 2011 21:03, Peter Simons  wrote:
>> Hi Reuben,
>>
>>  > Would anyone object if I obsoleted this macro in autoconf-archive?
>>
>> personally, I believe that marking our (inferior) solutions obsolete is
>> the way to go.
>
> Done in autoconf-archive; I'll submit a patch to autoconf separately..

Following, a patch to autoconf git head to remove the mention of
AC_DEFINE_DIR from the manual:

>From cf8962fe0654d39dc628ee3df8753d15275534cb Mon Sep 17 00:00:00 2001
From: Reuben Thomas 
Date: Fri, 16 Sep 2011 22:24:12 +0100
Subject: [PATCH] docs: remove mention of non-GCS-compliant AC_DEFINE_DIR.

* doc/autoconf.texi (Defining Directories): Update.  The macro was
in any case renamed AX_DEFINE_DIR, and is now obsolete in
autoconf-archive.
---
 ChangeLog |7 +++
 doc/autoconf.texi |9 -
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 76b283c..753d066 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-09-16  Reuben Thomas  
+
+   docs: remove mention of non-GCS-compliant AC_DEFINE_DIR.
+   * doc/autoconf.texi (Defining Directories): Update.  The macro was
+   in any case renamed AX_DEFINE_DIR, and is now obsolete in
+   autoconf-archive.
+
 2011-09-16  Eric Blake  

docs: fix typo in shell example
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index f202c10..fb2cd11 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -25528,15 +25528,6 @@ standard directory variables defined,
@pxref{configmake,,, gnulib, GNU
 Gnulib}.

 @item
-Use @code{AC_DEFINE} but have @command{configure} compute the literal
-value of @code{datadir} and others.  Many people have wrapped macros to
-automate this task; for an example, see the macro @code{AC_DEFINE_DIR} from
-the @uref{http://@/www.gnu.org/@/software/@/autoconf-archive/, Autoconf Macro
-Archive}.
-
-This solution does not conform to the GNU Coding Standards.
-
-@item
 Note that all the previous solutions hard wire the absolute name of
 these directories in the executables, which is not a good property.  You
 may try to compute the names relative to @code{prefix}, and try to
-- 
1.7.4.1



Re: Make AX_DEFINE_DIR obsolete?

2011-09-16 Thread Reuben Thomas
On 16 September 2011 21:03, Peter Simons  wrote:
> Hi Reuben,
>
>  > Would anyone object if I obsoleted this macro in autoconf-archive?
>
> personally, I believe that marking our (inferior) solutions obsolete is
> the way to go.

Done in autoconf-archive; I'll submit a patch to autoconf separately..

-- 
http://rrt.sc3d.org



Re: Make AX_DEFINE_DIR obsolete?

2011-09-16 Thread Peter Simons
Hi Reuben,

 > Would anyone object if I obsoleted this macro in autoconf-archive?

personally, I believe that marking our (inferior) solutions obsolete is
the way to go.

Take care,
Peter



Re: Typo in shell substitution example in autoconf manual.

2011-09-16 Thread Eric Blake

On 09/16/2011 01:22 PM, Nick Bowler wrote:

$ bash -c 't="a  b\"'\''}\\"; echo "${a-$t}"'
b  c"'}\


I had a double take upon reading this.  I think the output for all three
of those example commands should read

   a  b"'}\

rather than

   b  c"'}\


Thanks for the report.  I'm pushing this to fix it (I actually changed 
the input of $t to start with 'b  c' rather than fixing the output, so 
that the use of $a doesn't overlap with the output).


From 2a9b77423b28ad741ab74407f680d2caaadd Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Fri, 16 Sep 2011 13:37:38 -0600
Subject: [PATCH] docs: fix typo in shell example

* doc/autoconf.texi (Shell Substitutions): Fix typo.
* THANKS: Update.
Reported by Nick Bowler.

Signed-off-by: Eric Blake 
---
 ChangeLog |7 +++
 THANKS|1 +
 doc/autoconf.texi |6 +++---
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 01df9ad..76b283c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-09-16  Eric Blake  
+
+   docs: fix typo in shell example
+   * doc/autoconf.texi (Shell Substitutions): Fix typo.
+   * THANKS: Update.
+   Reported by Nick Bowler.
+
 2011-09-14  Stefano Lattarini  

docs: more details about make VPATH rewriting woes
diff --git a/THANKS b/THANKS
index 51188aa..867c0d8 100644
--- a/THANKS
+++ b/THANKS
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 3d99012..f202c10 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -15942,11 +15942,11 @@ Shell Substitutions
 the expression needing quoting.

 @example
-$ @kbd{/bin/sh -c 't="a  b\"'\''@}\\"; echo "$@{a-$t@}"'}
+$ @kbd{/bin/sh -c 't="b  c\"'\''@}\\"; echo "$@{a-$t@}"'}
 b  c"'@}\
-$ @kbd{ksh -c 't="a  b\"'\''@}\\"; echo "$@{a-$t@}"'}
+$ @kbd{ksh -c 't="b  c\"'\''@}\\"; echo "$@{a-$t@}"'}
 b  c"'@}\
-$ @kbd{bash -c 't="a  b\"'\''@}\\"; echo "$@{a-$t@}"'}
+$ @kbd{bash -c 't="b  c\"'\''@}\\"; echo "$@{a-$t@}"'}
 b  c"'@}\
 @end example

--
1.7.4.4

--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



Typo in shell substitution example in autoconf manual.

2011-09-16 Thread Nick Bowler
Hello,

I was reading the portability section of the autoconf manual and I
believe there's an error in one of the examples in §11.6: Shell
Substitutions.

https://www.gnu.org/software/autoconf/manual/autoconf.html#Shell-Substitutions

The examples in question are found at the end of the subheading
${var+value}, quoted here:

>  Perhaps the easiest way to work around quoting issues in a manner
>  portable to all shells is to place the results in a temporary variable,
>  then use ‘$t’ as the value, rather than trying to inline the expression
>  needing quoting.
>  
>$ /bin/sh -c 't="a  b\"'\''}\\"; echo "${a-$t}"'
>b  c"'}\
>$ ksh -c 't="a  b\"'\''}\\"; echo "${a-$t}"'
>b  c"'}\
>$ bash -c 't="a  b\"'\''}\\"; echo "${a-$t}"'
>b  c"'}\

I had a double take upon reading this.  I think the output for all three
of those example commands should read

  a  b"'}\

rather than

  b  c"'}\

as it appears in the manual.

Cheers,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)