Re: lib-ignore: link error with Sun C++ compiler

2010-03-28 Thread Bruno Haible
> * Bruno Haible wrote on Sat, Mar 20, 2010 at 11:52:25PM CET:
> > lib-ignore: Determine different options for different compilers.
> > * m4/lib-ignore.m4 (gl_IGNORE_UNUSED_LIBRARIES): Set a variable which
> > depends on the current language (C/C++/Fortran). Don't set LDFLAGS.
> > Add comments.
> > (_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS): New macro.
> > * NEWS: Mention the change.

I've committed this patch now, including Ralf's comments about libtool, below.

Jim, for coreutils, I propose this patch:

=
2010-03-28  Bruno Haible  

Update after change in gnulib's lib-ignore module.
* src/Makefile.am (AM_LDFLAGS): New variable.

--- src/Makefile.am.origSun Mar 28 11:31:05 2010
+++ src/Makefile.am Sun Mar 28 11:30:27 2010
@@ -170,6 +170,9 @@
 noinst_LIBRARIES = libver.a
 nodist_libver_a_SOURCES = version.c version.h
 
+# Tell the linker to omit references to unused shared libraries.
+AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
+
 # Sometimes, the expansion of $(LIBINTL) includes -lc which may
 # include modules defining variables like `optind', so libcoreutils.a
 # must precede $(LIBINTL) in order to ensure we use GNU getopt.
=



2010-03-28  Bruno Haible  
Ralf Wildenhues  

lib-ignore: Determine different options for different compilers.
* m4/lib-ignore.m4 (gl_IGNORE_UNUSED_LIBRARIES): Set a variable which
depends on the current language (C/C++/Fortran). Don't set LDFLAGS.
Add comments.
(_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS): New macro.
* NEWS: Mention the change.

*** NEWS.orig   Sun Mar 28 11:23:19 2010
--- NEWSSun Mar 28 11:23:01 2010
***
*** 6,11 
--- 6,17 
  
  DateModules Changes
  
+ 2010-03-28  lib-ignore  This module now provides a variable
+ IGNORE_UNUSED_LIBRARIES_CFLAGS that you should
+ add to LDFLAGS (when linking C programs only) or
+ CFLAGS yourself. It is no longer added to LDFLAGS
+ automatically.
+ 
  2010-03-18  pty This module now only declares the pty.h header.
  Use the new modules 'forkpty' or 'openpty' to
  get the functions that were previously provided.
*** m4/lib-ignore.m4.orig   Sun Mar 28 11:23:19 2010
--- m4/lib-ignore.m4Sun Mar 28 11:21:08 2010
***
*** 7,17 
  
  dnl Written by Paul Eggert.
  
  AC_DEFUN([gl_IGNORE_UNUSED_LIBRARIES],
  [
!   AC_CACHE_CHECK([for flag to ignore unused libraries],
! [gl_cv_ignore_unused_libraries],
! [gl_cv_ignore_unused_libraries=none
   gl_saved_ldflags=$LDFLAGS
   gl_saved_libs=$LIBS
   # Link with -lm to detect binutils 2.16 bug with --as-needed; see
--- 7,55 
  
  dnl Written by Paul Eggert.
  
+ # gl_IGNORE_UNUSED_LIBRARIES
+ # --
+ # Determines the option to be passed to the C/C++/Fortran compiler, so that it
+ # omits unused libraries.
+ # Example (on Solaris):
+ # $ cc foo.c -lnsl; ldd ./a.out
+ # libnsl.so.1 =>   /lib/libnsl.so.1
+ # libc.so.1 => /lib/libc.so.1
+ # libmp.so.2 =>/lib/libmp.so.2
+ # libmd.so.1 =>/lib/libmd.so.1
+ # libscf.so.1 =>   /lib/libscf.so.1
+ # libdoor.so.1 =>  /lib/libdoor.so.1
+ # libuutil.so.1 => /lib/libuutil.so.1
+ # libgen.so.1 =>   /lib/libgen.so.1
+ # libm.so.2 => /lib/libm.so.2
+ # $ cc foo.c -lnsl -Wl,-z,ignore; ldd ./a.out
+ # libc.so.1 => /lib/libc.so.1
+ # libm.so.2 => /lib/libm.so.2
+ #
+ # Note that the option works only for the C compiler, not for the C++
+ # compiler:
+ # - Sun C likes '-Wl,-z,ignore'.
+ #   '-Qoption ld -z,ignore' is not accepted.
+ #   '-z ignore' is accepted but has no effect.
+ # - Sun C++ and Sun Fortran like '-Qoption ld -z,ignore'.
+ #   '-Wl,-z,ignore' is not accepted.
+ #   '-z ignore' is accepted but has no effect.
+ #
+ # Sets and substitutes a variable that depends on the current language:
+ # - IGNORE_UNUSED_LIBRARIES_CFLAGSfor C
+ # - IGNORE_UNUSED_LIBRARIES_CXXFLAGS  for C++
+ # - IGNORE_UNUSED_LIBRARIES_FFLAGSfor Fortran
+ #
+ # Note that the option works only for direct invocation of the compiler, not
+ # through libtool: When libtool is used to create a shared library, it will
+ # honor and translate '-Wl,-z,ignore' to '-Qoption ld -z -Qoption ld ignore'
+ # if needed, but it will drop a '-Qoption ld -z,ignore' on the command line.
+ #
  AC_DEFUN([gl_IGNORE_UNUSED_LIBRARIES],
  [
!   AC_CACHE_CHECK([for []_AC_LANG[] compiler flag to ignore unused libraries],
! [gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries],
! [gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries=

Re: [PATCH 2/2] maint: use pragma consistently across replacement headers

2010-03-28 Thread Bruno Haible
Hi Eric,

> >> -#ifndef _GL_CTYPE_H
> >> -
> >>  #if __GNUC__ >= 3
> >>  @PRAGMA_SYSTEM_HEADER@
> >>  #endif
> >>
> >> +#ifndef _GL_CTYPE_H
> >> +
> >>  /* Include the original .  */
> >>  /* The include_next requires a split double-inclusion guard.  */
> >>  #...@include_next@ @NEXT_CTYPE_H@
> > 
> > Did you know that GCC has a special optimization for include files? ...

> are you saying that the optimization is useless for those files, because they
> are split includes, and thus already fail to meet the pattern that gcc
> is looking for?

No, on the contrary: The previous shape of most of our *.in.h files matches
what GCC is looking for: It starts with a "#ifndef _GL_STRING_H" and ends
with the corresponding "#endif". The fact that _GL_STRING_H is tested again
inside is irrelevant for this optimization.

> Maybe it's worth a bug report to the gcc folks to get them to also
> recognize idempotent preprocessor directives (such as the hoisted
> #pragma) that do not affect the optimization of reparsing the file?

Hmm, it's not only the #pragma, it's also the #if __GNUC__ >= 3 before it.
I can hardly imagine that the GCC people would implement such a feature
request - for them, it will be a rare use-case with an easy workaround.

The only .in.h files on which the GCC optimization does not apply anyway
are those with a special invocation convention, namely
  fcntl.in.h
  inttypes.in.h
  signal.in.h
  stddef.in.h
  stdio.in.h
  stdlib.in.h
  sys_select.in.h
  sys_stat.in.h
  time.in.h
  unistd.in.h
  wchar.in.h

> Well, we could revert this patch

Yes, this is what I would propose. We don't know how many people would notice
the GCC slowdown, but even if one single gnulib user complained, I wouldn't
like to have slowed down his compilation for no convincing reason.

> instead patch fcntl.in.h, stdlib.in.h, and so forth to follow this 
> optimization.

We can't do this: it's a special invocation convention. These include files are
not no-ops if they are included a second time with __need_system_fcntl_h or
_GL_JUST_INCLUDE_SYSTEM_INTTYPES_H set. If we were to change this logic, we are
likely to reintroduce bugs that we fixed long ago.

Here's the proposed patch:


2010-03-28  Bruno Haible  

Emit #pragma system_header after the inclusion guard, not before.
* lib/arpa_inet.in.h: Emit #pragma system_header after the inclusion
guard that spans the entire file, not before. This enables an
optimization in GCC's preprocessor.
* lib/ctype.in.h: Likewise.
* lib/dirent.in.h: Likewise.
* lib/errno.in.h: Likewise.
* lib/float.in.h: Likewise.
* lib/getopt.in.h: Likewise.
* lib/iconv.in.h: Likewise.
* lib/langinfo.in.h: Likewise.
* lib/locale.in.h: Likewise.
* lib/math.in.h: Likewise.
* lib/netdb.in.h: Likewise.
* lib/netinet_in.in.h: Likewise.
* lib/pty.in.h: Likewise.
* lib/sched.in.h: Likewise.
* lib/se-selinux.in.h: Likewise.
* lib/search.in.h: Likewise.
* lib/spawn.in.h: Likewise.
* lib/stdarg.in.h: Likewise.
* lib/stdint.in.h: Likewise.
* lib/string.in.h: Likewise.
* lib/strings.in.h: Likewise.
* lib/sys_file.in.h: Likewise.
* lib/sys_ioctl.in.h: Likewise.
* lib/sys_time.in.h: Likewise.
* lib/sys_times.in.h: Likewise.
* lib/sys_utsname.in.h: Likewise.
* lib/sys_wait.in.h: Likewise.
* lib/sysexits.in.h: Likewise.
* lib/wctype.in.h: Likewise.

--- lib/arpa_inet.in.h.orig Sun Mar 28 12:28:35 2010
+++ lib/arpa_inet.in.h  Sun Mar 28 12:07:53 2010
@@ -16,12 +16,12 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-# if __GNUC__ >= 3
-...@pragma_system_header@
-# endif
-
 #ifndef _GL_ARPA_INET_H
 
+#if __GNUC__ >= 3
+...@pragma_system_header@
+#endif
+
 /* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
under MinGW.
But avoid namespace pollution on glibc systems.  */
--- lib/ctype.in.h.orig Sun Mar 28 12:28:35 2010
+++ lib/ctype.in.h  Sun Mar 28 12:08:07 2010
@@ -23,12 +23,12 @@
  * 
  */
 
+#ifndef _GL_CTYPE_H
+
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
-#ifndef _GL_CTYPE_H
-
 /* Include the original .  */
 /* The include_next requires a split double-inclusion guard.  */
 #...@include_next@ @NEXT_CTYPE_H@
--- lib/dirent.in.h.origSun Mar 28 12:28:35 2010
+++ lib/dirent.in.h Sun Mar 28 12:08:17 2010
@@ -14,12 +14,12 @@
You should have received a copy of the GNU General Public License
along with this program.  If not, see .  */
 
+#ifndef _GL_DIRENT_H
+
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
-#ifndef _GL_DIRENT_H
-
 /* The include_next requires a split double-inclusion guard.  */
 #...@include_next

Re: [PATCH] build: sync primary and tests-related gnulib module lists

2010-03-28 Thread Bruno Haible
Jim Meyering wrote:
> * bootstrap.conf (gnulib_modules): Synchronize the primary list
> of modules with the list used by tests, so that we don't have
> a repeat of the wctob-vs-Solaris 8 build failure.

You should now be able to revert this. The bug is fixed in gnulib
since yesterday.

Bruno




Re: portable openpty, forkpty

2010-03-28 Thread Bruno Haible
Hi Simon,

Thanks for testing.
> The forkpty code builds fine as a part of InetUtils on Mac OS X.  I
> tried the gnulib self-checks for forkpty, but they failed:
> 
> Making check in gltests
> make  check-recursive
> make  check-TESTS
> PASS: test-alignof
> PASS: test-errno
> PASS: test-fcntl-h
> PASS: test-fcntl-h-c++
> forkpty returned -1
> FAIL: test-forkpty
> openpty returned -1
> FAIL: test-login_tty
> openpty returned -1
> FAIL: test-openpty
> PASS: test-pty-c++
> PASS: test-stddef
> PASS: test-stdint
> PASS: test-sys_ioctl
> PASS: test-sys_ioctl-c++
> PASS: test-sys_socket
> PASS: test-sys_socket-c++
> PASS: test-unistd
> PASS: test-unistd-c++
> PASS: test-wchar
> PASS: test-wchar-c++
> 
> 3 of 18 tests failed
> 
> 
> This is from a package created with './gnulib-tool --dir m
> --create-testdir --with-tests forkpty'

The only version of MacOS X I have access to is 10.5, and on this
system it works fine, both with the system-provided 'openpty'
   ./configure CPPFLAGS=-Wall
as well as with the gnulib replacements
   ac_cv_func_openpty=no \
   ac_cv_func_forkpty=no \
   ac_cv_func_login_tty=no \
   ac_cv_have_decl_openpty=no \
   ac_cv_have_decl_forkpty=no \
   ac_cv_have_decl_login_tty=no \
   ./configure CPPFLAGS=-Wall

Can you check why openpty and login_tty fail? The tests are written
in a way that can easily be single-stepped. (To build for debugging and
single-stepping on MacOS X, use CFLAGS=-ggdb, then you can debug with
gdb.)

The implementation of openpty on a particular platform is quite easy
to understand, once you stepped through it. It's only the #ifs which
are complicated.

Bruno




sys_ioctl, sys_select: fix link errors

2010-03-28 Thread Bruno Haible
On mingw, I get link errors:

g++ -mno-cygwin-L/usr/local/mingw/lib -o test-sys_ioctl-c++.exe 
test-sys_ioctl-c++.o ../gllib/libgnu.a   
test-sys_ioctl-c++.o:test-sys_ioctl-c++.cc:(.data+0x4): undefined reference to 
`_ioctl'
collect2: ld returned 1 exit status
make[4]: *** [test-sys_ioctl-c++.exe] Error 1

Then later:

g++ -mno-cygwin-L/usr/local/mingw/lib -o test-sys_ioctl-c++.exe 
test-sys_ioctl-c++.o ../gllib/libgnu.a   
../gllib/libgnu.a(ioctl.o): In function `rpl_ioctl':
/home/bruno/testdir1/gllib/ioctl.c:46: undefined reference to `_ioctlsoc...@12'
../gllib/libgnu.a(ioctl.o): In function `rpl_ioctl':
/home/bruno/testdir1/gllib/w32sock.h:34: undefined reference to 
`_wsagetlaster...@0'
collect2: ld returned 1 exit status
make[4]: *** [test-sys_ioctl-c++.exe] Error 1

and:

g++ -mno-cygwin-L/usr/local/mingw/lib -o test-sys_select-c++.exe 
test-sys_select-c++.o ../gllib/libgnu.a   
../gllib/libgnu.a(select.o): In function `rpl_select':
/home/bruno/testdir1/gllib/select.c:93: undefined reference to 
`_wsaenumnetworkeve...@12'
/home/bruno/testdir1/gllib/select.c:360: undefined reference to 
`_wsaeventsel...@12'
/home/bruno/testdir1/gllib/select.c:381: undefined reference to `_sel...@20'
...
collect2: ld returned 1 exit status
make[4]: *** [test-sys_select-c++.exe] Error 1


This patch fixes all three errors.


2010-03-28  Bruno Haible  

Fix link errors on mingw.
* lib/sys_ioctl.in.h (ioctl): Fix declaration idiom.
* modules/sys_ioctl-tests (Makefile.am): Link test-sys_ioctl-c++ with
$(LIBSOCKET).
* modules/sys_select-tests (Makefile.am): Link test-sys_select-c++ with
$(LIBSOCKET).

--- lib/sys_ioctl.in.h.orig Sun Mar 28 14:16:35 2010
+++ lib/sys_ioctl.in.h  Sun Mar 28 14:10:17 2010
@@ -49,13 +49,18 @@
 #   undef ioctl
 #   define ioctl rpl_ioctl
 #  endif
+_GL_FUNCDECL_RPL (ioctl, int,
+  (int fd, int request, ... /* {void *,char *} arg */));
+_GL_CXXALIAS_RPL (ioctl, int,
+  (int fd, int request, ... /* {void *,char *} arg */));
+# else
 _GL_FUNCDECL_SYS (ioctl, int,
   (int fd, int request, ... /* {void *,char *} arg */));
-# endif
 /* Need to cast, because on glibc systems, the second parameter is
 unsigned long int request.  */
 _GL_CXXALIAS_SYS_CAST (ioctl, int,
(int fd, int request, ... /* {void *,char *} arg */));
+# endif
 _GL_CXXALIASWARN (ioctl);
 #elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 # undef ioctl
--- modules/sys_ioctl-tests.origSun Mar 28 14:16:35 2010
+++ modules/sys_ioctl-tests Sun Mar 28 14:13:55 2010
@@ -15,5 +15,5 @@
 TESTS += test-sys_ioctl-c++
 check_PROGRAMS += test-sys_ioctl-c++
 test_sys_ioctl_c___SOURCES = test-sys_ioctl-c++.cc
-test_sys_ioctl_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME)
+test_sys_ioctl_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) 
$(LIB_CLOCK_GETTIME)
 endif
--- modules/sys_select-tests.orig   Sun Mar 28 14:16:35 2010
+++ modules/sys_select-testsSun Mar 28 14:15:13 2010
@@ -15,5 +15,5 @@
 TESTS += test-sys_select-c++
 check_PROGRAMS += test-sys_select-c++
 test_sys_select_c___SOURCES = test-sys_select-c++.cc
-test_sys_select_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP)
+test_sys_select_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) $(LIB_NANOSLEEP)
 endif




Re: #defines in unistd.h

2010-03-28 Thread Bruno Haible
Hi John,

Thanks for this report.

> The current gnulib unistd.in.h file includes the following section:
> 
>   #if @GNULIB_GETHOSTNAME@
>   /* Get all possible declarations of gethostname().  */
>   # if @UNISTD_H_HAVE_WINSOCK2_H@
>   #  if !defined _GL_SYS_SOCKET_H
>   #   undef socket
>   #   define socket   socket_used_without_including_sys_socket_h
>   #   undef connect
>   #   define connect  connect_used_without_including_sys_socket_h
>   #   undef accept
>   #   define accept   accept_used_without_including_sys_socket_h
>   #   undef bind
>   #   define bind bind_used_without_including_sys_socket_h
>   #   undef getpeername
>   #   define getpeername  
> getpeername_used_without_including_sys_socket_h
>   #   undef getsockname
>   #   define getsockname  
> getsockname_used_without_including_sys_socket_h
>   #   undef getsockopt
>   #   define getsockopt   
> getsockopt_used_without_including_sys_socket_h
>   #   undef listen
>   #   define listen   listen_used_without_including_sys_socket_h
>   #   undef recv
>   #   define recv recv_used_without_including_sys_socket_h
>   #   undef send
>   #   define send send_used_without_including_sys_socket_h
>   #   undef recvfrom
>   #   define recvfrom recvfrom_used_without_including_sys_socket_h
>   #   undef sendto
>   #   define sendto   sendto_used_without_including_sys_socket_h
>   #   undef setsockopt
>   #   define setsockopt   
> setsockopt_used_without_including_sys_socket_h
>   #   undef shutdown
>   #   define shutdown shutdown_used_without_including_sys_socket_h
>   #  endif
>   #  if !defined _GL_SYS_SELECT_H
>   #   undef select
>   #   define select   select_used_without_including_sys_select_h
>   #  endif
>   # endif
>   #endif
> 
> I think these definitions can cause trouble for C++ programs that do
> things like
> 
>   foo.h:
>   -
>   class foo {
> public:
>   foo (void) { }
>   void accept (void);
>   };
> 
>   foo.cc:
>   --
>   #include 
>   #include "foo.h"
>   void foo::accept (void) { }
> // Oops, accept is not a member of class foo.

Indeed. I'm applying the attached patch; it should fix this.

> or C programs like this:
> 
>   foo.h:
>   -
>   extern int accept;
>   extern void doit (void);
> 
>   foo.c:
>   -
>   #include 
>   #include "foo.h"
>   int accept = 0;
>   void doit (void) { accept = 1; }
> 
>   main.c:
>   --
>   #include "foo.h"
>   int main (void) { accept = -1; doit (); return accept; }
> /* oops, what happened to the global variable accept? */

C programs in a POSIX environment must not define global variables
named 'accept'.


2010-03-28  Bruno Haible  

unistd: Avoid #define replacements in C++ mode.
* lib/unistd.in.h (socket, connect, accept, bind, getpeername,
getsockname, getsockopt, listen, recv, send, recvfrom, sendto,
setsockopt, shutdown, select): In C++, attach a warning to the function
if possible, rather than #defining the symbol to a dysfunctional alias.
Reported by John W. Eaton .

*** lib/unistd.in.h.origSun Mar 28 14:22:45 2010
--- lib/unistd.in.h Sun Mar 28 13:54:06 2010
***
*** 97,148 
  # include 
  #endif
  
  #if @GNULIB_GETHOSTNAME@
  /* Get all possible declarations of gethostname().  */
  # if @UNISTD_H_HAVE_WINSOCK2_H@
  #  if !defined _GL_SYS_SOCKET_H
! #   undef socket
! #   define socket   socket_used_without_including_sys_socket_h
! #   undef connect
! #   define connect  connect_used_without_including_sys_socket_h
! #   undef accept
! #   define accept   accept_used_without_including_sys_socket_h
! #   undef bind
! #   define bind bind_used_without_including_sys_socket_h
! #   undef getpeername
! #   define getpeername  
getpeername_used_without_including_sys_socket_h
! #   undef getsockname
! #   define getsockname  
getsockname_used_without_including_sys_socket_h
! #   undef getsockopt
! #   define getsockopt   getsockopt_used_without_including_sys_socket_h
! #   undef listen
! #   define listen   listen_used_without_including_sys_socket_h
! #   undef recv
! #   define recv recv_used_without_including_sys_socket_h
! #   undef send
! #   define send send_used_without_including_sys_socket_h
! #   undef recvfrom
! #   define recvfrom recvfrom_used_without_including_sys_socket_h
! #   undef sendto
! #   define sendto   sendto_used_without_including_sys_socket_h
! #   undef setsockopt
! #   define setsockopt   setsockopt_used_without_including_sys_socket_h
! #   undef shutdown
! #   define shutdown shutdown_used_without_including_sys_socket_h
  #  endif
  #  if !defined _GL_SYS_SELECT_H
! #   undef select
! #   define select   

Re: C++ libtool build error?

2010-03-28 Thread Bruno Haible
Eric Blake wrote on 2010-03-17:
> > Allow the user to disable C++ code and tests.
> > * m4/ansi-c++.m4 (gl_CXX_CHOICE): New macro.
> > (gl_PROG_ANSI_CXX): Require it.
> 
> This is a nice patch, but would it be possible to take it one step
> further, and allow the developer to populate a default state for whether
> C++ code should be enabled/disabled ...
> [1] Oddly enough, this describes m4 :)

Implemented as below. You need to write
  AC_DEFUN([gl_CXX_CHOICE_DEFAULT_NO])

It would also have been possible to let the user write
  gl_CXX_CHOICE_DEFAULT_NO
and have a definition of this macro in a separate .m4 file, relying on
'aclocal' to find out which .m4 files are used and which are not. But
this would mean that gnulib-tool imports .m4 files that are most often
not used. It already does so for the 'gettext' module, and this is an
annoyance.

Bruno


2010-03-28  Bruno Haible  

ansi-c++-opt: Allow turning off the C++ build by default.
* m4/ansi-c++.m4 (gl_CXX_CHOICE): Let CXX_CHOICE default to 'no' if
gl_CXX_CHOICE_DEFAULT_NO is defined.
Requested by Eric Blake.

--- m4/ansi-c++.m4.orig Sun Mar 28 15:27:25 2010
+++ m4/ansi-c++.m4  Sun Mar 28 15:26:42 2010
@@ -1,4 +1,4 @@
-# ansi-c++.m4 serial 3
+# ansi-c++.m4 serial 4
 dnl Copyright (C) 2002-2003, 2005, 2010 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,16 +7,25 @@
 dnl From Bruno Haible.
 
 # Sets CXX_CHOICE to 'yes' or 'no', depending on the preferred use of C++.
+# The default is 'yes'. If the configure.ac contains a definition of the
+# macro gl_CXX_CHOICE_DEFAULT_NO, then the default is 'no'. In both cases,
+# the user can change the value by passing the option --disable-cxx or
+# --enable-cxx, respectively.
 
 AC_DEFUN([gl_CXX_CHOICE],
 [
   AC_MSG_CHECKING([whether to use C++])
   dnl It would be so nice if plus signs were supported in AC_ARG_ENABLE.
   dnl Feature request submitted on 2010-03-13.
-  AC_ARG_ENABLE([cxx],
-[  --disable-cxx   do not build C++ sources],
-[CXX_CHOICE="$enableval"],
-[CXX_CHOICE=yes])
+  m4_ifdef([gl_CXX_CHOICE_DEFAULT_NO],
+[AC_ARG_ENABLE([cxx],
+   [  --enable-cxxalso build C++ sources],
+   [CXX_CHOICE="$enableval"],
+   [CXX_CHOICE=no])],
+[AC_ARG_ENABLE([cxx],
+   [  --disable-cxx   do not build C++ sources],
+   [CXX_CHOICE="$enableval"],
+   [CXX_CHOICE=yes])])
   AC_MSG_RESULT([$CXX_CHOICE])
   AC_SUBST([CXX_CHOICE])
 ])




[PATCH 1/3] Macro _header_without_use renamed to _sc_header_without_use in maint.mk

2010-03-28 Thread Jose E . Marchesi


>From 94828fa78a7a03dad4cbbd88f3b5f4f9ccf22776 Mon Sep 17 00:00:00 2001
From: Jose E. Marchesi 
Date: Sun, 28 Mar 2010 13:28:34 +0200
Subject: [PATCH 1/3] Macro _header_without_use renamed to 
_sc_header_without_use in maint.mk

---
 ChangeLog|   27 +++
 top/maint.mk |   42 +-
 2 files changed, 48 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dca5a12..1cf6e26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2010-03-28  Jose E. Marchesi  
+
+   Macro _header_without_use renamed to _sc_header_without_use in
+   maint.mk
+   * top/maint.mk: _header_without_use macro renamed to
+   _sc_header_without_use.
+   (sc_prohibit_assert_without_use): Use the new name.
+   (sc_prohibit_close_stream_without_use): Likewise.
+   (sc_prohibit_getopt_without_use): Likewise.
+   (sc_prohibit_quotearg_without_use): Likewise.
+   (sc_prohibit_quote_without_use): Likewise.
+   (sc_prohibit_long_options_without_use): Likewise.
+   (sc_prohibit_inttostr_without_use): Likewise.
+   (sc_prohibit_ignore_value_without_use): Likewise.
+   (sc_prohibit_error_without_use): Likewise.
+   (sc_prohibit_xalloc_without_use): Likewise.
+   (sc_prohibit_hash_without_use): Likewise.
+   (sc_prohibit_hash_pjw_without_use): Likewise.
+   (sc_prohibit_safe_read_without_use): Likewise.
+   (sc_prohibit_argmatch_without_use): Likewise.
+   (sc_prohibit_canonicalize_without_use): Likewise.
+   (sc_prohibit_root_dev_ino_without_use): Likewise.
+   (sc_prohibit_openat_without_use): Likewise.
+   (sc_prohibit_c_ctype_without_use): Likewise.
+   (sc_prohibit_signal_without_use): Likewise.
+   (sc_prohibit_intprops_without_use): Likewise.
+
 2010-03-28  Bruno Haible  
 Ralf Wildenhues  
 
diff --git a/top/maint.mk b/top/maint.mk
index 6127c57..9cae5d9 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -292,7 +292,7 @@ sc_prohibit_HAVE_MBRTOWC:
 # To use this "command" macro, you must first define two shell variables:
 # h: the header, enclosed in <> or ""
 # re: a regular expression that matches IFF something provided by $h is used.
-define _header_without_use
+define _sc_header_without_use
   dummy=; : so we do not need a semicolon before each use; \
   h_esc=`echo "$$h"|sed 's/\././g'`;   \
   if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
@@ -307,44 +307,44 @@ endef
 
 # Prohibit the inclusion of assert.h without an actual use of assert.
 sc_prohibit_assert_without_use:
-   @h='' re='\
 sc_prohibit_hash_without_use:
@h='"hash.h"' \
re='$(_hash_fn)|$(_hash_struct)'\
- $(_header_without_use)
+ $(_sc_header_without_use)
 
 sc_prohibit_hash_pjw_without_use:
@h='"hash-pjw.h"' \
re='\'   \
-- 
1.6.5





[PATCH 2/3] Catch function calls with zero or more blank characters before the argument list in syntax check rules.

2010-03-28 Thread Jose E . Marchesi

>From baf55461a6b01978ba02327f790f4fd544b1342f Mon Sep 17 00:00:00 2001
From: Jose E. Marchesi 
Date: Sun, 28 Mar 2010 13:35:24 +0200
Subject: [PATCH 2/3] Catch function calls with zero or more blank characters 
before the argument list in syntax check rules.

---
 ChangeLog|   11 +++
 top/maint.mk |8 
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1cf6e26..909ddc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2010-03-28  Jose E. Marchesi  
 
+   Catch function calls with zero or more blank characters before the
+   argument list in syntax check rules.
+   * top/maint.mk (sc_error_exit_success): Pattern changed to catch
+   calls to a functions with zero or more blanks separating the
+   function name and the open parenthesis.
+   (sc_error_message_warn_fatal): Likewise.
+   (sc_error_message_uppercase): Likewise.
+   (sc_error_message_period): Likewise.
+
+2010-03-28  Jose E. Marchesi  
+
Macro _header_without_use renamed to _sc_header_without_use in
maint.mk
* top/maint.mk: _header_without_use macro renamed to
diff --git a/top/maint.mk b/top/maint.mk
index 9cae5d9..ffcd728 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -217,21 +217,21 @@ sc_prohibit_magic_number_exit:
 # Using EXIT_SUCCESS as the first argument to error is misleading,
 # since when that parameter is 0, error does not exit.  Use `0' instead.
 sc_error_exit_success:
-   @grep -nE 'error \(EXIT_SUCCESS,'   \
+   @grep -nE 'error *\(EXIT_SUCCESS,'  \
$$($(VC_LIST_EXCEPT) | grep -E '\.[chly]$$') && \
  { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; exit 1; } || :
 
 # `FATAL:' should be fully upper-cased in error messages
 # `WARNING:' should be fully upper-cased, or fully lower-cased
 sc_error_message_warn_fatal:
-   @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT))   \
+   @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))  \
| grep -E '"Warning|"Fatal|"fatal' &&   \
  { echo '$(ME): use FATAL, WARNING or warning' 1>&2;   \
exit 1; } || :
 
 # Error messages should not start with a capital letter
 sc_error_message_uppercase:
-   @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT))   \
+   @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))  \
| grep -E '"[A-Z]'  \
| grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' &&   \
  { echo '$(ME): found capitalized error message' 1>&2; \
@@ -239,7 +239,7 @@ sc_error_message_uppercase:
 
 # Error messages should not end with a period
 sc_error_message_period:
-   @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT))   \
+   @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))  \
| grep -E '[^."]\."' && \
  { echo '$(ME): found error message ending in period' 1>&2;\
exit 1; } || :
-- 
1.6.5





[PATCH 3/3] Macro _prohibit_regexp replaced by _sc_search_regep and rules adapted to use the new macro.

2010-03-28 Thread Jose E . Marchesi

>From 24ab183f237468f2aa59d2424dc416f61c183671 Mon Sep 17 00:00:00 2001
From: Jose E. Marchesi 
Date: Sun, 28 Mar 2010 15:42:03 +0200
Subject: [PATCH 3/3] Macro _prohibit_regexp replaced by _sc_search_regep and 
rules adapted to use the new macro.

---
 ChangeLog|   40 +++
 top/maint.mk |  340 ++
 2 files changed, 241 insertions(+), 139 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 909ddc3..3b8883d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,45 @@
 2010-03-28  Jose E. Marchesi  
 
+   Macro _prohibit_regexp replaced by _sc_search_regep and rules
+   adapted to use the new macro.
+   * ../gnulib-dev/top/maint.mk (_prohibit_regexp): replaced with
+   _sc_search_regexp.
+
+   * top/maint.mk (sc_cast_of_argument_to_free): Use
+   _sc_search_regexp.
+   (sc_cast_of_x_alloc_return_value): Likewise.
+   (sc_cast_of_alloca_return_value): Likewise.
+   (sc_space_tab): Likewise.
+   (sc_prohibit_atoi_atof): Likewise.
+   (sc_prohibit_magic_number_exit): Likewise.
+   (sc_error_exit_success): Likewise.
+   (sc_file_system): Likewise.
+   (sc_prohibit_have_config_h): Likewise.
+   (sc_require_config_h): Likewise.
+   (sc_prohibit_HAVE_MBRTOWC): Likewise.
+   (sc_obsolete_symbols): Likewise.
+   (sc_changelog): Likewise.
+   (sc_program_name): Likewise.
+   (sc_the_the): Likewise.
+   (sc_trailing_blank): Likewise.
+   (sc_two_space_separator_in_usage): Likewise.
+   (sc_useless_cpp_parens): Likewise.
+   (sc_GPL_version): Likewise.
+   (sc_GFDL_version): Likewise.
+   (sc_texinfo_acronym): Likewise.
+   (sc_prohibit_cvs_keyword): Likewise.
+   (sc_prohibit_stat_st_blocks): Likewise.
+   (sc_prohibit_S_IS_definition): Likewise.
+   (sc_redundant_const): Likewise.
+   (sc_makefile_TAB_only_indentation): Likewise.
+   (sc_m4_quote_check): Likewise.
+   (sc_makefile_path_separator_check): Likewise.
+   (sc_copyright_check): Likewise.
+   (sc_Wundef_boolean): Likewise.
+   (sc_vulnerable_makefile_CVE-2009-4029): Likewise.
+
+2010-03-28  Jose E. Marchesi  
+
Catch function calls with zero or more blank characters before the
argument list in syntax check rules.
* top/maint.mk (sc_error_exit_success): Pattern changed to catch
diff --git a/top/maint.mk b/top/maint.mk
index ffcd728..47ae3e5 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -148,15 +148,91 @@ syntax-check: $(local-check)
 export ignore_case =
 _ignore_case = $$(test -n "$$ignore_case" && echo -i || :)
 
-# There are many rules below that prohibit constructs in this package.
-# If the offending construct can be matched with a grep-E-style regexp,
-# use this macro.  The shell variables "re" and "msg" must be defined.
-define _prohibit_regexp
-  dummy=; : so we do not need a semicolon before each use; \
-  test "x$$re" != x || { echo '$(ME): re not defined' 1>&2; exit 1; }; \
-  test "x$$msg" != x || { echo '$(ME): msg not defined' 1>&2; exit 1; };\
-  grep $(_ignore_case) -nE "$$re" $$($(VC_LIST_EXCEPT)) && \
-{ echo '$(ME): '"$$msg" 1>&2; exit 1; } || :
+# _sc_search_regexp
+#
+# This macro searches for a given construct in the selected files and
+# then takes some action.
+#
+# Parameters (shell variables):
+#
+#  prohibit | require
+#
+# Regular expression (ERE) denoting either a forbidden construct
+# or a required construct.  Those arguments are exclusive.
+#
+#  in_vc_files | in_files
+#
+# grep-E-style regexp denoting the files to check.  If no files
+# are specified the default are all the files that are under
+# version control.
+#
+#  containing | non_containing
+#
+# Select the files (non) containing strings matching this regexp.
+# If both arguments are specified then CONTAINING takes
+# precedence.
+#
+#  with_grep_options
+#
+# Extra options for grep.
+#
+#  ignore_case
+#
+# Ignore case.
+#
+#  halt
+#
+# Message to display before to halting execution.
+
+# By default, _sc_search_regexp does not ignore case.
+export ignore_case =
+_ignore_case = $$(test -n "$$ignore_case" && echo -i || :)
+
+define _sc_say_and_exit
+   dummy=; : so we do not need a semicolon before each use;
\
+   { echo -e "$(ME): $$msg" 1>&2; exit 1; };
+endef
+
+define _sc_search_regexp
+   dummy=; : so we do not need a semicolon before each use;
\
+   
\
+   : Check arguments;  
\
+   test -n "$$prohibit" && test -n "$$require" &&  
\
+   { msg='Cannot specify both prohibit and require' $(_sc_say_and_exit) } 
|| :;\
+   test -z "$$prohibit" && test -z "$$require" &&  
\
+   { msg='Sh

using a gnulib dir from more than one place (was: [PATCH] build: avoid link failure on systems using gnulib's fcntl but not open)

2010-03-28 Thread Ralf Wildenhues
Hello Bruno,

* Bruno Haible wrote on Sun, Mar 28, 2010 at 01:39:24AM CET:
> +Comment:
> +This module should not be used as a dependency from a test module,
> +otherwise when this module occurs as a tests-related module, it will
> +have side effects on the compilation of the main modules in lib/.

I see you're fixing this issue, nice!  But more generally, I have a
question, as the general topic has come up before: would it be possible
to generalize gnulib or gnulib-tool so that a developer can state "I
would like to use bits of gnulib from several places in a package
hierarchy.  Place i needs module set m_i, please dump the union of all
m_i into the "lib" and "m4" directories, and tell me what to put into
each of the configure.ac and Makefile.am files, and what side conditions
I need to fulfill."  I think Sam's request went along this direction,
too.

I haven't been following gnulib development closely enough to be able to
judge whether this is feasible.  I'm not asking for you to do this, just
whether it would be possible in principle, and what would need to be
done.

Thanks,
Ralf




extra test module categories

2010-03-28 Thread Bruno Haible
Jim Meyering suggested:

> > Rather than lumping them all into one "-extratests" category
> > that is tied to the module file name, have you considered
> > adding new module attributes?
> > 
> > Then, we could give any module one or more attributes,
> > and eventually exclude based on those attributes.
> > For example, if a package maintainer wants to avoid C++ tests,
> > they could do that without unnecessarily excluding long-running
> > ones as well.
> 
> So, gnulib-tool would have command-line options
>   --with[out]-long-running-tests
>   --with[out]-unportable-tests [for tests that fail on some platforms,
> e.g. flock, unlink, poll]
>   --with[out]-c++-tests
> ?

This proposal is now implemented, without the --without-* options (who
needs to exclude some tests when he creates a testdir?).


2010-03-28  Bruno Haible  

gnulib-tool: Add support for special categories of tests.
* gnulib-tool: New options --with-c++-tests, --with-longrunning-tests,
--with-privileged-tests, --with-unportable-tests, --with-all-tests.
(func_usage): Document them.
(inc_cxx_tests, inc_longrunning_tests, inc_privileged_tests,
inc_unportable_tests, inc_all_tests): New variables.
(func_acceptable): Consider these variables.
(func_modules_transitive_closure): Make it work when the 'Status' field
consists of multiple words.
(func_import): Store and restore the values of inc_cxx_tests,
inc_longrunning_tests, inc_privileged_tests, inc_unportable_tests,
inc_all_tests in gnulib-comp.m4.
(func_create_testdir): Set inc_all_tests to true.
* doc/gnulib.texi (Extra tests modules): New section.
Suggested by Jim Meyering.

*** doc/gnulib.texi.origSun Mar 28 17:53:32 2010
--- doc/gnulib.texi Sun Mar 28 17:51:54 2010
***
*** 614,619 
--- 614,620 
  @menu
  * Out of memory handling::
  * Obsolete modules::
+ * Extra tests modules::
  * A C++ namespace for gnulib::  A different way of using Gnulib in C++
  * Library version handling::
  * Windows sockets::
***
*** 689,694 
--- 690,756 
  @end example
  
  
+ @node Extra tests modules
+ @section Extra tests modules
+ 
+ @cindex Extra tests modules
+ @cindex C++ tests modules
+ @cindex tests modules, C++
+ @cindex long-running tests modules
+ @cindex tests modules, long-running
+ @cindex privileged tests modules
+ @cindex tests modules, privileged
+ @cindex unportable tests modules
+ @cindex tests modules, unportable
+ Test modules can be marked with some special status attributes.  When a
+ test module has such an attribute, @code{gnulib-tool --import} will not
+ include it by default.
+ 
+ The supported status attributes are:
+ 
+ @table @code
+ @item c++-test
+ Indicates that the test is testing C++ interoperability.  Such a test is
+ useful in a C++ or mixed C/C++ package, but is useless in a C package.
+ 
+ @item longrunning-test
+ Indicates that the test takes a long time to compile or execute (more
+ than five minutes or so).  Such a test is better avoided in a release
+ that is made for the general public.
+ 
+ @item privileged-test
+ Indicates that the test will request special privileges, for example,
+ ask for the superuser password.  Such a test may hang when run
+ non-interactively and is therefore better avoided in a release that is
+ made for the general public.
+ 
+ @item unportable-test
+ Indicates that the test is known to fail on some systems, and that
+ there is no workaround about it.  Such a test is better avoided in a
+ release that is made for the general public.
+ @end table
+ 
+ @code{gnulib-tool --import} will not include tests marked with these
+ attributes by default.  When @code{gnulib-tool} is invoked with one
+ of the options @code{--with-c++-tests}, @code{--with-longrunning-tests},
+ @code{--with-privileged-tests}, @code{--with-unportable-tests}, it
+ will include tests despite the corresponding special status attribute.
+ When @code{gnulib-tool} receives the option @code{--with-all-tests},
+ it will include all tests regardless of their status attributes.
+ 
+ @code{gnulib-tool --create-testdir} and
+ @code{gnulib-tool --create-megatestdir} always include all tests
+ regardless of their status attributes.
+ 
+ In order to mark a module with a status attribute, you need to add it
+ to the module description, like this:
+ 
+ @example
+ Status:
+ longrunning-test
+ @end example
+ 
+ 
  @node A C++ namespace for gnulib
  @section A C++ namespace for gnulib
  
*** gnulib-tool.origSun Mar 28 17:53:32 2010
--- gnulib-tool Sun Mar 28 17:17:35 2010
***
*** 165,171 
  (recommended to use CC=\"gcc -Wall\" here)
--extract-descriptionextract the description
--extract-commentextract the comment
!   --extract-status extract the status (obsolete or not)
--extract

Re: using a gnulib dir from more than one place

2010-03-28 Thread Bruno Haible
Ralf,

> would it be possible
> to generalize gnulib or gnulib-tool so that a developer can state "I
> would like to use bits of gnulib from several places in a package
> hierarchy.  Place i needs module set m_i, please dump the union of all
> m_i into the "lib" and "m4" directories, and tell me what to put into
> each of the configure.ac and Makefile.am files, and what side conditions
> I need to fulfill."  I think Sam's request went along this direction,
> too.

One supported way to "use gnulib from several places in a package" is that
the user combines the modules he wants to use in a single list, and
invoke gnulib-tool once. Simple and painless.

Another supported way to "use gnulib from several places in a package" is
in different subdirectories of the package, where the subdirectories are
independent, that is, no subdirectory uses -I options that point to the
other subdirectory. Works fine, with one constraint: Each subdirectory
needs to have a separate 'configure.ac' file.

Sam's situation is more complicated: he wants to use gnulib in the core
part of clisp, and in several add-on modules that each depend on the core.
Even though he has a separate configure.ac part for each, there is the
problem if you have, say, unistd.h instantiated multiple times, with
slightly different content but with the same include guard. Sam solves
this by hacking the include guard macro. I think there may also be
other problems that we don't know about.

Bruno




Re: extra test module categories

2010-03-28 Thread Bruno Haible
And this makes it possible to declare part of the tests of a module
as c++-test or longrunning-test or similar.


2010-03-28  Bruno Haible  

gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
* gnulib-tool (func_exists_module): New function, extracted from
func_verify_module.
(func_verify_module): Use it.
(func_get_dependencies): Synthetize a dependency from 'foo-tests' to
'foo' only if 'foo' exists.
* doc/gnulib.texi (Extra tests modules): Explain how to split a tests
module.

--- doc/gnulib.texi.origSun Mar 28 18:17:43 2010
+++ doc/gnulib.texi Sun Mar 28 18:03:56 2010
@@ -750,6 +750,12 @@
 longrunning-test
 @end example
 
+If only a part of a test deserves a particular status attribute, you
+can split the module into a primary and a secondary test module,
+say @code{foo-tests} and @code{foo-extra-tests}.  Then add a dependency
+from @code{foo-tests} to @code{foo-extra-tests}, and mark the
+...@code{foo-extra-tests} with the particular status attribute.
+
 
 @node A C++ namespace for gnulib
 @section A C++ namespace for gnulib
--- gnulib-tool.origSun Mar 28 18:17:43 2010
+++ gnulib-tool Sun Mar 28 18:16:33 2010
@@ -1379,6 +1379,24 @@
   | LC_ALL=C sort -u
 }
 
+# func_exists_module module
+# tests whether a module, given by name, exists
+# Input:
+# - local_gnulib_dir  from --local-dir
+func_exists_module ()
+{
+  { test -f "$gnulib_dir/modules/$1" \
+|| { test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules" \
+ && test -f "$local_gnulib_dir/modules/$1"; }; } \
+  && test "CVS" != "$1" \
+  && test "ChangeLog" != "$1" \
+  && test "COPYING" != "$1" \
+  && test "README" != "$1" \
+  && test "TEMPLATE" != "$1" \
+  && test "TEMPLATE-EXTENDED" != "$1" \
+  && test "TEMPLATE-TESTS" != "$1"
+}
+
 # func_verify_module
 # verifies a module name
 # Input:
@@ -1386,16 +1404,7 @@
 # - module  module name argument
 func_verify_module ()
 {
-  if { test -f "$gnulib_dir/modules/$module" \
-   || { test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules" 
\
-&& test -f "$local_gnulib_dir/modules/$module"; }; } \
- && test "CVS" != "$module" \
- && test "ChangeLog" != "$module" \
- && test "COPYING" != "$module" \
- && test "README" != "$module" \
- && test "TEMPLATE" != "$module" \
- && test "TEMPLATE-EXTENDED" != "$module" \
- && test "TEMPLATE-TESTS" != "$module"; then
+  if func_exists_module "$module"; then
 # OK, $module is a correct module name.
 # Verify that building the module description with 'patch' succeeds.
 func_lookup_file "modules/$module"
@@ -1954,12 +1963,14 @@
 # - modcache  true or false, from --cache-modules/--no-cache-modules
 func_get_dependencies ()
 {
-  # ${module}-tests always implicitly depends on ${module}.
+  # ${module}-tests implicitly depends on ${module}, if that module exists.
   case "$1" in
 *-tests)
   fgd1="$1"
   func_remove_suffix fgd1 '-tests'
-  echo "$fgd1"
+  if func_exists_module "$fgd1"; then
+echo "$fgd1"
+  fi
   ;;
   esac
   # Then the explicit dependencies listed in the module description.




Re: C++ libtool build error?

2010-03-28 Thread Bruno Haible
Simon Josefsson wrote on 2010-03-17:
> >   - The C++ tests of the modules 'string', 'stdlib', etc.
> >   - The tests that ask for the superuser password ('idpriv-drop',
> > 'idpriv-droptemp').
> >   - The long-running tests of the 'havelib' module (currently still in
> > gettext).
> 
> I agree, having a mechanism to handle this would be useful.

Thanks for your opinion; it is now implemented.

> > Additionally, the user who installs a package might want to disable the C++
> > part even if it is packaged as part of the tarball. I'm applying this.
> 
> Thanks, but the original problem is still not addressed -- building
> libidn (and libunistring, and likely other projects too) fails after the
> C++ self-tests were introduced in gnulib.  What is the supported
> solution for that problem?

This fixes it:


2010-03-28  Bruno Haible  

Split C++ tests into separate tests modules.
* modules/dirent-c++-tests: New file, extracted from
modules/dirent-tests.
* modules/dirent-tests: Depend on it.
* modules/fcntl-h-c++-tests: New file, extracted from
modules/fcntl-h-tests.
* modules/fcntl-h-tests: Depend on it.
* modules/glob-c++-tests: New file, extracted from modules/glob-tests.
* modules/glob-tests: Depend on it.
* modules/iconv-h-c++-tests: New file, extracted from
modules/iconv-h-tests.
* modules/iconv-h-tests: Depend on it.
* modules/langinfo-c++-tests: New file, extracted from
modules/langinfo-tests.
* modules/langinfo-tests: Depend on it.
* modules/locale-c++-tests: New file, extracted from
modules/locale-tests.
* modules/locale-tests: Depend on it.
* modules/math-c++-tests: New file, extracted from modules/math-tests.
* modules/math-tests: Depend on it.
* modules/pty-c++-tests: New file, extracted from modules/pty-tests.
* modules/pty-tests: Depend on it.
* modules/search-c++-tests: New file, extracted from
modules/search-tests.
* modules/search-tests: Depend on it.
* modules/signal-c++-tests: New file, extracted from
modules/signal-tests.
* modules/signal-tests: Depend on it.
* modules/spawn-c++-tests: New file, extracted from
modules/spawn-tests.
* modules/spawn-tests: Depend on it.
* modules/stdio-c++-tests: New file, extracted from
modules/stdio-tests.
* modules/stdio-tests: Depend on it.
* modules/stdlib-c++-tests: New file, extracted from
modules/stdlib-tests.
* modules/stdlib-tests: Depend on it.
* modules/string-c++-tests: New file, extracted from
modules/string-tests.
* modules/string-tests: Depend on it.
* modules/sys_ioctl-c++-tests: New file, extracted from
modules/sys_ioctl-tests.
* modules/sys_ioctl-tests: Depend on it.
* modules/sys_select-c++-tests: New file, extracted from
modules/sys_select-tests.
* modules/sys_select-tests: Depend on it.
* modules/sys_socket-c++-tests: New file, extracted from
modules/sys_socket-tests.
* modules/sys_socket-tests: Depend on it.
* modules/sys_stat-c++-tests: New file, extracted from
modules/sys_stat-tests.
* modules/sys_stat-tests: Depend on it.
* modules/sys_time-c++-tests: New file, extracted from
modules/sys_time-tests.
* modules/sys_time-tests: Depend on it.
* modules/time-c++-tests: New file, extracted from modules/time-tests.
* modules/time-tests: Depend on it.
* modules/unistd-c++-tests: New file, extracted from
modules/unistd-tests.
* modules/unistd-tests: Depend on it.
* modules/wchar-c++-tests: New file, extracted from
modules/wchar-tests.
* modules/wchar-tests: Depend on it.
* modules/wctype-c++-tests: New file, extracted from
modules/wctype-tests.
* modules/wctype-tests: Depend on it.
Reported by Simon Josefsson.

Changing permissions from . to 100644
--- modules/dirent-c++-tests.orig   Tue Apr 14 12:31:40 2009
+++ modules/dirent-c++-testsSun Mar 28 18:47:43 2010
@@ -0,0 +1,19 @@
+Files:
+tests/test-dirent-c++.cc
+tests/signature.h
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-dirent-c++
+check_PROGRAMS += test-dirent-c++
+test_dirent_c___SOURCES = test-dirent-c++.cc
+test_dirent_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP)
+endif
--- modules/dirent-tests.orig   Sun Mar 28 19:05:14 2010
+++ modules/dirent-testsSun Mar 28 18:47:46 2010
@@ -1,19 +1,11 @@
 Files:
 tests/test-dirent.c
-tests/test-dirent-c++.cc
-tests/signature.h
 
 Depends-on:
-ansi-c++-opt
+dirent-c++-tests
 
 configure.ac:
 
 Makefile.am:
 TESTS += test-dirent
 check_PROGRAMS += test-dirent
-if ANSICXX
-TESTS += test-dirent-c++
-check_PROGRAMS += test-dirent-c++
-test

Re: [PATCH] build: avoid link failure on systems using gnulib's fcntl but not open

2010-03-28 Thread Simon Josefsson
Bruno Haible  writes:

> Simon, is it ok to remove the GNULIB_GC_CAMELLIA macro? I see it nowhere
> used in gnulib. Is it used in one of your packages?

I don't recall -- but please remove it, and if I notice any problems
I'll follow with a proper solution.

/Simon




[PATCH] exclude: fix the case of globs vs. EXCLUDE_INCLUDE

2010-03-28 Thread Jim Meyering
I expect to push this tiny patch by Javier (Cc'd).
Thanks, Javier!

Without it, grep's --include=GLOB doesn't work.

>From efd2b17d1431399233caa5e5b55c831a3459f66a Mon Sep 17 00:00:00 2001
From: Javier Villavicencio 
Date: Sun, 28 Mar 2010 20:42:01 +0200
Subject: [PATCH] exclude: fix the case of globs vs. EXCLUDE_INCLUDE

* lib/exclude.c (excluded_file_pattern_p): Fix logic error that
made it so grep -r --include=GLOB* ... did not work.
---
 ChangeLog |6 ++
 lib/exclude.c |2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 12e0722..86403b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-28  Javier Villavicencio  
+
+   exclude: fix the case of globs vs. EXCLUDE_INCLUDE
+   * lib/exclude.c (excluded_file_pattern_p): Fix logic error that
+   made it so grep -r --include=GLOB* ... did not work.
+
 2010-03-26  Jim Meyering  
Eric Blake  

diff --git a/lib/exclude.c b/lib/exclude.c
index d4dcd76..34b5636 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -342,7 +342,7 @@ excluded_file_pattern_p (struct exclude_segment const *seg, 
char const *f)
 {
   char const *pattern = exclude[i].pattern;
   int options = exclude[i].options;
-  if (excluded != exclude_fnmatch (pattern, f, options))
+  if (exclude_fnmatch (pattern, f, options))
 return !excluded;
 }
   return excluded;
--
1.7.0.3.448.g82eeb




read() and write() for MinGW

2010-03-28 Thread Neil Jerram
I'd like to contribute a gnulib module to handle the fact that, on
MinGW, you have to use recv() to read data from a socket, instead of
read().

Similarly, for writing, send() is needed instead of write().

Conceptually this is extremely simple, and I've found that gnulib
already contains useful bits like SOCKET_TO_FD, FD_TO_SOCKET, and the
code for determining if an arbitrary fd is a socket - which is all
great.

But I'm lost in a twisty maze of working out how to do this in the 100%
right Gnulib way.  I believe I should be writing a rpl_read() function
to replace read(), and I can see the pattern for that.  But what's the
preferred way to write the test to see if this is needed?  Checking for
__MINGW32__, or (WIN32 && !CYGWIN), or HAVE_WINSOCK2_H, or a feature
test that tries read() on a socket and determines if it worked?

I've tried to work this out by reference to existing Gnulib modules, but
I'm struggling to understand some points.  For example, looking at the
"write" module...

- m4/write.m4 tests gl_SIGNAL_SIGPIPE, which just tests (IIUC) whether
  SIGPIPE is defined -- but then lib/write.c only implements rpl_write()
  #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__.
  Does this mean that there is an implicit assumption here that those
  two conditions are equivalent?

- The lib/write.c code includes

  /* Try to raise signal SIGPIPE.  */
  raise (SIGPIPE);

  How can that work given that we've already determined that SIGPIPE is
  not defined?

All help and advice would be appreciated!

Thanks,
Neil




Re: [PATCH] exclude: fix the case of globs vs. EXCLUDE_INCLUDE

2010-03-28 Thread Javier Villavicencio
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160

On 03/28/2010 03:44 PM, Jim Meyering wrote:
> I expect to push this tiny patch by Javier (Cc'd).
> Thanks, Javier!
> 
> Without it, grep's --include=GLOB doesn't work.
> 
>>From efd2b17d1431399233caa5e5b55c831a3459f66a Mon Sep 17 00:00:00 2001
> From: Javier Villavicencio 
> Date: Sun, 28 Mar 2010 20:42:01 +0200
> Subject: [PATCH] exclude: fix the case of globs vs. EXCLUDE_INCLUDE
> 
> * lib/exclude.c (excluded_file_pattern_p): Fix logic error that
> made it so grep -r --include=GLOB* ... did not work.
> ---
>  ChangeLog |6 ++
>  lib/exclude.c |2 +-
>  2 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 12e0722..86403b2 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,9 @@
> +2010-03-28  Javier Villavicencio  
> +
> + exclude: fix the case of globs vs. EXCLUDE_INCLUDE
> + * lib/exclude.c (excluded_file_pattern_p): Fix logic error that
> + made it so grep -r --include=GLOB* ... did not work.
> +
>  2010-03-26  Jim Meyering  
>   Eric Blake  
> 
> diff --git a/lib/exclude.c b/lib/exclude.c
> index d4dcd76..34b5636 100644
> --- a/lib/exclude.c
> +++ b/lib/exclude.c
> @@ -342,7 +342,7 @@ excluded_file_pattern_p (struct exclude_segment const 
> *seg, char const *f)
>  {
>char const *pattern = exclude[i].pattern;
>int options = exclude[i].options;
> -  if (excluded != exclude_fnmatch (pattern, f, options))
> +  if (exclude_fnmatch (pattern, f, options))
>  return !excluded;
>  }
>return excluded;
> --
> 1.7.0.3.448.g82eeb
> 

Hello,

I think you may have mixed up the two patches I reported against grep
bug 29358, so, to clarify:
That above is actually the patch that made most sense to me against the
EXCLUDE_INCLUDE logic, as in: excluded_file_pattern_p should return
!excluded on string match, not depending on the value excluded gets from
options.

The fix for GLOB matching is the second patch to grep's main.c, that
just adds the EXCLUDE_WILDCARDS option to add_exclude().
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREDAAYFAkuvqHoACgkQgvV6MZSadQpxsACgqtt6l+wS1X5Zw6+o4yWMEI7w
H1QAn3XZDblo1BVbTSr3XRl53+tZoW7C
=aYnP
-END PGP SIGNATURE-




Re: read() and write() for MinGW

2010-03-28 Thread Bruno Haible
Hi Neil,

> I'd like to contribute a gnulib module to handle the fact that, on
> MinGW, you have to use recv() to read data from a socket, instead of
> read().
> 
> Similarly, for writing, send() is needed instead of write().

Gnulib already solves this problem, by wrapping the Win32 SOCKET in
a file descriptor. It was contributed by Paolo Bonzini:
  
  

> Conceptually this is extremely simple, and I've found that gnulib
> already contains useful bits like SOCKET_TO_FD, FD_TO_SOCKET, and the
> code for determining if an arbitrary fd is a socket - which is all
> great.

Yes, and the read() and write() functions don't need to make this
distinction, because they call ReadFile and WriteFile, which work
equally fine with HANDLEs and SOCKETs.

> But what's the
> preferred way to write the test to see if this is needed?  Checking for
> __MINGW32__, or (WIN32 && !CYGWIN), or HAVE_WINSOCK2_H, or a feature
> test that tries read() on a socket and determines if it worked?

Here you have a feature that is specific to the MSVC runtime library.
No need for a test like read() on a socket - this is overkill when a
simple (WIN32 && !CYGWIN) can do it as well.

Also, you want to exclude Cygwin, since Cygwin has working Unix-like
sockets.

__MINGW32__ is not the right condition here, because it evaluates to
false in a MSVC environment.

HAVE_WINSOCK2_H because it is also true on Cygwin, depending on compiler
options.

((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) is the
solution. (HAVE_WINSOCK2_H && !defined __CYGWIN__) would be equivalent.

> - m4/write.m4 tests gl_SIGNAL_SIGPIPE, which just tests (IIUC) whether
>   SIGPIPE is defined -- but then lib/write.c only implements rpl_write()
>   #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__.
>   Does this mean that there is an implicit assumption here that those
>   two conditions are equivalent?

Yes: All Unix platforms have SIGPIPE. Mingw doesn't. And Gnulib is
currently not interested in other platforms than Unix and Windows.

> - The lib/write.c code includes
> 
>   /* Try to raise signal SIGPIPE.  */
>   raise (SIGPIPE);
> 
>   How can that work given that we've already determined that SIGPIPE is
>   not defined?

This code is only compiled when GNULIB_SIGPIPE is defined. This is a
module indicator: It is defined if and only if gnulib's 'sigpipe'
module is present in a package. The module 'sigpipe' depends on 'signal'
and defines GNULIB_SIGNAL_H_SIGPIPE to 1. The module 'signal', when
GNULIB_SIGNAL_H_SIGPIPE is 1, defines SIGPIPE to a replacement value
(see lib/signal.in.h). This way, the lib/write.c code can use SIGPIPE.

Bruno




Re: sys_ioctl, sys_select: fix link errors

2010-03-28 Thread Ludovic Courtès
Hi Bruno,

Bruno Haible  writes:

> 2010-03-28  Bruno Haible  
>
>   Fix link errors on mingw.
>   * lib/sys_ioctl.in.h (ioctl): Fix declaration idiom.
>   * modules/sys_ioctl-tests (Makefile.am): Link test-sys_ioctl-c++ with
>   $(LIBSOCKET).
>   * modules/sys_select-tests (Makefile.am): Link test-sys_select-c++ with
>   $(LIBSOCKET).

This patch appears to break Inetutils bootstrapping:

  http://hydra.nixos.org/build/335490

Thanks,
Ludo’.





Re: sys_ioctl, sys_select: fix link errors

2010-03-28 Thread Bruno Haible
Hi Ludo,

> > * lib/sys_ioctl.in.h (ioctl): Fix declaration idiom.
> 
> This patch appears to break Inetutils bootstrapping:
> 
>   http://hydra.nixos.org/build/335490

Thanks for the quick report. This should fix it. The fix is modeled after the
gettimeofday, forkpty, openpty wrappers by Eric.


2010-03-28  Bruno Haible  

Fix ioctl's protoype on glibc systems.
* lib/sys_ioctl.in.h (ioctl): If REPLACE_IOCTL is 1, use a wrapper. Use
_GL_CXXALIAS_SYS, not _GL_CXXALIAS_SYS_CAST.
* lib/ioctl.c (rpl_ioctl) [HAVE_IOCTL]: New wrapper.
* modules/ioctl (configure.ac): Test whether ioctl has the POSIX
signature. If not, arrange to replace the ioctl function.
* m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H_DEFAULTS): Initialize
REPLACE_IOCTL.
* modules/sys_ioctl (Makefile.am): Substitute REPLACE_IOCTL.
* doc/posix-functions/ioctl.texi: Mention the glibc problem.
Reported by Ludovic Courtès .

--- doc/posix-functions/ioctl.texi.orig Mon Mar 29 02:22:24 2010
+++ doc/posix-functions/ioctl.texi  Mon Mar 29 02:22:13 2010
@@ -12,6 +12,9 @@
 On Windows platforms (excluding Cygwin), @code{ioctl} is called
 @code{ioctlsocket}, and error codes for this function are not placed in
 @code{errno}, and @code{WSAGetLastError} must be used instead.
+...@item
+On glibc platforms, the second parameter is of type @code{unsigned long}
+rather than @code{int}.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- lib/ioctl.c.origMon Mar 29 02:22:24 2010
+++ lib/ioctl.c Mon Mar 29 01:51:48 2010
@@ -23,12 +23,31 @@
 
 #include 
 
-#define WIN32_LEAN_AND_MEAN
+#if HAVE_IOCTL
+
+/* Provide a wrapper with the POSIX prototype.  */
+# undef ioctl
+int
+rpl_ioctl (int fd, int request, ... /* {void *,char *} arg */)
+{
+  void *buf;
+  va_list args;
+
+  va_start (args, request);
+  buf = va_arg (args, void *);
+  va_end (args);
+
+  return ioctl (fd, request, buf);
+}
+
+#else /* mingw */
+
+# define WIN32_LEAN_AND_MEAN
 /* Get winsock2.h. */
-#include 
+# include 
 
 /* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
+# include "w32sock.h"
 
 int
 rpl_ioctl (int fd, int req, ...)
@@ -49,3 +68,5 @@
 
   return r;
 }
+
+#endif
--- lib/sys_ioctl.in.h.orig Mon Mar 29 02:22:24 2010
+++ lib/sys_ioctl.in.h  Mon Mar 29 02:17:22 2010
@@ -44,7 +44,7 @@
 /* Declare overridden functions.  */
 
 #if @GNULIB_IOCTL@
-# if @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+# if @SYS_IOCTL_H_HAVE_WINSOCK2_H@ || @REPLACE_IOCTL@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef ioctl
 #   define ioctl rpl_ioctl
@@ -56,10 +56,8 @@
 # else
 _GL_FUNCDECL_SYS (ioctl, int,
   (int fd, int request, ... /* {void *,char *} arg */));
-/* Need to cast, because on glibc systems, the second parameter is
-unsigned long int request.  */
-_GL_CXXALIAS_SYS_CAST (ioctl, int,
-   (int fd, int request, ... /* {void *,char *} arg */));
+_GL_CXXALIAS_SYS (ioctl, int,
+  (int fd, int request, ... /* {void *,char *} arg */));
 # endif
 _GL_CXXALIASWARN (ioctl);
 #elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
--- m4/sys_ioctl_h.m4.orig  Mon Mar 29 02:22:24 2010
+++ m4/sys_ioctl_h.m4   Mon Mar 29 02:13:02 2010
@@ -1,4 +1,4 @@
-# sys_ioctl_h.m4 serial 7
+# sys_ioctl_h.m4 serial 8
 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -67,4 +67,5 @@
   SYS_IOCTL_H_HAVE_WINSOCK2_H=0; AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H])
   SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
 AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
+  REPLACE_IOCTL=0;  AC_SUBST([REPLACE_IOCTL])
 ])
--- modules/ioctl.orig  Mon Mar 29 02:22:24 2010
+++ modules/ioctl   Mon Mar 29 02:11:56 2010
@@ -11,6 +11,7 @@
 errno
 
 configure.ac:
+AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
 if test "$ac_cv_header_winsock2_h" = yes; then
   dnl Even if the 'socket' module is not used here, another part of the
@@ -18,6 +19,26 @@
   dnl sockets to the ioctl() function. So enable the support for sockets.
   AC_LIBOBJ([ioctl])
   gl_REPLACE_SYS_IOCTL_H
+else
+  AC_CHECK_FUNCS([ioctl])
+  dnl On glibc systems, the second parameter is 'unsigned long int request',
+  dnl not 'int request'. We cannot simply cast the function pointer, but
+  dnl instead need a wrapper.
+  AC_CACHE_CHECK([for ioctl with POSIX signature],
+[gl_cv_func_ioctl_posix_signature],
+[AC_COMPILE_IFELSE(
+   [AC_LANG_PROGRAM(
+  [[#include ]],
+  [[extern int ioctl (int, int, ...);]])
+   ],
+   [gl_cv_func_ioctl_posix_signature=yes],
+   [gl_cv_func_ioctl_posix_signature=no])
+])
+  if test $gl_cv_func_ioctl_posix_signature != yes; then
+REPLACE_IOCTL=1
+AC_LIBOBJ([ioctl])
+gl_REPLACE_SYS_IOCTL_H
+  fi
 fi
 g

Re: [PATCH] exclude: fix the case of globs vs. EXCLUDE_INCLUDE

2010-03-28 Thread Jim Meyering
Javier Villavicencio wrote:
> I think you may have mixed up the two patches I reported against grep

Think again ;-)

> bug 29358, so, to clarify:
> That above is actually the patch that made most sense to me against the
> EXCLUDE_INCLUDE logic, as in: excluded_file_pattern_p should return
> !excluded on string match, not depending on the value excluded gets from
> options.
>
> The fix for GLOB matching is the second patch to grep's main.c, that
> just adds the EXCLUDE_WILDCARDS option to add_exclude().

Both are required.
If we don't use exclude_fnmatch properly, then --include=GLOB
doesn't work.  If we don't specify EXCLUDE_WILDCARDS, then
grep doesn't even call exclude_fnmatch.




Re: lib-ignore: link error with Sun C++ compiler

2010-03-28 Thread Jim Meyering
Bruno Haible wrote:
>> * Bruno Haible wrote on Sat, Mar 20, 2010 at 11:52:25PM CET:
>> >lib-ignore: Determine different options for different compilers.
>> >* m4/lib-ignore.m4 (gl_IGNORE_UNUSED_LIBRARIES): Set a variable which
>> >depends on the current language (C/C++/Fortran). Don't set LDFLAGS.
>> >Add comments.
>> >(_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS): New macro.
>> >* NEWS: Mention the change.
>
> I've committed this patch now, including Ralf's comments about libtool, below.
>
> Jim, for coreutils, I propose this patch:
>
> =
> 2010-03-28  Bruno Haible  
>
>   Update after change in gnulib's lib-ignore module.
>   * src/Makefile.am (AM_LDFLAGS): New variable.
>
> --- src/Makefile.am.orig  Sun Mar 28 11:31:05 2010
> +++ src/Makefile.am   Sun Mar 28 11:30:27 2010
> @@ -170,6 +170,9 @@
>  noinst_LIBRARIES = libver.a
>  nodist_libver_a_SOURCES = version.c version.h
>
> +# Tell the linker to omit references to unused shared libraries.
> +AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)

Thanks, Bruno.
I've pushed that, along with the analogous one to grep,
now that both projects are using updated gnulib.




Re: Remove fts-lgpl?

2010-03-28 Thread Jim Meyering
Bruno Haible wrote:
> Eric applied this patch from Ralf Wildenhues on 2010-03-02:
>> Remove fts-lgpl module.
>>
>> * modules/fts-lgpl: Remove.
>> * MODULES.html.sh (func_all_modules): Adjust.
>> * check-module (find_included_lib_files): Adjust.
>> * m4/fts.m4 (gl_FUNC_FTS_LGPL): Remove.
>
> There is no use for the GNULIB_FTS macro now. It is always 1.
> Here's a proposed patch to remove it:
>
> 2010-03-27  Bruno Haible  
>
>   Remove vestiges of fts-lgpl module.
>   * lib/fts_.h: Assume GNULIB_FTS is 1.
>   * lib/fts.c: Likewise.
>   * modules/fts (configure.ac): Remove gl_MODULE_INDICATOR invocation.

That looks fine.
Thanks for the clean-up!