Re: Fix `set -o posix' again

2006-02-12 Thread Eric Blake
> Clever.  Would it not be easier thus:
> 
> case "`set -o 2>/dev/null`" in
> *"posix "* ) set -o posix ;;
> esac

The first "" are redundant, and you can't be sure whether a space or a
tab appears as the whitespace in the selection pattern.  But how
likely are we to have a shell that has an option that has the substring
"posix", without also supporting the actual option "posix"?  Why not:

case `set -o 2>/dev/null` in
  *posix*) set -o posix ;;
esac

--
Eric Blake




warning in AC_CHECK_DECL

2006-02-15 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Without this patch, AC_FUNC_STRERROR_R (and anything else that uses
AC_CHECK_DECL) gets set incorrectly when configuring with gcc and
CFLAGS='-Wall -Werror'.  For example, CVS head tar grabbed the wrong value
(leading to another bug report against gnulib argp-help's unused variable
when strerror_r is not found):

configure:11302: checking whether strerror_r is declared
configure:11326: gcc -c -g2 -Wall -Werror  conftest.c >&5
conftest.c: In function `main':
conftest.c:135: warning: unused variable `p'
configure:11332: $? = 1
...
| int
| main ()
| {
| #ifndef strerror_r
|   char *p = (char *) strerror_r;
| #endif
|
|   ;
|   return 0;
| }

2006-02-15  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/general.m4 (AC_CHECK_DECL): Avoid unused variable
warning.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD8y9o84KuGfSFAYARAuktAJ4/CLKHF0ZVPl9qE0Ygp4oKbSUNaACfeqND
2z+oG4/fDMSCepfbxlkOG4c=
=8RlE
-END PGP SIGNATURE-
Index: lib/autoconf/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.888
diff -u -p -r1.888 general.m4
--- lib/autoconf/general.m4 6 Jan 2006 00:10:37 -   1.888
+++ lib/autoconf/general.m4 15 Feb 2006 13:38:07 -
@@ -1,7 +1,7 @@
 # This file is part of Autoconf.   -*- Autoconf -*-
 # Parameterized macros.
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -2433,6 +2433,8 @@ AC_CACHE_CHECK([whether $1 is declared],
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
 [#ifndef $1
   char *p = (char *) $1;
+  if (p)
+return 0;
 #endif
 ])],
   [AS_VAR_SET(ac_Symbol, yes)],


Re: warning in AC_CHECK_DECL

2006-02-16 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake on 2/15/2006 6:40 AM:
> Without this patch, AC_FUNC_STRERROR_R (and anything else that uses
> AC_CHECK_DECL) gets set incorrectly when configuring with gcc and
> CFLAGS='-Wall -Werror'.  For example, CVS head tar grabbed the wrong value
> (leading to another bug report against gnulib argp-help's unused variable
> when strerror_r is not found):

Followup - with the earlier patch fixed, now AC_FUNC_STRERROR_R has a
warning, that was making the -Wall -Werror compilation think that
strerror_r returned int instead of char* on cygwin.

2006-02-16  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/functions.m4 (AC_FUNC_STRERROR_R): Avoid unused
variable warning.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD9NRZ84KuGfSFAYARAv1bAKCEuHiiOQpJJTbvqflD1L4WgHA7UgCgk5sR
QeXYktY6ZjON/T5hjuDeyBY=
=+5zc
-END PGP SIGNATURE-
Index: lib/autoconf/functions.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/functions.m4,v
retrieving revision 1.95
diff -u -p -r1.95 functions.m4
--- lib/autoconf/functions.m4   24 Jan 2006 00:20:15 -  1.95
+++ lib/autoconf/functions.m4   16 Feb 2006 19:35:33 -
@@ -1521,6 +1521,7 @@ AC_CACHE_CHECK([whether strerror_r retur
  char buf[100];
  char x = *strerror_r (0, buf, sizeof buf);
  char *p = strerror_r (0, buf, sizeof buf);
+ return !p || x;
]])],
ac_cv_func_strerror_r_char_p=yes)
 else


Re: document m4_foreach*/AC_FOREACH

2006-02-16 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 2/15/2006 5:22 PM:
> +dnl Make sure we do not divide by zero:
> +m4_for([myvar], 1, 1,  , [ myvar])
> +m4_for([myvar], 1, 1,+2, [ myvar])
> +m4_for([myvar], 1, 1,-2, [ myvar])

You probably also ought to have tests:

m4_for([myvar], 1, 2, 0, [ myvar])
m4_for([myvar], 1, 1, 0, [ myvar])
m4_for([myvar], 2, 1, 0, [ myvar])

to test that an explicit step size of 0 properly triggers an m4_assert,
distinct from a defaulted step size.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD9OIQ84KuGfSFAYARAnFLAJwMtdY0rOKLOSOOIBeUHkVC4W6OxgCePGEx
Sfu7IoZyaL08V1VV+U6CYwc=
=hlRN
-END PGP SIGNATURE-




Re: document m4_foreach*/AC_FOREACH

2006-02-16 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Ralf,

According to Ralf Wildenhues on 2/16/2006 1:58 PM:
>>m4_for([myvar], 1, 1, 0, [ myvar])
> 
> Yes, good idea.  Below is an additional patchlet for the first and third
> case.  The second isn't m4_assert'ed at the moment: the body is expanded
> once, with myvar set to 1.  Do you think that should be forbidden?  I'm
> not sure that would be necessary.  My concerns were mostly with (almost)
> endless loops and huge memory consumption, which may happen if the user
> inadvertently messes up.

I guess you have a point there, since step is irrelevant if first == last.
 The only reason to forbid it would be if the user would reasonably expect
an infinite loop, even though we are shortcutting to only execute the loop
once.  But like you said, the user should never reasonably expect an
infinite loop, so I think allowing the optimization of ignoring step when
the bounds are equal, even if step was 0, is okay.  Either way, the
testsuite needs to explicitly test the chosen behavior, so that we cannot
accidentally regress in the future (even though we never anticipate a user
coding up m4_for([myval], 1, 1, 0, [ myval]), we can't be too careful).

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD9Om784KuGfSFAYARAl+lAKDNuvfdXWIssVsOiKmBa6Kf+hWuOgCfeJZk
1LEhDiLQ2rfM8SUPTTwW0BQ=
=JVON
-END PGP SIGNATURE-




AC_LIBOBJ minor optimization

2006-02-20 Thread Eric Blake
Are minor optimizations such as this worthwhile?  It leads to
smaller generated configures, and allows the shell to perform
fewer pattern matches during operation.

2006-02-20  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/general.m4 (_AC_LIBOBJ): Minor optimization.

Index: lib/autoconf/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.889
diff -u -p -r1.889 general.m4
--- lib/autoconf/general.m4 15 Feb 2006 22:07:12 -  1.889
+++ lib/autoconf/general.m4 20 Feb 2006 20:28:14 -
@@ -2497,10 +2497,7 @@ m4_define([_AC_LIBOBJ],
 [AS_LITERAL_IF([$1],
   [AC_LIBSOURCE([$1.c])],
   [$2])dnl
-case $LIB@&[EMAIL PROTECTED] in
-"$1.$ac_objext"   | \
-  *" $1.$ac_objext"   | \
-"$1.$ac_objext "* | \
+case " $LIB@&[EMAIL PROTECTED] " in
   *" $1.$ac_objext "* ) ;;
   *) AC_SUBST([LIB@&[EMAIL PROTECTED], ["$LIB@&[EMAIL PROTECTED] 
$1.$ac_objext"]) ;;
 esac

--
Eric Blake




Re: AC_LIBOBJ minor optimization

2006-02-21 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Ralf,

According to Ralf Wildenhues on 2/21/2006 12:16 AM:
> 
> If you ask me, definitely:  $LIBOBJS may easily be a few K characters,
> and Libtool makes abundant use of this construct so it should not cause
> suprises.  I took liberty to just install your patch.

Thanks.

> 
> Note your actual diff posted had some whitespace differences wrt. the
> actual code so it did not apply cleanly (TAB vs spaces).

Sorry about that - my ISP's webmail interface is horrid.  I'll have to
remember to send patches as attachments in the future when fighting with
my webmail.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD+xlB84KuGfSFAYARApjJAKClQaivv6yD8ZWtpcRGYa5v+kWfuQCgw2pU
VYFAe0KTMGBO0HfVqyMrSUk=
=Movk
-END PGP SIGNATURE-




questions and doc patch on AC_TRY_LINK_FUNC

2006-03-10 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I have noticed that gcc 3.4.4 (the current version on cygwin) issues a
warning even though no -W options were specified, when a declaration
conflicts with a gcc builtin.  This behavior is currently tickled by the
implementation of AC_LANG_CALL, and it inhibits autoconf's ability to test
function linkage when the user happens to add -Werror to their CFLAGS:

$ cat conftest.c
/* confdefs.h.  */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char printf ();
int
main ()
{
return printf ();
  ;
  return 0;
}
$ gcc -o conftest conftest.c
conftest.c:15: warning: conflicting types for built-in function 'printf'

This also gives a false negative in the testsuite: './testsuite -k
AC_TRY_LINK_FUNC CFLAGS=-Werror' fails because it generated the above
conftest.c, and the warning was turned into an error by my choice of
CFLAGS, in spite of the comment issued by AC_LANG_CALL that the char
return type works around gcc builtins.  There are other failures triggered
by running ./testsuite with CFLAGS=-Werror, and I am slowly seeing whether
they are worth tackling.  Meanwhile, it pointed out a doc bug related to
AC_TRY_LINK_FUNC; patch attached.

Currently, to force a package to have a warning-free compile, I like to do
'./configure; make CFLAGS=-Werror', but I have to remember to set CFLAGS
for every subsequent make rerun.  But it would be nicer if I could do
'./configure CFLAGS=-Werror; make', and have make pick up the configured
flags.  At this point, I wonder whether it would be worth teaching
autoconf about gcc's -w flag (and comparable flags for other compilers, if
they are known), then using that flag during configuration to override the
user's CFLAGS warning settings to avoid the false negatives triggered by
various tests when warnings are present, while still allowing the user to
specify their desired level of warnings during compilation.

2006-03-08  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.texi (Obsolete Macros): Fix wording of
AC_TRY_LINK_FUNC.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEDuPn84KuGfSFAYARAgZaAJ4ipzqNjejC96zsDwKKK0b/bFZQlQCdF8Jp
Tz9rlhcM1uhVgmmi6x7LKQU=
=LGux
-END PGP SIGNATURE-
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.957
diff -u -p -r1.957 autoconf.texi
--- doc/autoconf.texi   6 Mar 2006 22:34:34 -   1.957
+++ doc/autoconf.texi   8 Mar 2006 13:31:11 -
@@ -15405,9 +15405,8 @@ and compilation flags are determined by 
 @defmac AC_TRY_LINK_FUNC (@var{function}, @ovar{action-if-found}, 
@ovar{action-if-not-found})
 @acindex{TRY_LINK_FUNC}
 This macro is equivalent to
[EMAIL PROTECTED]([AC_LANG_CALL([EMAIL PROTECTED],
[EMAIL PROTECTED])], [EMAIL PROTECTED],
[EMAIL PROTECTED])}.
[EMAIL PROTECTED]([AC_LANG_CALL([], [EMAIL PROTECTED])],
[EMAIL PROTECTED], [EMAIL PROTECTED])}.
 @end defmac
 
 @defmac AC_TRY_RUN (@var{program}, @ovar{action-if-true}, 
@ovar{action-if-false}, @ovar{action-if-cross-compiling})


Re: proposed gnulib-related additions to Autoconf

2006-03-10 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 3/1/2006 11:28 AM:
> "Gary V. Vaughan" <[EMAIL PROTECTED]> writes:
> 
>>   i) Let's just improve AC_CHECK_HEADERS (et al) to always make configure
>>  smaller and faster by despatching to (undocumented internal)
>>  _AC_CHECK_HEADERS_ONCE when it can.
> 
> Won't that break old scripts?  If they do something like this:

Not just old scripts.  Read on.

> 
>   if test $ac_feature_foo = yes; then
> AC_CHECK_HEADERS([sys/param.h])
>   fi
> 
> then we'd hoist the test for sys/param.h out of the then-part, which
> is not what was intended.

Indeed, my recent patch for gnulib's m4/sys_socket_h.m4 relies on the
AC_CHECK_HEADERS *NOT* being run when expanded inside a conditional, since
on cygwin, the header winsock2.h exists but is incompatible with
sys/socket.h.  If we used AC_CHECK_HEADERS_ONCE in that case, then cygwin
would get annoying warning messages from CVS head coreutils that a header
is present but cannot be compiled.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFECiXc84KuGfSFAYARAsH5AKCBfxKg5uBBouPtbR/IUNvRB8KgHACgi7j/
46ffnGOpm1pgxZ4OC9tkH7k=
=HSQU
-END PGP SIGNATURE-




Re: questions and doc patch on AC_TRY_LINK_FUNC

2006-03-10 Thread Eric Blake
> 
> Instead, how about if we use -fno-builtin if available?  Does that
> pacify your version of GCC?  If it works, that'd be a lot easier.

Yes, gcc 3.4.4 no longer warns about 'char printf();' in the
presence of -fno-builtin, allowing -Werror to compile the program
in question without failure.  Now, what is the best approach to
going about detecting whether the compiler supports that
flag, and if so, using that flag for all tests that involve
AC_LANG_CALL?

-- 
Eric Blake




Re: autoconf documentation slight modernization for C, other fixups

2006-03-10 Thread Eric Blake
> @@ -3867,8 +3867,8 @@ Posix prefers @code{setenv} to @code{put
>  
>  Posix specifies that @code{putenv} puts the given string directly in
>  @code{environ}, but some systems make a copy of it instead (e.g.,
> -glibc 2.0, or BSD).  And when a copy is made, @code{unsetenv} might
> -not free it, causing a memory leak (e.g., FreeBSD 4).
> +glibc 2.0, or @acronym{BSD}).  And when a copy is made, @code{unsetenv} might
> +not free it, causing a memory leak (e.g., [EMAIL PROTECTED] 4).

Should it be "FreeBSD" or "[EMAIL PROTECTED]"?  Likewise for NetBSD,
OpenBSD in your global search and replace for instances of BSD.

-- 
Eric Blake




Re: Tru64 expr limitation

2006-03-10 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 3/4/2006 11:14 AM:
> Tru64 UNIX 5.1 expr is a bit borked, in that it converts the result of a
> regex match into a number if possible.  :-(
>   $ expr 1 : '.*\(...\)'
>   1

Nice catch.

> 
> I'd guess you prefer the unified behavior but a bit slower everywhere
> instead, done in the patch below.  OK to apply?
>   * doc/autoconf.texi (Limitations of Usual Tools) :
>   Mention Tru64 expr bug that turns the result of a regex match
>   into a number if possible.

This part looks great.

>   * lib/autotest/general.m4 (AT_INIT): Work around it using
>   `echo | sed'.

What about this, instead:

> @@ -935,7 +935,7 @@
>for at_group in $at_fail_list
>do
>  # Normalize the test group number and cat the log.
> -at_group_normalized=`expr "0$at_group" : ".*\($at_format\)"`
> + at_group_normalized=`echo "0$at_group" | sed 
> "s,.*\($at_format\),\1,"`
>  cat "$at_suite_dir/$at_group_normalized/$as_me.log"

Seeing as how we are only using at_group_normalized as a directory name,
would the following, faster approach work?  (I'm hesitant to introduce
extra forks when they can be avoided, having seen how slow it is on cygwin).

at_group_normalized=`expr "0$at_group/" : ".*\($at_format/\)"`
cat "$at_suite_dir/$at_group_normalized$as_me.log"

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFECi8O84KuGfSFAYARAq83AJoDLbnLToaz+c7E+wTMJjpOyIUWggCeKUfg
GwkuDIkyNoC7wfjrwFPY0y8=
=PevA
-END PGP SIGNATURE-




Re: _AC_CACHE_DUMP simplified

2006-03-20 Thread Eric Blake
>   what would you say about this simplification of _AC_CACHE_DUMP?
> 

+  case `(ac_space=' '; set | grep ^ac_space) 2>&1` in

Don't you have to quote leading ^ in portable shell?  As in

case `(ac_space=' '; set | grep '^ac_space') 2>&1` in

I searched autoconf.texi, but did not find a definitive answer to
my question (it did point out that ^ is not portable in filenames,
and that leading ^ in expr regex is not portable, but did not
really mention whether bare ^ in shells should be avoided), so
maybe I'm just propagating an urban legend.

-- 
Eric Blake




Re: _AC_CACHE_DUMP simplified

2006-03-21 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 3/21/2006 4:26 PM:
> 
> Attached please find a corrected version.

Still has problems - see below.

> 
> There is a second patch which documents the ^ issue.

Looks fine to me.

> --- lib/autoconf/general.m4   16 Mar 2006 13:33:18 -  1.891
> +++ lib/autoconf/general.m4   21 Mar 2006 23:18:08 -
> @@ -1813,8 +1813,8 @@
>  # and sets the high bit in the cache file unless we assign to the vars.
>  {
>(set) 2>&1 |
> -case `(ac_space=' '; set | grep ac_space) 2>&1` in
> -*ac_space=\ *)
> +case `(ac_space=' '; set | grep '^ac_space') 2>&1` in
> +ac_space=\ *)

grep does not work on the output of set in all shells:

$ zsh --version
zsh 4.2.6 (i686-pc-cygwin)
$ zsh -c "(ac_space=' '; (set) 2>&1 | grep '^ac_space=')"
Binary file (standard input) matches
$ zsh -c "(ac_space=' '; (set) 2>&1 | sed -n '/^ac_space=/p')"
ac_space=' '

># `set' does not quote correctly, so add quotes (double-quote
># substitution turns  into \\, and sed turns \\ into \).
>sed -n \
> @@ -1823,8 +1823,7 @@
>;;
>  *)
># `set' quotes correctly as required by POSIX, so do not add quotes.
> -  sed -n \
> - ["s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"]
> +  grep ["^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*="]

Hmm, you are just replacing sed with grep, but still executing the same
number of processes.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEIM9D84KuGfSFAYARAtGZAKCMrjQ+klV93qN/FJQhNv2kHWHrHACdGzsh
E38iDsTpPg9d9pNoWic5584=
=yHV+
-END PGP SIGNATURE-




Re: _AC_CACHE_DUMP simplified

2006-03-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 3/21/2006 11:16 PM:
> * Stepan Kasal wrote on Wed, Mar 22, 2006 at 12:26:16AM CET:
>> There is a second patch which documents the ^ issue.
> 
> This is already in the docs:
> |  On some Posix-like platforms, `!' and `^' are special too, so they
> |  should be avoided.

No, that warning is related to portable filename characters, not to
command lines containing an unquoted history character or unquoted
alternate pipe character.

> 
>> [EMAIL PROTECTED] ^
>> [EMAIL PROTECTED] ^ quoting
>> +Always quote @samp{^}.  For example @command{/bin/sh} on Solaris 10
>> +chokes on @samp{echo ^a}.
>> +
> 
> I don't think it chokes.  It simply allows ^ as replacement for the
> pipe.  (No, I did not remember this the last time I posted in this
> thread, sorry; but Sven Mascheck's pages note this IIRC).

Then maybe adding an example to this section, such as 'echo ^echo foo'
outputting just "foo" instead of "^echo foo" on Solaris, will demonstrate
the situation better.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEITyb84KuGfSFAYARAsvwAJ9w2smOCXX2NCyVRrZcIWvsTJCexQCg1sg6
n6r81kTEWBjN8GyU5Ly19M0=
=7WGo
-END PGP SIGNATURE-




Re: more M4sh documentation

2006-03-27 Thread Eric Blake
> The M4sh macros are quite useful also outside of Autoconf.
> OK to apply this to document some of them?

Mostly good, but see nits below...

>  
> [EMAIL PROTECTED] AS_SET_CATFILE (@var{var}, @var{dir}, @var{file})
> [EMAIL PROTECTED]
> +Set the shell variable @var{var} to @var{dir}/@var{file}, but
> +optimizing the common cases (@var{dir} or @var{file} is @samp{.},
> [EMAIL PROTECTED] is absolute, etc.).
> [EMAIL PROTECTED] defmac

When file is absolute, dir/file is not the same as file.  I would reword
this paragraph as:

Set the shell variable @var{var} to the location of pathname
@var{file} from the perspective of directory @var{dir}, optimizing
for common cases (@var{dir} or @var{file} is @samp{.}, @var{file}
is absolute, etc.).

Doesn't etc. need special texinfo handling, since it is an abbreviation
(but this would mean a sweep through the entire .texi file, not just
your patch).

The AS_SET_CATFILE macro also fails when presented non-portable
filenames (for example, the Unix box relative path "a:\\b" looks like
a Windows drive letter and will be treated as absolute on Unix; the
pathname "1:/" will be treated as absolute even though on cygwin
it is relative; the pathname a:foo is treated as relative even though
on cygwin it is absolute).  But I don't know whether it is worth
making it the macro more robust, or just documenting the limitation
that AS_SET_CATFILE expects portable filenames to be useful, along
with recognition that it recognizes \ as an alternate spelling of / and
recognizes drive letters.

>  
> [EMAIL PROTECTED] AS_TMPDIR (@var{prefix}, @dvar{directory, $TMPDIR})
> [EMAIL PROTECTED]
> +Create a temporary directory in @var{directory}, as safely as possible
> +(@pxref{Limitations of Usual Tools}).
> [EMAIL PROTECTED] defaults to @env{TMPDIR}, which is defaulted to
> [EMAIL PROTECTED]/tmp}.  The @var{prefix} should be up to 4 characters long 
> and
> +indicate the script responsible for the directory.  If successful,
> +set @env{tmp} to the name of the newly created directory, otherwise
> +terminate the script.  No provision for the removal of @samp{$tmp} is
> +made.
> [EMAIL PROTECTED] defmac

Should we be providing a macro that expands portably into the proper
trap commands for removing $tmp on exit?  Or at least an example
usage of how the user might write such a trap command?

Hmm, is there a portable way to add commands to an existing trap?  It
seems like an AS_TRAP command might be useful for portably adding/
extending an exit trap to remove the tmpdir, but it seems like a rather
difficult task to define a useful interface for AS_TRAP that can be
portably implemented across the various shells.

> [EMAIL PROTECTED] AS_VERSION_COMPARE (@var{version-1}, @var{version-2}, 
> @ovar{action-if-less}, @ovar{action-if-greater}, @ovar{action-if-greater})

action-if-greater appears twice.

-- 
Eric Blake




document AS_BASENAME

2006-03-27 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

After my recent patch submission to coreutils, GNU dirname/basename will
now return // on platforms (for now, cygwin) that have // distinct from /.
 So the documentation needs an update; in the process, I noticed that
AS_DIRNAME is documented but not AS_BASENAME.

Also, do we want to remove this line about m4sh, that was picked up in the
context of my first hunk? "For the time being, it is not mature enough to
be widely used."

2006-03-22  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.texi (Limitations of Usual Tools): Document
basename.  Mention cygwin's treatment of //.
(Programming in M4sh): Document AS_BASENAME.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEIVKI84KuGfSFAYARAhu9AKCa6ma61ZCxkYAgusC9cuYSxK3DOQCgooNK
bRZ0YP0CKYlcsX1SqQT4zjg=
=W9WU
-END PGP SIGNATURE-
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.971
diff -u -p -U5 -r1.971 autoconf.texi
--- doc/autoconf.texi   21 Mar 2006 21:51:07 -  1.971
+++ doc/autoconf.texi   22 Mar 2006 13:32:02 -
@@ -9377,10 +9377,18 @@ A mess; trouble.  [Obs.] --Beau.@: & Fl.
 For the time being, it is not mature enough to be widely used.
 
 M4sh provides portable alternatives for some common shell constructs
 that unfortunately are not portable in practice.
 
[EMAIL PROTECTED] AS_BASENAME (@var{file-name})
[EMAIL PROTECTED]
+Return the filename portion of @var{file-name}, using the algorithm
+required by Posix.  @xref{Limitations of Usual Tools}, for more
+details about what this returns and why it is more portable than the
[EMAIL PROTECTED] command.
[EMAIL PROTECTED] defmac
+
 @defmac AS_BOURNE_COMPATIBLE
 @asindex{BOURNE_COMPATIBLE}
 Set up the shell to be more compatible with the Bourne shell as
 standardized by Posix, if possible.  This may involve setting
 environment variables, or setting options, or similar
@@ -12156,10 +12164,35 @@ Traditional Awk @code{split} supports on
 
 Traditional Awk has a limit of 99
 fields in a record.  You may be able to circumvent this problem by using
 @code{split}.
 
[EMAIL PROTECTED] @command{basename}
[EMAIL PROTECTED] 
[EMAIL PROTECTED] @command{basename}
+Not all hosts have a working @command{basename}, and you should instead
+use @code{AS_BASENAME} (@pxref{Programming in M4sh}).  For example:
+
[EMAIL PROTECTED]
+file=`basename "$file"`   # This is not portable.
+file=`AS_BASENAME(["$file"])` # This is more portable.
[EMAIL PROTECTED] example
+
+Unfortunately, neither of the above commands work if @code{$file} ends
+in newline, since @[EMAIL PROTECTED] removes all trailing newlines.
+
[EMAIL PROTECTED]
+This handles a few subtleties in the standard way required by
+Posix.  For example, Posix permits implementations to treat leading
[EMAIL PROTECTED]//} with special semantics, but requires leading @samp{///} and
+beyond to be equivalent to @samp{/}.  While most flavors of Unix treat
[EMAIL PROTECTED]//} identically to @samp{/}, there are some which treat it as a
+``super-root'' where it can provide access to other machines' files.
+This tradition started with Apollo Domain/OS, and continues today with
+Cygwin.
+
+
 @item @command{cat}
 @c 
 @prindex @command{cat}
 Don't rely on any option.
 
@@ -12329,27 +12362,11 @@ dir=`AS_DIRNAME(["$file"])` # This is mo
 Unfortunately, neither of the above commands work if @code{$file}'s
 directory name ends in newline, since @[EMAIL PROTECTED] removes all
 trailing newlines.
 
 @noindent
-This handles a few subtleties in the standard way required by
-Posix.  For example, under UN*X, should @samp{dirname //1} give
[EMAIL PROTECTED]/}?  Paul Eggert answers:
-
[EMAIL PROTECTED]
-No, under some older flavors of Unix, leading @samp{//} is a special
-file name: it refers to a ``super-root'' and is used to access other
-machines' files.  Leading @samp{///}, @samp{}, etc.@: are equivalent
-to @samp{/}; but leading @samp{//} is special.  This tradition
-started with Apollo Domain/OS, though it has largely died out in practice.
-
-Posix allows but does not require the special treatment for
[EMAIL PROTECTED]//}.  It says that the behavior of @command{dirname} on file 
names of the
-form @samp{//([^/]+/*)?} is implementation defined.  In these cases,
[EMAIL PROTECTED] @command{dirname} returns @samp{/}, but those no-longer-used
-flavors of Unix returned @samp{//}.
[EMAIL PROTECTED] quotation
+Similar to AS_BASENAME, AS_DIRNAME correctly handles leading @samp{//}.
 
 
 @item @command{egrep}
 @c --
 @prindex @command{egrep}


document AS_BASENAME

2006-03-27 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[Resend.  It appears that the original message made it to the web
archives, but was not mailed.]

After my recent patch submission to coreutils, GNU dirname/basename will
now return // on platforms (for now, cygwin) that have // distinct from /.
 So the documentation needs an update; in the process, I noticed that
AS_DIRNAME is documented but not AS_BASENAME.

Also, do we want to remove this line about m4sh, that was picked up in the
context of my first hunk? "For the time being, it is not mature enough to
be widely used."

2006-03-22  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.texi (Limitations of Usual Tools): Document
basename.  Mention cygwin's treatment of //.
(Programming in M4sh): Document AS_BASENAME.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEJ+RS84KuGfSFAYARAltqAKChwNWP5/oQ0Bkz+/iOOc5CxfBiwQCgzXUj
vbvc541a1y4+yFzAjgeH6Xg=
=4Nf8
-END PGP SIGNATURE-
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.971
diff -u -p -U5 -r1.971 autoconf.texi
--- doc/autoconf.texi   21 Mar 2006 21:51:07 -  1.971
+++ doc/autoconf.texi   22 Mar 2006 13:32:02 -
@@ -9377,10 +9377,18 @@ A mess; trouble.  [Obs.] --Beau.@: & Fl.
 For the time being, it is not mature enough to be widely used.
 
 M4sh provides portable alternatives for some common shell constructs
 that unfortunately are not portable in practice.
 
[EMAIL PROTECTED] AS_BASENAME (@var{file-name})
[EMAIL PROTECTED]
+Return the filename portion of @var{file-name}, using the algorithm
+required by Posix.  @xref{Limitations of Usual Tools}, for more
+details about what this returns and why it is more portable than the
[EMAIL PROTECTED] command.
[EMAIL PROTECTED] defmac
+
 @defmac AS_BOURNE_COMPATIBLE
 @asindex{BOURNE_COMPATIBLE}
 Set up the shell to be more compatible with the Bourne shell as
 standardized by Posix, if possible.  This may involve setting
 environment variables, or setting options, or similar
@@ -12156,10 +12164,35 @@ Traditional Awk @code{split} supports on
 
 Traditional Awk has a limit of 99
 fields in a record.  You may be able to circumvent this problem by using
 @code{split}.
 
[EMAIL PROTECTED] @command{basename}
[EMAIL PROTECTED] 
[EMAIL PROTECTED] @command{basename}
+Not all hosts have a working @command{basename}, and you should instead
+use @code{AS_BASENAME} (@pxref{Programming in M4sh}).  For example:
+
[EMAIL PROTECTED]
+file=`basename "$file"`   # This is not portable.
+file=`AS_BASENAME(["$file"])` # This is more portable.
[EMAIL PROTECTED] example
+
+Unfortunately, neither of the above commands work if @code{$file} ends
+in newline, since @[EMAIL PROTECTED] removes all trailing newlines.
+
[EMAIL PROTECTED]
+This handles a few subtleties in the standard way required by
+Posix.  For example, Posix permits implementations to treat leading
[EMAIL PROTECTED]//} with special semantics, but requires leading @samp{///} and
+beyond to be equivalent to @samp{/}.  While most flavors of Unix treat
[EMAIL PROTECTED]//} identically to @samp{/}, there are some which treat it as a
+``super-root'' where it can provide access to other machines' files.
+This tradition started with Apollo Domain/OS, and continues today with
+Cygwin.
+
+
 @item @command{cat}
 @c 
 @prindex @command{cat}
 Don't rely on any option.
 
@@ -12329,27 +12362,11 @@ dir=`AS_DIRNAME(["$file"])` # This is mo
 Unfortunately, neither of the above commands work if @code{$file}'s
 directory name ends in newline, since @[EMAIL PROTECTED] removes all
 trailing newlines.
 
 @noindent
-This handles a few subtleties in the standard way required by
-Posix.  For example, under UN*X, should @samp{dirname //1} give
[EMAIL PROTECTED]/}?  Paul Eggert answers:
-
[EMAIL PROTECTED]
-No, under some older flavors of Unix, leading @samp{//} is a special
-file name: it refers to a ``super-root'' and is used to access other
-machines' files.  Leading @samp{///}, @samp{}, etc.@: are equivalent
-to @samp{/}; but leading @samp{//} is special.  This tradition
-started with Apollo Domain/OS, though it has largely died out in practice.
-
-Posix allows but does not require the special treatment for
[EMAIL PROTECTED]//}.  It says that the behavior of @command{dirname} on file 
names of the
-form @samp{//([^/]+/*)?} is implementation defined.  In these cases,
[EMAIL PROTECTED] @command{dirname} returns @samp{/}, but those no-longer-used
-flavors of Unix returned @samp{//}.
[EMAIL PROTECTED] quotation
+Similar

Re: document AS_BASENAME

2006-03-28 Thread Eric Blake
Hi Ralf,

> > 
> > After my recent patch submission to coreutils, GNU dirname/basename will
> > now return // on platforms (for now, cygwin) that have // distinct from /.
> >  So the documentation needs an update; in the process, I noticed that
> > AS_DIRNAME is documented but not AS_BASENAME.
> 
> Yep.  I always thought that was because `basename' is fairly portable.

The problem is not so much whether basename/dirname conform to
POSIX (although that is an issue), but whether they even exist.  The
AS_ variants do try basename/dirname before falling back on expr/sed.
But looking at the source to AS_BASENAME, even recent Solaris
mishandles "basename /" with an empty line instead of "/".

However, I just noticed that AS_BASENAME does not do suffix
stripping (such as "AS_BASENAME([foo.c], [.c])" expanding to
"foo"), so I have the bigger task of actually implementing that
portably in m4sh before this patch can be applied.

> 
> > Also, do we want to remove this line about m4sh, that was picked up in the
> > context of my first hunk? "For the time being, it is not mature enough to
> > be widely used."
> 
> If you'd like an opinion, I'd still like a warning, maybe a bit weaker
> than that.  The discussion about my pending documentation patch also
> shows how immature it still is.

OK, I'll work up an alternative wording when I resubmit my patch.

> 
> A small nit:
> 
> > [EMAIL PROTECTED] AS_BASENAME (@var{file-name})
> > [EMAIL PROTECTED]
> > +Return the filename portion of @var{file-name}, using the algorithm
> > +required by Posix.  @xref{Limitations of Usual Tools}, for more
> 
> Required?  See below.
> 
> > +details about what this returns and why it is more portable than the
> > [EMAIL PROTECTED] command.
> > [EMAIL PROTECTED] defmac


> > +Unfortunately, neither of the above commands work if @code{$file} ends
> > +in newline, since @[EMAIL PROTECTED] removes all trailing newlines.
> > +
> > [EMAIL PROTECTED]
> > +This handles a few subtleties in the standard way required by
> > +Posix.  For example, Posix permits implementations to treat leading
> > [EMAIL PROTECTED]//} with special semantics,
> 
> I sense a contradiction between "required" and "permits" here.

POSIX provides an algorithm for basename that is deterministic
for all input except "" and "//", and for those two, mandates that
an implementation must output either "" or "." for the former,
and either "/" or "//" for the latter.  Likewise, dirname is
deterministic for everything except "//", where the choice is
still limited to "/" or "//".  But I can see how adding more
words to this effect (or something similar to Paul's original
example of "//1") could clarify the situation.  I'll give it another
shot.

> Are there basename implementations that turn /// into ///?

Not that I am aware of.

> If yes, that does not get very clear here, and I think the
> previous quoted comment by Paul was a bit clearer here.

-- 
Eric Blake




Re: document AS_BASENAME

2006-03-31 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 3/30/2006 11:54 PM:
> 
> FWIW, I wonder whether using expr at all for general names is a good
> idea, as the documented bug on Tru64 that turns everything into a number
> that looks like one (after other operations):
>  $ expr 'X000123.c' : 'X\(.*\)\.c'
>  123

AS_BASENAME attempts the platform's basename before falling back to expr;
it only filters out missing basename or instances of basename that
mishandle /.  If Tru64 has a working basename, then the expr bug will not
hit us when doing AS_BASENAME[(foo/01)]; but that does not prevent the
above suffix stripping bug unless we improve AS_BASENAME to take an
optional suffix argument.  Do we have anyone that can verify whether Tru64
will always have a working basename?  Should we beef up _AS_EXPR_PREPARE
to also refuse to use expr if it mishandles numeric string pattern matches?

Also, I noticed that where basename is missing, AS_BASENAME mishandles ///
(it was outputting . instead of /), patched thusly:

2006-03-31  Eric Blake  <[EMAIL PROTECTED]>

* lib/m4sugar/m4sh.m4 (AS_BASENAME_EXPR): Correctly handle ///.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFELUMs84KuGfSFAYARAtS3AJ9Hf1TfOamkIHRDtCceM7rdHYnnyQCgn0r8
QC8kwyUNL7cBmDZitKrDln8=
=zguC
-END PGP SIGNATURE-
Index: lib/m4sugar/m4sh.m4
===
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.165
diff -u -p -r1.165 m4sh.m4
--- lib/m4sugar/m4sh.m4 27 Mar 2006 17:42:18 -  1.165
+++ lib/m4sugar/m4sh.m4 31 Mar 2006 14:54:30 -
@@ -706,8 +706,7 @@ m4_defun([AS_BASENAME_EXPR],
 [AS_REQUIRE([_AS_EXPR_PREPARE])dnl
 $as_expr X/[]$1 : '.*/\([[^/][^/]*]\)/*$' \| \
 X[]$1 : 'X\(//\)$' \| \
-X[]$1 : 'X\(/\)$' \| \
-. : '\(.\)'])
+X[]$1 : 'X\(/\)' \| .])
 
 m4_defun([AS_BASENAME_SED],
 [echo X/[]$1 |


autotest fails when pwd is testgroup directory

2006-03-31 Thread Eric Blake
On cygwin, the current working directory of any process is locked from
removal (rmdir fails with EBUSY, as permitted by POSIX).  I encountered
a failed autotest run in tar, and went to investigate it as follows:

$ make check
... # Error - several tests, including 02, failed
$ cd tests/testsuite.dir/02
$ ./run
## --- ##
## GNU tar 1.15.90 test suite. ##
## --- ##
rm: cannot remove directory `/home/eblake/text/tar-
1.15.90/tests/testsuite.dir/02': Device or resource busy
mkdir: cannot create directory `/home/eblake/text/tar-
1.15.90/tests/testsuite.dir/02': File exists
testsuite: error: cannot create /home/eblake/text/tar-
1.15.90/tests/testsuite.dir/02
$

Ouch.  Because my shell is still in testsuite.dir/02, that directory is
locked from removal.  The ./run script is a thin wrapper around testsuite,
and testsuite attempted "rm -fr testsuite.dir/02", successfully removing
all its contents but failing to remove the directory itself, then fails to
remake the testgroup directory because it already exists, aborting
the test run and obliterating all information about the previous failed
run in the process.

The following patch still prints the warning about rm's inability to remove
the locked directory, but at least allows the testsuite to rerun the
test rather than giving up.  (Also, lib/autotest/general.m4 has some
spaces followed by tabs in code indentation that my editor wanted to clean
up; omitted from this patch but still useful to do).

2006-03-31  Eric Blake  <[EMAIL PROTECTED]>

* lib/m4sugar/m4sh.m4 (AS_MKDIR_P): Allow use in shell lists.
* lib/autotest/general.m4: Be tolerant of existing directory when
rm failed to remove it.

Index: lib/autotest/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.199
diff -u -b -r1.199 general.m4
--- lib/autotest/general.m4 27 Mar 2006 17:42:18 -  1.199
+++ lib/autotest/general.m4 31 Mar 2006 16:28:16 -
@@ -699,7 +699,7 @@
find $at_group_dir -type d ! -perm -700 -exec chmod u+rwx \{\} \;
rm -fr $at_group_dir
   fi
-  mkdir $at_group_dir ||
+  AS_MKDIR_P([$at_group_dir]) ||
AS_ERROR([cannot create $at_group_dir])
   cd $at_group_dir
   ;;
Index: lib/m4sugar/m4sh.m4
===
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.165
diff -u -b -r1.165 m4sh.m4
--- lib/m4sugar/m4sh.m4 27 Mar 2006 17:42:18 -  1.165
+++ lib/m4sugar/m4sh.m4 31 Mar 2006 16:53:04 -
@@ -939,7 +939,7 @@
   as_dir=`AS_DIRNAME("$as_dir")`
 done
 test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || AS_ERROR([cannot create directory $1]); }
+  fi || AS_ERROR([cannot create directory $1]); }dnl
 ])# AS_MKDIR_P
 
 






clean up m4sh.m4, then optimize AS_PATH_WALK

2006-04-01 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Two part patch: first, rearrange chunks of m4 to be alphabetical (as
implied by the comments), and fix a couple of typos.  Then, make it
possible to skip non-existent directories when doing a PATH walk.  Why?
Because without it, AS_DETECT_BETTER_SHELL throws /usr/bin/posix at the
front of the path walk, and on platforms without this directory, this adds
four shells to as_candidate_shells that cannot exist, wasting four
subshells in the subsequent _AS_RUN just to determine that $as_shell can't
be run because it doesn't exist.

2006-04-01  Eric Blake  <[EMAIL PROTECTED]>

* lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Optimize non-existant
directories, unless optional third argument supplied.
(AS_UNAME): Don't optimize PATH walk.

* lib/m4sugar/m4sh.m4: Sort sections as implied by the comments,
and fix some typos.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFELqzn84KuGfSFAYARAmMFAKCQR8ZFEyBupgSXbYjA/6d8W39fOACgzIeW
HJlEito+1mfkhDWJBe2CS1Y=
=5ARH
-END PGP SIGNATURE-
Index: m4sh.m4
===
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.167
diff -u -p -r1.167 m4sh.m4
--- m4sh.m4 1 Apr 2006 16:09:13 -   1.167
+++ m4sh.m4 1 Apr 2006 16:36:33 -
@@ -326,15 +326,15 @@ _AS_PATH_SEPARATOR_PREPARE
 _AS_UNSET_PREPARE
 
 # IFS
-# We need space, tab and new line, in precisely that order.
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
 as_nl='
 '
-IFS="  $as_nl"
+IFS=" ""   $as_nl"
 
-# Find who we are.  Look in the path if we contain no path at all
-# relative or not.
+# Find who we are.  Look in the path if we contain no directory separator.
 case $[0] in
   *[[\\/]]* ) as_myself=$[0] ;;
   *) _AS_PATH_WALK([],
@@ -423,6 +423,30 @@ m4_defun([AS_PREPARE],
 # This section is lexicographically sorted.
 
 
+# AS_CASE(WORD, [PATTERN1], [IF-MATCHED1]...[DEFAULT])
+# 
+# Expand into
+# | case WORD in
+# | PATTERN1) IF-MATCHED1 ;;
+# | ...
+# | *) DEFAULT ;;
+# | esac
+m4_define([_AS_CASE],
+[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
+   [$#], 1, [  *) $1 ;;],
+   [$#], 2, [  $1) m4_default([$2], [:]) ;;],
+   [  $1) m4_default([$2], [:]) ;;
+$0(m4_shiftn(2, $@))])dnl
+])
+m4_defun([AS_CASE],
+[m4_ifval([$2$3],
+[case $1 in
+_AS_CASE(m4_shift($@))
+esac
+])dnl
+])# AS_CASE
+
+
 # AS_EXIT([EXIT-CODE = 1])
 # 
 # Exit and set exit code to EXIT-CODE in the way that it's seen
@@ -470,30 +494,6 @@ fi
 ])# AS_IF
 
 
-# AS_CASE(WORD, [PATTERN1], [IF-MATCHED1]...[DEFAULT])
-# 
-# Expand into
-# | case WORD in
-# | PATTERN1) IF-MATCHED1 ;;
-# | ...
-# | *) DEFAULT ;;
-# | esac
-m4_define([_AS_CASE],
-[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
-   [$#], 1, [  *) $1 ;;],
-   [$#], 2, [  $1) m4_default([$2], [:]) ;;],
-   [  $1) m4_default([$2], [:]) ;;
-$0(m4_shiftn(2, $@))])dnl
-])
-m4_defun([AS_CASE],
-[m4_ifval([$2$3],
-[case $1 in
-_AS_CASE(m4_shift($@))
-esac
-])dnl
-])# AS_CASE
-
-
 # _AS_UNSET_PREPARE
 # -
 # AS_UNSET depends upon $as_unset: compute it.
@@ -652,6 +652,53 @@ m4_define([AS_ERROR],
 # This section is lexicographically sorted.
 
 
+# AS_BASENAME(FILE-NAME)
+# --
+# Simulate the command 'basename FILE-NAME'.  Not all systems have basename.
+# Also see the comments for AS_DIRNAME.
+
+m4_defun([AS_BASENAME_EXPR],
+[AS_REQUIRE([_AS_EXPR_PREPARE])dnl
+$as_expr X/[]$1 : '.*/\([[^/][^/]*]\)/*$' \| \
+X[]$1 : 'X\(//\)$' \| \
+X[]$1 : 'X\(/\)' \| \
+. : '\(.\)'])
+
+m4_defun([AS_BASENAME_SED],
+[echo X/[]$1 |
+sed ['/^.*\/\([^/][^/]*\)\/*$/{
+   s//\1/
+   q
+ }
+ /^X\/\(\/\/\)$/{
+   s//\1/
+   q
+ }
+ /^X\/\(\/\).*/{
+   s//\1/
+   q
+ }
+ s/.*/./; q']])
+
+m4_defun([AS_BASENAME],
+[AS_REQUIRE([_$0_PREPARE])dnl
+$as_basename $1 ||
+AS_BASENAME_EXPR([$1]) 2>/dev/null ||
+AS_BASENAME_SED([$1])])
+
+
+# _AS_BASENAME_PREPARE
+# 
+# Avoid Solaris 9 /usr/ucb/basename, as `basename /' outputs an empty line.
+m4_defun([_AS_BASENAME_PREPARE],
+[if (basename /) >/dev/null 2>&1 &&

Re: Manual Spelling Fixes

2006-04-01 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Noah Misch on 3/31/2006 9:05 AM:
> In the interest of simplifying the job of spell-checking the manual, this 
> patch
> adds LocalWords for every word my dictionary (aspell 0.50.3) did not have.  I
> fixed up some inconsistencies and actual misspellings.
> 
> 2006-03-31  Noah Misch  <[EMAIL PROTECTED]>
> 
>   * doc/autoconf.texi: Use `Cygwin', `MinGW', and `license' consistently.
>   Append LocalWords so ispell-buffer passes cleanly.  Spelling fixes.

Looks okay to me.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFELqY684KuGfSFAYARAmgLAJ4gBPHwN6Ni1c/z7hWIDvC4uwu7wQCeLZee
7yoJQGsBSv7tpr2lsCayzOA=
=3aWj
-END PGP SIGNATURE-




Re: document AS_BASENAME

2006-04-01 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 4/1/2006 8:35 AM:
> Hello,
> 
>> Thanks for spotting that bug, but there's a simpler patch, [...]
> 
> depends of the definition of simplicity.  Eric's point probably was
> that "expr ." is simpler than "expr . : '\(.\)'"

Exactly.  Unless there is an expr that mishandles strings unless you use
the : operator, then my patch was correct and produces a smaller configure.

> 
>>  * lib/m4sugar/m4sh.m4 (AS_BASENAME_EXPR): Handle ///, , etc.
>>  correctly.  Problem reported by Eric Blake.
> 
> I believe the real problem behind this is that we have two implementations 
> of basename: as an ``expr'' expression and as a Sed program, and each of
> them tries to handle all the corner cases.
> 
> I think it would be simpler to handle the corner cases once, by a shell
> ``case,'' and use expr||sed only for the non-trivial one.

I like the idea.  Nits below.

> @@ -649,12 +649,12 @@
>  ## 4. Portable versions of common tools.  ##
>  ## -- ##
>  
> -# This section is lexicographically sorted.
> -

Why not sort it?  I just posted a patch along this line in another mail.

>  m4_defun([AS_DIRNAME],
> -[(dirname $1) 2>/dev/null ||
> -AS_DIRNAME_EXPR([$1]) 2>/dev/null ||
> -AS_DIRNAME_SED([$1])])
> +[AS_REQUIRE([_AS_EXPR_PREPARE])dnl
> +AS_CASE([$1],
> +  [[*[!/]/*[!/]*]],

Are negated character classes portable?

> +[(dirname $1) 2>/dev/null ||
> + $as_expr X[]$1 : 'X\(.*[[^/]]\)//*[[^/][^/]]*/*$' 2>/dev/null ||
> + echo X[]$1 | sed ['s|^X\(.*[^/]\)//*[^/][^/]*/*$|\1|p']],
> +  [[//|//[!/]*]],
> +[(dirname $1) 2>/dev/null || echo //],

Save a process.  I would just blindly echo, rather than trying to use
dirname here.  After all, on systems where // is not special, it is still
a correct output, even if it doesn't match dirname.

> +  [/*], [echo /],
> +  [echo .])])
>  
>  
>  # AS_BASENAME(FILE-NAME)
>  # --
>  # Simulate the command 'basename FILE-NAME'.  Not all systems have basename.
> +# Try to respect the platform specific behavior for // and the empty string.
>  # Also see the comments for AS_DIRNAME.
> +AS_REQUIRE([_AS_EXPR_PREPARE])dnl
> +AS_CASE([$1],
> +  [[*[!/]*]],
> +[$as_basename $1 ||
> + $as_expr X/[]$1 : '.*/\([[^/][^/]*]\)/*$' 2>/dev/null ||
> + echo X/[]$1 | sed ['s|^.*/\([^/][^/]*\)/*$|\1|']],
> +  [//], [$as_basename $1 || echo //],

Likewise - just echo // rather than trying basename.

> +  [''], [$as_basename $1 || echo .],

This bothers me a bit.  Normally, if "$file" does not exist, then 'cd
`dirname "$file"`; ls `basename "$file"`' will also fail.  But by making
the empty string evaluate to a valid filename, you are violating this
assumption.  GNU basename intentionally makes the empty string return the
empty string, for the safety factor of catching empty input filenames.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFELq6z84KuGfSFAYARArXaAJ0XLIh6iZYj+uSqRNEujiuUnWYK9wCg06SD
d0/POBq4YySuSFdfwqePQ6A=
=JKYM
-END PGP SIGNATURE-




Re: document AS_BASENAME

2006-04-01 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 4/1/2006 8:35 AM:
> I think it would be simpler to handle the corner cases once, by a shell
> ``case,'' and use expr||sed only for the non-trivial one.
> 
> 
>   * lib/m4sugar/m4sh.m4 (AS_DIRNAME): Reimplement using AS_CASE.
>   (AS_BASENAME): Likewise.
>   (AS_DIRNAME_EXPR, AS_DIRNAME_SED, AS_BASENAME_EXPR, AS_BASENAME_SED):
> Nuke.
>   * tests/m4sh.at (AS_DIRNAME, AS_BASENAME): Do not test the removed
> macros.

Also, if we are handling the special cases up front, then we can guarantee
that we are no longer calling 'basename /'.  If we decide to take the
approach of your patch, then _AS_BASENAME_PREPARE becomes extraneous, and
you should delete it (since we would be removing the one reason we avoid a
platform basename).

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFELrFi84KuGfSFAYARApWyAJ9tEuq6x9KqAZb4hgCGUaaPBgu0JQCfbIrb
Hc60LkPDc2xAZqT84o08qJk=
=1N4R
-END PGP SIGNATURE-




Re: document AS_BASENAME

2006-04-01 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 4/1/2006 10:13 AM:
> 
> 2) I'm not sure "basename /" is the only bug around.  The code shall be
> interpreted this way:
> 
>   "If it handles even basename /, we can hopefully trust it."
> 
> Thus I think it would be too adventurous to start using the buggy basename
> implementations right now, before the release.

True.

> 
> 3) Pre-computing the as_basename variable saves a subshell in each
> AS_BASENAME call with a non-trivial argument.  So _AS_BASENAME_PREPARE is
> an efficiency issue, too.  (I even considered adding _AS_DIRNAME_PREPARE.)

That's the clincher.  Actually, AS_DIRNAME is expanded more frequently
than AS_BASENAME in coreutils' configure, so I retract my previous
objection to leaving _AS_BASENAME_PREPARE, and would welcome the addition
of _AS_DIRNAME_PREPARE.

(I do some compatibility development on cygwin running on an old 266 MHz
Win98 machine, where every fork takes a full second of wall clock time, so
I know first hand how avoiding extra forks can speed up a shell script.)

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFELtEC84KuGfSFAYARAv0wAJ9tRj/QjDW8RJyu/mkVCFmXguYuHwCfS03K
xTeEe/jzQpp3VBq/zhNXKpM=
=wqnG
-END PGP SIGNATURE-




Re: clean up m4sh.m4, then optimize AS_PATH_WALK

2006-04-01 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 4/1/2006 11:35 AM:
>>  * lib/m4sugar/m4sh.m4: Sort sections as implied by the comments,
>>  and fix some typos.
> 
> I committed both of these, modifying the ``Sort'' one a bit:
> - I made sure there are two empty lines between the individual macros.
> - I moved _AS_MKDIR_P_PREPARE after _AS_MKDIR_P.  (Well, this might
>   have been a mistake, but it's not worth fixing it.)
> The exact form of that patch is attached to this post.

Thanks for the cleanup.

> 
>> 2006-04-01  Eric Blake  <[EMAIL PROTECTED]>
>>
>>  * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Optimize non-existant
>>  directories, unless optional third argument supplied.
>>  (AS_UNAME): Don't optimize PATH walk.

Bah - one patch fixes typos, the other adds them!  How about this followup
(I don't think an extra ChangeLog entry is warranted, since one typo is in
the ChangeLog, and the other is part of what was already documented as
changed today).  I don't have CVS write access to autoconf yet, although
my papers are on file - maybe it's time for me to be given access?

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFELtJp84KuGfSFAYARAk1gAKCBKQq4T7Lcl+GrWxlSU5jTaeqF9gCdHtxE
gN6YOiCJO8TNkudHkPRM8PI=
=i1i0
-END PGP SIGNATURE-
Index: ChangeLog
===
RCS file: /sources/autoconf/autoconf/ChangeLog,v
retrieving revision 1.2753
diff -u -p -r1.2753 ChangeLog
--- ChangeLog   1 Apr 2006 18:33:24 -   1.2753
+++ ChangeLog   1 Apr 2006 19:10:28 -
@@ -1,6 +1,6 @@
 2006-04-01  Eric Blake  <[EMAIL PROTECTED]>
 
-   * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Optimize non-existant
+   * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Optimize nonexistent
directories, unless optional third argument supplied.
(AS_UNAME): Don't optimize PATH walk.
 
Index: lib/m4sugar/m4sh.m4
===
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.169
diff -u -p -r1.169 m4sh.m4
--- lib/m4sugar/m4sh.m4 1 Apr 2006 18:32:10 -   1.169
+++ lib/m4sugar/m4sh.m4 1 Apr 2006 19:10:28 -
@@ -927,7 +927,7 @@ fi
 
 # _AS_PATH_WALK([PATH = $PATH], BODY, [NO-OPTIMIZE])
 # --
-# Walk through PATH running BODY for each `as_dir'.  Skip non-existent
+# Walk through PATH running BODY for each `as_dir'.  Skip nonexistent
 # directories unless NO-OPTIMIZE is specified.
 #
 # Still very private as its interface looks quite bad.


THANKS update

2006-04-03 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'm feeling left out (does anyone have a good script that can scan
ChangeLog to find anyone else that is inadvertantly left out?)

2006-04-03  Eric Blake  <[EMAIL PROTECTED]>

* THANKS: Add myself.

Index: THANKS
===
RCS file: /sources/autoconf/autoconf/THANKS,v
retrieving revision 1.129
diff -u -p -r1.129 THANKS
- --- THANKS  20 Feb 2006 08:50:33 -  1.129
+++ THANKS  3 Apr 2006 13:01:51 -
@@ -57,6 +57,7 @@ Eli Zaretskii   [EMAIL PROTECTED]
 Enrique Robledo Arnuncio[EMAIL PROTECTED]
 Erez Zadok  [EMAIL PROTECTED]
 Eric Backus [EMAIL PROTECTED]
+Eric Blake  [EMAIL PROTECTED]
 Eric Mumpower   [EMAIL PROTECTED]
 Eric Sunshine   [EMAIL PROTECTED]
 Ezra Peisach[EMAIL PROTECTED]

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEMR0N84KuGfSFAYARAla/AKCpa2E3fSl5hjhfLqw1bPJbxfO7GwCfWuaN
/r2iQPkZxV+EoRm2V+MEuuI=
=mq5Y
-END PGP SIGNATURE-




Re: clean up m4sh.m4, then optimize AS_PATH_WALK

2006-04-03 Thread Eric Blake
> > So this patch was not only not fixing a bug, but merely an optimization,
> > but also introducing a bug.
> >
> > Please leave the introduction of bugs to post 2.60 for now, unless you
> > also fix actual bugs.  Micro-optimization doesn't count for the latter.

Sorry about that - I guess I had not thought about the full consequences
of changing semantics of a core macro, especially this close to a release,
when my only goal was a faster configure file.

> 
> But we can do better!  We can optimize out _all_ extra forks for nonexistent
> shells!  I hope you will count this as a bug fix!  :-)

I'll leave that to Ralf or others to decide.

> 
> > * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Optimize nonexistent
> > directories, unless optional third argument supplied.
> > (AS_UNAME): Don't optimize PATH walk.
> 
> On a second thought, I shouldn't have accepted that patch.
> If any caller needs to skip nonexistent directories, he can do so by
> insering the command
>   test -d "$ac_dir" || continue
> to the beginning of the second parameter.

Fair enough.  Go ahead and revert my patch (but your proposed patch
is too small - you also need to revert my comment changes).

-- 
Eric Blake




Re: maintainer checks

2006-04-04 Thread Eric Blake
> also some rules are not so useful (the `space tab' combination
> is used several times correctly in some macros).

Consider the trick I used here, for IFS in m4sh.m4:
http://lists.gnu.org/archive/html/autoconf-patches/2006-04/msg8.html

If space-tab is really a requirement of the macro, it must be quoted
to be protected to the shell.  Therefore, we should always be able
to break the quoting into two pieces, so that there is no longer a
space-tab in the .m4 file.

-- 
Eric Blake




Re: _AC_CACHE_DUMP simplified

2006-04-04 Thread Eric Blake
> 
> Can we avoid 'sed' and 'grep' entirely?  How about this instead?
> 
> case `(ac_space=' '; set) 2>&1` in
> *'
> ac_space= '*)

Are we sure ac_space is not first in the environment, or do we
need something like:

case $as_nl`(ac_space=' '; set) 2>&1` in
*${as_nl}ac_space=\ *)

This is still not robust to something in the environment such
as 'ac_spac="${as_nl}ac_space= "', but the probability of
configuring in an environment that polluted is too small to
be worried about (since we already have a tough time
handling newlines in the environment).

-- 
Eric Blake




Re: autotest fails when pwd is testgroup directory

2006-04-05 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 4/1/2006 9:15 AM:
> Hello,
>   I committed Eric's patch, but I added a line of comment to the AT_INIT
> code, see below.
> +++ lib/autotest/general.m4   1 Apr 2006 16:09:13 -   1.200
> @@ -699,7 +699,8 @@
>   find $at_group_dir -type d ! -perm -700 -exec chmod u+rwx \{\} \;
>   rm -fr $at_group_dir
>fi
> -  mkdir $at_group_dir ||
> +  # Be tolerant if the above `rm' was not able to remove the directory.
> +  AS_MKDIR_P([$at_group_dir]) ||
>   AS_ERROR([cannot create $at_group_dir])

I just noticed that AS_MKDIR_P already does AS_ERROR (fatal to the script)
if it fails, so the AS_ERROR in autotest/general.m4 is now redundant with
the one built in to m4sh.m4.  Also, should we document AS_ERROR and
friends in autoconf.texi?  Also, AS_MKDIR_P is not threadsafe if mkdir -p
is not supported, is that a problem?

How about this followup patch for the redundancy in autotest:

2006-04-05  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.texi (Programming in M4sh): Document that
AS_MKDIR_P exits the script on failure.
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE, AS_MESSAGE, AS_WARN)
(AS_ERROR, AS_MKDIR_P, _AS_DIRNAME_PREPARE, _AS_MKDIR_P_PREPARE)
(_AS_TR_*PREPARE): Improve documentation.
* lib/autotest/general.m4: Remove redundant AS_ERROR.  Cleanup
space followed by tab.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEM8Rp84KuGfSFAYARAs8QAKDUpzKSWUKstgXMA51wMnqrKIYeugCfSiPp
4rLL4qSq4F/h3euu3nZkIe4=
=qVGK
-END PGP SIGNATURE-
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.982
diff -u -p -r1.982 autoconf.texi
--- doc/autoconf.texi   3 Apr 2006 08:06:22 -   1.982
+++ doc/autoconf.texi   5 Apr 2006 13:18:11 -
@@ -9451,7 +9451,8 @@ except that it is portable to older vers
 lack support for the @option{-p} option.  Also, @code{AS_MKDIR_P}
 succeeds if @var{file-name} is a symbolic link to an existing directory,
 even though Posix is unclear whether @samp{mkdir -p} should
-succeed in that case.
+succeed in that case.  If creation of @var{file-name} fails, exit the
+script.
 @end defmac
 
 @defmac AS_SHELL_SANITIZE
Index: lib/autotest/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.202
diff -u -p -r1.202 general.m4
--- lib/autotest/general.m4 3 Apr 2006 04:47:02 -   1.202
+++ lib/autotest/general.m4 5 Apr 2006 13:18:12 -
@@ -388,16 +388,16 @@ dnl Process *=* last to allow for user s
 m4_divert_push([PARSE_ARGS_END])dnl
 
 *=*)
-   at_envvar=`expr "x$at_option" : 'x\([[^=]]*\)='`
-   # Reject names that are not valid shell variable names.
-   expr "x$at_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
- AS_ERROR([invalid variable name: $at_envvar])
-   at_value=`echo "$at_optarg" | sed "s/'/'''/g"`
-   eval "$at_envvar='$at_value'"
-   export $at_envvar
+   at_envvar=`expr "x$at_option" : 'x\([[^=]]*\)='`
+   # Reject names that are not valid shell variable names.
+   expr "x$at_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
+ AS_ERROR([invalid variable name: $at_envvar])
+   at_value=`echo "$at_optarg" | sed "s/'/'''/g"`
+   eval "$at_envvar='$at_value'"
+   export $at_envvar
# Propagate to debug scripts.
-   at_debug_args="$at_debug_args $at_option"
-   ;;
+   at_debug_args="$at_debug_args $at_option"
+   ;;
 
  *) echo "$as_me: invalid option: $at_option" >&2
echo "Try \`$[0] --help' for more information." >&2
@@ -700,8 +700,7 @@ do
rm -fr $at_group_dir
   fi
   # Be tolerant if the above `rm' was not able to remove the directory.
-  AS_MKDIR_P([$at_group_dir]) ||
-   AS_ERROR([cannot create $at_group_dir])
+  AS_MKDIR_P([$at_group_dir])
   cd $at_group_dir
   ;;
   esac
@@ -743,7 +742,7 @@ m4_divert_push([TESTS_END])[]dnl
run. This means that test suite is improperly designed.  Please
report this failure to .
 _ATEOF
-   echo "$at_setup_line" >"$at_check_line_file"
+   echo "$at_setup_line" >"$at_check

empty test suite

2006-04-05 Thread Eric Blake
Low hanging fruit (I was actually surprised it was this easy).

2006-04-05  Eric Blake  <[EMAIL PROTECTED]>

* lib/autotest/general.m4 (AT_INIT): Prep AT_*_all, so that an
empty test suite works.
* tests/autotest.at (Empty test suite): Remove xfail.

Index: tests/autotest.at
===
RCS file: /sources/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.10
diff -u -b -r1.10 autotest.at
--- tests/autotest.at   14 Mar 2006 07:20:15 -  1.10
+++ tests/autotest.at   5 Apr 2006 15:54:12 -
@@ -78,11 +78,11 @@
 ## Empty test suite.  ##
 ## -- ##
 
-# This is not a sensible thing to do, but the user should not get a unhelpful
-# error message, which is what happens presently.
+# This is not a sensible thing to do, but the user should not get an unhelpful
+# error message.
 AT_CHECK_AT([Empty test suite],
 [[AT_INIT([empty test suite])
-]], [:])
+]])
 
 
 ## - ##
Index: lib/autotest/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.202
diff -u -b -r1.202 general.m4
--- lib/autotest/general.m4 3 Apr 2006 04:47:02 -   1.202
+++ lib/autotest/general.m4 5 Apr 2006 15:46:31 -
@@ -172,6 +172,8 @@
  m4_defn([AT_PACKAGE_STRING])[ test suite]m4_ifval([$1], [: $1]))
 m4_define([AT_ordinal], 0)
 m4_define([AT_banner_ordinal], 0)
+m4_define([AT_groups_all], [])
+m4_define([AT_help_all], [])
 AS_INIT
 AT_COPYRIGHT(
 [Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software






Re: maintainer checks

2006-04-05 Thread Eric Blake
Hi Ralf,
> 
> I have applied the two attached patches.
>   * TODO, config/Makefile.am, lib/freeze.mk, lib/autoconf/c.m4,
>   lib/autoconf/specific.m4, lib/autoconf/status.m4,
>   lib/autoconf/types.m4, lib/autotest/general.m4,
>   tests/mktests.sh, tests/torture.at: White space cleanup:
>   remove some SPACE before TAB, or add quoting ('' or @&t@).

Thanks for the cleanup.  However, I wonder if you got everything
right - I did this:
cvs diff -Bw -D 'Apr 5 11am' -D 'Apr 5 3 pm'
to see just the quoting changes in your changset, and noticed
the following:

> +++ lib/autoconf/status.m4  5 Apr 2006 20:55:14 -   1.91
> @@ -606,14 +606,14 @@ uniq confdefs.h |
>sed -n '
> t rset
> :rset
> -   s/^[]*#[]*define[   ][   ]*//
> +   s/^[ '' ]*#[ '' ]*define[ ''][   ]*//

only 3 of the four brackets were re-quoted here...

@@ -641,8 +641,8 @@ do
   dnl Quote, for the `[ ]' and `define'.
   echo ['# First, check the format of the line:
 cat >"$tmp/defines.sed" <

Re: autotest fails when pwd is testgroup directory

2006-04-05 Thread Eric Blake
Hi Ralf,
> > 
> > I just noticed that AS_MKDIR_P already does AS_ERROR (fatal to the script)
> > if it fails,
> 
> Which sucks, frankly.  Another badly designed interface that now is less
> generally usable than it could be.  And we have to stick to it because
> 2.59 has it, too.  Wish we had chosen a worse name..

Here's where an interface change might work.  Would this proposal
be acceptable:

# AS_MKDIR_P(dir, [allow-fail])
#--
# Ensure that DIR exists, possibly as a symlink, and create
# it and all intermediate directories if necessary.  On failure,
# return the status if the optional ALLOW-FAIL is not blank;
# otherwise issue an error message and terminate the shell.

Or even something like:
# AS_MKDIR_P(dir, [action-if-fail = AS_ERROR])
#---
# Ensure that DIR exists, possibly as a symlink, and create
# it and all intermediate directories if necessary.  On failure,
# invoke ACTION-IF-FAIL, which defaults to printing an
# error message and terminating the shell if not specified.

Either way, it should be easy to change the m4 implementation
to add the optional $2 argument which would let code avoid
the AS_ERROR in AS_MKDIR_P.

-- 
Eric Blake




Re: _AC_COMPILER_EXEEXT cleanup

2006-04-06 Thread Eric Blake
Stepan Kasal  ucw.cz> writes:

> 2006-04-01  Stepan Kasal   ucw.cz>
> 
>   Clean up _AC_COMPILER_EXEEXT* macros.
> 
>   * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Don't try to
>   (_AC_COMPILER_EXEEXT_O): Don't export ac_cv_exeext, it's not needed (or
> no longer needed) by libtool.  Make it a cache check.

This patch broke many macros on cygwin, because EXEEXT was being set to '' 
instead of '.exe'.  Please apply the followup:

2006-04-06  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_O): Inside cache
check, s/ac_exeext/ac_cv_exeext/.  Fixes regression introduced
2006-04-01.

Index: lib/autoconf/lang.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/lang.m4,v
retrieving revision 1.178
diff -u -b -r1.178 lang.m4
--- lib/autoconf/lang.m46 Apr 2006 11:24:00 -   1.178
+++ lib/autoconf/lang.m46 Apr 2006 18:07:32 -
@@ -542,7 +542,7 @@
   test -f "$ac_file" || continue
   case $ac_file in
_AC_COMPILER_EXEEXT_REJECT ) ;;
-   *.* ) ac_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
+   *.* ) ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
  break;;
* ) break;;
   esac

-- 
Eric Blake







Re: autotest fails when pwd is testgroup directory

2006-04-06 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Noah Misch on 4/5/2006 8:10 AM:
> 
>> Also, should we document AS_ERROR and friends in autoconf.texi?
> 
> I don't have an opinion on this.

Ralf mentioned AC_MSG_ERROR, but that has different semantics (exit
autoconf, not configure).  So, (in a separate patch), here is a first cut
at documenting another portion of m4sh.

> 
>> Also, AS_MKDIR_P is not threadsafe if mkdir -p is not supported, is that a
>> problem?
> 
> This does not matter for Autoconf.

I improved my documentation attempt to try to capture this idea.

> 
> 
>> 2006-04-05  Eric Blake  <[EMAIL PROTECTED]>
>>
>>  * doc/autoconf.texi (Programming in M4sh): Document that
>>  AS_MKDIR_P exits the script on failure.
> 
> This part is fine.

Resubmitted.

> 
>>  * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE, AS_MESSAGE, AS_WARN)
>>  (AS_ERROR, AS_MKDIR_P, _AS_DIRNAME_PREPARE, _AS_MKDIR_P_PREPARE)
>>  (_AS_TR_*PREPARE): Improve documentation.
> 
> These changes don't clarify much.

Is it worth resending that as a separate patch, so that all functions in
m4sh.m4 are consistently documented?  For now, I am not resubmitting
without further consensus.

> 
> You took a very simple change and expanded its diff by a factor of nine 
> through
> unrelated comment updates and white space cleanups.  Please avoid that.

Sorry about that.

2006-04-06  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.texi (Programming in M4sh): Document that
AS_MKDIR_P exits the script on failure.
* lib/autotest/general.m4: Remove redundant AS_ERROR.

2006-04-06  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.text (Programming in M4sh): Slightly weaken the
    disclaimer about using m4sh.  Document AS_ERROR, AS_MESSAGE, and
AS_WARN.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFENeMR84KuGfSFAYARAoV4AKDDi9VU9Q1zijsuZlruaO8EMFSLhQCeOi8W
E/Al+L9ZSaHUyJBhDNPyWxk=
=NbmD
-END PGP SIGNATURE-
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.986
diff -u -p -r1.986 autoconf.texi
--- doc/autoconf.texi   6 Apr 2006 17:51:22 -   1.986
+++ doc/autoconf.texi   7 Apr 2006 03:31:46 -
@@ -9462,6 +9462,15 @@ lack support for the @option{-p} option.
 succeeds if @var{file-name} is a symbolic link to an existing directory,
 even though Posix is unclear whether @samp{mkdir -p} should
 succeed in that case.
+
+This version is not necessarily thread-safe; see @pxref{Limitations of
+Usual Tools} for more details.  However, since @code{configure} is not
+generally run in parallel with other processes trying to create the same
+directory tree, this is normally not a problem.  If creation of
[EMAIL PROTECTED] fails, this macro prints an error message and exits the
+script.
[EMAIL PROTECTED] FIXME The AS_MKDIR_P interface should be enhanced post 2.60 
to allow
[EMAIL PROTECTED] the user to handle failure themselves, rather than always 
exiting.
 @end defmac
 
 @defmac AS_SHELL_SANITIZE
Index: lib/autotest/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.204
diff -u -p -b -r1.204 general.m4
--- lib/autotest/general.m4 5 Apr 2006 20:55:14 -   1.204
+++ lib/autotest/general.m4 7 Apr 2006 03:31:48 -
@@ -702,8 +702,7 @@ do
rm -fr $at_group_dir
   fi
   # Be tolerant if the above `rm' was not able to remove the directory.
-  AS_MKDIR_P([$at_group_dir]) ||
-   AS_ERROR([cannot create $at_group_dir])
+  AS_MKDIR_P([$at_group_dir])
   cd $at_group_dir
   ;;
   esac
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.986
diff -u -p -r1.986 autoconf.texi
--- doc/autoconf.texi   6 Apr 2006 17:51:22 -   1.986
+++ doc/autoconf.texi   7 Apr 2006 03:53:28 -
@@ -9400,10 +9400,10 @@ A mess; trouble.  [Obs.] --Beau.@: & Fl.
 @end quotation
 
 
-For the time being, it is not mature enough to be widely used.
-
 M4sh provides portable alternatives for some common shell constructs
-that unfortunately are not portable in practice.
+that unfortunately are not portable in practice.  Some of these
+interfaces are still under development, and may change in future
+releases, but those documented here will continue to be supported.
 
 @defmac AS_BASENAME (@var{file-name})
 @asindex{BASENAME}
@@ -9434,

Re: autotest fails when pwd is testgroup directory

2006-04-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake on 4/6/2006 9:57 PM:
> 
> Ralf mentioned AC_MSG_ERROR, but that has different semantics (exit
> autoconf, not configure).  So, (in a separate patch), here is a first cut
> at documenting another portion of m4sh.

It must have been late when I wrote that - I was obviously wrong about the
two having different semantics, since autoconf/general.m4 simply does
m4_copy([AS_ERROR], [AC_MSG_ERROR]).  There is still the issue of whether
we should document m4sh macros for standalone use in other scripts, but
recommend the AC_MSG variants when writing configure scripts, but without
more consensus, this patch is not ready for primetime yet.

> 2006-04-06  Eric Blake  <[EMAIL PROTECTED]>
> 
>   * doc/autoconf.text (Programming in M4sh): Slightly weaken the
>   disclaimer about using m4sh.  Document AS_ERROR, AS_MESSAGE, and
>   AS_WARN.
> 

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFENloA84KuGfSFAYARAm0HAKDJkTf885USzin19bcvtjrQ9rAk/gCgju1y
/Ak8DuhfbRMwTfWO+no6gXI=
=Qq0z
-END PGP SIGNATURE-




const/volatile vs. -Werror

2006-04-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

This patch allows:
./testsuite -d -k 'C keywords' CFLAGS='-Wall -Werror'
to succeed with gcc 3.4.4.  There were so many tests in AC_C_CONST, some
with duplicate names but different scopes, that I relettered the local
variables.

2006-04-07  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/c.m4 (AC_C_CONST, AC_C_VOLATILE): Avoid warnings
from gcc.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFENl8e84KuGfSFAYARAvT9AKDUfbeg3MN4SsDp2nwuLDBO8vjjQQCdHhCF
DLe+ZwXqXaPXIjSaFUV+Qjc=
=8MwQ
-END PGP SIGNATURE-
Index: lib/autoconf/c.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.220
diff -u -p -r1.220 c.m4
--- lib/autoconf/c.m4   6 Apr 2006 11:24:00 -   1.220
+++ lib/autoconf/c.m4   7 Apr 2006 12:31:32 -
@@ -1439,47 +1439,43 @@ AC_DEFUN([AC_C_CONST],
 #ifndef __cplusplus
   /* Ultrix mips cc rejects this.  */
   typedef int charset[2];
-  const charset x;
+  const charset a;
   /* SunOS 4.1.1 cc rejects this.  */
   char const *const *ccp;
   char **p;
   /* NEC SVR4.0.2 mips cc rejects this.  */
   struct point {int x, y;};
-  static struct point const zero = {0,0};
+  static struct point const b = {0,0};
   /* AIX XL C 1.02.0.0 rejects this.
  It does not let you subtract one const X* pointer from another in
  an arm of an if-expression whose if-part is not a constant
  expression */
-  const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
+  const char *c = "string";
+  ccp = &c + (c ? c-c : 0);
   /* HPUX 7.0 cc rejects these. */
   ++ccp;
   p = (char**) ccp;
   ccp = (char const *const *) p;
-  { /* SCO 3.2v4 cc rejects this.  */
-char *t;
-char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-*t++ = 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-int x[] = {25, 17};
-const int *foo = &x[0];
-++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+  /* SCO 3.2v4 cc rejects this.  */
+  char *d;
+  char const *e = 0 ? (char *) 0 : (char const *) 0;
+  *d++ = 0;
+  /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+  int f[] = {25, 17};
+  const int *g = &f[0];
+  ++g;
+  /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
 typedef const int *iptr;
-iptr p = 0;
-++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
+  iptr h = 0;
+  ++h;
+  /* AIX XL C 1.02.0.0 rejects this saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
 struct s { int j; const int *ap[3]; };
-struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-const int foo = 10;
-  }
+  struct s *i; i->j = 5;
+  /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+  const int j = 10;
+  /* Refer to all variables to avoid compiler warnings.  */
+  return !a[0] && !b.x && !c && !d && !e && !f && !g && !h && !i->j && !j;
 #endif
 ]])],
   [ac_cv_c_const=yes],
@@ -1546,8 +1542,9 @@ AN_IDENTIFIER([volatile], [AC_C_VOLATILE
 AC_DEFUN([AC_C_VOLATILE],
 [AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
-volatile int x;
-int * volatile y;])],
+volatile int x = 0;
+int * volatile y = (int *) 0;
+return !x && !y;])],
   [ac_cv_c_volatile=yes],
   [ac_cv_c_volatile=no])])
 if test $ac_cv_c_volatile = no; then



Re: const/volatile vs. -Werror

2006-04-07 Thread Eric Blake
Hi Ralf.

> > This patch allows:
> > ./testsuite -d -k 'C keywords' CFLAGS='-Wall -Werror'
> > to succeed with gcc 3.4.4.  There were so many tests in AC_C_CONST, some
> > with duplicate names but different scopes, that I relettered the local
> > variables.
> 
> Eric, please make my life easier and resubmit a *minimal* patch
> that allows me to quickly see what's going on.  No renaming.

Understood.  The resubmittal is now 5 insertions, 1 deletion, per
diffstat.

> 
> Let's put this in a bit stronger words: until the alpha release,
> I will reject any non-minimal patch for new stuff, even bugfixes.
> I don't have unlimited time, and I don't want this release to
> take unlimited time, and after 2.60 there'll be enough time for
> everyone to do cleanup patches and thus introduce new bugs.

This resubmittal is tested with
./testsuite -d -k 'C keywords' CFLAGS='-std=c89 -Wall -Werror'
and fixes the C89 regression I made in the first version.  I
understand if you decide to delay this patch until after the alpha
release, since it only helps the corner case of configuring with
-Werror.

In the process, it pointed out a couple of bugs with autotest;
a followup post will give details and a patch for one of
the two issues.

2006-04-07  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/c.m4 (AC_C_CONST, AC_C_VOLATILE): Avoid warnings
from gcc.

 Index: lib/autoconf/c.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.220
diff -u -p -r1.220 c.m4
--- lib/autoconf/c.m4   6 Apr 2006 11:24:00 -   1.220
+++ lib/autoconf/c.m4   7 Apr 2006 21:40:05 -
@@ -1461,6 +1461,7 @@ AC_DEFUN([AC_C_CONST],
 char const *s = 0 ? (char *) 0 : (char const *) 0;
 
 *t++ = 0;
+if (s) return 0;
   }
   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
 int x[] = {25, 17};
@@ -1479,7 +1480,9 @@ AC_DEFUN([AC_C_CONST],
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
 const int foo = 10;
+if (!foo) return 0;
   }
+  return !x[0] && !zero.x;
 #endif
 ]])],
   [ac_cv_c_const=yes],
@@ -1547,7 +1550,8 @@ AC_DEFUN([AC_C_VOLATILE],
 [AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
 volatile int x;
-int * volatile y;])],
+int * volatile y = (int *) 0;
+return !x && !y;])],
   [ac_cv_c_volatile=yes],
   [ac_cv_c_volatile=no])])
 if test $ac_cv_c_volatile = no; then




autotest annoyances

2006-04-07 Thread Eric Blake
While testing my previous patch for const/volatile vs. -Werror, I encountered
two autotest anomalies.  I first enhanced the testsuite to detect both
problems, as well as my earlier patch this week for when removing
the test group directory fails.

The first bug was that when using the -d option to testsuite (which is done by
all the testsuite.dir/###/run scripts), the run script was only regenerated
if the test failed (it was missing after a success or skip).  I also managed
to come up with a patch for this.

The second bug is that environment variables passed as options to ./testsuite
are copied directly into the run scripts, but without regards for shell
metacharacters.  That means that an environment variable that contains
spaces, such as "./run CFLAGS='-std=c89 -Werror'", will regenerate a broken
run script that tries to invoke 'testsuite CFLAGS=-std=c89 -Werror'.  However,
fixing this quickly and safely is beyond my abilities, with a pending alpha
release, so the test is just xfailed for now.

2006-04-07  Eric Blake  <[EMAIL PROTECTED]>

* tests/autotest.at (AT_CHECK_AT_START): New macro, split out
from...
(AT_CHECK_AT): ...here, for use in...
(Debugging a successful test, Debugging a failed test): ...these
new tests.  The first of these is fixed by...
* lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT): New
macro, split out from...
(AT_INIT): ...here, so that using -d also generates a run script.

Index: lib/autotest/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.206
diff -u -p -r1.206 general.m4
--- lib/autotest/general.m4 7 Apr 2006 18:31:09 -   1.206
+++ lib/autotest/general.m4 8 Apr 2006 00:57:29 -
@@ -162,6 +162,22 @@ m4_define([_AT_NORMALIZE_TEST_GROUP_NUMB
   done
 ])
 
+# _AT_CREATE_DEBUGGING_SCRIPT
+# ---
+# Create the debugging script $at_group_dir/run which will reproduce the
+# current test group.
+m4_define([_AT_CREATE_DEBUGGING_SCRIPT],
+[{
+   echo "#! /bin/sh"
+   echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"[EMAIL 
PROTECTED]"}'\''='\''"[EMAIL PROTECTED]"'\'''
+   echo "cd '$at_dir'"
+   echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$[0]" \
+'-v -d' "$at_debug_args" "$at_group" '${1+"[EMAIL PROTECTED]"}'
+   echo 'exit 1'
+ } >$at_group_dir/run
+ chmod +x $at_group_dir/run
+])# _AT_CREATE_DEBUGGING_SCRIPT
+
 
 # AT_INIT([TESTSUITE-NAME])
 # -
@@ -793,11 +809,12 @@ _ATEOF
  echo "$at_log_msg" >&AS_MESSAGE_LOG_FD
 
  # Cleanup the group directory, unless the user wants the files.
- $at_debug_p ||
-   if test -d $at_group_dir; then
- find $at_group_dir -type d ! -perm -700 -exec chmod u+rwx \{\} \;
- rm -fr $at_group_dir
-   fi
+ if $at_debug_p ; then
+   _AT_CREATE_DEBUGGING_SCRIPT
+ elif test -d $at_group_dir; then
+   find $at_group_dir -type d ! -perm -700 -exec chmod u+rwx \{\} \;
+   rm -fr $at_group_dir
+ fi
  ;;
*)
  # Upon failure, include the log into the testsuite's global
@@ -807,15 +824,7 @@ _ATEOF
 
  # Upon failure, keep the group directory for autopsy, and
  # create the debugging script.
- {
-   echo "#! /bin/sh"
-   echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"[EMAIL 
PROTECTED]"}'\''='\''"[EMAIL PROTECTED]"'\'''
-   echo "cd '$at_dir'"
-   echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$[0]" \
-'-v -d' "$at_debug_args" "$at_group" '${1+"[EMAIL PROTECTED]"}'
-   echo 'exit 1'
- } >$at_group_dir/run
- chmod +x $at_group_dir/run
+ _AT_CREATE_DEBUGGING_SCRIPT
  $at_errexit && break
  ;;
   esac
Index: tests/autotest.at
===
RCS file: /sources/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.11
diff -u -p -r1.11 autotest.at
--- tests/autotest.at   5 Apr 2006 16:04:22 -   1.11
+++ tests/autotest.at   8 Apr 2006 00:57:29 -
@@ -19,14 +19,15 @@ AT_BANNER([Autotest.])
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
-# A

Re: const/volatile vs. -Werror

2006-04-07 Thread Eric Blake

> > -int * volatile y;])],
> > +int * volatile y = (int *) 0;
> 
> Why is that initialization needed?  y is zero by default.

Actually, this code snippet occurs as the second argument to
AC_LANG_PROGRAM, meaning that they are local variables inside
main().  If y is not initialized, then it is indeterminate.  But if the
compiler doesn't warn about the reference to an indeterminate y,
then I don't mind simplifying this patch by not changing that line
(the warning I was attempting to fix was that y was not being
referenced).

-- 
Eric Blake




Re: autotest annoyances

2006-04-08 Thread Eric Blake
Hi Ralf,

> Instead of logically splitting up the check here, how about adding an
> argument, as below?  (I'm a bit unsure myself, but it looks somewhat
> cleaner this way, as it prevents the user from screwing up by forgetting
> the AT_CLEANUP inadvertently.)
> 
>  # AT_CHECK_AT(TITLE, SUITE-CODE, [XFAIL-CONDITION], [STATUS = 0],
> -# [STDOUT := ignore], STDERR)
> +# [STDOUT := ignore], STDERR, [POST-TEST-CODE])
>  # ---
>  # Create a new test named TITLE that runs a minimal Autotest test suite,
>  # SUITE-CODE.  Call AT_XFAIL_IF with XFAIL-CONDITION.  STATUS and STDERR pass
>  # directly to the AT_CHECK that call the minimal test suite.  STDOUT is not
> -# used, but it is reserved for future use.
> +# used, but it is reserved for future use.  Put additional toplevel tests
> +# code in POST-TEST-CODE.

I like your idea better.  I will resubmit with that paradigm.

More comments coming to your other reply.

-- 
Eric Blake




Re: autotest annoyances

2006-04-08 Thread Eric Blake
s of ac_configure_args selectively for config.status.
> A bit tricky, but it's possible.  (It's not safe against all kinds
> of uses of backslashes; that would require searching for an echo
> replacement like Libtool does.)

I'll start looking into this, but for now I will leave it as an xfail and
focus instead on the issues raised by the first bug.

-- 
Eric Blake




Re: autotest annoyances

2006-04-08 Thread Eric Blake
> 
> Obviously, this would also need more tests in autotest.at.
> And I think the first test can be tightened to test only
> missing ./run, instead of getting mixed up with invalid ./run,
>  even if my proposal [for fixing ./testsuite return codes] is
>  too invasive before the alpha release.

> So my resubmittal will have to touch up that documentation as well.
> I think that the best semantics is that running the debugging script
> regenerates the entire directory, including a fresh rebuild of ./run,
> and with a new timestamp for testsuite.log; but that since the
> re-run uses the same command line options, the same results
> should happen.
> 

Here is an updated version of my previous patch.  I have avoided
using environment variables when testing that ./run exists in the
first test, so that we don't get a pass for the wrong reason.  And
-d DOES inhibit logging, but only at the top-level (in order to
preserve the full log).  At the testgroup level, since the entire
testgroup directory is blown away, the testgroup log is regenerated
even when -d is specified.

2006-04-08  Eric Blake  <[EMAIL PROTECTED]>

* tests/autotest.at (AT_CHECK_AT): Add new argument, to allow
top-level tests after micro-suite has been run.   Used in...
(Debugging a successful test, Debugging script and environment),
(Debugging a failed test): ...these new tests.  The first of these
is fixed by...
* lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT): New
macro, split out from...
(AT_INIT): ...here, so that using -d also generates a run script.
Document that -d inhibits top-level logging.
* doc/autoconf.texi (testsuite Invocation): Document that -d only
inhibits top-level logging; debug scripts are created.

-- 
Eric Blake
Index: tests/autotest.at
===
RCS file: /sources/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.11
diff -u -p -r1.11 autotest.at
--- tests/autotest.at   5 Apr 2006 16:04:22 -   1.11
+++ tests/autotest.at   8 Apr 2006 18:38:37 -
@@ -20,12 +20,13 @@ AT_BANNER([Autotest.])
 # 02110-1301, USA.
 
 # AT_CHECK_AT(TITLE, SUITE-CODE, [XFAIL-CONDITION], [STATUS = 0],
-# [STDOUT := ignore], STDERR)
+# [STDOUT := ignore], STDERR, [POST-TEST-CODE])
 # ---
 # Create a new test named TITLE that runs a minimal Autotest test suite,
 # SUITE-CODE.  Call AT_XFAIL_IF with XFAIL-CONDITION.  STATUS and STDERR pass
 # directly to the AT_CHECK that call the minimal test suite.  STDOUT is not
-# used, but it is reserved for future use.
+# used, but it is reserved for future use.  Run POST-TEST-CODE
+# at the top level after the micro-suite has been run.
 m4_define([AT_CHECK_AT],
 [
 AT_SETUP([$1])
@@ -49,8 +50,9 @@ AT_DATA([mysuite.at], [$2])
 AT_CHECK_AUTOM4TE([--language=autotest -o micro-suite mysuite.at])
 AT_CHECK([$CONFIG_SHELL ./micro-suite],   m4_default([$4], 0), [ignore], 
[$6])
 AT_CHECK([$CONFIG_SHELL ./micro-suite -v -x], m4_default([$4], 0), [ignore], 
[$6])
+$7
 AT_CLEANUP
-])
+])# AT_CHECK_AT
 
 # AT_CHECK_AT_TEST(TITLE, SUITE-SNIPPET, ...)
 # ---
@@ -251,6 +253,51 @@ AT_CHECK_AT_TITLE_CHAR([Double-quote], [
 AT_CHECK_AT_TITLE_CHAR([Backslash],[\])
 
 
+## - ##
+## Debugging a test. ##
+## - ##
+
+AT_CHECK_AT_TEST([Debugging a successful test],
+  [AT_CHECK([:])], [], [], [], [ignore],
+[# Without options, when all tests pass, no test directory should exist.
+AT_CHECK([test -d micro-suite.dir/1 && exit 42
+  ./micro-suite -d 1], [], [ignore], [ignore])
+# Running with -d should leave a reproducible test group.
+# Also, running the test script from the test group locks the
+# directory from removal on some platforms; the script should still be
+# able to run even if rmdir fails.
+AT_CHECK([(cd micro-suite.dir/1 && ./run)], [], [ignore], [ignore])
+# Running a debugging script implies -d.
+AT_CHECK([(cd micro-suite.dir/1 && ./run)], [], [ignore], [ignore])
+])
+
+AT_CHECK_AT_TEST([Debugging script and environment],
+  [AT_CHECK([test "$MY_VAR" = pass || exit 42])],
+  [], [1], [], [ignore], [
+# Changing environment outside of debugging script is not preserved.
+AT_CHECK([(cd micro-suite.dir/1 && MY_VAR=pass ./run)],
+ [0], [ignore], [ignore])
+AT_CHECK([(cd micro-suite.dir/1 && ./run)],
+ [1], [ignore], [ignore])
+# Changing environment as argument to debugging script is preserved.
+AT_CHECK([(cd micro-suite.dir/1; ./run MY_VAR=pass)],
+ [0], [ignore], [ignore])
+AT_CHECK([(cd micro-suite.dir/1; ./run)],
+ [0], [ignore], [ignore])
+])
+
+# The run script is currently invalid when shell metacharacters are passed
+# in

testsuite buglet

2006-04-08 Thread Eric Blake
I think this patch:
http://lists.gnu.org/archive/html/autoconf-patches/2006-03/msg00067.html

was inadvertantly applied wrong (it put the test for $() on the `` tests, then
calls out the $() tests in the changelog).

2006-04-08  Eric Blake  <[EMAIL PROTECTED]>

* tests/autotest.at (Backquote command substitution),
(Multiline backquote command substitution): Remove mistaken
AT_NO_CMDSUBST, which was meant to be applied...
(Parenthetical command substitution, Multiline parenthetical
command substitution): here.
Index: tests/autotest.at
===
RCS file: /sources/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.11
diff -u -p -r1.11 autotest.at
--- tests/autotest.at   5 Apr 2006 16:04:22 -   1.11
+++ tests/autotest.at   8 Apr 2006 22:13:21 -
@@ -110,8 +110,7 @@ two
 
 AT_CHECK_AT_TEST([Backquote command substition],
   [AT_CHECK([echo `echo hi`], 0, [hi
-], [])],
-  [AT_NO_CMDSUBST])
+], [])])
 
 
 AT_CHECK_AT_TEST([Multiline backquote command substition],
@@ -120,12 +119,12 @@ bar
 ])
AT_CHECK([echo "`cat myfile`"], 0, [foo
 bar
-], [])],
-  [AT_NO_CMDSUBST])
+], [])])
 
 AT_CHECK_AT_TEST([Parenthetical command substition],
   [AT_CHECK([echo $(echo hi)], 0, [hi
-], [])])
+], [])],
+  [AT_NO_CMDSUBST])
 
 AT_CHECK_AT_TEST([Multiline parenthetical command substition],
   [AT_DATA([myfile],[foo
@@ -133,7 +132,8 @@ bar
 ])
AT_CHECK([echo "$(cat myfile)"], 0, [foo
 bar
-], [])])
+], [])],
+  [AT_NO_CMDSUBST])
 
 
 ## - ##
@@ -251,6 +253,51 @@ AT_CHECK_AT_TITLE_CHAR([Double-quote], [
 AT_CHECK_AT_TITLE_CHAR([Backslash],[\])
 
 
+## - ##
+## Debugging a test. ##
+## - ##
+
+AT_CHECK_AT_TEST([Debugging a successful test],
+  [AT_CHECK([:])], [], [], [], [ignore],
+[# Without options, when all tests pass, no test directory should exist.
+AT_CHECK([test -d micro-suite.dir/1 && exit 42
+  ./micro-suite -d 1], [], [ignore], [ignore])
+# Running with -d should leave a reproducible test group.
+# Also, running the test script from the test group locks the
+# directory from removal on some platforms; the script should still be
+# able to run even if rmdir fails.
+AT_CHECK([(cd micro-suite.dir/1 && ./run)], [], [ignore], [ignore])
+# Running a debugging script implies -d.
+AT_CHECK([(cd micro-suite.dir/1 && ./run)], [], [ignore], [ignore])
+])
+
+AT_CHECK_AT_TEST([Debugging script and environment],
+  [AT_CHECK([test "$MY_VAR" = pass || exit 42])],
+  [], [1], [], [ignore], [
+# Changing environment outside of debugging script is not preserved.
+AT_CHECK([(cd micro-suite.dir/1 && MY_VAR=pass ./run)],
+ [0], [ignore], [ignore])
+AT_CHECK([(cd micro-suite.dir/1 && ./run)],
+ [1], [ignore], [ignore])
+# Changing environment as argument to debugging script is preserved.
+AT_CHECK([(cd micro-suite.dir/1; ./run MY_VAR=pass)],
+ [0], [ignore], [ignore])
+AT_CHECK([(cd micro-suite.dir/1; ./run)],
+ [0], [ignore], [ignore])


empty test

2006-04-08 Thread Eric Blake
An empty test is somewhat different than an empty testsuite (although
a user should not create one, we might as well avoid the syntax
error of "( )" if they do).

2006-04-08  Eric Blake  <[EMAIL PROTECTED]>

* lib/autotest/general.m4 (_AT_CHECK): Avoid syntax error on empty
check.
* tests/autotest.at (Empty test, Empty check): New test to check it.
Index: tests/autotest.at
===
RCS file: /sources/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.11
diff -u -p -r1.11 autotest.at
--- tests/autotest.at   5 Apr 2006 16:04:22 -   1.11
+++ tests/autotest.at   8 Apr 2006 23:28:44 -
@@ -84,6 +84,11 @@ AT_CHECK_AT([Empty test suite],
 [[AT_INIT([empty test suite])
 ]])
 
+# Next level of emptiness.
+AT_CHECK_AT_TEST([Empty test], [])
+
+# And finally, an empty check should not cause a syntax error.
+AT_CHECK_AT_TEST([Empty check], [AT_CHECK])
 
 ## - ##
 ## Newlines and command substitutions in test commands.  ##
Index: lib/autotest/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.206
diff -u -p -r1.206 general.m4
--- lib/autotest/general.m4 7 Apr 2006 18:31:09 -   1.206
+++ lib/autotest/general.m4 8 Apr 2006 23:28:46 -
@@ -1469,7 +1469,7 @@ if test -n "$at_trace_this"; then
 grep '^ *+' "$at_stder1" >&2
 grep -v '^ *+' "$at_stder1" >"$at_stderr"
 else
-( $1 ) >"$at_stdout" 2>"$at_stderr"
+( :; $1 ) >"$at_stdout" 2>"$at_stderr"
 at_status=$?
 fi
 


Re: empty test

2006-04-09 Thread Eric Blake

> > >   * lib/autotest/general.m4 (_AT_CHECK): Avoid syntax error on empty
> > >   check.
> > 
> > That looks fine; please install.  Thanks.
> 
> Erm, instead of the
>   :; $1
> 
> could we just have
>   m4_default([$1], [:])
> 
> please?  This avoids the size overhead incurred for the non-pathological
> case.

Except that with your idea, with AT_CHECK([ ]) (note the space), the m4_default
sees it as non-empty but shell syntax disagrees.  I went the course of
minimally invasive patch, by always ensuring valid syntax (assuming, of course,
that the shell snippet handed to AT_CHECK is also valid outside of a subshell),
rather than trying to play m4 games to guess when syntax is valid.  Of course,
how we handle something like AT_CHECK([;]) is up in the air, since by itself, 
";"
is not valid as a script outside of a subshell, nor would it be valid with 
either
of our proposals.

-- 
Eric Blake




Re: autotest annoyances

2006-04-11 Thread Eric Blake
Hi Ralf,
> 
> I read your patch the way that this "more than 2 exit statuses" proposal
> isn't immediately necessary any more, right?

Indeed, and so I won't propose anything on this front until after 2.60.

> 
> Yes, or similarly.  I traced back why Akim did it back then the way it
> was documented until now: the `run' script was a numbered script at that
> time, and lived outside the test directory.  So not recreating that made
> sense then.  But it doesn't now.

Thanks for the detective work.

> > I'll start looking into this, but for now I will leave it as an xfail and
> > focus instead on the issues raised by the first bug.
> 
> No need.  It was easier than I thought (because all the ingredients are
> already in place).  See below.

Nice (I would like to think that I would also have found that, if I had just
spent time looking for it, but am glad you didn't mind the work).

-- 
Eric Blake




minor cleanup

2006-04-12 Thread Eric Blake
Minor annoyances:

2006-04-12  Eric Blake  <[EMAIL PROTECTED]>

* tests/autotest.at (Debugging a failed test): Fix comment.
* doc/.cvsignore: Add autoconf and standards, created by make html.

Index: doc/.cvsignore
===
RCS file: /sources/autoconf/autoconf/doc/.cvsignore,v
retrieving revision 1.7
diff -u -r1.7 .cvsignore
--- doc/.cvsignore  31 Oct 2003 08:48:41 -  1.7
+++ doc/.cvsignore  12 Apr 2006 17:11:55 -
@@ -11,10 +11,12 @@
 *.ky
 *.aux *.dvi *.info *.log
 Makefile
+autoconf
 *.pdf
 *.pg
 *.ps
 stamp-vti
+standards
 *.tmp
 *.toc
 *.tp
Index: tests/autotest.at
===
RCS file: /sources/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.15
diff -u -r1.15 autotest.at
--- tests/autotest.at   11 Apr 2006 16:09:54 -  1.15
+++ tests/autotest.at   12 Apr 2006 17:11:55 -
@@ -291,7 +291,7 @@
  [0], [ignore], [ignore])
 ])
 
-# The run script is currently invalid when shell metacharacters are passed
+# The run script must still be valid when shell metacharacters are passed
 # in via an environment option.
 AT_CHECK_AT_TEST([Debugging a failed test],
   [AT_CHECK([test "$MY_VAR" = "one space" || exit 42])],






Re: Cygwin and text mode

2006-04-18 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 4/18/2006 1:55 AM:
> I'm not the only one to stumble over Cygwin with text mode mounts[1].
> As they prevent a successful generation of config.status, this may
> need to be addressed before 2.60, or big warning letters printed to
> this extent.

Agreed.

As the cygwin bash packager, I just patched the cygwin version of bash[1]
so that here-docs are always treated as binary files, even if /tmp was
accidentally mounted as text mode, in response to a related query about a
libtool failure[2].  Hopefully, that will reduce the number of CFLF line
endings from heredocs, and may improve the situation with autoconf on a
textmode mount.  But it will be a while before I have enough time to
actually sit down with a text mode mount and analyze every autoconf
failure - it really is much easier to document that on cygwin, only binary
mode mounts are guaranteed (and that includes /tmp being mounted as
binary, since /bin/sh (aka bash) uses /tmp for heredocs).

[1] http://cygwin.com/ml/cygwin/2006-04/msg00423.html
[2] http://cygwin.com/ml/cygwin/2006-04/msg00414.html
- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEROHR84KuGfSFAYARAkHPAJwOOy9rA8BdQ+LCxPo2h1uTcAw9GgCgyU89
uNXiybMbIjwetWqtQteIIQE=
=Qgmh
-END PGP SIGNATURE-




Re: Bug#368012: mingw crosscompilation broken with autoconf-2.59.cvs.2006.05.13-1

2006-05-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Ralf,

According to Ralf Wildenhues on 5/25/2006 4:49 AM:
> 
> 2006-05-25  Stepan Kasal  <[EMAIL PROTECTED]>
>   and Ralf Wildenhues  <[EMAIL PROTECTED]>
> 
>   * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Drop the
>   initialization of `ac_cv_exeext', do not override it if it was
>   already set, unless it was set to `no', for compatibility with
>   Autoconf-2.13, and comment this.
>   Do not export `ac_cv_exeext', Libtool hasn't needed this for years.
>   (_AC_COMPILER_EXEEXT_DEFAULT): Likewise, do not export it.
>   (_AC_COMPILER_EXEEXT_WORKS, _AC_COMPILER_EXEEXT_CROSS): Typos.
>   * doc/autoconf.texi (Compilers and Preprocessors) :
>   Document that this test may be overridden by setting
>   `ac_cv_exeext'.
> 
> --- lib/autoconf/lang.m4  2006-05-25 12:45:55.0 +0200
> +++ lib/autoconf/lang.m4  2006-05-25 12:42:36.0 +0200
> @@ -495,9 +495,11 @@
>  rm -f $ac_rmfiles
>  
>  AS_IF([AC_TRY_EVAL(ac_link_default)],
> -[# Be careful to initialize this variable, since it used to be cached.
> -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
> -ac_cv_exeext=
> +[# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
> +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
> +# in a Makefile.  Because we should not override ac_cv_exeext if it was
> +# cached, so that the user can short-circuit this test for compilers
> +# unknown to Autoconf.

That last sentence needs help.  I would s/Because we/We/.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEdafM84KuGfSFAYARAoCrAJ94cgrU6rkY9hhLBQpzRhuuE5r+ugCePY88
q2+QLeE7L5KMlJWy7NgMARs=
=zMV6
-END PGP SIGNATURE-




document M4 variable

2006-06-03 Thread Eric Blake
I have been patching some core dumps in m4 1.4.4, and wanted to
test my version with autoconf.  To my relief, setting M4=/my/m4
worked to override which m4 was used, even though it wasn't
documented.  But I propose this to make it obvious:

2006-06-03  Eric Blake  <[EMAIL PROTECTED]>

* bin/autoreconf.in (help): Document M4 environment variable.
* bin/autoconf.as (Usage): Likewise.
* bin/autom4te.in (help): Likewise.
* doc/autoconf.texi (autom4te Invocation): Likewise.

Index: bin/autoconf.as
===
RCS file: /sources/autoconf/autoconf/bin/autoconf.as,v
retrieving revision 1.18
diff -u -p -r1.18 autoconf.as
--- bin/autoconf.as 25 Apr 2006 12:57:28 -  1.18
+++ bin/autoconf.as 4 Jun 2006 02:15:48 -
@@ -45,7 +45,7 @@ Warning categories include:
   \`none'  turn off all the warnings
   \`error' warnings are error
 
-The environment variable \`WARNINGS' is honored.
+The environment variables \`M4' and \`WARNINGS' are honored.
 
 Library directories:
   -B, --prepend-include=DIR  prepend directory DIR to search path
Index: bin/autom4te.in
===
RCS file: /sources/autoconf/autoconf/bin/autom4te.in,v
retrieving revision 1.97
diff -u -p -r1.97 autom4te.in
--- bin/autom4te.in 6 Jan 2006 00:10:37 -   1.97
+++ bin/autom4te.in 4 Jun 2006 02:15:48 -
@@ -191,7 +191,7 @@ Languages include:
 
 " . Autom4te::ChannelDefs::usage . "
 
-The environment variable \`WARNINGS\' is honored.
+The environment variables \`M4\' and \`WARNINGS\' are honored.
 
 Library directories:
   -B, --prepend-include=DIR  prepend directory DIR to search path
Index: bin/autoreconf.in
===
RCS file: /sources/autoconf/autoconf/bin/autoreconf.in,v
retrieving revision 1.133
diff -u -p -r1.133 autoreconf.in
--- bin/autoreconf.in   18 May 2006 06:50:35 -  1.133
+++ bin/autoreconf.in   4 Jun 2006 02:15:48 -
@@ -89,7 +89,7 @@ Library directories:
   -I, --include=DIR  append directory DIR to search path
 
 The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
-AUTOPOINT, LIBTOOLIZE are honored.
+AUTOPOINT, LIBTOOLIZE, M4 are honored.
 
 Report bugs to <[EMAIL PROTECTED]>.
 ";
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1035
diff -u -p -r1.1035 autoconf.texi
--- doc/autoconf.texi   3 Jun 2006 23:21:06 -   1.1035
+++ doc/autoconf.texi   4 Jun 2006 02:15:53 -
@@ -9065,7 +9065,10 @@ autom4te @var{options} @var{files}
 @end example
 
 @noindent
-where the @var{files} are directly passed to @command{m4}.  In addition
[EMAIL PROTECTED] M4
+where the @var{files} are directly passed to @command{m4}.  By default,
[EMAIL PROTECTED] m4 is found during configure, but the environment variable
[EMAIL PROTECTED] can be set to tell @command{autom4te} where to look.  In 
addition
 to the regular expansion, it handles the replacement of the quadrigraphs
 (@pxref{Quadrigraphs}), and of @samp{__oline__}, the current line in the
 output.  It supports an extended syntax for the @var{files}:


FYI: testsuite typo

2006-06-06 Thread Eric Blake
This bugged me, when running the 2.59e testsuite to regression-test CVS m4 
(soon to be released as m4 1.4.5).  Committed as obvious.

2006-06-06  Eric Blake  <[EMAIL PROTECTED]>

* tests/tools.at (automatically allowed tokens): Fix typo.

Index: tests/tools.at
===
RCS file: /sources/autoconf/autoconf/tests/tools.at,v
retrieving revision 1.87
diff -u -r1.87 tools.at
--- tests/tools.at  5 Jun 2006 08:18:33 -   1.87
+++ tests/tools.at  6 Jun 2006 14:40:06 -
@@ -307,7 +307,7 @@
 
 # autoconf: automatically allowed tokens
 # --
-AT_SETUP([autoconf: automatically alowed tokens])
+AT_SETUP([autoconf: automatically allowed tokens])
 
 AT_DATA_M4SH([configure.ac],
 [[AC_INIT






squelch changeword builtin

2006-06-07 Thread Eric Blake
I tried bootstrapping CVS m4 with a version of m4 built with --enable-
changeword.

$ make
make: Entering directory `/home/eblake/m4/doc'
 cd .. && /bin/sh /home/eblake/m4/missing --run automake-1.9a --gnu  
doc/Makefile
configure.ac:112: /usr/local/bin/m4: Warning: Too few arguments to built-in 
`changeword'
autom4te: /usr/local/bin/m4 failed with exit status: 1
automake-1.9a: autoconf failed with exit status: 1

(Not so) obviously, this snippet of m4's configure.ac was underquoted, and I 
will be patching m4 accordingly:

AC_ARG_ENABLE([changeword],
  [AS_HELP_STRING([--enable-changeword],
 [enable -W and changeword() builtin])],
  [if test "$enableval" = yes; then
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLE_CHANGEWORD], [1],
  [Define to 1 if the changeword(REGEXP) functionality is wanted])
  else
AC_MSG_RESULT([no])
  fi], [AC_MSG_RESULT([no])])

However, it makes sense to me to protect m4sugar from this (mis-)feature of m4 
1.4.x (the feature has been withdrawn in CVS head, replaced by the new 
changesyntax builtin).  I guess we should also consider whether we should 
protect m4sugar from other new builtins in the eventual m4 2.0, for anyone 
using a CVS snapshot of m4 to run autoconf.  My patch below does not attempt to 
make any decisions about changesyntax, epatsubst, eregexp, erenamesyms, 
renamesyms, syncoutput, or the proposed (but not yet implemented) qindir.  I 
also note that the m4 2.0 builtin symbols is already protected.

OK to apply?

2006-06-07  Eric Blake  <[EMAIL PROTECTED]>

* lib/m4sugar/m4sugar.m4 (changeword): Disable this experimental
feature of m4 1.4.x.

Index: lib/m4sugar/m4sugar.m4
===
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sugar.m4,v
retrieving revision 2.98
diff -u -r2.98 m4sugar.m4
--- lib/m4sugar/m4sugar.m4  5 Jun 2006 08:18:33 -   2.98
+++ lib/m4sugar/m4sugar.m4  7 Jun 2006 15:43:55 -
@@ -121,6 +121,7 @@
 m4_rename_m4([builtin])
 m4_rename_m4([changecom])
 m4_rename_m4([changequote])
+m4_undefine([changeword])
 m4_rename_m4([debugfile])
 m4_rename_m4([debugmode])
 m4_rename_m4([decr])
@@ -221,7 +222,7 @@
 m4_define([m4_warn],
 [_m4_warn([$1], [$2],
 m4_ifdef([m4_expansion_stack],
- [m4_defn([m4_expansion_stack])
+[m4_defn([m4_expansion_stack])
 m4_location[: the top level]]))dnl
 ])
 
@@ -768,7 +769,7 @@
 # When we pop the last value from the stack, we divert to -1.
 m4_define([m4_divert_pop],
 [m4_ifndef([_m4_divert_diversion],
-   [m4_fatal([too many m4_divert_pop])])dnl
+  [m4_fatal([too many m4_divert_pop])])dnl
 m4_if([$1], [], [],
   [$1], m4_defn([_m4_divert_diversion]), [],
   [m4_fatal([$0($1): diversion mismatch: ]_m4_divert_n_stack)])dnl






Re: m4_wrap behavior

2006-06-13 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[dropping bug-m4, adding autoconf-patches]

According to Stepan Kasal on 6/13/2006 2:46 PM:
> 
> The biggest problem is this:
> 
> m4_init contains:
>   m4_divert_push([KILL])
>   m4_wrap([m4_divert_pop([KILL])[]])
> 
> AS_INIT contains:
>   m4_init
>   ...
>   m4_divert_push([BODY])
>   m4_wrap([m4_divert_pop([BODY])[]])
> 
> That clearly depends on the LIFO order of m4_wrap.
...
>
> Actually, the code of AS_INIT really looks nice and the building of
> one package on top of another naturally works with the LIFO order.
> It seems to be pity that m4 standrdized for FIFO.
>

Well, how about a patch to m4sugar that forces m4_wrap to always be LIFO,
and documents it as such, regardless of the underlying m4wrap
implementation?  I'm not sure if we want this before 2.60 (on the other
hand, we will need it if m4 2.0 comes out before autoconf 2.61).
Borrowing from my earlier mail in this thread:

2006-06-13  Eric Blake  <[EMAIL PROTECTED]>

* lib/m4sugar/m4sugar.m4 (_m4_wrap_level): New helper macro.
(m4_wrap): Reimplement to guarantee LIFO order, even if m4wrap is
in POSIX-specified FIFO order.
* doc/autoconf.texi (Redefined M4 Macros): Document that m4_wrap
    is always LIFO.


- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEj4jr84KuGfSFAYARAoSfAKDSRsOSLCJ4DzhkGW3blyj1aT89tQCfSw2E
eJSKXVDR5NzYTBG/l3/4Xxw=
=v52f
-END PGP SIGNATURE-
Index: lib/m4sugar/m4sugar.m4
===
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sugar.m4,v
retrieving revision 2.98
diff -u -p -r2.98 m4sugar.m4
--- lib/m4sugar/m4sugar.m4  5 Jun 2006 08:18:33 -   2.98
+++ lib/m4sugar/m4sugar.m4  14 Jun 2006 03:53:22 -
@@ -561,6 +561,38 @@ m4_define([m4_undefine],
 m4_builtin([undefine], $@)])
 
 
+# _m4_wrap_level
+# --
+# Track the current recursion level of m4.  Nested calls to m4_wrap
+# are processed in LIFO order on the next recursion level after the
+# current input level has been expanded.
+m4_define([_m4_wrap_level], [0])
+
+
+# m4_wrap(TEXT)
+# -
+# Add TEXT to the beginning of the current recursion level of wrapped
+# text, to be expanded when the current input is exhausted.  This
+# enforces LIFO ordering, even though POSIX requires the underlying
+# m4wrap to have FIFO ordering; and works whether the underlying m4wrap
+# is FIFO (GNU m4 2.0) or LIFO (GNU m4 1.4.x).  It also forbids excess
+# arguments, since POSIX does not guarantee how they are handled.
+#
+# This relies on intermediate macros of the form _m4_wrap for
+# storing the LIFO stack, and only calls the real m4wrap once per
+# recursion level.
+m4_define([m4_wrap],
+[m4_if(m4_eval([$# > 1]), [1],
+   [m4_fatal([$0: too many arguments])])dnl
+m4_ifdef([_m4_wrap]_m4_wrap_level,
+ [m4_define([_m4_wrap]_m4_wrap_level,
+[$1]m4_defn([_m4_wrap]_m4_wrap_level))],
+ [m4_builtin([m4wrap], [m4_define([_m4_wrap_level],
+  m4_incr(_m4_wrap_level))dnl
+_m4_wrap]_m4_wrap_level)dnl
+m4_define([_m4_wrap]_m4_wrap_level, [$1])])])
+
+
 ## -- ##
 ## 7. Implementing m4 loops.  ##
 ## -- ##
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1042
diff -u -p -r1.1042 autoconf.texi
--- doc/autoconf.texi   8 Jun 2006 17:25:10 -   1.1042
+++ doc/autoconf.texi   14 Jun 2006 03:53:26 -
@@ -9593,7 +9593,9 @@ provide extended regular expression synt
 
 @defmac m4_wrap (@var{text})
 @msindex{wrap}
-This macro corresponds to @code{m4wrap}.
+This macro corresponds to @code{m4wrap}.  However, this macro fails if
+there is more than one argument, and multiple invocations are collected
+in last-in-first-out order, in order to ease stacking paradigms.
 
 You are encouraged to end @var{text} with @samp{[]}, so that there are
 no risks that two consecutive invocations of @code{m4_wrap} result in an


Re: VPATH / English / etc updates for Autoconf manual

2006-06-14 Thread Eric Blake
> 
> Here's what I installed:
> 
> @@ -1394,7 +1419,7 @@ disable warnings falling into @var{categ
>  
>  Warnings about @samp{syntax} are enabled by default, and the environment
>  variable @env{WARNINGS}, a comma separated list of categories, is
> -honored as well.  Passing @option{-W @var{category}} will actually behave as 
> if
> +honored as well.  Passing @option{-W @var{category}} actually behave as if

s/behave/&s/

>  you had passed @option{--warnings=syntax,$WARNINGS,@var{category}}.  If

Also, is it okay to add this node, documenting a problem that once bit
automake?

2006-06-14  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.texi (The Make Macro MAKEFLAGS): New node.

Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1044
diff -u -p -r1.1044 autoconf.texi
--- doc/autoconf.texi   14 Jun 2006 05:14:09 -  1.1044
+++ doc/autoconf.texi   14 Jun 2006 12:43:17 -
@@ -490,6 +490,7 @@ Portable Make Programming
 * Long Lines in Makefiles:: Line length limitations
 * Macros and Submakes:: @code{make macro=value} and submakes
 * The Make Macro SHELL::@code{$(SHELL)} portability issues
+* The Make Macro MAKEFLAGS::@code{$(MAKEFLAGS)} portability issues
 * Comments in Make Rules::  Other problems with Make comments
 * obj/ and Make::   Don't name a subdirectory @file{obj}
 * make -k Status::  Exit status of @samp{make -k}
@@ -13609,6 +13610,7 @@ itself.
 * Long Lines in Makefiles:: Line length limitations
 * Macros and Submakes:: @code{make macro=value} and submakes
 * The Make Macro SHELL::@code{$(SHELL)} portability issues
+* The Make Macro MAKEFLAGS::@code{$(MAKEFLAGS)} portability issues
 * Comments in Make Rules::  Other problems with Make comments
 * obj/ and Make::   Don't name a subdirectory @file{obj}
 * make -k Status::  Exit status of @samp{make -k}
@@ -13864,6 +13866,33 @@ $ @kbd{env SHELL=/bin/tcsh FOO=bar gmake
 bar
 @end example
 
+
[EMAIL PROTECTED] The Make Macro MAKEFLAGS
[EMAIL PROTECTED] The Make Macro MAKEFLAGS
[EMAIL PROTECTED] @code{MAKEFLAGS} and @command{make}
[EMAIL PROTECTED] @command{make} and @code{MAKEFLAGS}
+
+Posix requires @command{make} to use @code{MAKEFLAGS} to affect the
+current and recursive invocations of make, but allows implementations
+several formats for the variable.  Therefore, attempting to parse
[EMAIL PROTECTED] to determine if @code{-s} for silent execution or
[EMAIL PROTECTED] for continued execution are in effect is inherently
+non-portable.  You cannot assume that the first space-separated word in
[EMAIL PROTECTED] contains single-letter options, since in the cygwin
+version of GNU make, it is either @code{--unix} or @code{--win32},
+moving the single-letter options to the second word.
+
[EMAIL PROTECTED]
+$ @kbd{cat Makefile}
+all:
+   @@echo $(MAKEFLAGS)
+$ @kbd{make}
+--unix
+$ @kbd{make -k}
+--unix -k
[EMAIL PROTECTED] example
+
+
 @node Comments in Make Rules
 @section Comments in Make Rules
 @cindex Comments in @file{Makefile} rules


Re: m4_wrap behavior

2006-06-15 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 6/15/2006 1:28 AM:
> 
> I'm fine with documenting that m4_wrap order is
> implementation-dependent, but I'd like to see a patch that will cause
> Autoconf to work regardless of m4wrap order.

I already provided such a patch, that guarantees LIFO order in m4_wrap
regardless of m4wrap direction; and it is just a minor tweak to that patch
to instead guarantee FIFO order.
http://lists.gnu.org/archive/html/autoconf-patches/2006-06/msg00060.html

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEkUi484KuGfSFAYARAjHqAKC28THf0GaepJPc2D6+M6b3pyakYwCeLVot
yzdt3f8Js1btYYlFRUhnFFk=
=p4rA
-END PGP SIGNATURE-




Re: m4_wrap behavior

2006-06-15 Thread Eric Blake
> Something like that sounds fine, but I worry about
> having m4_wrap behave differently from M4's m4wrap.
> That's an unhealthy naming convention.

Agreed, although several other m4sugar macros are defined
to have improved semantics or limitations beyond the
underlying m4.

> 
> Also, I worry that non-Autoconf uses of m4_wrap will break with the
> new implementation, due to some obscure token-pasting or whatever
> (sorry, I'm waving my hands here).

Actually, I'm pretty confident that my patch matched native behavior;
between Solaris m4 (FIFO) and m4 1.4.4a (LIFO), and two versions
of my patch, I was able to make either m4 match the behavior
of the other regardless of token-pasting and m4wrap recursion
scenarios.  But that's for a reviewer to determine :)

> 
> How about this idea instead?
> 
>  * Leave m4_wrap alone.
>  * Use something like Eric's patch to define a new macro m4_wrap_fifo.
>  * Modify Autoconf to use m4_wrap_fifo rather than m4_wrap.
>  * Document m4_wrap_fifo.
>  * Document that m4_wrap isn't portable.
> 

Wouldn't that be m4_wrap_lifo for autoconf 2.60, if we want
minimal code changes to the rest of autoconf?

Speaking of which, here is an idea towards a simpler
m4-2.0-proof definition of m4_wrap, with less overhead
per use of m4_wrap than my earlier patch (no ChangeLog
provided, as this is just an idea for now).

-- 
Eric Blake



Index: lib/m4sugar/m4sugar.m4
===
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sugar.m4,v
retrieving revision 2.98
diff -u -p -r2.98 m4sugar.m4
--- lib/m4sugar/m4sugar.m4  5 Jun 2006 08:18:33 -   2.98
+++ lib/m4sugar/m4sugar.m4  16 Jun 2006 00:57:52 -
@@ -139,7 +139,15 @@ m4_rename_m4([index])
 m4_rename_m4([indir])
 m4_rename_m4([len])
 m4_rename([m4exit], [m4_exit])
-m4_rename([m4wrap], [m4_wrap])
+
+# m4 1.4.x provided only m4wrap with LIFO order.  m4 2.0 will provide
+# m4wrap with FIFO order, and m4parw with LIFO order.  For autoconf 2.60,
+# we depend on LIFO order internally, but document that m4_wrap has
+# indeterminate order.  Then, in a future release of autoconf, we can
+# define m4_wrap_fifo and m4_wrap_lifo, and quit using m4_wrap.
+m4_ifdef([m4pawr],
+[m4_rename([m4pawr], [m4_wrap])m4_undefine([m4wrap])],
+[m4_rename([m4wrap], [m4_wrap])])
 m4_rename_m4([maketemp])
 m4_rename([patsubst], [m4_bpatsubst])
 m4_undefine([popdef])




document testsuite cleanup

2006-06-16 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

OK to install?  I noticed this when upgrading m4's Makefile.am to follow
the autoconf manual.

2006-06-16  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.texi (Making testsuite Scripts): Document how to
clean up after testsuite.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEkq0884KuGfSFAYARAjgaAKDV7UEO2Vt8P8AQoPey7IRrU0qonwCggmmr
6VySS1yDNoVZeDtdJ+8zFdU=
=Ecqk
-END PGP SIGNATURE-
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1049
diff -u -p -r1.1049 autoconf.texi
--- doc/autoconf.texi   15 Jun 2006 13:20:05 -  1.1049
+++ doc/autoconf.texi   16 Jun 2006 13:06:35 -
@@ -17909,6 +17909,9 @@ installcheck-local: atconfig atlocal $(T
 $(SHELL) $(TESTSUITE) AUTOTEST_PATH="$(bindir)" \
   $(TESTSUITEFLAGS)
 
+clean-local:
+   test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
+
 AUTOTEST = $(AUTOM4TE) --language=autotest
 $(TESTSUITE): $(srcdir)/testsuite.at
 $(AUTOTEST) -I $(srcdir) -o $@@.tmp $@@.at


Re: Autoconf <-> CVS M4 interactions

2006-06-16 Thread Eric Blake
> 
> M4 upgrade scenario:
> 
> - You are working on Autoconf; the build tree has the same --prefix
>   as an earlier version of Autoconf that is already installed there.
> - The earlier Autoconf version used M4 1.4.x as underlying work horse.
> - Now (sometime in the future) you are just apt to try out, say,
>   just-released M4-2.0 (or, in the present, you're crazy enough to try
>   CVS M4 ;-)  so that's what you use for the new Autoconf.

Indeed, I will not allow CVS M4 to be released as m4-2.0 until I am
satisfied that this very scenario works without regressions (running
an installed autoconf that was configured with m4 1.4.x but now uses
m4 2.0).  We certainly aren't there, yet.  For one thing, CVS m4 needs
to be taught that when a version 1 frozen file is parsed in, it needs to
initialize the syntax table to sane defaults (done normally by the
'S' command in version 2 frozen files).  But right now, CVS m4 cannot
properly read files frozen by m4 1.4.x.

> 
>   * bin/autoupdate.in (handle_autoconf_macros): Do not
>   _au__undefine the builtins that aren't defined, before restoring
>   the original ones.  Fixes warnings issues by CVS M4.

That is safe, but I'd rather figure out the underlying cause of why
CVS m4 is not defining builtins in the first place.

-- 
Eric Blake




Re: another batch of minor doc patches

2006-06-16 Thread Eric Blake
> I installed this to accommodate the flurry of last-minute suggestions
> and a few other VPATH/quoting problems I noticed (can't say I caught
> them all):

Comments on the ChangeLog:

> 
> 2006-06-16  Paul Eggert  <[EMAIL PROTECTED]>
> 
>   * doc/autoconf.texi:
...
>   (Making testsuite Scripts, Defining Directories):
>   Quote variable usages better.

You missed mentioning that this added documentation of
clean-local that was previously missing.

...
>   (Special Shell Variables): Note leading ./ or ../, as suggested
>   by Stepan Kasal.

Actually, that was me, not Stepan, and I haven't tested it
everywhere, so we may yet encounter a shell that does not
obey that POSIX rule for cd.  But since you have already
checked it in, we may as well leave it there until proven
otherwise.

-- 
Eric Blake




Re: Autoconf release

2006-06-19 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 6/19/2006 12:33 AM:
> Ralf Wildenhues <[EMAIL PROTECTED]> writes:
> 
>> I am considering postponing 2.60 for a couple of days because of some
>> pending issues, allowing for a comment period for some posted patches,
>> and a bit of time to think about the m4wrap issue.
> 
> Fine with me.
> 
> One possibility for m4wrap is to do nothing until after 2.60 is out.
> I.e., if m4 2.0 isn't expected to be out soon, we can fix m4wrap
> issues in Autoconf 2.61.

I'll put it this way.  If 2.60 adds an m4wrap workaround, then m4 2.0
might come out before autoconf 2.61.  But if 2.60 does not add an m4wrap
workaround, then m4 development will have to wait for yet another autoconf
release.  One of my criteria for a successful m4 2.0 release is that it
must be a drop-in replacement on top of 1.4.x from autoconf's perspective
(and while we aren't there yet, it may be possible to get there in the
next few months).

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFElpjT84KuGfSFAYARAhWzAJ9EiLkMj6c/xyeWNamB9TdWQc3O6QCaAnal
bWZ4uv6jIDLHPetNU+FkKCU=
=eRQw
-END PGP SIGNATURE-




Re: m4_wrap behavior

2006-06-20 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

>
> +** Autoconf no longer depends on whether m4wrap is FIFO (as Posix requires)
> +  or LIFO (as in GNU m4 1.4.x).  GNU m4 2.0 is expected to conform to Posix
> +  here, so m4wrap/m4_wrap users should no longer depend on LIFO behavior.

A note - I've been trying to clean up m4, so that in its documentation, it
is called 'm4' if it is the program, and 'GNU M4' if it is the package
(similar to 'autoconf' vs. 'GNU Autoconf').  We ought to be consistent
here, and call it GNU M4 2.0 or GNU M4 1.4.x.

> -You are encouraged to end @var{text} with @samp{[]}, so that there are
> -no risks that two consecutive invocations of @code{m4_wrap} result in an
> -unexpected pasting of tokens, as in
> +Posix requires arguments of multiple @code{m4wrap} calls to be
> +reprocessed at @acronym{EOF} in the same order as the original calls.
> [EMAIL PROTECTED] M4 versions through 1.4.x, however, reprocess them in
> +reverse order.  Your code should not depend on the order.

There was also the question of whether m4sugar should reject calls to
m4_wrap with multiple arguments, since that is not Posix-specified (GNU m4
1.4.x concatenates each argument together with a space, but traditional
implementations only save the first argument).  An approach for that is:

m4_define([m4_wrap],
[m4_if(m4_eval([$# > 1])), [1], [m4_fatal([$0: too many args])],
[m4_builtin([m4wrap], [EMAIL PROTECTED])])])

But I don't think that is a show-stopper; if anything, 2.60 should just
document that m4_wrap is only safe with one argument.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEl+Vt84KuGfSFAYARAht8AKCSI2QZVS5uou2CY9sbgkwXWOnKBQCgmmYr
1P0iDJpWl6Zcw4DrhWplLg8=
=PIb/
-END PGP SIGNATURE-




Re: new behavior in M4 1.4.5 breaks autoconf "make check"

2006-07-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 7/17/2006 11:31 AM:
> Apparently a post-1.4.4b change to M4 changed one of its diagnostics?

Yes, I intentionally changed the diagnostics to be closer to GNU coding
standards.  There are still some fixes to be made before it is compliant,
but now filenames are quoted, and messages start with lowercase.

> Anyway, the new diagnostic in M4 1.4.5 breaks Autoconf's "make check".
> I assume this change is permanent so I have installed the following
> into Autoconf.

It's always a little dangerous to make the testsuite depend on the exact
text of the error message of a third-party program, but in this case, it
will help ensure that automake users upgrade their m4 installation.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEvFu+84KuGfSFAYARAgjnAKDEVNFIMr13DWj5Z9Bh/sukf5UzKQCfYOST
wonioXF9cMov31h0kI/m1wE=
=8DWE
-END PGP SIGNATURE-




Re: any objections to Autoconf 2.61?

2006-08-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 8/7/2006 5:11 AM:
> Hello Paul,
> 
> * Paul Eggert wrote on Mon, Aug 07, 2006 at 07:43:05AM CEST:
>> Given the problems we're having with Autoconf 2.60 and M4 1.4.5,
>> perhaps it's time to issue Autoconf 2.61, with the NEWS item
>> prominently mentioning that 1.4.5 or later is now recommended.
> 
> Is "the problems" the handful of bug reports stemming from changed M4
> warning output that causes a spurious test suite failure?  If so, I
> think the test suite should pass with both 1.4.5 and previous M4
> versions, even if they aren't recommended.  And I don't think it's
> such a big issue, if you ask me (but maybe I have missed something
> here).

Additionally, M4 1.4.5 had some testsuite failures reported, so I am
trying to output M4 1.4.6 in the near future.  And in this release, m4
will use GNU Coding Standard error messages ("m4:file:line: message"
rather than "file:line: m4: message"), so it may be better to recommend
1.4.6, and make the testsuite robust to all three formats of error
messages.  I'm still running the potential 1.4.6 through prerelease tests,
one of which is seeing how the autoconf testsuite behaves with it.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE1zn+84KuGfSFAYARAtt+AKCyHduQPKbsa+O01JzHptvBEuatQACg2VD2
VqVhSRzgz2YeyKVlmCOUQdQ=
=fuRv
-END PGP SIGNATURE-




Re: CC=cc ./configure or ./configure CC=cc

2006-08-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 8/8/2006 10:34 AM:
> [ moving to autoconf-patches ]
> 
> * Ralf Wildenhues wrote on Tue, Aug 08, 2006 at 06:29:12PM CEST:
>>  * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): `config.status
>>  --help' should mention that `--version' outputs configuration
>>  settings.  Report by Bruno Haible.
> 
> D'oh.  I should not be so quick, sorry about that.  OK to apply this
> followup patch to correct the manual as well (and for me to apply the
> last patch)?

I say go for it.  It is helpful information, whether or not we ever
implement config.status --config.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE2dUg84KuGfSFAYARAphpAKC9p7ac071JRls6ZdneI0wYTQcP+wCdG6Dz
ucJ3QM3LUS5w5+aUj50Z5DU=
=eJJk
-END PGP SIGNATURE-




Re: Autoconf now recommends M4 1.4.6

2006-08-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 8/25/2006 11:24 AM:
> Now that 1.4.6 is out, and fixes some serious buffer overruns, I
> installed this:
> 
> 2006-08-25  Paul Eggert  <[EMAIL PROTECTED]>
> 
>   * NEWS: Recommend M4 1.4.6 instead of 1.4.5.

Thanks for doing that.  I also hope (but have not tried to benchmark) that
plugging the memory leak in m4's regexp/patsubst macros will speed
autoconf performance since so many m4sugar macros rely on regular expressions.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE7zR484KuGfSFAYARAghpAKC3a3yxafQOd+2vOefFfzm26nEWCQCgkWlr
2qzZFer3XZVCufVd5WCflVU=
=ZaAP
-END PGP SIGNATURE-




Re: AC_CHECK_SIZEOF failing on undefined HAVE_STDINT_H with -Werror

2006-08-28 Thread Eric Blake
> ...
> > -], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])
> > +]])], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])
> >  if test $ac_cv_header_stat_broken = yes; then
> >AC_DEFINE(STAT_MACROS_BROKEN, 1,
> > [Define to 1 if the `S_IS*' macros in  do not
> 
> It looks like you got this logic backwards in the update.  If all four test
> cases
> compile, we are now defining ac_cv_header_stat_broken to yes.

I'm checking in this patch, hopefully obvious:

2006-08-28  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/headers.m4 (AC_HEADER_STAT): Fix logic that was
mistakenly swapped on 2006-08-15.

Index: lib/autoconf/headers.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/headers.m4,v
retrieving revision 1.51
diff -u -p -r1.51 headers.m4
--- lib/autoconf/headers.m4 15 Aug 2006 16:24:42 -  1.51
+++ lib/autoconf/headers.m4 29 Aug 2006 04:31:51 -
@@ -529,7 +529,7 @@ extern char c3[S_ISLNK (S_IFREG) ? -1 : 
 #if defined S_ISSOCK && defined S_IFREG
 extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
 #endif
-]])], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])
+]])], ac_cv_header_stat_broken=no, ac_cv_header_stat_broken=yes)])
 if test $ac_cv_header_stat_broken = yes; then
   AC_DEFINE(STAT_MACROS_BROKEN, 1,
[Define to 1 if the `S_IS*' macros in  do not




Re: AC_CHECK_SIZEOF failing on undefined HAVE_STDINT_H with -Werror

2006-08-29 Thread Eric Blake
> > It looks like you got this logic backwards in the update.  If all four test
> > cases
> > compile, we are now defining ac_cv_header_stat_broken to yes.
> 
> Thanks for catching and fixing that.

Oops - I made that patch without bumping the version number, even
though the release of 2.60a was the prior patch.  I'm applying this, along
with a regenerated configure using the new 2.60b version.

2006-08-29  Eric Blake  <[EMAIL PROTECTED]>

* configure.ac (AC_INIT): Bump to 2.60b.
* NEWS: Update.

Index: configure.ac
===
RCS file: /sources/autoconf/autoconf/configure.ac,v
retrieving revision 1.81
diff -u -p -r1.81 configure.ac
--- configure.ac24 Aug 2006 22:56:47 -  1.81
+++ configure.ac29 Aug 2006 12:34:22 -
@@ -22,7 +22,7 @@
 # We need AC_CONFIG_TESTDIR.
 AC_PREREQ([2.59])
 
-AC_INIT([GNU Autoconf], [2.60a], [EMAIL PROTECTED])
+AC_INIT([GNU Autoconf], [2.60b], [EMAIL PROTECTED])
 AC_SUBST([PACKAGE_NAME])dnl
 AC_CONFIG_SRCDIR([ChangeLog])
Index: NEWS
===
RCS file: /sources/autoconf/autoconf/NEWS,v
retrieving revision 1.397
diff -u -p -r1.397 NEWS
--- NEWS25 Aug 2006 21:42:41 -  1.397
+++ NEWS29 Aug 2006 12:35:31 -
@@ -1,3 +1,5 @@
+* Major changes in Autoconf 2.60b (??)
+
 * Major changes in Autoconf 2.60a (2006-08-25)
 
 ** GNU M4 1.4.6 or later is now recommended.  At least one "make check"




Re: Fix make check for outfashioned m4

2006-09-08 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 9/8/2006 6:43 AM:
> Hello,
>   the testsuite stumbled over my M4 1.4.3.  I enhanced the
> reformatting in tests/local.at to fix that.
> When I was there, I updated the comment and added the missing
> explanation for  s/ E[A-Z]*$//
> 
> OK to commit?

Comments below.

> 
> [I seem to recall a reasoning that this behaviour is half-wanted:
> it might make people to upgrade their m4.  Well, feel free to add
> a warning to configure then.]

Every version of M4 prior to the (as-yet-unreleased) 1.4.7 has known input
sequences that will cause a core dump.  And if you are unlucky enough to
be on a platform without ecvt(), M4 1.4.4 and earlier allow arbitrary code
execution via a stack overflow exploit.  Maybe a configure warning is a
good idea.  I'll let Paul weigh in on whether allowing older versions in
the test suite is a good idea.

>  # AT_CHECK_M4(COMMAND, [EXIT-STATUS = 0], STDOUT, STDERR)
>  # ---
> -# If stderr is specified, normalize the observed stderr.  E.g. (GNU M4 1.5):
> +# If stderr is specified, normalize the observed stderr.  E.g. (GNU M4 2.0):
>  #
> -#  /usr/local/bin/m4: script.4s: 1: Cannot open foo: No such file or 
> directory
> +#  /usr/local/bin/m4: script.4s: 1: cannot open `foo': No such file or 
> directory

Actually, 1.4.6 and later (including the eventual 2.0) output the location as:
/usr/local/bin/m4:script.4s:1: cannot...

>  #  autom4te: /usr/local/bin/m4 failed with exit status: 1
>  #
>  # or (using gm4 as GNU M4 1.4):
> @@ -73,30 +73,42 @@
>  #  script.4s:1: /usr/local/bin/gm4: Cannot open foo: No such file or 
> directory
>  #  autom4te: /usr/local/bin/gm4 failed with exit status: 1
>  #
> +# or (using GNU M$ 1.4.6):
> +#  /usr/local/bin/m4:script.4s:1: cannot open `foo': No such file or 
> directory
> +#
>  # becomes
>  #
> -#  m4: script.4s: 1: Cannot open foo: No such file or directory
> +#  m4: script.4s: 1: cannot open `foo': No such file or directory
>  #  autom4te: m4 failed with exit status: 1
>  #
>  # We use the following sed patterns:
>  #
> -# (file): (line): (m4):
> -# or  (m4): (file): (line):
> +# (m4): (file): (line):
> +# or  (file): (line): (m4):

So a better comment would be:
   (file): (line): (m4):
or (m4): ?(file): ?(line):

> +[AT_CHECK([[sed 's/^[^:]*m4: *\([^:]*\): *\([0-9][0-9]*\): /m4: \1: \2: /

GNU Coding standards would recommend /m4:\1:\2: / in the end of that
replacement, although making that change would have a ripple effect on
other locations in the testsuite.

> + s/^\([^:]*\): *\([0-9][0-9]*\): *[^:]*m4: /m4: \1: \2: /
> + s/^\(m4: [^:]*: *[0-9][0-9]*: \)C\(annot open 
> \)\([^`:]*\):/\1c\2`\3'\'':/
> + s/^autom4te: [^ ]*m4 /autom4te: m4 /
> + s/^autom4te: [^ ]*m4\.exe /autom4te: m4 /
> + s/ (E[A-Z]*)$//
> +' stderr]], [0],[$4])])
>  ])
>  
>  # AT_CHECK_AUTOM4TE(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFAW3T84KuGfSFAYARAkc9AKCz44+/UQpOEyZNFjImZsok2yd6lgCcDBZ/
TlYBgRNzLUxkKX4tzQOnSHk=
=OvFE
-END PGP SIGNATURE-




m4 2.0 command line change

2006-09-19 Thread Eric Blake
Yesterday, in CVS m4, I just added --debugfile as a new synonym for this option 
which better states what is going on (and matches the name of the debugfile 
macro, to boot).  And by deprecating the old spellings in CVS M4, it also gives 
M4 the freedom to redefine -o (after a couple of years of deprecation warnings, 
of course) to be more like `gcc -o' or `autom4te -o' where it specifies the 
output file instead of using stdout.  However, it also means that the autoconf 
testsuite fails loads of tests when using CVS m4 due to this new warning 
polluting stderr:

/usr/local/bin/m4: Warning: `--error-output' is deprecated, use `--debugfile' 
instead

I plan on adding --debugfile to M4 1.4.7, but leaving --error-output as a 
silent synonym there (so that a user can upgrade to M4 1.4.7 without breaking 
existing installations of autoconf 2.60 due to deprecation warnings).  This 
also means that M4 2.0 should not be released until after autoconf 2.61 (along 
with automake 1.10, libtool 2.0, gettext 0.15.1; wow - what a release 
dependency list!).

OK to commit this patch?  Not included in this patch, but easy to add, would be 
checking the results of $M4_DEBUGFILE in configure.ac to tell the user that 
their version of M4 is outdated (since only 1.4.7 or newer will support the 
option --debugfile).

2006-09-19  Eric Blake   l-3com.com>

* m4/m4.m4 (AC_PROG_GNU_M4): Check for m4 --debugfile support.
* bin/Makefile.am (edit): Substitute M4_DEBUGFILE.
* bin/autom4te.in (handle_m4): Favor --debugfile over misnamed
--error-output, to avoid warnings with M4 2.0.

Index: m4/m4.m4
===
RCS file: /sources/autoconf/autoconf/m4/m4.m4,v
retrieving revision 1.4
diff -u -r1.4 m4.m4
--- m4/m4.m424 Aug 2006 22:56:47 -  1.4
+++ m4/m4.m419 Sep 2006 19:53:59 -
@@ -1,4 +1,4 @@
-# Copyright (C) 2000 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2006 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,12 +18,23 @@
 # AC_PROG_GNU_M4
 # --
 # Check for GNU m4, at least 1.3 (supports frozen files).
+# Also, check whether --error-output (through 1.4.x) or --debugfile (2.0)
+# is supported, and AC_SUBST M4_DEBUGFILE accordingly.
 AC_DEFUN([AC_PROG_GNU_M4],
-[AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
-AC_CACHE_CHECK(whether m4 supports frozen files, ac_cv_prog_gnu_m4,
+[AC_PATH_PROGS([M4], [gm4 gnum4 m4], [m4])
+AC_CACHE_CHECK([whether m4 supports frozen files], [ac_cv_prog_gnu_m4],
 [ac_cv_prog_gnu_m4=no
 if test x"$M4" != x; then
   case `$M4 --help < /dev/null 2>&1` in
 *reload-state*) ac_cv_prog_gnu_m4=yes ;;
   esac
-fi])])
+fi])
+if test $ac_cv_prog_gnu_m4 = yes ; then
+  AC_CACHE_CHECK([how m4 supports trace files], [ac_cv_prog_gnu_m4_debugfile],
+[case `$M4 --help < /dev/null 2>&1` in
+  *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;;
+  *) ac_cv_prog_gnu_m4_debugfile=--error-output ;;
+esac])
+AC_SUBST([M4_DEBUGFILE], $ac_cv_prog_gnu_m4_debugfile)
+fi
+])
Index: bin/Makefile.am
===
RCS file: /sources/autoconf/autoconf/bin/Makefile.am,v
retrieving revision 1.25
diff -u -r1.25 Makefile.am
--- bin/Makefile.am 17 Jun 2006 08:08:19 -  1.25
+++ bin/Makefile.am 19 Sep 2006 19:53:59 -
@@ -2,7 +2,7 @@
 
 ## Makefile for Autoconf.
 
-## Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+## Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -46,6 +46,7 @@
-e 's|@[EMAIL PROTECTED]|'`echo autoheader | sed '$(transform)'`'|g' \
-e 's|@[EMAIL PROTECTED]|'`echo autom4te | sed '$(transform)'`'|g' \
-e 's|@[EMAIL PROTECTED]|$(M4)|g' \
+   -e 's|@[EMAIL PROTECTED]|$(M4_DEBUGFILE)|g' \
-e 's|@[EMAIL PROTECTED]|$(AWK)|g' \
-e 's|@[EMAIL PROTECTED]|$(VERSION)|g' \
-e 's|@[EMAIL PROTECTED]|$(PACKAGE_NAME)|g' \
Index: bin/autom4te.in
===
RCS file: /sources/autoconf/autoconf/bin/autom4te.in,v
retrieving revision 1.100
diff -u -r1.100 autom4te.in
--- bin/autom4te.in 23 Jun 2006 15:19:34 -  1.100
+++ bin/autom4te.in 19 Sep 2006 19:53:59 -
@@ -448,7 +448,7 @@
 {
   my ($req, @macro) = @_;
 
-  # GNU m4 appends when using --error-output.
+  # GNU m4 appends when using --debugfile/--error-output.
   unlink ($tcache . $req->id . "t");
 
   # Run m4.
@@ -461,7 +461,7 @@
   . join (' --include=', '', @include)
   . &

Re: m4 2.0 command line change

2006-09-19 Thread Eric Blake
Paul Eggert  CS.UCLA.EDU> writes:

> 
> Eric Blake  byu.net> writes:
> 
> > * m4/m4.m4 (AC_PROG_GNU_M4): Check for m4 --debugfile support.
> > * bin/Makefile.am (edit): Substitute M4_DEBUGFILE.
> > * bin/autom4te.in (handle_m4): Favor --debugfile over misnamed
> > --error-output, to avoid warnings with M4 2.0.
> 
> That looks reasonable; please install.  Thanks.
> 

Done, plus this followon change:

2006-09-19  Eric Blake  <[EMAIL PROTECTED]>

* m4/m4.m4: Change copyright.
* configure: Regenerate.
* Makefile.in: Likewise.
* bin/Makefile.in: Likewise.
* doc/Makefile.in: Likewise.
* lib/Makefile.in: Likewise.
* lib/Autom4te/Makefile.in: Likewise.
* lib/autoconf/Makefile.in: Likewise.
* lib/autoscan/Makefile.in: Likewise.
* lib/autotest/Makefile.in: Likewise.
* lib/emacs/Makefile.in: Likewise.
* lib/m4sugar/Makefile.in: Likewise.
* man/Makefile.in: Likewise.
* tests/Makefile.in: Likewise.

Index: m4/m4.m4
===
RCS file: /sources/autoconf/autoconf/m4/m4.m4,v
retrieving revision 1.5
diff -u -b -r1.5 m4.m4
--- m4/m4.m420 Sep 2006 02:44:51 -  1.5
+++ m4/m4.m420 Sep 2006 03:05:35 -
@@ -1,19 +1,8 @@
-# Copyright (C) 2000, 2006 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# m4.m4 serial 2
+dnl Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 
 # AC_PROG_GNU_M4
 # --







Re: Fix chdir-long.m4 caching (was: megatest fallout)

2006-09-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 9/25/2006 2:03 PM:
> Hello Jim,
> 
>>   7 checking whether this system has an arbitrary file name length 
>> limit... yes
> 
> OK to apply this patch?  I think this variable isn't used elsewhere in
> gnulib nor coreutils, so renaming this shouldn't be a problem.

How about covering our tracks so this won't happen again?

2006-09-25  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/general.m4 (AC_CACHE_VAL): Warn if cache-id is not
cached.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFGJLa84KuGfSFAYARAmFyAKCO6c9SAlf5VPQV8Cpf8Zpy9NekAwCfaP/6
P0OZoxGRqau7wwh5WNromK8=
=DMRt
-END PGP SIGNATURE-
Index: lib/autoconf/general.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.930
diff -u -p -r1.930 general.m4
--- lib/autoconf/general.m4 14 Sep 2006 09:40:59 -  1.930
+++ lib/autoconf/general.m4 26 Sep 2006 02:38:20 -
@@ -1905,7 +1905,10 @@ rm -f confcache[]dnl
 # The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
 # Should be dnl'ed.  Try to catch common mistakes.
 m4_defun([AC_CACHE_VAL],
-[m4_bmatch([$2], [AC_DEFINE],
+[m4_bmatch([$1], [_cv_],
+  [AC_DIAGNOSE([syntax],
+[$0($1, ...): suspicious cache-id, must contain _cv_ to be cached])])dnl
+m4_bmatch([$2], [AC_DEFINE],
   [AC_DIAGNOSE([syntax],
 [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
 [where no actions should be taken])])dnl


Re: Fix chdir-long.m4 caching

2006-09-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Ralf,

According to Ralf Wildenhues on 9/25/2006 11:00 PM:
>> How about covering our tracks so this won't happen again?
> 
> Nice idea (I had it too but wasn't sure whether it could be done safely).
> Your patch has the logic the other way round, and it fails to work with
> shell indirections.

Indeed - I was just throwing the idea out for comment, and had not tested
it yet (or I probably would have noticed my backwards logic).

> I'm still not sure whether the following is safe.

It looks right to me - all it does is add a warning if the first argument
is literal but does not contain _cv_; otherwise it does not change
behavior.  I say go for the patch, as you have it written; and after we
figure out a test case to add to make sure we are triggering the warning
as expected.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFGRiP84KuGfSFAYARAhroAJ4n6w9QdOzBjZc/vgDmm7NnadlQcQCgyHmk
EjiiL27MQVCAIxR1x2Uzhvk=
=eeCS
-END PGP SIGNATURE-




Re: Fix chdir-long.m4 caching

2006-09-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake-1 on 9/26/2006 1:28 PM:
>> Well, here you go.  First, the patch makes the `AC_CACHE_CHECK' test
>> fail, so is incomplete.  So here's a patch to fix the test, also test
>> that we warn in the literal case, and add a case with a m4 macro.  This
>> is where my previous patch failed.  I guess you'd suggest I need to rip
>> off a set of `[]' quotes from the second argument of AC_CACHE_CHECK.
>> I'd argue that this could be a backward incompatibility for user code.
> 
> Ouch - that means AS_LITERAL_IF gets things wrong when we pass
> a macro that expands to a non-literal.  This sounds like you uncovered
> a bigger bug, and I'm not sure what impact it would have if we changed
> AS_LITERAL_IF to check for m4 macros, and/or change AS_VAR_SET
> to properly quote.

On second thought, it looks like libtool exploits the fact that the first
argument to AC_CACHE_VAR can be a macro, so we definitely need to keep
this case working.  But it still might be worth making AS_LITERAL_IF
recognize when it is handed a macro name that would expand to a non-literal.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFGdyt84KuGfSFAYARApX6AJ4icEQdNbxBfPOvoybbC796YbNKGgCgkUQD
3M1JcxEMrWxZj80ZUU2Sv+Q=
=dhKG
-END PGP SIGNATURE-




Re: Fix AC_FUNC_ERROR_AT_LINE and others

2006-09-27 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 9/26/2006 11:53 PM:
> Does Cygwin have an error_at_line function without having an
> ?  If not, then it shouldn't be an issue, as the test is for
> error_at_line.

Indeed.  cygwin does not have error_at_line, and the autoconf testsuite
for AC_FUNC_ERROR_AT_LINE still passed.  Lack of the header caused the
desired compilation failure corresponding to lack of the function.  So no
problem with your patch :)

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFGm9u84KuGfSFAYARAmWiAJwJKV4LGvDSufq47t2H3CU3I9VslQCdFK66
yY0+seI66LWAbB1XfbGkJPY=
=fxg4
-END PGP SIGNATURE-




Re: Fix chdir-long.m4 caching

2006-09-30 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 9/29/2006 7:48 AM:
> 
> Why both of them have to be updated?  There are far more consumers
> of Autoconf than of Autotest.  I suggest to remove the limitation
> from AT_CHECK documentation only.  Ultrix is rare these days, and
> people willing to run the generated testsuite there will have to use
> a working shell.
> 
> What about the following patch?

> 2006-09-29  Stepan Kasal  <[EMAIL PROTECTED]>
>
>   * doc/autoconf.texi (Writing testsuite.at): Remove the
>   limitation that the first parameter of AT_CHECK cannot
>   contain redirection.
>   * tests/local.at (AT_CHECK_M4): Fix for cases when the past
>   parameter is `stderr' or `experr'.

I like the thought, but we would also need to update the comments in
lib/autotest/general.m4, and perhaps add a warning in the manual that
autotest will not work with Ultrix.  Or maybe it is time to update our
shell selection logic to make sure that the shell supports double
redirection along with all the other features we require, and filter out
any shell that behaves as poorly as Ultrix (but did Ultrix come with any
alternate shell, or would we pounding the last nail in the coffin of that
museum system?).

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFHnP884KuGfSFAYARAlltAKCkX4arV8a/sVQIaaJshEW7EhkwzQCgy3mR
Bs0cYBmZa0A6pJklRcMUE3o=
=BGlC
-END PGP SIGNATURE-




Re: Fix chdir-long.m4 caching

2006-09-30 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Stepan Kasal on 9/29/2006 8:46 AM:
> So I did the one line change to AS_LITERAL_IF, did many changes in
> the indirect callers of it, and wrote a test case.
> 
> The resulting patch is attached here.

Thanks for all that effort.  I agree with your reasoning and testing
approach, and the patch appears to be correct to me.  Is there any
documentation we need to update as a result, just in case there is a rare
compatibility problem?  And I would feel comfortable getting more than
just my opinion before applying this patch, as it touches a rather
fundamental low-level piece of autoconf.

> 
> Can this bring some backward compatibility problems?

Perhaps if the macro has side-effects, although that is bad style:
m4_define([count], [0])
m4_define([ac_var], [m4_pushdef([count],
  m4_incr(count))ac_cv_side_effect_counter])

# this would only bump count once, since we did the expansion early
AC_CACHE_CHECK([for something], ac_var)
# but how many times is count bumped here?  I think it is different pre-
# and post-patch, because the text ac_var gets output multiple times,
# and each output is then expanded during rescanning.
AC_CACHE_CHECK([for something else], [ac_var])

But I don't see any evidence of real-life autoconf macros this perverted,
where the user cares about the final value of count.

> As I said before, I hope the problems should be rare.

I hope so too.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFHngz84KuGfSFAYARAlioAKCBpFh888t3g6a+G/F0gNSlc3DTegCfeLod
85eGSQvji/ITXDnrcxEe4rU=
=2m/E
-END PGP SIGNATURE-




Re: Fix AC_FUNC_ERROR_AT_LINE and others

2006-10-03 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 10/3/2006 12:56 AM:
> 
>> That is because gnulib-tool is smart enough to require AC_GNU_SOURCE,
>> but does not require AC_USE_SYSTEM_EXTENSIONS (it requires
>> gl_USE_SYSTEM_EXTENSIONS instead).  I'm not sure whether the fix
>> lies in autoconf or in gnulib.
> 
> Sorry, I don't understand the problem.  gl_USE_SYSTEM_EXTENSIONS
> AC_REQUIREs AC_USE_SYSTEM_EXTENSIONS, so if gnulib-tool requires
> gl_USE_SYSTEM_EXTENSIONS, why isn't that equivalent to requiring
> AC_USE_SYSTEM_EXTENSIONS?

gl_USE_SYSTEM_EXTENSIONS was the culprit, and I updated it last night to
require AC_USE_SYSTEM_EXTENSIONS when that is defined.  So autoconf no
longer needs to worry.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFIk5Y84KuGfSFAYARAiy9AJ0TXXeQ68cNnqCwFss4llR87IjVegCfffbt
4QoGo3utkdggmJZdiTJnMh8=
=2AnP
-END PGP SIGNATURE-




Re: Fix chdir-long.m4 caching

2006-10-14 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

PING

According to Stepan Kasal on 9/29/2006 8:46 AM:
> Hello,
> 
> On Wed, Sep 27, 2006 at 07:29:45PM +0200, I proposed:
>> ``The right way'' first.
>>
>> 1a)
>> I think that it would be best for consistency to write:
>>   AC_CACHE_CHECK([for $1], [ac_var], ...
>> and then remove the [] quotes from the definition of AC_CACHE_CHECK.
> 
...

> 
> So I did the one line change to AS_LITERAL_IF, did many changes in
> the indirect callers of it, and wrote a test case.
> 
> The resulting patch is attached here.
> 
> Can this bring some backward compatibility problems?
> As I said before, I hope the problems should be rare.
> After a consultation with Ralf Cautious Wildenhues, I tested the
> patch with libtool (details below).  And I verified that my patch
> passes the test suites of Autoconf and Automake.
> 
> So I believe the patch is safe.  OK to commit?

Anyone else care to review this patch?  I've been running with it in my
local tree with no apparent adverse affects.

> 
> 2006-09-29  Stepan Kasal  <[EMAIL PROTECTED]>
> 
>   * lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Expand $1 before
>   looking for special shell characters.
>   * lib/autoconf/functions.m4 (AC_CHECK_FUNC): Do not expand the
>   macro defined by AS_VAR_PUSHDEF before passing it as a
>   parameter.
>   * lib/autoconf/general.m4 (AC_CHECK_FILE, AC_CHECK_DECL):
>   * lib/autoconf/libs.m4 (AC_SEARCH_LIBS, AC_CHECK_LIB):
>   * lib/autoconf/types.m4 (_AC_CHECK_TYPE_NEW, AC_CHECK_MEMBER):
>   * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL,
>   _AC_CHECK_HEADER_NEW, _AC_CHECK_HEADER_OLD,
>   _AC_CHECK_HEADER_DIRENT): Likewise.
>   * lib/autotest/general.m4 (AT_INIT): Quote parameters of
>   AS_VAR_* properly.
>   * tests/m4sh.at (AS_LITERAL_IF): New test.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFMN5k84KuGfSFAYARAn7qAJ9HlCMTN0L+CKR6JwmbpboKHXbIFgCeM99D
eOU4culhQgYPj9udJvPFjdo=
=hrDT
-END PGP SIGNATURE-




fix --version output

2006-10-15 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

GNU Coding Standards recommend listing the copyright as the second line,
and delaying the authors to the end.
http://www.gnu.org/prep/standards/standards.html#Command_002dLine-Interfaces

OK to apply?

2006-10-15  Eric Blake  <[EMAIL PROTECTED]>

* bin/autoconf.as (version): Reorder to match GNU Coding
Standards.
* bin/autoheader.in (version): Likewise.
* bin/autom4te.in (version): Likewise.
* bin/autoreconf.in (version): Likewise.
* bin/autoscan.in (version): Likewise.
* bin/autoupdate.in (version): Likewise.
* bin/ifnames.in (version): Likewise.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFMt1Z84KuGfSFAYARApAqAKCLAEZn1VuS7omx6pwBcebRVDk5HgCgqkwy
s0QkBZA8rpR1jDv/NI4rA98=
=ouYV
-END PGP SIGNATURE-
Index: bin/autoconf.as
===
RCS file: /sources/autoconf/autoconf/bin/autoconf.as,v
retrieving revision 1.20
diff -u -p -r1.20 autoconf.as
--- bin/autoconf.as 24 Aug 2006 22:56:47 -  1.20
+++ bin/autoconf.as 16 Oct 2006 01:11:54 -
@@ -61,11 +61,11 @@ Report bugs to ."]
 
 version=["\
 autoconf (@PACKAGE_NAME@) @VERSION@
-Written by David J. MacKenzie and Akim Demaille.
-
 Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."]
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+Written by David J. MacKenzie and Akim Demaille."]
 
 help="\
 Try \`$as_me --help' for more information."
Index: bin/autoheader.in
===
RCS file: /sources/autoconf/autoconf/bin/autoheader.in,v
retrieving revision 1.145
diff -u -p -r1.145 autoheader.in
--- bin/autoheader.in   6 Jan 2006 00:10:37 -   1.145
+++ bin/autoheader.in   16 Oct 2006 01:11:54 -
@@ -87,11 +87,11 @@ Report bugs to <[EMAIL PROTECTED]>.
 # $VERSION
 # 
 $version = "autoheader (@PACKAGE_NAME@) @VERSION@
-Written by Roland McGrath and Akim Demaille.
-
 Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+Written by Roland McGrath and Akim Demaille.
 ";
 
 
Index: bin/autom4te.in
===
RCS file: /sources/autoconf/autoconf/bin/autom4te.in,v
retrieving revision 1.101
diff -u -p -r1.101 autom4te.in
--- bin/autom4te.in 20 Sep 2006 02:44:51 -  1.101
+++ bin/autom4te.in 16 Oct 2006 01:11:55 -
@@ -211,11 +211,11 @@ Report bugs to <[EMAIL PROTECTED]>.
 # 
 $version =  <<"EOF";
 autom4te (@PACKAGE_NAME@) @VERSION@
-Written by Akim Demaille.
-
 Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+Written by Akim Demaille.
 EOF
 
 
Index: bin/autoreconf.in
===
RCS file: /sources/autoconf/autoconf/bin/autoreconf.in,v
retrieving revision 1.135
diff -u -p -r1.135 autoreconf.in
--- bin/autoreconf.in   5 Jun 2006 12:16:06 -   1.135
+++ bin/autoreconf.in   16 Oct 2006 01:11:55 -
@@ -97,11 +97,11 @@ Report bugs to <[EMAIL PROTECTED]>.
 # $VERSION
 # 
 $version = "autoreconf (@PACKAGE_NAME@) @VERSION@
-Written by David J. MacKenzie and Akim Demaille.
-
 Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+Written by David J. MacKenzie and Akim Demaille.
 ";
 
 # Lib files.
Index: bin/autoscan.in
===
RCS file: /sources/autoconf/autoconf/bin/autoscan.in,v
retrieving revision 1.105
diff -u -p -r1.105 autoscan.in
--- bin/autoscan.in 3 Apr 2006 15:58:20 -   1.105
+++ bin/autoscan.in 16 Oct 2006 01:11:55 -
@@ -123,11 +123,11 @@ Report bugs to <[EMAIL PROTECTED]>.\
 # $version
 # 
 $version = "autoscan (@PACKAGE_NAME@) @VERSION@
-Written by David J. MacKenzie and Akim Demaille.
-
 Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+warran

Re: fix --version output

2006-10-16 Thread Eric Blake
Paul Eggert  CS.UCLA.EDU> writes:

> > 2006-10-15  Eric Blake   byu.net>
> >
> > * bin/autoconf.as (version): Reorder to match GNU Coding
> > Standards.
...
> 
> Thanks; please apply.
> 

Done, along with rewording to match gnulib's version-etc wording style, and 
accompanied with regenerating everything using automake 1.10 instead of 1.9.6.

-- 
Eric Blake






doc typo fix

2006-10-16 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Applied as obvious.

2006-10-16  Eric Blake  <[EMAIL PROTECTED]>

* doc/autoconf.texi (Setting Output Variables): Fix typo.

Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1095
diff -u -p -r1.1095 autoconf.texi
- --- doc/autoconf.texi   14 Oct 2006 09:54:32 -  1.1095
+++ doc/autoconf.texi   17 Oct 2006 02:29:39 -
@@ -8356,7 +8356,7 @@ The string @var{variable} is passed to @
 (@pxref{Forbidden Patterns}).
 @end defmac

- [EMAIL PROTECTED] Previous Variable
[EMAIL PROTECTED] Precious Variable
 @cindex Variable, Precious
 Running @command{configure} in varying environments can be extremely
 dangerous.  If for instance the user runs @samp{CC=bizarre-cc

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFNEB+84KuGfSFAYARAv0qAJsGTgA8Q1BU0qIJ8yP7Z/RcOwaf2ACfS7wa
k6qE5Jj2ZuayK/eUYAXM6Nc=
=i1Zl
-END PGP SIGNATURE-




m4 2.0 maketemp vs. mkstemp

2006-10-19 Thread Eric Blake
The Austin group has recommended that for the next version of POSIX, m4's 
maketemp macro be deprecated as insecure (POSIX specifies it to replace 
trailing X's with the pid without regards to file existence, which makes it 
easy for an attacker to provide a substitute file), and add a new macro mkstemp 
that matches the current M4 1.4.x maketemp semantics [1] (based on mkstemp(3) 
semantics).  As a result, I will be patching CVS m4 to emit a warning on use of 
maketemp, and that will cause autom4te to fail if anyone is using m4sugar's 
current m4_maketemp.  So I propose this patch, which adds m4_mkstemp, and makes 
m4_maketemp and m4_mkstemp synonyms (both pointing to the non-warning variant 
provided by the underlying M4).  OK to apply?

[1] See the thread at 
http://www.opengroup.org/austin/mailarchives/ag/msg09834.html; if you are an 
Austin group member (free registration), you can also login to read the 
referenced proposed interpretation 117.

2006-10-19  Eric Blake  <[EMAIL PROTECTED]>

* lib/m4sugar/m4sugar.m4 (m4_maketemp): Avoid warnings generated
by M4 1.9a.
* lib/emacs/autoconf-mode.el (autoconf-font-lock-keywords):
Color m4_mkstemp.
* doc/autoconf.texi (Redefined M4 Macros): Document m4_mkstemp.

Index: lib/m4sugar/m4sugar.m4
===
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sugar.m4,v
retrieving revision 2.99
diff -u -r2.99 m4sugar.m4
--- lib/m4sugar/m4sugar.m4  20 Jun 2006 05:35:38 -  2.99
+++ lib/m4sugar/m4sugar.m4  19 Oct 2006 16:46:56 -
@@ -140,7 +140,11 @@
 m4_rename_m4([len])
 m4_rename([m4exit], [m4_exit])
 m4_rename([m4wrap], [m4_wrap])
-m4_rename_m4([maketemp])
+m4_ifdef([mkstemp],
+ [m4_rename_m4([mkstemp])
+  m4_copy([m4_mkstemp], [m4_maketemp])],
+ [m4_rename_m4([maketemp])
+  m4_copy([m4_maketemp], [m4_mkstemp])])
 m4_rename([patsubst], [m4_bpatsubst])
 m4_undefine([popdef])
 m4_rename_m4([pushdef])
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1096
diff -u -r1.1096 autoconf.texi
--- doc/autoconf.texi   17 Oct 2006 02:31:44 -  1.1096
+++ doc/autoconf.texi   19 Oct 2006 16:56:58 -
@@ -9752,7 +9752,6 @@
 @msindex{index}
 @msindex{indir}
 @msindex{len}
[EMAIL PROTECTED]
 @msindex{pushdef}
 @msindex{shift}
 @msindex{substr}
@@ -9856,6 +9855,20 @@
 to recover the behavior of the builtin.
 @end defmac
 
[EMAIL PROTECTED] m4_maketemp (@var{template})
[EMAIL PROTECTED] m4_mkstemp (@var{template})
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+Posix requires @code{maketemp} to replace the trailing @samp{X}
+characters in @var{template} with the process id, without regards to the
+existence of a file by that name, but this a security hole.  When this
+was pointed out to the Posix folks, they agreed to invent a new macro
[EMAIL PROTECTED] that always creates a uniquely named file, but not all
+versions of @acronym{GNU} M4 support the new macro.  In M4sugar,
[EMAIL PROTECTED] and @code{m4_mkstemp} are synonyms for each other,
+and both have the secure semantics regardless of which macro the
+underlying M4 provides.
[EMAIL PROTECTED] defmac
 
 
 @node Looping constructs
@@ -19135,4 +19148,6 @@
 @c Local Variables:
 @c fill-column: 72
 @c ispell-local-dictionary: "american"
[EMAIL PROTECTED] indent-tabs-mode: nil
[EMAIL PROTECTED] whitespace-check-buffer-indent: nil
 @c End:
Index: lib/emacs/autoconf-mode.el
===
RCS file: /sources/autoconf/autoconf/lib/emacs/autoconf-mode.el,v
retrieving revision 1.4
diff -u -r1.4 autoconf-mode.el
--- lib/emacs/autoconf-mode.el  14 May 2005 07:00:40 -  1.4
+++ lib/emacs/autoconf-mode.el  19 Oct 2006 17:09:59 -
@@ -6,7 +6,7 @@
 
 ;; This file is part of Autoconf
 
-;; Copyright 2001 Free Software Foundation, Inc.
+;; Copyright 2001, 2006 Free Software Foundation, Inc.
 ;;
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@
 (defvar autoconf-font-lock-keywords
   `(("\\bdnl \\(.*\\)"  1 font-lock-comment-face t)
 ("[EMAIL PROTECTED]" . font-lock-variable-name-face)
-("\\b\\(m4_\\)?\\(builtin\\|change\\(com\\|quote\\|word\\)
\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)
\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)
\\|gnu\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)
\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\)
\\|p\\(atsubst\\|opdef\\|ushdef\\)
\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)
\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)
\\b" . font-lock-keyword-face)
+("\\b\\(m4_\\)?\\(builtin\\|change\\(com\\|

m4_quote [was: fix AT_SETUP's sh-escaping]

2006-10-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Joel E. Denny on 10/25/2006 2:20 AM:
> On Mon, 23 Oct 2006, Paul Eggert wrote:
> 
>> First, shouldn't that m4_dquote be m4_quote?
> 
> As far as I can tell, m4_quote does nothing.  That is, the quotes it adds 
> are just stripped immediately upon return.  I'm really not sure why 
> m4_quote exists, but maybe I'm just missing something.

It exists for expanding relatively arbitrary parameters inside nested
macros.  For example, in the upcoming M4 1.4.8 manual, I have the
following example of a foreach macro (converted here to m4sugar syntax):

# foreachq(x, `item_1, item_2, ..., item_n', stmt)
#   quoted list, simple version
m4_define([foreachq], [m4_pushdef([$1])_foreachq($@)m4_popdef([$1])])
m4_define([_arg1], [$1])
m4_define([_foreachq], [m4_if(m4_quote($2), [], [],
  [m4_define([$1], [_arg1($2)])$3[]$0([$1], [m4_shift($2)], [$3])])])

If you don't use m4_quote, then the unquoted expansion of $2 inside the
first argument of m4_if will lead to syntax errors if $2 contains unquoted
commas.

However, I don't recommend the above foreachq macro - it is quadratic in
behavior (the m4 1.4.8 manual documents it as an example of what not to
do, then provides a better solution later).  Instead, use m4_foreach
already provided by m4sugar, which already solves the problem in a linear
fashion.

m4_quote still will not protect you from unquoted close parentheses, so if
your arbitrary text is likely to be a portable shell case statement, you
are already in quoting trouble.  There is an item on the M4 2.0 todo list
to add a new builtin that can handle truly arbitrary text, regardless of
unquoted commas or close parentheses, but that has not been implemented yet.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFP1gZ84KuGfSFAYARAjT5AKCp06GcjTwiBov6wMQakerI67xEQQCgn+NN
Z5k3YqvMjFfc3w64ezZjaEQ=
=VIJ+
-END PGP SIGNATURE-




Re: m4_quote [was: fix AT_SETUP's sh-escaping]

2006-10-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Joel E. Denny on 10/26/2006 12:14 AM:
> 
> I just did this experiment, which for me is clearer than either above 
> example:
> 
>   $ cat example.m4
>   m4_divert(0)dnl
>   m4_define([mkargs],[1,2,3])
>   m4_define([echo_arg1],[[$1]])
>   echo_arg1(mkargs)
>   echo_arg1([mkargs])
>   echo_arg1(m4_quote(mkargs))
>   echo_arg1(m4_dquote(mkargs))
>   $ autom4te -l m4sugar example.m4
>   1
>   mkargs
>   1,2,3
>   [1],[2],[3]
> 
> I wonder if this could be added to the autoconf manual.
> 

Sounds good to me.  How about this patch?

2006-10-26  Eric Blake  <[EMAIL PROTECTED]>

* THANKS: Update.
* doc/autoconf.texi (Evaluation Macros): Improve the example to
show effect on macros that expand with commas.
Reported by Joel E. Denny.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFQKoe84KuGfSFAYARAkMSAKDWStEcXaNFjOterLYxfBkZ4ueXfACfTDHD
BikoajIsHteCbOtSfTrmTGA=
=6/mh
-END PGP SIGNATURE-
Index: doc/autoconf.texi
===
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1101
diff -u -p -r1.1101 autoconf.texi
--- doc/autoconf.texi   25 Oct 2006 20:21:05 -  1.1101
+++ doc/autoconf.texi   26 Oct 2006 12:28:48 -
@@ -9921,14 +9921,24 @@ using these macros, (ii), using @code{m4
 $ @kbd{cat example.m4}
 # Overquote, so that quotes are visible.
 m4_define([show], [$[]1 = [$1], $[]@@ = [$@@]])
+m4_define([mkargs], [1, 2, 3])
+m4_define([arg1], [[$1]])
 m4_divert(0)dnl
 show(a, b)
 show(m4_quote(a, b))
 show(m4_dquote(a, b))
+arg1(mkargs)
+arg1([mkargs])
+arg1(m4_quote(mkargs))
+arg1(m4_dquote(mkargs))
 $ @kbd{autom4te -l m4sugar example.m4}
 $1 = a, $@@ = [a],[b]
 $1 = a,b, $@@ = [a,b]
 $1 = [a],[b], $@@ = [[a],[b]]
+1
+mkargs
+1,2,3
+[1],[2],[3]
 @end example
 
 


Re: Autoconf fails tests 24 and 26 with M4 branch-1_4 now

2006-10-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[I guess since this is a patch, I should copy it to the patch list...]

According to Ralf Wildenhues on 10/26/2006 12:52 AM:
> I'm seeing further destabilization in the Autoconf/M4 combo.
> My increased focus on testing this combination is because:
> - there was an announcement that the next Autoconf release may be
>   released soon,
> - due to Stepan's recent changes to Autoconf, it practically now
>   *requires* at least M4 1.4.7 to operate properly.  So if it finally
>   turns out that 1.4.7 has a regression over previous M4 releases, there
>   is a trap situation for users.

Which change are you referring to that requires 1.4.7 or greater?  To my
knowledge, even the original M4 1.4 from ten years ago can still make it
through the 2.61 testsuite.  The change to quit redirecting stdin from
/dev/null was only for M4 CVS head, and has no bearing on 1.4.x behavior.

On the other hand, last night I found a bug in 1.4.7 that can potentially
lead to arbitrary code execution, due to an allocation overflow in the
divert builtin.  Recommending 1.4.8 is not necessarily a bad idea for the
security conscious (I'm hoping to release 1.4.8 this weekend, but there is
still an outstanding gnulib patch that mkdtemp does not compile on mingw
that I need to get resolved).

>
> Here are the failures.  By the way, there was a time when version
> requirements were not quite as strict, by the way.
>
> Cheers,
> Ralf
>
> # -*- compilation -*-
> 24. m4sugar.at:51: testing ...
...

> --- - 2006-10-26 08:34:34.110204000 +0200
> +++ /tmp/autoconf/build/tests/testsuite.dir/at-stdout 2006-10-26 
> 08:34:34.0 +0200
> @@ -1,6 +1,6 @@
>  script.4s:6: warning: obsolete
>  script.4s:7: warning: cross
> -script.4s:3: cross_warning is expanded from...
> +script.4s:2: cross_warning is expanded from...
>  script.4s:7: the top level
>  script.4s:8: warning: syntax
>

> 26. m4sugar.at:121: testing ...
> +++ /tmp/autoconf/build/tests/testsuite.dir/at-stdout 2006-10-26 
> 08:34:34.0 +0200
> @@ -1,7 +1,7 @@
>  script.4s:12: error: m4_require: circular dependency of foo
> -script.4s:5: bar is expanded from...
> -script.4s:2: foo is expanded from...
> -script.4s:8: baz is expanded from...
> +script.4s:4: bar is expanded from...
> +script.4s:1: foo is expanded from...
> +script.4s:7: baz is expanded from...

Both of these are again line-number related.  Now that the __line__
invoked under the hood by m4_defun in 1.4.7a tracks the location of the
m4_defun's open (, rather than the location of the ), the solution is to
collapse the testsuite use of m4_defun to a single line.  Here's a
proposed testsuite patch:

2006-10-26  Eric Blake  <[EMAIL PROTECTED]>

    * tests/m4sugar.at (m4_warn, m4_require: circular dependencies):
Also work with M4 1.4.8.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFQKqb84KuGfSFAYARArN5AKCI2XIr3NNW9Rsi50i8PPVjcAAx2wCgwF/q
qur/9EzYM/v4QtgAuLfxQgg=
=BMib
-END PGP SIGNATURE-
Index: tests/m4sugar.at
===
RCS file: /sources/autoconf/autoconf/tests/m4sugar.at,v
retrieving revision 1.31
diff -u -p -r1.31 m4sugar.at
--- tests/m4sugar.at20 Jun 2006 05:35:38 -  1.31
+++ tests/m4sugar.at26 Oct 2006 12:13:04 -
@@ -59,8 +59,7 @@ AT_SETUP([m4@&[EMAIL PROTECTED])
 
 AT_DATA_M4SUGAR([script.4s],
 [[m4_init
-m4_defun([cross_warning],
-[m4_warn([cross],  [cross])])
+m4_defun([cross_warning], [m4_warn([cross],  [cross])])
 
 m4_divert([0])dnl
 m4_warn([obsolete],  [obsolete])dnl
@@ -69,27 +68,27 @@ m4_warn([syntax], [syntax])dnl
 ]])
 
 AT_CHECK_M4SUGAR([-o-], 0, [],
-[script.4s:8: warning: syntax
+[script.4s:7: warning: syntax
 ])
 
 AT_CHECK_M4SUGAR([-o- -Wall -f], 0, [],
-[script.4s:6: warning: obsolete
-script.4s:7: warning: cross
-script.4s:3: cross_warning is expanded from...
-script.4s:7: the top level
-script.4s:8: warning: syntax
+[script.4s:5: warning: obsolete
+script.4s:6: warning: cross
+script.4s:2: cross_warning is expanded from...
+script.4s:6: the top level
+script.4s:7: warning: syntax
 ])
 
 AT_CHECK_M4SUGAR([-o- -Wnone,cross -f], 0, [],
-[script.4s:7: warning: cross
-script.4s:3: cross_warning is expanded from...
+[script.4s:6: warning: cross
+script.4s:2: cross_warning is expanded from...
 script.4s:7: the top level
 ])
 
 AT_CHECK_M4SUGAR([-o- -Wnone,cross,error -f], 1, [],
-[[script.4s:7: warning: cross
-script.4s:3: cross_warning is expanded from...
-script.4s:7: the top level
+[[script.4s:6: warning: cross
+script.4s:2: cross_warning is e

Re: Autoconf fails tests 24 and 26 with M4 branch-1_4 now

2006-10-26 Thread Eric Blake
Ralf Wildenhues  gmx.de> writes:

> 
> Hi Eric,
> 
> * Eric Blake wrote on Thu, Oct 26, 2006 at 02:31:23PM CEST:
> > [I guess since this is a patch, I should copy it to the patch list...]
> > 2006-10-26  Eric Blake  <[EMAIL PROTECTED]> 
> > 
> > * tests/m4sugar.at (m4_warn, m4_require: circular dependencies): 
> > Also work with M4 1.4.8. 
> 
> Yes, thanks.

I went ahead and checked this in.

-- 
Eric Blake






Re: m4_quote

2006-10-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 10/26/2006 10:06 AM:
> Eric Blake <[EMAIL PROTECTED]> writes:
> 
>> Sounds good to me.  How about this patch?
>>
>> 2006-10-26  Eric Blake  <[EMAIL PROTECTED]>
>>
>>  * THANKS: Update.
>>  * doc/autoconf.texi (Evaluation Macros): Improve the example to
>>  show effect on macros that expand with commas.
>>  Reported by Joel E. Denny.
> 
> That looks good, thanks; please install.

Done, plus a comparison between arg1(m4_defn([mkargs])) vs.
arg1(m4_quote(mkargs)) (the latter collapses spaces after commas).

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFQUwY84KuGfSFAYARAtCJAJ9tJHc1z6lIUh6URbvCFd6tiGY+bwCgiiqS
1/QQyLdCNsDBhuTXL/ktf/o=
=GCyG
-END PGP SIGNATURE-




Re: fix AT_SETUP's sh-escaping

2006-10-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Joel E. Denny on 10/26/2006 12:28 PM:
> 
> Ok, this seemingly obvious point didn't click with me completely 
> yesterday.  It seems a little funny to me that anyone would (1) pass in a 
> test description with macros to be expanded later and then (2) expect that 
> nothing strange would happen if the expansions contained characters that 
> are special to whatever the output language happens to be.

Until you realize that having macros expanding to characters that are
special in M4 is a desirable feature in autom4te, and that expanding the
macros early can mess up M4 parsing, whereas expanding them late will
work.  The manual documents the problems of having a macro that expands to
"#include ", and expanding that early, where it is treated as an
M4 comment, vs. expanding it late for a valid C code snippet.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFQU1g84KuGfSFAYARAgmaAJ4oPiKg3jmB3zhY98+ayv8fSH02hwCgm8dV
vfLw+6x5xZVQgFQW3Zp+dqg=
=rHQK
-END PGP SIGNATURE-




Re: fix AT_SETUP's sh-escaping

2006-11-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 11/9/2006 5:42 PM:
> 
> How about if we use something like the ECHO_C / ECHO_N technology
> instead?  I'll take a look at it, I guess.

Speaking of which, for some time now, I have wished that AT_DATA and
AT_CHECK could handle files that don't end in newline.  I ended up doing
this in the M4 autotest sources:

| AT_SETUP([__@&[EMAIL PROTECTED])
| dnl Unfortunately, AT_DATA does not make it easy to create files without
| dnl a trailing newline.
| [echo $ECHO_N "__line"__:__"file__$ECHO_C"] > nested
...

Perhaps I should look at using ECHO_C/ECHO_N technology to make it
possible to support AT_DATA([no newline]).

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFU/T184KuGfSFAYARAryYAJ9/NqxiYOh2T8kKd6E7Evbo/VeFFgCeJCPm
IUhxSI8QuVQeKlzkOWf8xgY=
=2XBn
-END PGP SIGNATURE-




Re: patch for problems with echo '-...' and echo '...\...'

2006-11-27 Thread Eric Blake
Paul Eggert  CS.UCLA.EDU> writes:

> 
> I fixed the problems that Ralf spotted in my pre-2.61 proposal (at
> least, the problems I understood...  and installed this patch.
> 
> 2006-11-17  Paul Eggert   cs.ucla.edu>
> 
>   'echo' has some portability problems, when given a first argument
>   with a leading '-', or when given any argument containing '\'.
>   Avoid using 'echo' in these cases.
...
>   * lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT, AT_INIT):
>   (AT_CLEANUP, _AT_DECIDE_TRACEABLE, _AT_CHECK): Likewise.


This patch triggers a coredump in bash 3.2.5, as detected by the m4 testsuite:

$ bash --version
GNU bash, version 3.2.5(6)-release (i686-pc-cygwin)
Copyright (C) 2005 Free Software Foundation, Inc.
$ bash
$ as_echo='printf %s\n'
$ : $as_echo "m4debug: module m4: opening file
m4debug: module m4: init hook called
m4debug: module m4: opened
m4debug: module m4: builtins loaded
m4debug: module gnu: opening file
m4debug: module gnu: opened
m4debug: module gnu: builtins loaded
m4debug: module gnu: macros loaded
m4debug: path search for \`in' found \`in'
m4debug: input read from in
m4trace:in:1: -1- id 1: include ... = {m4}
m4debug:in:1: path search for \`nested' found \`nested'
m4debug:in:1: input read from nested
m4trace:in:1: -1- id 1: include(\`nested') -> 
m4trace:nested:1: -1- id 2: m4wrap ... = {m4}
m4trace:nested:1: -1- id 2: m4wrap(\`divnum
') -> \`'
m4trace:nested:2: -1- id 3: dnl ... = {m4}
m4trace:nested:2: -1- id 3: dnl -> \`'
m4debug:nested:3: input reverted to in, line 1
m4trace:in:1: -1- id 4: dnl ... = {m4}
m4trace:in:1: -1- id 4: dnl -> \`'
m4trace:in:2: -1- id 5: len ... = {m4}
m4trace:in:2: -1- id 5: len(\`abc') -> \`3'
m4debug:in:3: input exhausted
m4debug: input from m4wrap recursion level 1
m4trace:nested:1: -1- id 6: divnum ... = {m4}
m4trace:nested:1: -1- id 6: divnum -> \`0'
m4debug: input from m4wrap exhausted
m4debug: module gnu: symbols unloaded
m4debug: module gnu: finish hook called
m4debug: module gnu: closed
m4debug: module m4: symbols unloaded
m4debug: module m4: resident module not closed
"
$ $as_echo "m4debug: module m4: opening file
m4debug: module m4: init hook called
m4debug: module m4: opened
m4debug: module m4: builtins loaded
m4debug: module gnu: opening file
m4debug: module gnu: opened
m4debug: module gnu: builtins loaded
m4debug: module gnu: macros loaded
m4debug: path search for \`in' found \`in'
m4debug: input read from in
m4trace:in:1: -1- id 1: include ... = {m4}
m4debug:in:1: path search for \`nested' found \`nested'
m4debug:in:1: input read from nested
m4trace:in:1: -1- id 1: include(\`nested') -> 
m4trace:nested:1: -1- id 2: m4wrap ... = {m4}
m4trace:nested:1: -1- id 2: m4wrap(\`divnum
') -> \`'
m4trace:nested:2: -1- id 3: dnl ... = {m4}
m4trace:nested:2: -1- id 3: dnl -> \`'
m4debug:nested:3: input reverted to in, line 1
m4trace:in:1: -1- id 4: dnl ... = {m4}
m4trace:in:1: -1- id 4: dnl -> \`'
m4trace:in:2: -1- id 5: len ... = {m4}
m4trace:in:2: -1- id 5: len(\`abc') -> \`3'
m4debug:in:3: input exhausted
m4debug: input from m4wrap recursion level 1
m4trace:nested:1: -1- id 6: divnum ... = {m4}
m4trace:nested:1: -1- id 6: divnum -> \`0'
m4debug: input from m4wrap exhausted
m4debug: module gnu: symbols unloaded
m4debug: module gnu: finish hook called
m4debug: module gnu: closed
m4debug: module m4: symbols unloaded
m4debug: module m4: resident module not closed
"
m4debug: module m4: opening file
m4debug: module m4: init hook called
m4debug: module m4: opened
m4debug: module m4: builtins loaded
m4debug: module gnu: opening file
m4debug: module gnu: opened
m4debug: module gnu: builtins loaded
m4debug: module gnu: macros loaded
m4debug: path search for `in' found `in'
m4debug: input read from in
m4trace:in:1: -1- id 1: include ... = {m4}
m4debug:in:1: path search for `nested' found `nested'
m4debug:in:1: input read from nested
m4trace:in:1: -1- id 1: include(`nested') -> 
m4trace:nested:1: -1- id 2: m4wrap ... = {m4}
m4trace:nested:1: -1- id 2: m4wrap(`divnum
') -> `'
m4trace:nested:2: -1- id 3: dnl ... = {m4}
m4trace:nested:2: -1- id 3: dnl -> `'
m4debug:nested:3: input reverted to in, line 1
m4trace:in:1: -1- id 4: dnl ... = {m4}
m4trace:in:1: -1- id 4: dnl -> `'
m4trace:in:2: -1- id 5: len ... = {m4}
m4trace:in:2: -1- id 5: len(`abc') -> `3'
m4debug:in:3: input exhausted
m4debug: input from m4wrap recursion level 1
m4trace:nested:1: -1- id 6: divnum ... = {m4}
m4trace:nested:1: -1- id 6: divnum -> `0'
m4debug: input from m4wrap exhausted
m4debug: module gnu: symbols unloaded
m4debug: module gnu: finish hook called
m4debug: module gnu: closed
m4debug: module m4: symbols unloaded
m4debug: module m4: resident module not closed
Aborted (core dumped)

I'm still trying to further analyze why bash is crashing on this input, and 
whether it is just limited to cygwin or visible from other platforms.

-- 
Eric Blake






Re: patch for problems with echo '-...' and echo '...\...'

2006-11-28 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 11/28/2006 1:50 AM:
> Eric Blake <[EMAIL PROTECTED]> writes:
> 
>> I'm still trying to further analyze why bash is crashing on this input, and 
>> whether it is just limited to cygwin or visible from other platforms.
> 
> For what it's worth, I can't reproduce the problem on Solaris 8
> (sparc), where Bash 3.2.5 was compiled by GCC 4.1.1 with the -m64
> option.

It seems to be a bug in newlib's asprintf, which would mean only platforms
like cygwin are affected, but I'm still trying to investigate it further.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFbEfT84KuGfSFAYARAowSAKDHHLDcPNk3x3mWQAktd1HdndBp7gCgpS3G
CUyNEPA9E9A4byGEwZixQVc=
=JMxf
-END PGP SIGNATURE-




Re: patch for problems with echo '-...' and echo '...\...'

2006-11-29 Thread Eric Blake
Eric Blake  byu.net> writes:

> > 
> > For what it's worth, I can't reproduce the problem on Solaris 8
> > (sparc), where Bash 3.2.5 was compiled by GCC 4.1.1 with the -m64
> > option.
> 
> It seems to be a bug in newlib's asprintf, which would mean only platforms
> like cygwin are affected, but I'm still trying to investigate it further.

FYI - the patch to newlib's asprintf is here:
http://sourceware.org/ml/newlib/2006/msg00931.html

All platforms that use older versions of newlib (ie. cygwin 1.5.22 and earlier) 
are vulnerable to any use of asprintf that results in more than BUFSIZ bytes.  
With this patch applied, the m4 testsuite once again passes, so no autoconf 
changes are needed in regards to this thread's change from echo to printf.  I'm 
not sure if it is worth an autoconf and/or gnulib macro to detect the newlib 
bug, since the cygwin community tends to recommend updating cygwin rather than 
trying to put workarounds in upstream packages.

-- 
Eric Blake






Re: cygwin -mno-cygwin AC_CHECK_SIZEOF

2006-12-01 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Bob Rossi on 12/1/2006 5:28 AM:
>>> And the fact that you are now telling configure the truth that you are
>>> cross-compiling, even though the cross binaries are executable, may be
>>> enough for autoconf to try harder for discovering how AC_CHECK_SIZEOF
>>> should behave without tripping up on line endings (and if that is not
>>> the case, maybe we should consider patching autoconf to make it happen
>>> that way).
>> Or have autoconf use some other tool that does not do binary processing
>> (e.g., awk or tr) instead of cat, which would enable the text mount
>> solution.
> 
> I really think this is the current best solution, that is, to modify
> autoconf to not use cat. Either that, or simply don't put the \n in the
> AC_CHECK_SIZEOF macro. I'm not sure why that is done in the first place.

Avoiding the troublesome line ending seems best to me.

> If
>   fprintf(f, "%d\n", sizeof($1));
> was changed to
>   fprintf(f, "%d", sizeof($1));
> I think it would fix the problem.
> 
> Well, I downloaded the autoconf sources, but couldn't find the
> AC_CHECK_SIZEOF code. I did find it in /usr/share/autoconf, but when I
> modify it, the system autoconf behavior doesn't change. Any ideas?

Patch below.  Keep replies on the autoconf-patches list.

2006-12-01  Eric Blake  <[EMAIL PROTECTED]>

* lib/autoconf/c.m4 (AC_LANG_INT_SAVE): Avoid newline, to aid in
cross-compiling from cygwin to mingw.
Reported by Bob Rossi.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFcDFp84KuGfSFAYARAtT8AJ0Y//kEEtgJ+IfEwPxpiffBFj4hLwCgwurT
8aHWGq0bRfQSCQDp8Yw7i2I=
=Lv51
-END PGP SIGNATURE-
Index: lib/autoconf/c.m4
===
RCS file: /sources/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.240
diff -u -p -r1.240 c.m4
--- lib/autoconf/c.m4   28 Nov 2006 00:26:45 -  1.240
+++ lib/autoconf/c.m4   1 Dec 2006 13:36:23 -
@@ -284,14 +284,14 @@ static unsigned long int ulongval () { r
   long int i = longval ();
   if (i != ($2))
return 1;
-  fprintf (f, "%ld\n", i);
+  fprintf (f, "%ld", i);
 }
   else
 {
   unsigned long int i = ulongval ();
   if (i != ($2))
return 1;
-  fprintf (f, "%lu\n", i);
+  fprintf (f, "%lu", i);
 }
   return ferror (f) || fclose (f) != 0;
 ])])


Re: cygwin -mno-cygwin AC_CHECK_SIZEOF

2006-12-01 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 12/1/2006 6:57 AM:
>> Avoiding the troublesome line ending seems best to me.
> 
> How does this mesh with
> <http://lists.gnu.org/archive/html/autoconf-patches/2001-09/msg00043.html>
> or formulated differently, if we're going to break POSIX compatibility,
> do we at least have sufficient evidence that all known systems cope with
> it?

POSIX requires cat to handle all files, not just text.  And I can't find
anywhere in POSIX that requires output handed to command substitution to
be a text file; command substitution is worded as removing any sequence of
one or more newlines, but nothing seems to say that a trailing newline
must have been present.  And autoconf only uses the file created by
AC_LANG_INT_SAVE in `cat conftest.val`.

> 
> FWIW, the patch in that thread undid a previous change that removed the
> line ending.

Yes, I think that reverting the older patch and removing the \n is safe
according to POSIX rules.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFcDqn84KuGfSFAYARAlOlAJ99iBBlSPX6ZvlBhhWMFOEp8CI62wCfcogO
R+2vY6Met+TC+GPjiYT5XIk=
=ODDq
-END PGP SIGNATURE-




Re: patch for problems with echo '-...' and echo '...\...'

2006-12-02 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 12/2/2006 3:36 AM:
> 
> I was thinking of preferring a shell with a builtin functioning printf,
> if we can find this out portably.  Any idea how we can reliably detect
> a command being builtin?

printf is new enough that shells that support it most likely also support
type.  At any rate, I would assume that this might be a close enough
approximation to what you are asking for, in that it would only give false
negatives:

case `(type printf) 2>/dev/null` in
  *built*in*) echo builtin ;;
  *) echo external or missing ;;
esac

My only concern is whether it would work reliably in MSYS, since Windows
provides a 'type.exe' utility that behaves more like cat; but my
understanding is that running ./configure on MSYS uses bash, where type
and printf are builtins, so I think it will work there, too.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFcZ5t84KuGfSFAYARAtQGAKC2ujZUO1ZCibAcbSeay40N/vnrqACfS8wY
x31f3WHL03mV2qfhguBD1BY=
=qB9M
-END PGP SIGNATURE-




Re: calling autoreconf and minimizing rebuilds

2006-12-05 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 12/4/2006 11:11 PM:
> Quoting automake/configure.ac:
> # The amount we should wait after modifying files depends on the platform.
> # On Windows '95, '98 and ME, files modifications have 2-seconds
> # granularity and can be up to 3 seconds in the future w.r.t. the
> # system clock.

For what it's worth, Microsoft no longer supports Windows 9x, so cygwin no
longer actively caters to support these old systems.  The eventual cygwin
1.7.0 has only been tested to work on Windows NT class systems.  But the
thread Ralf dug up shows that even NT systems have odd clock issues with
regards to FAT filesystems.

On the other hand, the 2-second granularity is a "feature" of the FAT
filesystem, which is run on more than just Windows (unfortunately, FAT
tends to be the filesystem of choice in USB Flash drives).  Even Linux
supports FAT, although I doubt anyone is foolhardy enough to develop on
FAT when there are so many better filesystems to choose from.  But you
need at least 'sleep 2' to guarantee distinct timestamps on FAT.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFdYIS84KuGfSFAYARArTxAJ4juONQEaAeYihDBb2dP4wwggKr1ACfdmks
4w8e9Nz4rz/jaPjMHSIZfzk=
=2XyF
-END PGP SIGNATURE-




Re: Time for Autoconf 2.61a?

2006-12-11 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 12/11/2006 12:17 AM:
> Would anyone object if I produced an Autoconf 2.61a test version and
> put it out on alpha.gnu.org?  This might help people test Autoconf's
> recent Awk-related changes more.

Do we want to go with libtool-like numbering, where ace... (odd letters)
are reserved for CVS builds, and bdf... (even letters) denote snapshots
uploaded to alpha.gnu.org?  Other than the choice of the number, I agree
that uploading a snapshot would be worthwhile.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFfVWC84KuGfSFAYARAiU/AKCDGcpj18837rsCyaQAT/376zPhyACeMrvf
ivF5oXjWOcJgUEc3oV6bvBI=
=OhE4
-END PGP SIGNATURE-




  1   2   3   4   5   6   7   8   9   10   >