[PATCH] update DEPENDENCIES for interix

2011-05-16 Thread mduft
From: Markus Duft md...@gentoo.org

Hey!

This is a small patch in reply to [1] to update the DEPENDENCIES for interix 
accordingly.
suacomp 0.6.8 (which is the dependency) is not yet released, but will be today 
or tomorrow,
so i think thath is not a problem :)

[1] http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00310.html

Regards, Markus

---
 ChangeLog|6 ++
 DEPENDENCIES |7 +++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c2a67da..e487d21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-16  Markus Duft  md...@gentoo.org
+
+   update dependencies for interix (SUA).
+   * DEPENDENCIES: add mandatory dependency to suacomp = 0.6.8 on
+   interix (only!).
+
 2011-05-13  Paul Eggert  egg...@cs.ucla.edu
 
intprops-tests: new module
diff --git a/DEPENDENCIES b/DEPENDENCIES
index f025ab2..aa2e7d9 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -90,6 +90,13 @@ at any time.
 http://ftp.gnu.org/gnu/grep/
 ftp://ftp.gnu.org/gnu/grep/
 
+* suacomp 0.6.8 or newer.
+  + Mandatory for Interix (Microsoft SUA) only.
+  + Homepage:
+http://www.sf.net/projects/suacomp
+  + Download:
+http://sourceforge.net/projects/suacomp/files/
+
 * GNU gettext.
   + Always use the newest available gettext release, see
 
http://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html.
-- 
1.7.3.4




Re: [PATCH] update DEPENDENCIES for interix

2011-05-16 Thread Eric Blake
On 05/16/2011 01:47 AM, md...@s01en22.salomon.at wrote:
 From: Markus Duft md...@gentoo.org
 
 Hey!
 
 This is a small patch in reply to [1] to update the DEPENDENCIES for interix 
 accordingly.
 suacomp 0.6.8 (which is the dependency) is not yet released, but will be 
 today or tomorrow,
 so i think thath is not a problem :)
 
 [1] http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00310.html
 
 Regards, Markus
 
 ---
  ChangeLog|6 ++
  DEPENDENCIES |7 +++
  2 files changed, 13 insertions(+), 0 deletions(-)
 
 diff --git a/ChangeLog b/ChangeLog
 index c2a67da..e487d21 100644
 --- a/ChangeLog
 +++ b/ChangeLog
 @@ -1,3 +1,9 @@
 +2011-05-16  Markus Duft  md...@gentoo.org
 +
 + update dependencies for interix (SUA).
 + * DEPENDENCIES: add mandatory dependency to suacomp = 0.6.8 on
 + interix (only!).

Hmm, is it also worth teaching gnulib-common.m4 to do a $host_os check
and make configure fail on interix if suacomp is not present on the
user's machine?

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

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



signature.asc
Description: OpenPGP digital signature


Re: bootstrap symlink dependencies

2011-05-16 Thread Pádraig Brady
On 14/05/11 09:07, Paul Eggert wrote:
 If something treats symlink mtime as significant,
 then I suspect that it's at fault.
 
 Yes, there's something busted there.  GNU 'make' does the right thing:
 it follows symlinks when checking time stamps.  Is some other 'make'
 is being used, or perhaps some tool other than 'make'?

I suspect something else in the depths of auto* is busted,
as I'm using standard make.

 If we did want to maintain the symlink timestamps for some reason,
 then I suppose we could do something like the following,
 but I'm unsure as how to do this best portably.
 
 We can use 'ls' rather than 'stat'.  Something like the following, perhaps?
 (I haven't tested it.)

I tested your ls ordering trick on linux, solaris 10 and freebsd and it works.
Please push.

thanks!
Pádraig.

 
 diff --git a/build-aux/bootstrap b/build-aux/bootstrap
 index d32db57..b6dacb7 100755
 --- a/build-aux/bootstrap
 +++ b/build-aux/bootstrap
 @@ -670,10 +670,17 @@ symlink_to_dir()
  cp -fp $src $dst
}
  else
 +  # Leave any existing symlink alone, if it already points to the source,
 +  # so that broken 'make' implementations that care about symlink times
 +  # aren't confused into doing unnecessary builds.  Conversely, if the
 +  # existing symlink's time stamp is older than the source, make it 
 afresh,
 +  # so that broken 'make's aren't confused into skipping needed builds.
test -h $dst 
src_ls=`ls -diL $src 2/dev/null`  set $src_ls  src_i=$1 
dst_ls=`ls -diL $dst 2/dev/null`  set $dst_ls  dst_i=$1 
 -  test $src_i = $dst_i || {
 +  test $src_i = $dst_i 
 +  both_ls=`ls -dt $src $dst` 
 +  test X$both_ls = X$dst$nl$src || {
  dot_dots=
  case $src in
  /*) ;;



Re: [PATCH] update DEPENDENCIES for interix

2011-05-16 Thread Markus Duft
On 05/16/11 16:01, Eric Blake wrote:
 On 05/16/2011 01:47 AM, md...@s01en22.salomon.at wrote:
 From: Markus Duft md...@gentoo.org

 Hey!

 This is a small patch in reply to [1] to update the DEPENDENCIES for interix 
 accordingly.
 suacomp 0.6.8 (which is the dependency) is not yet released, but will be 
 today or tomorrow,
 so i think thath is not a problem :)

 [1] http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00310.html

 Regards, Markus

 ---
  ChangeLog|6 ++
  DEPENDENCIES |7 +++
  2 files changed, 13 insertions(+), 0 deletions(-)

 diff --git a/ChangeLog b/ChangeLog
 index c2a67da..e487d21 100644
 --- a/ChangeLog
 +++ b/ChangeLog
 @@ -1,3 +1,9 @@
 +2011-05-16  Markus Duft  md...@gentoo.org
 +
 +update dependencies for interix (SUA).
 +* DEPENDENCIES: add mandatory dependency to suacomp = 0.6.8 on
 +interix (only!).
 
 Hmm, is it also worth teaching gnulib-common.m4 to do a $host_os check
 and make configure fail on interix if suacomp is not present on the
 user's machine?

hm - that's a good idea actually... because: if it is _not_ there, things
will most probably still compile, but introduce hard-to-find issues (like
tar producing files with wrong timestamps, and then make triggering autoconf, 
etc.,
maybe breaking builds as prerequisites for bootstrapping of those packages
are not there... wow - was that sentence meaningfull...? ;))

whatever - i will have a look at putting it all together and introduce that
check the next days

thanks :)
markus

 




Re: bootstrap symlink dependencies

2011-05-16 Thread Paul Eggert
On 05/16/11 07:44, Pádraig Brady wrote:
 I tested your ls ordering trick on linux, solaris 10 and freebsd and it works.
 Please push.

Thanks, done.



Re: bootstrap symlink dependencies

2011-05-16 Thread Jim Meyering
Paul Eggert wrote:
 On 05/16/11 07:44, Pádraig Brady wrote:
 I tested your ls ordering trick on linux, solaris 10 and freebsd and it 
 works.
 Please push.

 Thanks, done.

Thanks.  I appreciate the added comments, too ;-)

What do you think of this addition?
It may be more efficient to invoke one subshell rather than two,
even though the new subshell includes an additional pipe to sed.
For the record, I don't really care either way, since even for coreutils,
saving 1000 subshells (one per file from gnulib) is probably a
negligible gain in performance, overall.


From 505269035674871320926a2aac4c7091d6267aa4 Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
Date: Sun, 15 May 2011 09:24:40 +0200
Subject: [PATCH] bootstrap: performance tweak: use one fewer subshell per
 file

* build-aux/bootstrap (symlink_to_dir): Use one subshell rather than
two in determining whether two files refer to the same inode number.
---
 ChangeLog   |6 ++
 build-aux/bootstrap |7 +++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dc66282..f3c1561 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-15  Jim Meyering  meyer...@redhat.com
+
+   bootstrap: performance tweak: use one fewer subshell per file
+   * build-aux/bootstrap (symlink_to_dir): Use one subshell rather
+   than two in determining whether two file's inode numbers are the same.
+
 2011-05-13  Jim Meyering  meyer...@redhat.com

maint.mk: three new prohibit_HDR_without_use rules
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 522ac70..f8f1975 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2011-05-16.16; # UTC
+scriptversion=2011-05-16.18; # UTC

 # Bootstrap this package from checked-out sources.

@@ -677,9 +677,8 @@ symlink_to_dir()
   # so that broken tools aren't confused into skipping needed builds.  See
   # http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html.
   test -h $dst 
-  src_ls=`ls -diL $src 2/dev/null`  set $src_ls  src_i=$1 
-  dst_ls=`ls -diL $dst 2/dev/null`  set $dst_ls  dst_i=$1 
-  test $src_i = $dst_i 
+  inums=`ls -1diL $src $dst 2/dev/null|sed 's/ .*//'`  set $inums 
+  test $1 = $2 
   both_ls=`ls -dt $src $dst` 
   test X$both_ls = X$dst$nl$src || {
 dot_dots=
--
1.7.5.1.467.g1a85



Re: bootstrap symlink dependencies

2011-05-16 Thread Eric Blake
On 05/16/2011 12:57 PM, Jim Meyering wrote:
 Paul Eggert wrote:
 On 05/16/11 07:44, Pádraig Brady wrote:
 I tested your ls ordering trick on linux, solaris 10 and freebsd and it 
 works.
 Please push.

 Thanks, done.
 
 Thanks.  I appreciate the added comments, too ;-)
 
 What do you think of this addition?
 It may be more efficient to invoke one subshell rather than two,
 even though the new subshell includes an additional pipe to sed.
 For the record, I don't really care either way, since even for coreutils,
 saving 1000 subshells (one per file from gnulib) is probably a
 negligible gain in performance, overall.

Anything that shaves 1000 processes is worthwhile for cygwin.  However,

 @@ -677,9 +677,8 @@ symlink_to_dir()
# so that broken tools aren't confused into skipping needed builds.  
 See
# http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html.
test -h $dst 
 -  src_ls=`ls -diL $src 2/dev/null`  set $src_ls  src_i=$1 
 -  dst_ls=`ls -diL $dst 2/dev/null`  set $dst_ls  dst_i=$1 
 -  test $src_i = $dst_i 
 +  inums=`ls -1diL $src $dst 2/dev/null|sed 's/ .*//'`  set $inums 
 

Two subshells with no pipe vs. one subshell with a pipe produces the
same amount of fork/exec calls under bash, so you aren't saving
processes in this case.  On it's own merits, I have no strong opinions
about keeping or dropping this patch.

But you gave me an idea that _does_ speed up cygwin:

inums=`ls -1diL $src $dst 2/dev/null`
inum1=${inums%%[!0-9]*}
inums=${inums#*
}
inum2=${inums%%[!0-9]*}
test $inum1 = $inum2

which computes the same with only one child process, by avoiding both a
second ls and a pipeline.  On the other hand, it only works with POSIX
shells (Solaris /bin/sh doesn't understand the XSI notion of %% and ##).

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



signature.asc
Description: OpenPGP digital signature


Re: bootstrap symlink dependencies

2011-05-16 Thread Paul Eggert
On 05/16/11 12:12, Eric Blake wrote:
 On the other hand, it only works with POSIX
 shells (Solaris /bin/sh doesn't understand the XSI notion of %% and ##).
 

Another option might be something like this (untested)

lswords=`ls -1diL $src $dst 2/dev/null` 
inum=  \
for lsword in $lswords; do
  case $lsword in
*[!0-9]*) ;;
*) if test -z $inum; then
 inum=$lsword
   elif test $inum -ne $lsword; then
 inum=
 break
   fi ;;
  esac
done 
test -n $inum

This uses just one fork+exec too, but it doesn't use the
XSI notion of %% and ##.  It can be fooled if $src
or $dst contains an integer surrounded by spaces, but
any such errors cause it to fail in a conservative way
(by doing needless remakes), and these errors should be
rare so that's not so bad.

It assumes [!0-9] works, though;
is that a safe assumption these days?



Re: bootstrap symlink dependencies

2011-05-16 Thread Eric Blake
On 05/16/2011 01:40 PM, Paul Eggert wrote:
 lswords=`ls -1diL $src $dst 2/dev/null` 
 inum=  \
 for lsword in $lswords; do
   case $lsword in
 *[!0-9]*) ;;
 *) if test -z $inum; then
  inum=$lsword
elif test $inum -ne $lsword; then
inum=
break
fi ;;
   esac
 done 
 test -n $inum
 
 This uses just one fork+exec too, but it doesn't use the
 XSI notion of %% and ##.  It can be fooled if $src
 or $dst contains an integer surrounded by spaces, but
 any such errors cause it to fail in a conservative way
 (by doing needless remakes), and these errors should be
 rare so that's not so bad.
 
 It assumes [!0-9] works, though;
 is that a safe assumption these days?

Yes, autoconf has been using [!...] negated shell patterns for years
now, with no problems on Solaris /bin/sh or any other shell.

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



signature.asc
Description: OpenPGP digital signature


Re: bootstrap symlink dependencies

2011-05-16 Thread Ralf Wildenhues
Hi Pádraig,

* Pádraig Brady wrote on Mon, May 16, 2011 at 04:44:42PM CEST:
 On 14/05/11 09:07, Paul Eggert wrote:
  If something treats symlink mtime as significant,
  then I suspect that it's at fault.
  
  Yes, there's something busted there.  GNU 'make' does the right thing:
  it follows symlinks when checking time stamps.  Is some other 'make'
  is being used, or perhaps some tool other than 'make'?
 
 I suspect something else in the depths of auto* is busted,
 as I'm using standard make.

GNU make, I presume.

Is this issue still open?  And if yes, how can it be reproduced?
(Sorry, I haven't been following the thread really, but I still
can't let a non-bug-report without details go uncommented.  ;-)

Cheers,
Ralf



Re: bootstrap symlink dependencies

2011-05-16 Thread Paul Eggert
On 05/16/11 12:47, Ralf Wildenhues wrote:
 GNU make, I presume.

I checked GNU make 3.82's source code, and I didn't
see how it could be a problem with GNU make, as it uses
stat, not lstat, for target timestamps.  Perhaps I misread
the code, but I think it more likely the problem is elsewhere.
(Sorry that this doesn't narrow it down much)



gnulib compilation error

2011-05-16 Thread Sam Steingold
I am getting this error:

In file included from /home/sds/src/clisp/current/build-g/gllib/sys/stat.h:44,
 from clisp.c:31:
/home/sds/src/clisp/current/build-g/gllib/time.h:469: error: expected ';', ',' 
or ')' before '__timer'
/home/sds/src/clisp/current/build-g/gllib/time.h:491: error: expected ';', ',' 
or ')' before '__timer'

time.h:469:_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict 
__timer,
 struct tm *restrict __result)
_GL_ARG_NONNULL ((1, 2)));

it appears that time_t is not defined.

I am including these modules:

no-c++ stdint stdbool havelib gettext localcharset
uniwidth/width streq uniname/uniname unitypes link-follow
host-cpu-c-abi socklen sockets fd-hook setenv unsetenv errno
arpa_inet netinet_in inet_ntop inet_pton lstat stat canonicalize-lgpl
nocrash libsigsegv gnu-make gettimeofday getpagesize sys_time sys_wait
 mktime strftime strptime strverscmp uname strerror fnmatch-gnu
 regex

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://mideasttruth.com http://pmw.org.il
http://ffii.org http://memri.org http://thereligionofpeace.com
Independence: nobody pays for you.  Liberty: nobody thinks for you.



do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Sam Steingold
DIUC that if I include the sys_time  unistd modules, I can write

#include unistd.h
#include sys/time.h

instead of

#ifdef HAVE_SYS_TIME_H
 #include sys/time.h
#endif
#ifdef HAVE_UNISTD_H
  #include unistd.h
#endif

??

the same question for all the other headers...

thanks!

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://openvotingconsortium.org http://pmw.org.il http://palestinefacts.org
http://www.memritv.org http://honestreporting.com http://truepeace.org
Politically Correct Chess: Translucent VS. Transparent.



Re: gnulib compilation error

2011-05-16 Thread Eric Blake
On 05/16/2011 01:51 PM, Sam Steingold wrote:
 I am getting this error:

On which platform?

 
 In file included from /home/sds/src/clisp/current/build-g/gllib/sys/stat.h:44,
  from clisp.c:31:
 /home/sds/src/clisp/current/build-g/gllib/time.h:469: error: expected ';', 
 ',' or ')' before '__timer'
 /home/sds/src/clisp/current/build-g/gllib/time.h:491: error: expected ';', 
 ',' or ')' before '__timer'
 
 time.h:469:_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const 
 *restrict __timer,
  struct tm *restrict __result)
 _GL_ARG_NONNULL ((1, 2)));
 
 it appears that time_t is not defined.

Most likely a broken header, and we can work around it if we know which
platform needs the replacement time.h to include some prerequisite
headers.

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



signature.asc
Description: OpenPGP digital signature


Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 01:53 PM, Sam Steingold wrote:
 DIUC that if I include the sys_time  unistd modules, I can write
 
 #include unistd.h
 #include sys/time.h
 
 instead of
 
 #ifdef HAVE_SYS_TIME_H
  #include sys/time.h
 #endif
 #ifdef HAVE_UNISTD_H
   #include unistd.h
 #endif
 
 ??
 
 the same question for all the other headers...

Absolutely!  In fact, the maintainer-mode module includes the
sc_prohibit_always_true_header_tests to help you check for files where
you can unconditionally include headers guaranteed by gnulib replacements.

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



signature.asc
Description: OpenPGP digital signature


Re: gnulib compilation error

2011-05-16 Thread Sam Steingold
 * Eric Blake roy...@erqung.pbz [2011-05-16 13:55:31 -0600]:

 On 05/16/2011 01:51 PM, Sam Steingold wrote:
 I am getting this error:

 On which platform?

CentOS release 5.6 (Final)
Linux 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 
GNU/Linux

sorry about not including the obviously required information right away


-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://iris.org.il http://camera.org http://palestinefacts.org
http://jihadwatch.org http://mideasttruth.com http://ffii.org
Bill Gates is not god and Microsoft is not heaven.



Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Sam Steingold
 * Eric Blake roy...@erqung.pbz [2011-05-16 13:56:46 -0600]:

 On 05/16/2011 01:53 PM, Sam Steingold wrote:
 DIUC that if I include the sys_time  unistd modules, I can write
 
 #include unistd.h
 #include sys/time.h
 
 instead of
 
 #ifdef HAVE_SYS_TIME_H
  #include sys/time.h
 #endif
 #ifdef HAVE_UNISTD_H
   #include unistd.h
 #endif
 
 ??
 
 the same question for all the other headers...

 Absolutely!  In fact, the maintainer-mode module includes the
 sc_prohibit_always_true_header_tests to help you check for files where
 you can unconditionally include headers guaranteed by gnulib replacements.

there is no maintainer-mode in gnulib/modules.
how do I use it?

thanks!

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://openvotingconsortium.org http://honestreporting.com
http://camera.org http://thereligionofpeace.com http://truepeace.org
Genius is immortal, but morons live longer.



Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 02:10 PM, Sam Steingold wrote:
 Absolutely!  In fact, the maintainer-mode module includes the
 sc_prohibit_always_true_header_tests to help you check for files where
 you can unconditionally include headers guaranteed by gnulib replacements.
 
 there is no maintainer-mode in gnulib/modules.

Sorry for my typo; 'maintainer-makefile'.

 how do I use it?

Import that module, possibly add a cfg.mk counterpart (hmm, we probably
ought to provide a template file for that; but you can use
coreutils.git/cfg.mk for an idea of how it can be customized), use GNU
make, and run 'make syntax-check' to catch a number of consistency
errors.  If you decide that a particular syntax check is inappropriate
for your project, cfg.mk will let you omit it.

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



signature.asc
Description: OpenPGP digital signature


Re: gnulib compilation error

2011-05-16 Thread Bruno Haible
Sam Steingold wrote:
 I am getting this error:
 
 In file included from /home/sds/src/clisp/current/build-g/gllib/sys/stat.h:44,
  from clisp.c:31:
 /home/sds/src/clisp/current/build-g/gllib/time.h:469: error: expected ';', 
 ',' or ')' before '__timer'
 /home/sds/src/clisp/current/build-g/gllib/time.h:491: error: expected ';', 
 ',' or ')' before '__timer'
 
 time.h:469:_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const 
 *restrict __timer,
  struct tm *restrict __result)
 _GL_ARG_NONNULL ((1, 2)));
 
 it appears that time_t is not defined.

More likely, 'restrict' is not defined, or is defined to an unsupported value.
Cf. [1][2]

With gnulib, 'restrict' ought to be defined by config.h. Maybe you have several
config.h files, and one of them defines 'restrict' but not the others? Or maybe
the compilation unit that you are compiling does not start with
#include config.h?

Bruno

[1] http://lists.gnu.org/archive/html/grub-devel/2010-12/msg00016.html
[2] http://lists.gnu.org/archive/html/bug-gnulib/2008-05/msg00222.html
-- 
In memoriam The victims of the Zaklopača massacre 
http://greatersurbiton.wordpress.com/2010/02/12/interview-with-nihada-hodzic-survivor-of-the-zaklopaca-massacre/



Re: bootstrap symlink dependencies

2011-05-16 Thread Pádraig Brady
On 16/05/11 20:47, Ralf Wildenhues wrote:
 Hi Pádraig,
 
 * Pádraig Brady wrote on Mon, May 16, 2011 at 04:44:42PM CEST:
 On 14/05/11 09:07, Paul Eggert wrote:
 If something treats symlink mtime as significant,
 then I suspect that it's at fault.

 Yes, there's something busted there.  GNU 'make' does the right thing:
 it follows symlinks when checking time stamps.  Is some other 'make'
 is being used, or perhaps some tool other than 'make'?

 I suspect something else in the depths of auto* is busted,
 as I'm using standard make.
 
 GNU make, I presume.
 
 Is this issue still open?  And if yes, how can it be reproduced?
 (Sorry, I haven't been following the thread really, but I still
 can't let a non-bug-report without details go uncommented.  ;-)

Sorry I have no time to dig into this currently.
I know I'd lose half a hour (it's on my ever increasing todo list).

Anyway fa6f from gnulib broke my coreutils build dir,
because @HAVE_SIGHANDLER_T@ was not replaced.
I've noticed before that if I remove the symlinks
from the m4 directory and rerun bootstrap,
then things start working.

cheers,
Pádraig.



Re: gnulib compilation error

2011-05-16 Thread Sam Steingold
 * Bruno Haible oe...@pyvfc.bet [2011-05-16 22:23:23 +0200]:

 With gnulib, 'restrict' ought to be defined by config.h. Maybe you
have several config.h files, and one of them defines 'restrict' but not
the others? Or maybe the compilation unit that you are compiling does
not start with #include config.h?

yes, thanks, fixed.

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://mideasttruth.com http://www.memritv.org http://thereligionofpeace.com
http://openvotingconsortium.org http://truepeace.org http://honestreporting.com
Lisp: Serious empowerment.



Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Sam Steingold
 * Eric Blake roy...@erqung.pbz [2011-05-16 14:13:29 -0600]:

 Import that module, possibly add a cfg.mk counterpart (hmm, we
 probably ought to provide a template file for that; but you can use
 coreutils.git/cfg.mk for an idea of how it can be customized), use GNU
 make, and run 'make syntax-check' to catch a number of consistency
 errors.  If you decide that a particular syntax check is inappropriate
 for your project, cfg.mk will let you omit it.

it looks useful but _very_ hard to actually use.

why is maint.mk put into my top dir?
shouldn't it go to src/build-aux/?
why doesn't vc-list-files accept a list of directories?
(it would be 'src modules' for me)
why is $(srcdir)/lib/ hard-coded? I use gllib instead of lib.

when I managed to get it running, I got
warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.

thanks for the pointer though...
-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://www.memritv.org http://openvotingconsortium.org http://camera.org
http://thereligionofpeace.com http://iris.org.il http://mideasttruth.com
Those who can't write, write manuals.



Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 03:16 PM, Sam Steingold wrote:
 * Eric Blake roy...@erqung.pbz [2011-05-16 14:13:29 -0600]:

 Import that module, possibly add a cfg.mk counterpart (hmm, we
 probably ought to provide a template file for that; but you can use
 coreutils.git/cfg.mk for an idea of how it can be customized), use GNU
 make, and run 'make syntax-check' to catch a number of consistency
 errors.  If you decide that a particular syntax check is inappropriate
 for your project, cfg.mk will let you omit it.
 
 it looks useful but _very_ hard to actually use.
 
 why is maint.mk put into my top dir?

Because that's where GNUmakefile looks for it.

 shouldn't it go to src/build-aux/?

Patches welcome, but for now, all projects using it have lived with it
in the top directory.

 why doesn't vc-list-files accept a list of directories?

Patches welcome; seems like a useful addition.

 (it would be 'src modules' for me)
 why is $(srcdir)/lib/ hard-coded? I use gllib instead of lib.

Where is it hard-coded?  We've been trying to get rid of hard-coded
aspects, but we can only fix things as they are pointed out.

 
 when I managed to get it running, I got
 warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.

You can add per-file exemptions to particular rules, either via
top-level .x-sc files or via entries in cfg.mk (the latter being fewer
files to maintain).

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



signature.asc
Description: OpenPGP digital signature


Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Karl Berry
 warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.

Why should there ever be a warning about an occurrence of HAVE_ALLOCA_H
in the ChangeLog?  Just wondering.



Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Sam Steingold
 * Eric Blake roy...@erqung.pbz [2011-05-16 15:30:04 -0600]:

 why doesn't vc-list-files accept a list of directories?

 Patches welcome; seems like a useful addition.



--- /home2/sds/src/clisp/current/gnulib/build-aux/vc-list-files 2011-05-03 
12:08:03.0 -0400
+++ /home2/sds/src/clisp/current/src/build-aux/vc-list-files2011-05-16 
17:42:00.0 -0400
@@ -2,7 +2,7 @@
 # List version-controlled file names.
 
 # Print a version string.
-scriptversion=2011-04-29.20; # UTC
+scriptversion=2011-05-16.21; # UTC
 
 # Copyright (C) 2006-2011 Free Software Foundation, Inc.
 
@@ -30,7 +30,7 @@ scriptversion=2011-04-29.20; # UTC
 postprocess=
 case $1 in
   --help) cat EOF
-Usage: $0 [-C SRCDIR] [DIR]
+Usage: $0 [-C SRCDIR] [DIR...]
 
 Output a list of version-controlled files in DIR (default .), relative to
 SRCDIR (default .).  SRCDIR must be the top directory of a checkout.
@@ -61,16 +61,10 @@ EOF
 shift; shift ;;
 esac
 
-dir=
-case $# in
-  0) ;;
-  1) dir=$1 ;;
-  *) echo $0: too many arguments 12
- echo Usage: $0 [-C srcdir] [DIR] 12; exit 1;;
-esac
-
-test x$dir = x  dir=.
+dirs=$*
+test x$dirs = x  dirs=.
 
+for dir in $dirs; do
 if test -d .git; then
   test x$dir = x. \
  dir= sed_esc= \
@@ -108,6 +102,7 @@ else
   echo $0: Failed to determine type of version control used in `pwd` 12
   exit 1
 fi
+done
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)

Diff finished.  Mon May 16 17:42:25 2011







 (it would be 'src modules' for me)
 why is $(srcdir)/lib/ hard-coded? I use gllib instead of lib.

 Where is it hard-coded?  We've been trying to get rid of hard-coded
 aspects, but we can only fix things as they are pointed out.

--- /home2/sds/src/clisp/current/gnulib/top/maint.mk2011-05-16 
16:32:49.0 -0400
+++ /home2/sds/src/clisp/current/maint.mk   2011-05-16 17:20:23.0 
-0400
@@ -681,7 +681,7 @@ sc_useless_cpp_parens:
 # #if HAVE_HEADER_H that you remove, be sure that your project explicitly
 # requires the gnulib module that guarantees the usability of that header.
 gl_assured_headers_ = \
-  cd $(gnulib_dir)/lib  echo *.in.h|sed 's/\.in\.h//g'
+  cd $(gnulib_dir)  echo *.in.h|sed 's/\.in\.h//g'
 
 # Convert the list of names to upper case, and replace each space with |.
 az_ = abcdefghijklmnopqrstuvwxyz
@@ -718,7 +718,7 @@ gl_extract_significant_defines_ = \
 # of macros that are guaranteed to be defined by parts of gnulib.
 define def_sym_regex
gen_h=$(gl_generated_headers_); \
-   (cd $(gnulib_dir)/lib;  \
+   (cd $(gnulib_dir);  \
  for f in *.in.h $(gl_other_headers_); do  \
perl -lne '$(gl_extract_significant_defines_)' $$f; \
  done; \
@@ -1049,7 +1049,7 @@ writable-files:
  test $$fail  exit 1 || : ;\
fi
 
-v_etc_file = $(gnulib_dir)/lib/version-etc.c
+v_etc_file = $(gnulib_dir)/version-etc.c
 sample-test = tests/sample-test
 texi = doc/$(PACKAGE).texi
 # Make sure that the copyright date in $(v_etc_file) is up to date.

Diff finished.  Mon May 16 17:43:03 2011



-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://pmw.org.il http://www.memritv.org http://honestreporting.com
http://mideasttruth.com http://www.PetitionOnline.com/tap12009/
char*a=char*a=%c%s%c;main(){printf(a,34,a,34);};main(){printf(a,34,a,34);}



Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 03:36 PM, Karl Berry wrote:
  warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.
 
 Why should there ever be a warning about an occurrence of HAVE_ALLOCA_H
 in the ChangeLog?  Just wondering.

Only because the filters haven't been tuned to exclude non-source files
by default for all of the syntax check rules.  It's not too hard to add
ChangeLog to a permanent per-file exemption, by adding:

VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ChangeLog$$

to cfg.mk.  Modify that regex as needed to permanently skip other files
from the maint.mk syntax checks.

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



signature.asc
Description: OpenPGP digital signature


Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 03:44 PM, Sam Steingold wrote:
 * Eric Blake roy...@erqung.pbz [2011-05-16 15:30:04 -0600]:

 why doesn't vc-list-files accept a list of directories?

 Patches welcome; seems like a useful addition.
 

 @@ -61,16 +61,10 @@ EOF
  shift; shift ;;
  esac
  
 -dir=
 -case $# in
 -  0) ;;
 -  1) dir=$1 ;;
 -  *) echo $0: too many arguments 12
 - echo Usage: $0 [-C srcdir] [DIR] 12; exit 1;;
 -esac
 -
 -test x$dir = x  dir=.
 +dirs=$*

This isn't safe if any arguments contain whitespace.  Why not iterate
directly over $@ in that case, rather than assigning to an intermediate
$dirs only to then reiterate?

 +test x$dirs = x  dirs=.

Which means this would be written:

test $# = 0  set .

  
 +for dir in $dirs; do
  if test -d .git; then
test x$dir = x. \
   dir= sed_esc= \
 @@ -108,6 +102,7 @@ else
echo $0: Failed to determine type of version control used in `pwd` 12
exit 1
  fi
 +done
  

Of course, we'd want to reindent the loop body, as well.

 Where is it hard-coded?  We've been trying to get rid of hard-coded
 aspects, but we can only fix things as they are pointed out.
 
 --- /home2/sds/src/clisp/current/gnulib/top/maint.mk  2011-05-16 
 16:32:49.0 -0400
 +++ /home2/sds/src/clisp/current/maint.mk 2011-05-16 17:20:23.0 
 -0400
 @@ -681,7 +681,7 @@ sc_useless_cpp_parens:
  # #if HAVE_HEADER_H that you remove, be sure that your project explicitly
  # requires the gnulib module that guarantees the usability of that header.
  gl_assured_headers_ = \
 -  cd $(gnulib_dir)/lib  echo *.in.h|sed 's/\.in\.h//g'
 +  cd $(gnulib_dir)  echo *.in.h|sed 's/\.in\.h//g'

NACK.  This is one case where we are looking at the gnulib source
directory (such as $GNULIB_SRCDIR), to see files from gnulib.git, and
_not_ in the resulting --libdir location of your project.  This
hard-code is correct.

 -v_etc_file = $(gnulib_dir)/lib/version-etc.c
 +v_etc_file = $(gnulib_dir)/version-etc.c

Same NACK.  Again, this is a case where we are looking at a file living
in gnulib.git, and not what got copied into your project.

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



signature.asc
Description: OpenPGP digital signature


Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Sam Steingold
 * Eric Blake roy...@erqung.pbz [2011-05-16 15:45:00 -0600]:

 On 05/16/2011 03:36 PM, Karl Berry wrote:
  warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.
 
 Why should there ever be a warning about an occurrence of HAVE_ALLOCA_H
 in the ChangeLog?  Just wondering.

 Only because the filters haven't been tuned to exclude non-source files
 by default for all of the syntax check rules.  It's not too hard to add
 ChangeLog to a permanent per-file exemption, by adding:

 VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ChangeLog$$

 to cfg.mk.  Modify that regex as needed to permanently skip other files
 from the maint.mk syntax checks.

from the way VC_LIST_ALWAYS_EXCLUDE_REGEX is used, this appears to be TRT:

VC_LIST_ALWAYS_EXCLUDE_REGEX = ChangeLog|configure|config.in.h|aclocal.m4

however, it has no effect.

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://jihadwatch.org http://openvotingconsortium.org http://truepeace.org
http://mideasttruth.com http://memri.org http://dhimmi.com
.ACMD setaloiv siht gnidaeR



Re: proposed new module intoverflow

2011-05-16 Thread Pádraig Brady
I just noticed this excellent paper on AIR integers
http://www.cert.org/archive/pdf/09tn023.pdf
which also summarizes other run-time integer
overflow handling methods, including precondition testing
as implemented by Paul's handy new macros.

cheers,
Pádraig.



environ

2011-05-16 Thread Sam Steingold
does importing the environ module mean that I can remove this:

#if !HAVE_DECL_ENVIRON
extern_C char** environ;
#endif

from my sources and assume that environ is properly declared in unistd?

also, how can I come up with the answer to this question myself without
bothering you?

thanks!

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://honestreporting.com http://truepeace.org http://pmw.org.il
http://camera.org http://www.PetitionOnline.com/tap12009/
Before telling the Truth, make sure you know it.



Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 03:56 PM, Sam Steingold wrote:
 
 from the way VC_LIST_ALWAYS_EXCLUDE_REGEX is used, this appears to be TRT:
 
 VC_LIST_ALWAYS_EXCLUDE_REGEX = ChangeLog|configure|config.in.h|aclocal.m4

| outside () is different than (|).  Try:

VC_LIST_ALWAYS_EXCLUDE_REGEX = \
 ^(ChangeLog|configure|config.in.h|aclocal.m4)$$

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



signature.asc
Description: OpenPGP digital signature


Re: do I need ifdef HAVE_UNISTD_H if I import unistd?

2011-05-16 Thread Sam Steingold
 * Eric Blake roy...@erqung.pbz [2011-05-16 15:57:43 -0600]:

 On 05/16/2011 03:56 PM, Sam Steingold wrote:
 
 from the way VC_LIST_ALWAYS_EXCLUDE_REGEX is used, this appears to be TRT:
 
 VC_LIST_ALWAYS_EXCLUDE_REGEX = ChangeLog|configure|config.in.h|aclocal.m4

 | outside () is different than (|).  Try:

 VC_LIST_ALWAYS_EXCLUDE_REGEX = \
  ^(ChangeLog|configure|config.in.h|aclocal.m4)$$

does not work either.

also, this seems wrong because

1. when VC_LIST_ALWAYS_EXCLUDE_REGEX is used, it is put inside ()

2. my output looks like this:

../src/../src/configure:31052:#ifdef HAVE_UNISTD_H
../src/../src/configure:31330:#ifdef HAVE_UNISTD_H
../src/../src/configure:31425:#ifdef HAVE_UNISTD_H
../src/../src/configure:31538:#ifdef HAVE_UNISTD_H
../src/../src/configure:31562:#ifdef HAVE_UNISTD_H

so ^ does not look right.

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://dhimmi.com http://ffii.org http://memri.org http://truepeace.org
http://jihadwatch.org http://www.PetitionOnline.com/tap12009/
Experience comes with debts.



[PATCH] vc-list-files: accept multiple directory operands

2011-05-16 Thread Eric Blake
* build-aux/vc-list-files: Iterate over all remaining operands.

Signed-off-by: Eric Blake ebl...@redhat.com
---

Here's what I'm pushing (including a white-space-ignored version,
to show how small the real changes are).

diff --git c/build-aux/vc-list-files w/build-aux/vc-list-files
index 2fced25..405e458 100755
--- c/build-aux/vc-list-files
+++ w/build-aux/vc-list-files
@@ -2,7 +2,7 @@
 # List version-controlled file names.

 # Print a version string.
-scriptversion=2011-04-29.20; # UTC
+scriptversion=2011-05-16.22; # UTC

 # Copyright (C) 2006-2011 Free Software Foundation, Inc.

@@ -30,7 +30,7 @@ scriptversion=2011-04-29.20; # UTC
 postprocess=
 case $1 in
   --help) cat EOF
-Usage: $0 [-C SRCDIR] [DIR]
+Usage: $0 [-C SRCDIR] [DIR...]

 Output a list of version-controlled files in DIR (default .), relative to
 SRCDIR (default .).  SRCDIR must be the top directory of a checkout.
@@ -61,17 +61,11 @@ EOF
 shift; shift ;;
 esac

-dir=
-case $# in
-  0) ;;
-  1) dir=$1 ;;
-  *) echo $0: too many arguments 12
- echo Usage: $0 [-C srcdir] [DIR] 12; exit 1;;
-esac
-
-test x$dir = x  dir=.
+test $# = 0  set .

-if test -d .git; then
+for dir
+do
+  if test -d .git; then
   test x$dir = x. \
  dir= sed_esc= \
 || { dir=$dir/; sed_esc=`echo $dir|env sed 's,\([\\/]\),\1,g'`; }
@@ -81,12 +75,12 @@ if test -d .git; then
   # belong to this package.
   eval exec git ls-tree -r 'HEAD:$dir' \
 \| sed -n 's/^100[^   ]*./$sed_esc/p' $postprocess
-elif test -d .hg; then
+  elif test -d .hg; then
   eval exec hg locate '$dir/*' $postprocess
-elif test -d .bzr; then
+  elif test -d .bzr; then
   test $postprocess = ''  postprocess=| sed 's|^\./||'
   eval exec bzr ls -R --versioned '$dir' $postprocess
-elif test -d CVS; then
+  elif test -d CVS; then
   test $postprocess = ''  postprocess=| sed 's|^\./||'
   if test -x build-aux/cvsu; then
 eval build-aux/cvsu --find --types=AFGM '$dir' $postprocess
@@ -102,12 +96,13 @@ elif test -d CVS; then
 }}'\''\
   `find $dir -name Entries -print` /dev/null' $postprocess
   fi
-elif test -d .svn; then
+  elif test -d .svn; then
   eval exec svn list -R '$dir' $postprocess
-else
+  else
   echo $0: Failed to determine type of version control used in `pwd` 12
   exit 1
-fi
+  fi
+done

 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)



 ChangeLog   |6 +++
 build-aux/vc-list-files |   89 ++-
 2 files changed, 48 insertions(+), 47 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2fb40f2..9bcc95a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-16  Sam Steingold s...@gnu.org
+   and Eric Blake  ebl...@redhat.com
+
+   vc-list-files: accept multiple directory operands
+   * build-aux/vc-list-files: Iterate over all remaining operands.
+
 2011-05-16  Paul Eggert  egg...@cs.ucla.edu

* build-aux/bootstrap (gnulib_tool): Handle symlink timestamps better.
diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
index 2fced25..405e458 100755
--- a/build-aux/vc-list-files
+++ b/build-aux/vc-list-files
@@ -2,7 +2,7 @@
 # List version-controlled file names.

 # Print a version string.
-scriptversion=2011-04-29.20; # UTC
+scriptversion=2011-05-16.22; # UTC

 # Copyright (C) 2006-2011 Free Software Foundation, Inc.

@@ -30,7 +30,7 @@ scriptversion=2011-04-29.20; # UTC
 postprocess=
 case $1 in
   --help) cat EOF
-Usage: $0 [-C SRCDIR] [DIR]
+Usage: $0 [-C SRCDIR] [DIR...]

 Output a list of version-controlled files in DIR (default .), relative to
 SRCDIR (default .).  SRCDIR must be the top directory of a checkout.
@@ -61,53 +61,48 @@ EOF
 shift; shift ;;
 esac

-dir=
-case $# in
-  0) ;;
-  1) dir=$1 ;;
-  *) echo $0: too many arguments 12
- echo Usage: $0 [-C srcdir] [DIR] 12; exit 1;;
-esac
-
-test x$dir = x  dir=.
-
-if test -d .git; then
-  test x$dir = x. \
- dir= sed_esc= \
-|| { dir=$dir/; sed_esc=`echo $dir|env sed 's,\([\\/]\),\1,g'`; }
-  # Ignore git symlinks - either they point into the tree, in which case
-  # we don't need to visit the target twice, or they point somewhere
-  # else (often into a submodule), in which case the content does not
-  # belong to this package.
-  eval exec git ls-tree -r 'HEAD:$dir' \
-\| sed -n 's/^100[^   ]*./$sed_esc/p' $postprocess
-elif test -d .hg; then
-  eval exec hg locate '$dir/*' $postprocess
-elif test -d .bzr; then
-  test $postprocess = ''  postprocess=| sed 's|^\./||'
-  eval exec bzr ls -R --versioned '$dir' $postprocess
-elif test -d CVS; then
-  test $postprocess = ''  postprocess=| sed 's|^\./||'
-  if test -x build-aux/cvsu; then
-eval build-aux/cvsu --find --types=AFGM '$dir' $postprocess
-  elif (cvsu --help) /dev/null 21; then
-eval cvsu --find --types=AFGM '$dir' $postprocess
+test $# = 0  set .
+
+for dir
+do
+  if test -d .git; then
+test x$dir = x. \
+   dir= sed_esc= \
+  || { dir=$dir/; sed_esc=`echo 

Re: Document reasonable portability targets

2011-05-16 Thread Bruno Haible
Hi,

On 2011-01-29 I proposed to document the reasonable portability targets
supported by gnulib [1]. The same question is popping up again [2][3].
The replies to [1] were:
  - Paul suggested less strict categorization.
  - Simon suggested not to exclude any system, through harsh words.
Well, actually that was one of the points of the exercise: to make
it clear that we can't commit to support niche and museum platforms.

I've tried to integrate the comments like this.

[1] http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00542.html
[2] http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00246.html
[3] http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00324.html


2011-05-16  Bruno Haible  br...@clisp.org

doc: List the target platforms.
* doc/gnulib-intro.texi (Target Platforms): New section.
* doc/gnulib.texi (Introduction): Update menu.
* README (Portability guidelines): Refer to the new section. Update
statement about oldest supported environment. Remove rationale why
errno.h, string.h, stdlib.h are assumed. Update example of an
unportable C89 function.
Reported by Bastien Roucariès roucaries.bast...@gmail.com and
Charles Wilson cyg...@cwilson.fastmail.fm. Feedback from Paul Eggert.

--- README.orig Tue May 17 00:23:00 2011
+++ README  Mon May 16 22:50:35 2011
@@ -77,6 +77,7 @@
 
 Contributing to Gnulib
 ==
+
 All software here is copyrighted by the Free Software Foundation - you need
 to have filled out an assignment form for a project that uses the
 module for that contribution to be accepted here.
@@ -201,7 +202,8 @@
 --
 
 Gnulib code is intended to be portable to a wide variety of platforms,
-not just GNU platforms.
+not just GNU platforms.  See the documentation section Target Platforms
+for details.
 
 Many Gnulib modules exist so that applications need not worry about
 undesirable variability in implementations.  For example, an
@@ -210,27 +212,17 @@
 need not worry about localtime_r returning int (not char *) on some
 platforms that predate POSIX 1003.1-2001.
 
-Originally much of the Gnulib code was portable to ancient hosts like
-4.2BSD, but it is a maintenance hassle to maintain compatibility with
-unused hosts, so currently we assume at least a freestanding C89
-compiler, possibly operating with a C library that predates C89.  The
-oldest environment currently ported to is probably SunOS 4 + GCC 1.x,
-though we haven't tested this exact combination.  SunOS 4 last shipped
-on 1998-09-30, and Sun dropped support for it on 2003-10-01, so at
-some point we may start assuming a C89 library as well.
+Currently we assume at least a freestanding C89 compiler, possibly
+operating with a C library that predates C89.  The oldest environment
+currently ported to are probably HP-UX 10.20 and IRIX 5.3, though we
+are not testing these platform very often.
 
 Because we assume a freestanding C89 compiler, Gnulib code can include
 float.h, limits.h, stdarg.h, and stddef.h unconditionally.  It
 can also assume the existence of ctime.h, errno.h, fcntl.h,
-locale.h, signal.h, stdio.h, stdlib.h, string.h, and
-time.h.  Some of these headers, such as errno.h, were present in
-Unix Version 7 and are thus widely available.  string.h and
-stdlib.h were not in Unix Version 7, so they weren't universally
-available on ancient hosts, but they are both in SunOS 4 (the oldest
-platform still in relatively-common use) so Gnulib assumes them now.
-Similarly, many modules include sys/types.h even though it's not
-even in C99; that's OK since sys/types.h has been around nearly
-forever.
+locale.h, signal.h, stdio.h, stdlib.h, string.h, and time.h.
+Similarly, many modules include sys/types.h even though it's not even
+in C99; that's OK since sys/types.h has been around nearly forever.
 
 Even if the include files exist, they may not conform to C89.
 However, GCC has a fixincludes script that attempts to fix most
@@ -239,10 +231,10 @@
 should use fixincludes or fix their include files manually.
 
 Even if the include files conform to C89, the library itself may not.
-For example, SunOS 4's (free (NULL)) can dump core, so Gnulib code
-must avoid freeing a null pointer, even though C89 allows it.
+For example, strtod and mktime have some bugs on some platforms.
 You can work around some of these problems by requiring the relevant
-modules, e.g., the Gnulib 'free' module supplies a conforming 'free'.
+modules, e.g., the Gnulib 'mktime' module supplies a working and
+conforming 'mktime'.
 
 The GNU coding standards allow one departure from strict C99: Gnulib
 code can assume that standard internal types like size_t are no wider
--- doc/gnulib-intro.texi.orig  Tue May 17 00:23:00 2011
+++ doc/gnulib-intro.texi   Tue May 17 00:22:57 2011
@@ -74,6 +74,116 @@
 stdout if desired, and emits an error message if the subprocess
 failed.
 
+@node Target Platforms
+@section Target Platforms
+

Re: strcase?

2011-05-16 Thread Bruno Haible
Eric Blake wrote:
  A few modules use the status obsolete in the meaning of deprecated,
  however. Maybe it will help to avoid the confusion if we fix these. Here
  is a proposed patch.
 
 Looks reasonable to me.

Thanks for the review. Applied and pushed.

 obsolete means you need it only if targetting 
 otherwise-obsolete platforms with no replacement needed on modern
 platforms, deprecated means you should be prepared for the module to
 disappear by switching to its modern counterpart module.

This is a good explanation; you can put it into the documentation if the
question comes up again.

Bruno
-- 
In memoriam The victims of the Zaklopača massacre 
http://greatersurbiton.wordpress.com/2010/02/12/interview-with-nihada-hodzic-survivor-of-the-zaklopaca-massacre/



Re: strcase?

2011-05-16 Thread Bruno Haible
Simon Josefsson wrote:
 What seems to be missing here is a clarification of what it means for a
 platform to be modern -- I recall we discussed this before, but I
 cannot find that anything ended up in the manual.
 
 I think we need to name some platforms that we consider modern and
 some platforms that we consider obsolete for the obsolete keyword to
 be well defined and understandable by maintainers.

I've now reworked my proposal from January and committed a doc section
Target platforms.

It gives no definite answer, because there are various degrees of support.
But at some point there's a consensus that platform XY is obsolete.

Bruno
-- 
In memoriam The victims of the Zaklopača massacre 
http://greatersurbiton.wordpress.com/2010/02/12/interview-with-nihada-hodzic-survivor-of-the-zaklopaca-massacre/



Re: [PATCH] update DEPENDENCIES for interix

2011-05-16 Thread Bruno Haible
Hi Markus,

 This is a small patch in reply to [1] to update the DEPENDENCIES for interix 
 accordingly.
 
 [1] http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00310.html
   gnulib should document that libsuacomp is a
prerequisite for running on Interix.

The DEPENDENCIES file documents something different, namely:
   The following packages are needed by maintainers for using 'gnulib-tool'.

Now that we have a section Target platforms in the Gnulib manual, I think
that the mention of Interix (with version number) and suacomp (with homepage)
should go there. Near doc/gnulib-intro.texi:153.

Can you provide a patch for that file?

Bruno
-- 
In memoriam The victims of the Zaklopača massacre 
http://greatersurbiton.wordpress.com/2010/02/12/interview-with-nihada-hodzic-survivor-of-the-zaklopaca-massacre/



Re: alloca-opt

2011-05-16 Thread Bruno Haible
[Ccing bug-gnulib]

Sam Steingold asked:
 if I use alloca-opt from gnulib, can I replace
 
 #ifdef HAVE_ALLOCA
   #define alloca  __builtin_alloca
 #elif defined(MICROSOFT)
   #include malloc.h
   #define alloca _alloca
 #elif defined(HAVE_ALLOCA_H)
   #include alloca.h
   #ifndef alloca /* some define 'alloca' as macro... */
 #if !(defined(UNIX_OSF) || defined(UNIX_DEC_ULTRIX))
   /* OSF/1 V3 declares `alloca' as returning char*, but in OSF/1 V4
it returns void*. I don't know how to distinguish the two. */
   extern_C void* alloca (int size); /* see MALLOC(3V) */
 #endif
   #endif
 #elif defined(_AIX)
   #pragma alloca /* AIX requires this to be the first thing in the file. */
 #elif !defined(NO_ALLOCA)
   extern_C void* alloca (int size); /* see MALLOC(3V) */
 #endif
 
 with something like
 
 #include alloca.h
 #ifndef HAVE_ALLOCA
   #if defined(MICROSOFT)
 #include malloc.h
 #define alloca _alloca
   #elif defined(_AIX)
 #pragma alloca /* AIX requires this to be the first thing in the file. */
   #elif !defined(NO_ALLOCA)
 extern_C void* alloca (int size); /* see MALLOC(3V) */
   #endif
 #endif
 
 of something even simpler?

Here's how you can find out:

1) The module description says:

Description:
Memory allocation on the stack, as an optional optimization.
It allows using the alloca() macro if and only if the autoconf tests define
HAVE_ALLOCA.
...
Include:
alloca.h

So this means you should be able to write

   #include alloca.h

   #if HAVE_ALLOCA
... use alloca(n) ...
   #endif

If you are still unsure:

2) Look at the unit test modules/alloca-opt-tests. It mentions a file
tests/test-alloca-opt.c. When you look there, it indeed does

   #include alloca.h

   #if HAVE_ALLOCA
... use alloca(n) ...
   #endif

So really this way of using alloca is tested.

3) Finally there is also documentation:
http://www.gnu.org/software/gnulib/manual/html_node/alloca_002dopt.html

Bruno
-- 
In memoriam The victims of the Zaklopača massacre 
http://greatersurbiton.wordpress.com/2010/02/12/interview-with-nihada-hodzic-survivor-of-the-zaklopaca-massacre/



Re: Document reasonable portability targets

2011-05-16 Thread Paul Eggert
Thanks for redrafting that.  It looks much better now.  Some further comments:

 +currently ported to are probably HP-UX 10.20 and IRIX 5.3, though we
 +are not testing these platform very often.

platform - platforms

 +will not support all versions that are at most three years old, but only

I had trouble parsing the sentence that contains this line.  Perhaps replace
the entire line with the word supports?

 +people from their developers or users community contributes support to

Change to developers or users contribute support to.

 +As of 2011, the list of supported platforms is the following:

The actual list talks about testing, not supporting, so I suggest changing
supported to tested.

 +@item
 +Interix 3.5 is not tested.

I suggest adding Interix 6.1 is rarely tested, and requires suacomp 0.6.8 or 
later.; see
http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00324.html and
http://lists.gnu.org/archive/html/bug-tar/2011-05/msg9.html.

 +These operating systems are all supported in an unvirtualized environment.

I'd remove the above sentence, partly because of the tested versus supported
issue, partly because the sentence is redundant.

 +The following platforms are @emph{not} supported by Gnulib.  Even correct
 +patches for their support will not be applied.

Rather than just saying no, it'll be helpful to give a few reasons why,
so that people don't write and ask why?.  Also, there's no need for the @emph.
And it wouldn't hurt to add a Please here.  How about the following wording 
instead?
It tries to capture the essential (i.e., harsh :-) idea without being too 
off-putting.

  The following platforms are not supported by Gnulib.  The cost of supporting 
them
  would exceed the benefit because they're rarely used, or poorly documented,
  or have been supplanted by other platforms, or diverge too much from POSIX,
  or some combination of these and other factors.  Please don't bother sending
  us patches for them.



[PATCH] inttypes: avoid autoconf warning

2011-05-16 Thread Eric Blake
I noticed this while updating libvirt to the latest gnulib.

configure.ac:80: warning: AC_REQUIRE: `gl_STDINT_H' was expanded before it was 
required
gnulib/m4/inttypes.m4:18: gl_INTTYPES_INCOMPLETE is expanded from...
gnulib/m4/inttypes.m4:12: gl_INTTYPES_H is expanded from...
gnulib/m4/gnulib-comp.m4:379: gl_INIT is expanded from...
configure.ac:80: the top level

* m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): Only expand once.
* m4/stdint.m4 (gl_STDINT_H): Likewise.

Signed-off-by: Eric Blake ebl...@redhat.com
---

The interaction stems from the direct expansion in modules/stdint
vs. the AC_REQUIRE([gl_STDINT_H]) in inttypes.m4.  I'm not sure
what sequence of modules triggered this (that is, I could reproduce
it in libvirt, but not using ./gnulib-tool --with-tests in isolation),
but I did validate that this fixes it.  Besides, per the autoconf
manual, the easiest fix is to make the macros one-shot, after
verifying that they indeed only need to run once.

 ChangeLog  |6 ++
 m4/inttypes.m4 |4 ++--
 m4/stdint.m4   |4 ++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ac9a165..a418adf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-16  Eric Blake  ebl...@redhat.com
+
+   inttypes: avoid autoconf warning
+   * m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): Only expand once.
+   * m4/stdint.m4 (gl_STDINT_H): Likewise.
+
 2011-05-16  Sam Steingold s...@gnu.org
and Eric Blake  ebl...@redhat.com

diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
index 1e81990..cc027a4 100644
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -1,4 +1,4 @@
-# inttypes.m4 serial 23
+# inttypes.m4 serial 24
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,7 @@ AC_DEFUN([gl_INTTYPES_H],
   gl_INTTYPES_PRI_SCN
 ])

-AC_DEFUN([gl_INTTYPES_INCOMPLETE],
+AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
 [
   AC_REQUIRE([gl_STDINT_H])
   AC_CHECK_HEADERS_ONCE([inttypes.h])
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index dff37fe..c75e957 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 40
+# stdint.m4 serial 41
 dnl Copyright (C) 2001-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 dnl From Paul Eggert and Bruno Haible.
 dnl Test whether stdint.h is supported or must be substituted.

-AC_DEFUN([gl_STDINT_H],
+AC_DEFUN_ONCE([gl_STDINT_H],
 [
   AC_PREREQ([2.59])dnl

-- 
1.7.4.4