gnulib-tool broken on solaris

2010-02-24 Thread Ben Walton

Hi All,

I updated my gnulib git repo tonight before patching it into some
source and discovered that gnulib-tool was broken by commit 5b1da95 (I
bisected).  I've verified this breakage on Solaris 8 - 10.

--snip--
bwalton @ build8x : ~/gnulib
$ uname -a
SunOS build8x 5.8 Generic_117351-61 i86pc i386

bwalton @ build8x : ~/gnulib
$ git show-ref HEAD
108cfb803174abf17eb101eb9d1a642ce1ba refs/remotes/origin/HEAD

bwalton @ build8x : ~/gnulib
$ ./gnulib-tool --help
./gnulib-tool[814]: syntax error at line 816 : `(' unexpected
--snip--

The attached patch fixes the problem, but I'm not sure if it's the
best solution or fully portable.

HTH.
-Ben


0001-Fix-a-Solaris-breakage-introduced-by-5b1da95.patch
Description: Binary data


signature.asc
Description: PGP signature


Re: arg-nonnull.h & warn-on-use.h in build-aux

2010-02-24 Thread Sam Steingold
Hi,

On 2/24/10, Ralf Wildenhues  wrote:
>  * Sam Steingold wrote on Wed, Feb 24, 2010 at 01:15:13AM CET:
> > On 2/23/10, Bruno Haible wrote:
>  > >  Autoconf requires it to be constant. You specify it through the
>  > >  AC_CONFIG_AUX_DIR macro. In other words, if you add to
>  > >   clisp/modules/syscalls/configure.ac
>  > >  the line
>  > >   AC_CONFIG_AUX_DIR([../../src/build-aux])
>  > >  then you need only one copy of arg-nonnull.h, at
>  > >   clisp/src/build-aux/arg-nonnull.h
>  >
>  > I already have CL_MODULE_COMMON_CHECKS() in 
> clisp/modules/syscalls/configure.in
>  > which expands to
>  > AC_REQUIRE([AC_CONFIG_AUX_DIR],
>  > [AC_CONFIG_AUX_DIR([$cl_cv_clisp_libdir/build-aux])])
>
>
> That won't work right, the aux dir name needs to be known to autoreconf
>  and 'automake --add-missing', so it needs to be a literal string.
>
>  The reason autoconf doesn't warn or error out about nonliteral
>  AC_CONFIG_AUX_DIR argument is probably that in the distant past
>  (2.13 I guess, before I knew Autoconf anyway) it used to be
>  possible to pass a shell variable.

the reason it does not complain for me is that before calling all
those autoFOO things I create a local directory called
'$cl_cv_clisp_libdir' which point to the right place.

at any rate, why does automake write this $(top_srcdir)/src/build-aux
instead of what specify in my AC_CONFIG_AUX_DIR?

-- 
Sam Steingold 




Re: arg-nonnull.h & warn-on-use.h in build-aux

2010-02-24 Thread Ralf Wildenhues
Hello,

* Sam Steingold wrote on Wed, Feb 24, 2010 at 01:15:13AM CET:
> On 2/23/10, Bruno Haible wrote:
> >  Autoconf requires it to be constant. You specify it through the
> >  AC_CONFIG_AUX_DIR macro. In other words, if you add to
> >   clisp/modules/syscalls/configure.ac
> >  the line
> >   AC_CONFIG_AUX_DIR([../../src/build-aux])
> >  then you need only one copy of arg-nonnull.h, at
> >   clisp/src/build-aux/arg-nonnull.h
> 
> I already have CL_MODULE_COMMON_CHECKS() in 
> clisp/modules/syscalls/configure.in
> which expands to
> AC_REQUIRE([AC_CONFIG_AUX_DIR],
> [AC_CONFIG_AUX_DIR([$cl_cv_clisp_libdir/build-aux])])

That won't work right, the aux dir name needs to be known to autoreconf
and 'automake --add-missing', so it needs to be a literal string.

The reason autoconf doesn't warn or error out about nonliteral
AC_CONFIG_AUX_DIR argument is probably that in the distant past
(2.13 I guess, before I knew Autoconf anyway) it used to be
possible to pass a shell variable.

Cheers,
Ralf




Re: gnulib bootstrap and git submodules

2010-02-24 Thread Eric Blake
- "Jim Meyering"  wrote:
> > +# time-stamp-end: "; # UTC"
> 
> Those look fine.
> Though you might want to drop the semicolon in each.

Oh well, I already pushed with the semicolon.  At least this way,
all of the timestamped scripts in build-aux have the same formatting,
regardless of sh vs. perl.  Sometimes copy-n-pasteability trumps
minimalism:

$ git grep UTC build-aux

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




Re: gnulib bootstrap and git submodules

2010-02-24 Thread Jim Meyering
Eric Blake wrote:
> And adding timestamps aids in tracking whether projects are using the
> latest bootstrap.

That seems useful.
...
> Subject: [PATCH] bootstrap, git-version-gen: use timestamp
>
> Timestamps are useful, particularly for files copied into other
> packages, to see how long since a file has forked.
>
> * build-aux/git-version-gen (scriptversion): Force UTC.
> * build-aux/bootstrap (scriptversion): New variable.
...

> +# time-stamp-end: "; # UTC"

Those look fine.
Though you might want to drop the semicolon in each.
It's needed in that context in perl scripts, but not in bourne shell ones.




Re: [PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Eric Blake
According to Peter Simons on 2/24/2010 10:46 AM:
> Hi Simon,
> 
>  >> The following patches are necessary to make those modules compile in
>  >> projects that don't use a  header.
>  >
>  > That is generally not supported by gnulib. The majority of code in gnulib
>  > assumes there is a config.h already; >95% if my grep is working.
> 
> given the extreme technical simplicity of supporting both builds with and
> without a config.h header file, do you think that is a wise choice?

These days, gnulib uses so many #defines that it would exceed command-line
length limits on some platforms if they were passed via -D through the
Makefile.  That, and some things don't work well through makefiles, such
as an expansion containing # (and gnulib now has some of those for the
*.in.h replacement headers).  So going without any header at all is no
longer a portable option.

Which means the question is now one of whether we should support an
arbitrary name, or just hard-code .  We went with the latter.
At this point, it is technically just simpler to make your package use
config.h than it is to try to make gnulib support conditional config.h.

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



signature.asc
Description: OpenPGP digital signature


Re: gnulib bootstrap and git submodules

2010-02-24 Thread Eric Blake
According to Eric Blake on 2/24/2010 9:54 AM:
> Libvirt came up with the compelling reason - Fedora Core 11 only has
> 1.6.2.5, and RPEL 5 is back at git 1.5.5.  This should fix it, by
> borrowing ideas from m4's bootstrap script.

And adding timestamps aids in tracking whether projects are using the
latest bootstrap.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org
From 108cfb803174abf17eb101eb9d1a642ce1ba Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Wed, 24 Feb 2010 10:25:56 -0700
Subject: [PATCH] bootstrap, git-version-gen: use timestamp

Timestamps are useful, particularly for files copied into other
packages, to see how long since a file has forked.

* build-aux/git-version-gen (scriptversion): Force UTC.
* build-aux/bootstrap (scriptversion): New variable.

Signed-off-by: Eric Blake 
---
 ChangeLog |4 
 build-aux/bootstrap   |   10 ++
 build-aux/git-version-gen |5 +++--
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8aef62a..0b5ca46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-02-24  Eric Blake  

+   bootstrap, git-version-gen: use timestamp
+   * build-aux/git-version-gen (scriptversion): Force UTC.
+   * build-aux/bootstrap (scriptversion): New variable.
+
bootstrap: allow older git
* build-aux/bootstrap (GNULIB_SRCDIR): Add fallback if git is
older than 1.6.4.  Requested by the libvirt project.
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 875e751..365a3d9 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -1,4 +1,6 @@
 #! /bin/sh
+# Print a version string.
+scriptversion=2010-02-24.17; # UTC

 # Bootstrap this package from checked-out sources.

@@ -841,3 +843,11 @@ fi
 bootstrap_epilogue

 echo "$0: done.  Now you can run './configure'."
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 5f2f1cc..16da2a8 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2010-01-27.16
+scriptversion=2010-02-24.17; # UTC

 # Copyright (C) 2007-2010 Free Software Foundation, Inc.
 #
@@ -146,5 +146,6 @@ echo "$v" | tr -d '\012'
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
-- 
1.6.6.1



signature.asc
Description: OpenPGP digital signature


Re: [PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Peter Simons
Hi Simon,

 >> The following patches are necessary to make those modules compile in
 >> projects that don't use a  header.
 >
 > That is generally not supported by gnulib. The majority of code in gnulib
 > assumes there is a config.h already; >95% if my grep is working.

given the extreme technical simplicity of supporting both builds with and
without a config.h header file, do you think that is a wise choice?

Take care,
Peter





Re: gnulib bootstrap and git submodules

2010-02-24 Thread Jim Meyering
Eric Blake wrote:
> According to Jim Meyering on 2/17/2010 10:21 AM:
>>> or should we just assume that git 1.6.4 or newer is widespread enough to
>>> not be worth the hassle?
>>
>> I'd prefer to assume git 1.6.4 to keep things simpler, at least until
>> someone comes up with a compelling reason to add code to support older git.
>
> Libvirt came up with the compelling reason - Fedora Core 11 only has
> 1.6.2.5, and RPEL 5 is back at git 1.5.5.  This should fix it, by
> borrowing ideas from m4's bootstrap script.
>
> --
> Eric Blake   ebl...@redhat.com+1-801-349-2682
> Libvirt virtualization library http://libvirt.org
>
> From 980a90b55fd2721864880aed353bd05ba5b69365 Mon Sep 17 00:00:00 2001
> From: Eric Blake 
> Date: Wed, 24 Feb 2010 09:48:16 -0700
> Subject: [PATCH] bootstrap: allow older git
>
> git 1.6.4 is too new to be universally available yet.
>
> * build-aux/bootstrap (GNULIB_SRCDIR): Add fallback if git is
> older than 1.6.4.  Requested by the libvirt project.

Thanks.
That looks right to me.
...
> +  "`git_modules_config submodule.gnulib.url`" "$gnulib_path" \

Please use $(...) rather than `...`.
That is fine, since bootstrap already has other uses of $(...).




Re: gnulib bootstrap and git submodules

2010-02-24 Thread Eric Blake
According to Jim Meyering on 2/17/2010 10:21 AM:
>> or should we just assume that git 1.6.4 or newer is widespread enough to
>> not be worth the hassle?
> 
> I'd prefer to assume git 1.6.4 to keep things simpler, at least until
> someone comes up with a compelling reason to add code to support older git.

Libvirt came up with the compelling reason - Fedora Core 11 only has
1.6.2.5, and RPEL 5 is back at git 1.5.5.  This should fix it, by
borrowing ideas from m4's bootstrap script.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org
From 980a90b55fd2721864880aed353bd05ba5b69365 Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Wed, 24 Feb 2010 09:48:16 -0700
Subject: [PATCH] bootstrap: allow older git

git 1.6.4 is too new to be universally available yet.

* build-aux/bootstrap (GNULIB_SRCDIR): Add fallback if git is
older than 1.6.4.  Requested by the libvirt project.

Signed-off-by: Eric Blake 
---
 ChangeLog   |6 ++
 build-aux/bootstrap |   20 ++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 49e035d..37e30fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-24  Eric Blake  
+
+   bootstrap: allow older git
+   * build-aux/bootstrap (GNULIB_SRCDIR): Add fallback if git is
+   older than 1.6.4.  Requested by the libvirt project.
+
 2010-02-17  Eric Blake  

manywarnings: add more warnings
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index bd23856..656886d 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -431,12 +431,28 @@ case ${GNULIB_SRCDIR--} in
   GNULIB_SRCDIR=$gnulib_path
   ;;
 *)
-  # Use GNULIB_SRCDIR as a reference.  Assumes git 1.6.4 or newer.
+  # Use GNULIB_SRCDIR as a reference.
   if test -d "$GNULIB_SRCDIR"/.git && \
 git_modules_config submodule.gnulib.url >/dev/null; then
 echo "$0: getting gnulib files..."
-git submodule update --init --reference "$GNULIB_SRCDIR" \
+if git submodule --help|grep reference > /dev/null; then
+  # Prefer the one-liner available in git 1.6.4 or newer.
+  git submodule update --init --reference "$GNULIB_SRCDIR" \
 "$gnulib_path" || exit $?
+else
+  # This fallback allows at least git 1.5.5.
+  if test -f "$gnulib_path"/gnulib-tool; then
+# Since file already exists, assume submodule init already complete.
+git submodule update || exit $?
+  else
+# Older git can't clone into an empty directory.
+rmdir "$gnulib_path" 2>/dev/null
+git clone --reference "$GNULIB_SRCDIR" \
+  "`git_modules_config submodule.gnulib.url`" "$gnulib_path" \
+  && git submodule init && git submodule update \
+  || exit $?
+  fi
+fi
 GNULIB_SRCDIR=$gnulib_path
   fi
   ;;
-- 
1.6.6.1



signature.asc
Description: OpenPGP digital signature


Re: Glibc 2.11 configure error?

2010-02-24 Thread Eric Blake
According to thinke365 on 2/23/2010 11:24 PM:
> checking for cpuid.h... no
> configure: error: gcc must provide the  headerwhat's wrong?

This is the wrong list; this particular check is part of glibc's
configure.ac, so your question is better asked on the glibc lists.  But
most likely, your gcc is too old compared to what glibc expects (glibc
tends to be very aggressive at exploiting newer compiler features).

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



signature.asc
Description: OpenPGP digital signature


Glibc 2.11 configure error?

2010-02-24 Thread thinke365

i use CentOS 5.3,
kernel version 2.6.18
gcc version 4.1.2

configure
shows error:
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking for strings.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking cpuid.h usability... no
checking cpuid.h presence... no
checking for cpuid.h... no
configure: error: gcc must provide the  headerwhat's wrong?


-- 
View this message in context: 
http://old.nabble.com/Glibc-2.11-configure-error--tp27714112p27714112.html
Sent from the Gnulib mailing list archive at Nabble.com.





Re: [PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Ludovic Courtès
Hi,

Simon Josefsson  writes:

> Peter Simons  writes:
>
>> The following patches are necessary to make those modules compile in
>> projects that don't use a  header.
>
> That is generally not supported by gnulib.  The majority of code in
> gnulib assumes there is a config.h already; >95% if my grep is working.

And there’s the ‘sc_prohibit_have_config_h’ target in maint.mk,
presumably because of this.

Thanks,
Ludo’.





Re: [PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Simon Josefsson
Peter Simons  writes:

> The following patches are necessary to make those modules compile in
> projects that don't use a  header.

That is generally not supported by gnulib.  The majority of code in
gnulib assumes there is a config.h already; >95% if my grep is working.

/Simon




[PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Peter Simons
---
 ChangeLog |5 +
 lib/malloca.c |2 ++
 lib/md5.c |2 ++
 lib/sha1.c|2 ++
 4 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 501c267..8df0a56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-24  Peter Simons  
+
+lib/malloca.c, lib/md5.c, lib/sha1.c: don't include  unless
+HAVE_CONFIG_H is defined
+
 2010-02-23  Eric Blake  
 
warn-on-use: work with old autoconf
diff --git a/lib/malloca.c b/lib/malloca.c
index b0e6ab6..7d5c6a5 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -16,7 +16,9 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_CONFIG_H
 #include 
+#endif
 
 /* Specification.  */
 #include "malloca.h"
diff --git a/lib/md5.c b/lib/md5.c
index 4480ba8..ff3fc6d 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -20,7 +20,9 @@
 
 /* Written by Ulrich Drepper , 1995.  */
 
+#ifdef HAVE_CONFIG_H
 #include 
+#endif
 
 #include "md5.h"
 
diff --git a/lib/sha1.c b/lib/sha1.c
index 1ea84f6..f290f47 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -23,7 +23,9 @@
   Robert Klep   -- Expansion function fix
 */
 
+#ifdef HAVE_CONFIG_H
 #include 
+#endif
 
 #include "sha1.h"
 
-- 
1.7.0





[PATCH] lib/malloca.c, lib/md5.c, lib/sha1.c: don't include unless HAVE_CONFIG_H is defined

2010-02-24 Thread Peter Simons
The following patches are necessary to make those modules compile in
projects that don't use a  header.