[csw-devel] SF.net SVN: gar:[2896] csw/mgar/pkg/cvsps/trunk

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Fri Jan 23 21:50:07 CET 2009


Revision: 2896
          http://gar.svn.sourceforge.net/gar/?rev=2896&view=rev
Author:   bdwalton
Date:     2009-01-23 20:50:07 +0000 (Fri, 23 Jan 2009)

Log Message:
-----------
- Clean up autoconf patches.
- Import gnulib functions for missing things.

Modified Paths:
--------------
    csw/mgar/pkg/cvsps/trunk/Makefile
    csw/mgar/pkg/cvsps/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/cvsps/trunk/files/0001-add-basic-autotools-files.patch
    csw/mgar/pkg/cvsps/trunk/files/0002-add-modified-autoconf-check_zlib-from-loic-dachary.patch
    csw/mgar/pkg/cvsps/trunk/files/0003-add-script-to-do-the-autotools-setup-steps.patch
    csw/mgar/pkg/cvsps/trunk/files/0004-add-config.h-awareness-to-all-source-files.patch
    csw/mgar/pkg/cvsps/trunk/files/0005-gnulib-import-of-missing-functions.patch
    csw/mgar/pkg/cvsps/trunk/files/0006-enabled-imported-gnulib-functions.patch

Removed Paths:
-------------
    csw/mgar/pkg/cvsps/trunk/files/0001-adding-initial-autotools-files.patch
    csw/mgar/pkg/cvsps/trunk/files/0002-adding-script-to-do-the-auto-steps.patch
    csw/mgar/pkg/cvsps/trunk/files/0004-make-cvsps.c-aware-of-config.h-from-autoconf.patch
    csw/mgar/pkg/cvsps/trunk/files/0005-add-autoconf-checks-for-lsocket-lnsl.patch
    csw/mgar/pkg/cvsps/trunk/files/0006-corrected-naming-mistake-in-Makefile.am.patch
    csw/mgar/pkg/cvsps/trunk/files/patch-extralibs.diff

Modified: csw/mgar/pkg/cvsps/trunk/Makefile
===================================================================
--- csw/mgar/pkg/cvsps/trunk/Makefile	2009-01-23 20:49:38 UTC (rev 2895)
+++ csw/mgar/pkg/cvsps/trunk/Makefile	2009-01-23 20:50:07 UTC (rev 2896)
@@ -11,11 +11,12 @@
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
 DISTFILES += $(call admfiles,CSWcvsps,)
 
-PATCHFILES = 0001-adding-initial-autotools-files.patch
-PATCHFILES += 0002-adding-script-to-do-the-auto-steps.patch
-PATCHFILES += 0004-make-cvsps.c-aware-of-config.h-from-autoconf.patch
-PATCHFILES += 0005-add-autoconf-checks-for-lsocket-lnsl.patch
-PATCHFILES += 0006-corrected-naming-mistake-in-Makefile.am.patch
+PATCHFILES = 0001-add-basic-autotools-files.patch
+PATCHFILES += 0002-add-modified-autoconf-check_zlib-from-loic-dachary.patch
+PATCHFILES += 0003-add-script-to-do-the-autotools-setup-steps.patch
+PATCHFILES += 0004-add-config.h-awareness-to-all-source-files.patch
+PATCHFILES += 0005-gnulib-import-of-missing-functions.patch
+PATCHFILES += 0006-enabled-imported-gnulib-functions.patch
 
 PREREQUISITE_PKGS = CSWzlib CSWautomake CSWautoconf
 
@@ -26,18 +27,18 @@
 
 TEST_SCRIPTS =
 
-INSTALL_SCRIPTS = custom
+#INSTALL_SCRIPTS = custom
 
 include gar/category.mk
 
-pre-configure-isa-i386:
+pre-configure-modulated:
 	@echo About to initialize the autotools bits.
-	@(cd $(WORKSRC_FIRSTMOD); chmod +x autoinit.sh; ./autoinit.sh)
+	@(cd $(WORKSRC); chmod +x autoinit.sh; ./autoinit.sh)
 	@$(MAKECOOKIE)
 
 
-install-custom:
-	ginstall -d $(DESTDIR)$(bindir)
-	ginstall -d $(DESTDIR)$(mandir)/man1
-	ginstall -m 755 $(WORKSRC)/cvsps $(DESTDIR)$(bindir)/
-	ginstall -m 644 $(WORKSRC)/cvsps.1 $(DESTDIR)$(mandir)/man1/
+# install-custom:
+# 	ginstall -d $(DESTDIR)$(bindir)
+# 	ginstall -d $(DESTDIR)$(mandir)/man1
+# 	ginstall -m 755 $(WORKSRC)/cvsps $(DESTDIR)$(bindir)/
+# 	ginstall -m 644 $(WORKSRC)/cvsps.1 $(DESTDIR)$(mandir)/man1/

Modified: csw/mgar/pkg/cvsps/trunk/checksums
===================================================================
--- csw/mgar/pkg/cvsps/trunk/checksums	2009-01-23 20:49:38 UTC (rev 2895)
+++ csw/mgar/pkg/cvsps/trunk/checksums	2009-01-23 20:50:07 UTC (rev 2896)
@@ -1,7 +1,8 @@
 bde2110ed9f5d14de8f8cb04e9d596fe  download/cvsps-2.1.tar.gz
 cb54db01900320e1bf80da166c60c2f8  download/CSWcvsps.gspec
-cc014dedc4c04f49f820c083ba903439  download/0001-adding-initial-autotools-files.patch
-bd3516f9223b80e6140247520ed767f8  download/0002-adding-script-to-do-the-auto-steps.patch
-f2039869b307620fe8f1c88cf129d04d  download/0004-make-cvsps.c-aware-of-config.h-from-autoconf.patch
-7d7f7d520ea371bb0e0ed5424831b795  download/0005-add-autoconf-checks-for-lsocket-lnsl.patch
-acbb7ea325559370e1804c88407c5304  download/0006-corrected-naming-mistake-in-Makefile.am.patch
+f1980fbc932203a048a6e5c3cfa1af5b  download/0001-add-basic-autotools-files.patch
+85b73079daeef9d87b637939e3749489  download/0002-add-modified-autoconf-check_zlib-from-loic-dachary.patch
+f5d84b7c7a05a44f64f740006df5c349  download/0003-add-script-to-do-the-autotools-setup-steps.patch
+78d2f5dc4b1aa496e4f4ea8d2db4bf17  download/0004-add-config.h-awareness-to-all-source-files.patch
+58cbd19160b6a98f3c5ff2a8786f0848  download/0005-gnulib-import-of-missing-functions.patch
+02c14b029fd57a61fa97cc8209f18d7d  download/0006-enabled-imported-gnulib-functions.patch

Added: csw/mgar/pkg/cvsps/trunk/files/0001-add-basic-autotools-files.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0001-add-basic-autotools-files.patch	                        (rev 0)
+++ csw/mgar/pkg/cvsps/trunk/files/0001-add-basic-autotools-files.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -0,0 +1,65 @@
+From e6497925a720052265d5854b70a987a48bd07e58 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Fri, 23 Jan 2009 17:03:35 +0100
+Subject: [PATCH] add basic autotools files
+
+---
+ Makefile.am  |    4 ++++
+ configure.ac |   34 ++++++++++++++++++++++++++++++++++
+ 2 files changed, 38 insertions(+), 0 deletions(-)
+ create mode 100644 Makefile.am
+ create mode 100644 configure.ac
+
+diff --git a/Makefile.am b/Makefile.am
+new file mode 100644
+index 0000000..86de070
+--- /dev/null
++++ b/Makefile.am
+@@ -0,0 +1,4 @@
++bin_PROGRAMS = cvsps
++cvsps_SOURCES = cache.c cap.c cvs_direct.c cvsps.c list_sort.c stats.c util.c
++cvsps_SOURCES += cbtcommon/debug.c cbtcommon/sio.c cbtcommon/text_util.c
++cvsps_SOURCES += cbtcommon/hash.c cbtcommon/tcpsocket.c
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..a882782
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,34 @@
++AC_PREREQ([2.63])
++AC_INIT([cvsps], [2.1])
++AC_CONFIG_SRCDIR([util.h])
++AC_CONFIG_HEADERS([config.h])
++
++# We're using automake too
++AM_INIT_AUTOMAKE(cvsps,2.1)
++
++# Checks for programs.
++AC_PROG_CC
++AC_PROG_INSTALL
++
++# Checks for libraries.
++AC_CHECK_LIB([z], [gzputs])
++AC_SEARCH_LIBS([gethostbyname], [nsl])
++AC_SEARCH_LIBS([bind], [socket])
++
++# Checks for header files.
++AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h])
++
++# Checks for typedefs, structures, and compiler characteristics.
++AC_TYPE_PID_T
++AC_TYPE_SIZE_T
++AC_TYPE_SSIZE_T
++
++# Checks for library functions.
++AC_FUNC_FORK
++AC_FUNC_MALLOC
++AC_FUNC_MKTIME
++AC_CHECK_FUNCS([gethostbyname gettimeofday memmove memset mkdir regcomp setenv socket strchr strdup strerror strrchr strstr strsep tzset])
++
++AC_CONFIG_FILES([Makefile])
++AC_OUTPUT
++
+-- 
+1.6.0.5
+

Deleted: csw/mgar/pkg/cvsps/trunk/files/0001-adding-initial-autotools-files.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0001-adding-initial-autotools-files.patch	2009-01-23 20:49:38 UTC (rev 2895)
+++ csw/mgar/pkg/cvsps/trunk/files/0001-adding-initial-autotools-files.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -1,62 +0,0 @@
-From 00471f248d519bab09d6aedd13bc4cb00df577d8 Mon Sep 17 00:00:00 2001
-From: Ben Walton <bwalton at opencsw.org>
-Date: Thu, 22 Jan 2009 01:48:47 +0100
-Subject: [PATCH] adding initial autotools files
-
----
- Makefile.am  |    2 ++
- configure.ac |   33 +++++++++++++++++++++++++++++++++
- 2 files changed, 35 insertions(+), 0 deletions(-)
- create mode 100644 Makefile.am
- create mode 100644 configure.ac
-
-diff --git a/Makefile.am b/Makefile.am
-new file mode 100644
-index 0000000..efde4db
---- /dev/null
-+++ b/Makefile.am
-@@ -0,0 +1,2 @@
-+bin_PROGRAMS = cvssp
-+cvssp_SOURCES = cache.c cap.c cvs_direct.c cvsps.c list_sort.c stats.c util.c
-diff --git a/configure.ac b/configure.ac
-new file mode 100644
-index 0000000..2d7e79d
---- /dev/null
-+++ b/configure.ac
-@@ -0,0 +1,33 @@
-+AC_PREREQ([2.63])
-+AC_INIT([cvsps], [2.1])
-+AC_CONFIG_SRCDIR([util.h])
-+AC_CONFIG_HEADERS([config.h])
-+
-+# We're using automake too
-+AM_INIT_AUTOMAKE(cvsps,2.1)
-+
-+# Checks for programs.
-+AC_PROG_CC
-+AC_PROG_INSTALL
-+
-+# Checks for libraries.
-+# FIXME: Replace `main' with a function in `-lz':
-+AC_CHECK_LIB([z], [gzputs])
-+
-+# Checks for header files.
-+AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h])
-+
-+# Checks for typedefs, structures, and compiler characteristics.
-+AC_TYPE_PID_T
-+AC_TYPE_SIZE_T
-+AC_TYPE_SSIZE_T
-+
-+# Checks for library functions.
-+AC_FUNC_FORK
-+AC_FUNC_MALLOC
-+AC_FUNC_MKTIME
-+AC_CHECK_FUNCS([gethostbyname gettimeofday memmove memset mkdir regcomp setenv socket strchr strdup strerror strrchr strstr tzset])
-+
-+AC_CONFIG_FILES([Makefile])
-+AC_OUTPUT
-+
--- 
-1.6.0.5
-

Added: csw/mgar/pkg/cvsps/trunk/files/0002-add-modified-autoconf-check_zlib-from-loic-dachary.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0002-add-modified-autoconf-check_zlib-from-loic-dachary.patch	                        (rev 0)
+++ csw/mgar/pkg/cvsps/trunk/files/0002-add-modified-autoconf-check_zlib-from-loic-dachary.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -0,0 +1,96 @@
+From e1f5b581f98abf6ffca50a1a757108e8ebba8f9f Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Fri, 23 Jan 2009 18:49:38 +0100
+Subject: [PATCH] add modified autoconf check_zlib from loic dachary
+
+---
+ configure.ac |   66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 65 insertions(+), 1 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a882782..414c98b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,6 +3,70 @@ AC_INIT([cvsps], [2.1])
+ AC_CONFIG_SRCDIR([util.h])
+ AC_CONFIG_HEADERS([config.h])
+ 
++
++# This is a slightly modified version of CHECK_ZLIB as provided under the GPL
++# by Loic Dachary at http://autoconf-archive.cryp.to/check_zlib.html
++# The GPL may be found at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
++# I am not included the file with this project since the project is not mine.
++# 2009-01-23
++# -Ben Walton <bwalton at opencsw.org>
++
++#this should be a safe default for most systems that ship a zlib by default.
++ZLIB_HOME=/usr/
++
++AC_DEFUN([CHECK_ZLIB],
++#
++# Handle user hints
++#
++[AC_MSG_CHECKING(for zlib)
++AC_ARG_WITH(zlib,
++[  --with-zlib=DIR	root directory path of zlib installation [defaults to /usr]],
++[if test "$withval" != no ; then
++  AC_MSG_RESULT($withval)
++  if test -d "$withval"
++  then
++    ZLIB_HOME="$withval"
++  else
++	AC_MSG_ERROR([$withval is not a valid zlib dir.])
++  fi
++else
++	AC_MSG_ERROR([You can't disable use of zlib])
++fi])
++
++# Locate zlib, if wanted
++if test -n "${ZLIB_HOME}"
++then
++        ZLIB_OLD_LDFLAGS=$LDFLAGS
++        ZLIB_OLD_CPPFLAGS=$LDFLAGS
++        LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
++        CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
++        AC_LANG_SAVE
++        AC_LANG_C
++        AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
++        AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
++        AC_LANG_RESTORE
++        if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
++        then
++                #
++                # If both library and header were found, use them
++                #
++                AC_CHECK_LIB(z, inflateEnd)
++                AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
++                AC_MSG_RESULT(ok)
++        else
++                #
++                # If either header or library was not found, revert and bomb
++                #
++                AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
++                LDFLAGS="$ZLIB_OLD_LDFLAGS"
++                CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
++                AC_MSG_RESULT(failed)
++                AC_MSG_ERROR(specify a valid zlib installation with --with-zlib=DIR)
++        fi
++fi
++
++])
++
+ # We're using automake too
+ AM_INIT_AUTOMAKE(cvsps,2.1)
+ 
+@@ -11,7 +75,7 @@ AC_PROG_CC
+ AC_PROG_INSTALL
+ 
+ # Checks for libraries.
+-AC_CHECK_LIB([z], [gzputs])
++CHECK_ZLIB()
+ AC_SEARCH_LIBS([gethostbyname], [nsl])
+ AC_SEARCH_LIBS([bind], [socket])
+ 
+-- 
+1.6.0.5
+

Deleted: csw/mgar/pkg/cvsps/trunk/files/0002-adding-script-to-do-the-auto-steps.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0002-adding-script-to-do-the-auto-steps.patch	2009-01-23 20:49:38 UTC (rev 2895)
+++ csw/mgar/pkg/cvsps/trunk/files/0002-adding-script-to-do-the-auto-steps.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -1,25 +0,0 @@
-From b92b9590bec3e41238297d9f15d20b9e79c3e65b Mon Sep 17 00:00:00 2001
-From: Ben Walton <bwalton at opencsw.org>
-Date: Thu, 22 Jan 2009 01:54:49 +0100
-Subject: [PATCH] adding script to do the auto* steps
-
----
- autoinit.sh |    6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
- create mode 100755 autoinit.sh
-
-diff --git a/autoinit.sh b/autoinit.sh
-new file mode 100755
-index 0000000..d5d5881
---- /dev/null
-+++ b/autoinit.sh
-@@ -0,0 +1,6 @@
-+#!/bin/sh
-+
-+aclocal
-+autoconf
-+autoheader
-+automake --add-missing --foreign
--- 
-1.6.0.5
-

Added: csw/mgar/pkg/cvsps/trunk/files/0003-add-script-to-do-the-autotools-setup-steps.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0003-add-script-to-do-the-autotools-setup-steps.patch	                        (rev 0)
+++ csw/mgar/pkg/cvsps/trunk/files/0003-add-script-to-do-the-autotools-setup-steps.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -0,0 +1,25 @@
+From 8c789701ec47444baac8612e1fbf258989b3f1ce Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Thu, 22 Jan 2009 01:54:49 +0100
+Subject: [PATCH] add script to do the autotools setup steps
+
+---
+ autoinit.sh |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+ create mode 100755 autoinit.sh
+
+diff --git a/autoinit.sh b/autoinit.sh
+new file mode 100755
+index 0000000..d5d5881
+--- /dev/null
++++ b/autoinit.sh
+@@ -0,0 +1,6 @@
++#!/bin/sh
++
++aclocal
++autoconf
++autoheader
++automake --add-missing --foreign
+-- 
+1.6.0.5
+

Added: csw/mgar/pkg/cvsps/trunk/files/0004-add-config.h-awareness-to-all-source-files.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0004-add-config.h-awareness-to-all-source-files.patch	                        (rev 0)
+++ csw/mgar/pkg/cvsps/trunk/files/0004-add-config.h-awareness-to-all-source-files.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -0,0 +1,204 @@
+From 27703c47440259a4196164fe2016af6a9d2da7ca Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Fri, 23 Jan 2009 19:10:58 +0100
+Subject: [PATCH] add config.h awareness to all source files
+
+---
+ cache.c               |    4 ++++
+ cap.c                 |    4 ++++
+ cbtcommon/debug.c     |    4 ++++
+ cbtcommon/hash.c      |    4 ++++
+ cbtcommon/sio.c       |    4 ++++
+ cbtcommon/tcpsocket.c |    4 ++++
+ cbtcommon/text_util.c |    5 +++++
+ cvs_direct.c          |    4 ++++
+ cvsps.c               |    4 ++++
+ list_sort.c           |    4 ++++
+ stats.c               |    4 ++++
+ util.c                |    4 ++++
+ 12 files changed, 49 insertions(+), 0 deletions(-)
+
+diff --git a/cache.c b/cache.c
+index 4c51cf7..2519684 100644
+--- a/cache.c
++++ b/cache.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <search.h>
+ #include <string.h>
+diff --git a/cap.c b/cap.c
+index a6186f6..0197489 100644
+--- a/cap.c
++++ b/cap.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/cbtcommon/debug.c b/cbtcommon/debug.c
+index 3f5ac52..b0f818d 100644
+--- a/cbtcommon/debug.c
++++ b/cbtcommon/debug.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <stdarg.h>
+ #include <errno.h>
+diff --git a/cbtcommon/hash.c b/cbtcommon/hash.c
+index ddc081b..81a34dc 100644
+--- a/cbtcommon/hash.c
++++ b/cbtcommon/hash.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/cbtcommon/sio.c b/cbtcommon/sio.c
+index a9faf81..3f70851 100644
+--- a/cbtcommon/sio.c
++++ b/cbtcommon/sio.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ 
+ #ifdef WIN32
+diff --git a/cbtcommon/tcpsocket.c b/cbtcommon/tcpsocket.c
+index 27cc13a..ec64bd1 100644
+--- a/cbtcommon/tcpsocket.c
++++ b/cbtcommon/tcpsocket.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #ifdef SOLARIS
+ #include <strings.h>
+ #else
+diff --git a/cbtcommon/text_util.c b/cbtcommon/text_util.c
+index 052a94b..485f0be 100644
+--- a/cbtcommon/text_util.c
++++ b/cbtcommon/text_util.c
+@@ -9,6 +9,11 @@
+  * @created Fri Nov  6 14:33:29 1998
+  * @version $Revision: 1.9 $$Date: 2001/10/25 18:36:11 $
+  */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <ctype.h>
+ #include <string.h>
+ #include <stdio.h>
+diff --git a/cvs_direct.c b/cvs_direct.c
+index 920487d..4eb268c 100644
+--- a/cvs_direct.c
++++ b/cvs_direct.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+diff --git a/cvsps.c b/cvsps.c
+index 1e64e3c..4f49f22 100644
+--- a/cvsps.c
++++ b/cvsps.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/list_sort.c b/list_sort.c
+index 6c6f54c..95ee733 100644
+--- a/list_sort.c
++++ b/list_sort.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include "list_sort.h"
+diff --git a/stats.c b/stats.c
+index 0276a50..3c3085d 100644
+--- a/stats.c
++++ b/stats.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <search.h>
+diff --git a/util.c b/util.c
+index e4b9d14..216c53e 100644
+--- a/util.c
++++ b/util.c
+@@ -3,6 +3,10 @@
+  * See COPYING file for license information 
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+-- 
+1.6.0.5
+

Deleted: csw/mgar/pkg/cvsps/trunk/files/0004-make-cvsps.c-aware-of-config.h-from-autoconf.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0004-make-cvsps.c-aware-of-config.h-from-autoconf.patch	2009-01-23 20:49:38 UTC (rev 2895)
+++ csw/mgar/pkg/cvsps/trunk/files/0004-make-cvsps.c-aware-of-config.h-from-autoconf.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -1,25 +0,0 @@
-From 037ecab1f1c4fb5cb066273c235e850e57305f01 Mon Sep 17 00:00:00 2001
-From: Ben Walton <bwalton at opencsw.org>
-Date: Thu, 22 Jan 2009 02:02:14 +0100
-Subject: [PATCH] make cvsps.c aware of config.h from autoconf
-
----
- cvsps.c |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
-
-diff --git a/cvsps.c b/cvsps.c
-index 1e64e3c..d19b7ab 100644
---- a/cvsps.c
-+++ b/cvsps.c
-@@ -3,6 +3,8 @@
-  * See COPYING file for license information 
-  */
- 
-+#include "config.h"
-+
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--- 
-1.6.0.5
-

Deleted: csw/mgar/pkg/cvsps/trunk/files/0005-add-autoconf-checks-for-lsocket-lnsl.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0005-add-autoconf-checks-for-lsocket-lnsl.patch	2009-01-23 20:49:38 UTC (rev 2895)
+++ csw/mgar/pkg/cvsps/trunk/files/0005-add-autoconf-checks-for-lsocket-lnsl.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -1,30 +0,0 @@
-From 25e9a38e60200cc65f1b0a9eae1328c7dac678f6 Mon Sep 17 00:00:00 2001
-From: Ben Walton <bwalton at opencsw.org>
-Date: Thu, 22 Jan 2009 02:19:42 +0100
-Subject: [PATCH] add autoconf checks for -lsocket, -lnsl
-
----
- configure.ac |    5 ++++-
- 1 files changed, 4 insertions(+), 1 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 2d7e79d..7a71222 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -11,9 +11,12 @@ AC_PROG_CC
- AC_PROG_INSTALL
- 
- # Checks for libraries.
--# FIXME: Replace `main' with a function in `-lz':
- AC_CHECK_LIB([z], [gzputs])
- 
-+# socket stuff
-+AC_CHECK_LIB([socket], [bind])
-+AC_CHECK_LIB([nsl],[gethostbyname])
-+
- # Checks for header files.
- AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h])
- 
--- 
-1.6.0.5
-

Added: csw/mgar/pkg/cvsps/trunk/files/0005-gnulib-import-of-missing-functions.patch
===================================================================
--- csw/mgar/pkg/cvsps/trunk/files/0005-gnulib-import-of-missing-functions.patch	                        (rev 0)
+++ csw/mgar/pkg/cvsps/trunk/files/0005-gnulib-import-of-missing-functions.patch	2009-01-23 20:50:07 UTC (rev 2896)
@@ -0,0 +1,5783 @@
+From bac41c37a9db9aae12ff571ae511c925a03c261a Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Fri, 23 Jan 2009 21:35:07 +0100
+Subject: [PATCH] gnulib import of missing functions
+
+---
+ gnulib/Makefile.am         |  368 +++++++++++++++++++++++++++
+ gnulib/alloca.in.h         |   56 ++++
+ gnulib/m4/alloca.m4        |   46 ++++
+ gnulib/m4/eealloc.m4       |   32 +++
+ gnulib/m4/environ.m4       |   36 +++
+ gnulib/m4/extensions.m4    |   94 +++++++
+ gnulib/m4/gnulib-cache.m4  |   37 +++
+ gnulib/m4/gnulib-common.m4 |  110 ++++++++
+ gnulib/m4/gnulib-comp.m4   |  224 ++++++++++++++++
+ gnulib/m4/gnulib-tool.m4   |   57 ++++
+ gnulib/m4/include_next.m4  |  170 +++++++++++++
+ gnulib/m4/longlong.m4      |  106 ++++++++
+ gnulib/m4/malloca.m4       |   14 +
+ gnulib/m4/multiarch.m4     |   66 +++++
+ gnulib/m4/setenv.m4        |   71 +++++
+ gnulib/m4/stdint.m4        |  404 +++++++++++++++++++++++++++++
+ gnulib/m4/stdlib_h.m4      |   62 +++++
+ gnulib/m4/string_h.m4      |   92 +++++++
+ gnulib/m4/strsep.m4        |   24 ++
+ gnulib/m4/unistd_h.m4      |   83 ++++++
+ gnulib/m4/wchar.m4         |   99 +++++++
+ gnulib/m4/wint_t.m4        |   28 ++
+ gnulib/malloca.c           |  137 ++++++++++
+ gnulib/malloca.h           |  134 ++++++++++
+ gnulib/malloca.valgrind    |    7 +
+ gnulib/setenv.c            |  330 ++++++++++++++++++++++++
+ gnulib/stdint.in.h         |  567 +++++++++++++++++++++++++++++++++++++++++
+ gnulib/stdlib.in.h         |  377 +++++++++++++++++++++++++++
+ gnulib/string.in.h         |  605 ++++++++++++++++++++++++++++++++++++++++++++
+ gnulib/strsep.c            |   58 +++++
+ gnulib/unistd.in.h         |  582 ++++++++++++++++++++++++++++++++++++++++++
+ gnulib/unsetenv.c          |   90 +++++++
+ gnulib/wchar.in.h          |  306 ++++++++++++++++++++++
+ link-warning.h             |   28 ++
+ 34 files changed, 5500 insertions(+), 0 deletions(-)
+ create mode 100644 gnulib/Makefile.am
+ create mode 100644 gnulib/alloca.in.h
+ create mode 100644 gnulib/m4/alloca.m4
+ create mode 100644 gnulib/m4/eealloc.m4
+ create mode 100644 gnulib/m4/environ.m4
+ create mode 100644 gnulib/m4/extensions.m4
+ create mode 100644 gnulib/m4/gnulib-cache.m4
+ create mode 100644 gnulib/m4/gnulib-common.m4
+ create mode 100644 gnulib/m4/gnulib-comp.m4
+ create mode 100644 gnulib/m4/gnulib-tool.m4
+ create mode 100644 gnulib/m4/include_next.m4
+ create mode 100644 gnulib/m4/longlong.m4
+ create mode 100644 gnulib/m4/malloca.m4
+ create mode 100644 gnulib/m4/multiarch.m4
+ create mode 100644 gnulib/m4/setenv.m4
+ create mode 100644 gnulib/m4/stdint.m4
+ create mode 100644 gnulib/m4/stdlib_h.m4
+ create mode 100644 gnulib/m4/string_h.m4
+ create mode 100644 gnulib/m4/strsep.m4
+ create mode 100644 gnulib/m4/unistd_h.m4
+ create mode 100644 gnulib/m4/wchar.m4
+ create mode 100644 gnulib/m4/wint_t.m4
+ create mode 100644 gnulib/malloca.c
+ create mode 100644 gnulib/malloca.h
+ create mode 100644 gnulib/malloca.valgrind
+ create mode 100644 gnulib/setenv.c
+ create mode 100644 gnulib/stdint.in.h
+ create mode 100644 gnulib/stdlib.in.h
+ create mode 100644 gnulib/string.in.h
+ create mode 100644 gnulib/strsep.c
+ create mode 100644 gnulib/unistd.in.h
+ create mode 100644 gnulib/unsetenv.c
+ create mode 100644 gnulib/wchar.in.h
+ create mode 100644 link-warning.h
+
+diff --git a/gnulib/Makefile.am b/gnulib/Makefile.am
+new file mode 100644
+index 0000000..b1ddb97
+--- /dev/null
++++ b/gnulib/Makefile.am
+@@ -0,0 +1,368 @@
++## DO NOT EDIT! GENERATED AUTOMATICALLY!
++## Process this file with automake to produce Makefile.in.
++# Copyright (C) 2002-2009 Free Software Foundation, Inc.
++#
++# This file is free software, distributed under the terms of the GNU
++# General Public License.  As a special exception to the GNU General
++# Public License, this file may be distributed as part of a program
++# that contains a configuration script generated by Autoconf, under
++# the same distribution terms as the rest of that program.
++#
++# Generated by gnulib-tool.
++# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-libtool --macro-prefix=gl setenv stdint strsep unsetenv
++
++AUTOMAKE_OPTIONS = 1.5 gnits
++
++SUBDIRS =
++noinst_HEADERS =
++noinst_LIBRARIES =
++noinst_LTLIBRARIES =
++EXTRA_DIST =
++BUILT_SOURCES =
++SUFFIXES =
++MOSTLYCLEANFILES = core *.stackdump
++MOSTLYCLEANDIRS =
++CLEANFILES =
++DISTCLEANFILES =
++MAINTAINERCLEANFILES =
++EXTRA_DIST += m4/gnulib-cache.m4
++
++AM_CPPFLAGS =
++
++noinst_LIBRARIES += libgnu.a
++
++libgnu_a_SOURCES =
++libgnu_a_LIBADD = $(gl_LIBOBJS)
++libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
++EXTRA_libgnu_a_SOURCES =
++
++## begin gnulib module alloca-opt
++
++BUILT_SOURCES += $(ALLOCA_H)
++
++# We need the following in order to create <alloca.h> when the system
++# doesn't have one that works with the given compiler.
++alloca.h: alloca.in.h
++	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
++	  cat $(srcdir)/alloca.in.h; \
++	} > $@-t
++	mv -f $@-t $@
++MOSTLYCLEANFILES += alloca.h alloca.h-t
++
++## end   gnulib module alloca-opt
++
++## begin gnulib module link-warning
++
++LINK_WARNING_H=$(top_srcdir)/./link-warning.h
++
++## end   gnulib module link-warning
++
++## begin gnulib module malloca
++
++libgnu_a_SOURCES += malloca.c
++
++## end   gnulib module malloca
++
++## begin gnulib module stdint
++
++BUILT_SOURCES += $(STDINT_H)
++
++# We need the following in order to create <stdint.h> when the system
++# doesn't have one that works with the given compiler.
++stdint.h: stdint.in.h
++	rm -f $@-t $@
++	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
++	  sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
++	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
++	      -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
++	      -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
++	      -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
++	      -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
++	      -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
++	      -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
++	      -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
++	      -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
++	      -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
++	      -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
++	      -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
++	      -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
++	      -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
++	      -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
++	      -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
++	      -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
++	      -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
++	      -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
++	      -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
++	      -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
++	      -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
++	      < $(srcdir)/stdint.in.h; \
++	} > $@-t
++	mv $@-t $@
++MOSTLYCLEANFILES += stdint.h stdint.h-t
++
++## end   gnulib module stdint
++
++## begin gnulib module stdlib
++
++BUILT_SOURCES += stdlib.h
++
++# We need the following in order to create <stdlib.h> when the system
++# doesn't have one that works with the given compiler.
++stdlib.h: stdlib.in.h
++	rm -f $@-t $@
++	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
++	      -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
++	      -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
++	      -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
++	      -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
++	      -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
++	      -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
++	      -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
++	      -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
++	      -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
++	      -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
++	      -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
++	      -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
++	      -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
++	      -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
++	      -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
++	      -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
++	      -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
++	      -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
++	      -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
++	      -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
++	      -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
++	      -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
++	      -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
++	      -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
++	      -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
++	      -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
++	      -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
++	      -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
++	      -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
++	      -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
++	      -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
++	      -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
++	      -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
++	      -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
++	      -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
++	      -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
++	      -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
++	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
++	      < $(srcdir)/stdlib.in.h; \
++	} > $@-t
++	mv $@-t $@
++MOSTLYCLEANFILES += stdlib.h stdlib.h-t
++
++## end   gnulib module stdlib
++
++## begin gnulib module string
++
++BUILT_SOURCES += string.h
++
++# We need the following in order to create <string.h> when the system
++# doesn't have one that works with the given compiler.
++string.h: string.in.h
++	rm -f $@-t $@
++	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
++	      -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
++	      -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
++	      -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
++	      -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
++	      -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
++	      -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
++	      -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
++	      -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
++	      -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
++	      -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
++	      -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
++	      -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
++	      -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
++	      -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
++	      -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
++	      -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
++	      -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
++	      -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
++	      -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
++	      -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
++	      -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
++	      -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
++	      -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
++	      -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
++	      -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
++	      -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
++	      -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
++	      -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
++	      -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
++	      -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
++	      -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
++	      -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
++	      -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
++	      -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
++	      -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
++	      -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
++	      -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
++	      -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
++	      -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
++	      -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
++	      -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
++	      -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \
++	      -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
++	      -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
++	      -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
++	      -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
++	      -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
++	      -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
++	      -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
++	      -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
++	      -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
++	      -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
++	      -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
++	      -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
++	      -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
++	      -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
++	      -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
++	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
++	      < $(srcdir)/string.in.h; \
++	} > $@-t
++	mv $@-t $@
++MOSTLYCLEANFILES += string.h string.h-t
++
++## end   gnulib module string
++
++## begin gnulib module unistd
++
++BUILT_SOURCES += unistd.h
++
++# We need the following in order to create an empty placeholder for
++# <unistd.h> when the system doesn't have one.
++unistd.h: unistd.in.h
++	rm -f $@-t $@
++	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
++	  sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
++	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
++	      -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
++	      -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
++	      -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
++	      -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
++	      -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
++	      -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
++	      -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
++	      -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
++	      -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
++	      -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
++	      -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \
++	      -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
++	      -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
++	      -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
++	      -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
++	      -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
++	      -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
++	      -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
++	      -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
++	      -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
++	      -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
++	      -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
++	      -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
++	      -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
++	      -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
++	      -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
++	      -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
++	      -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
++	      -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
++	      -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
++	      -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
++	      -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
++	      -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
++	      -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
++	      -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
++	      -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
++	      -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
++	      -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
++	      -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
++	      -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
++	      -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
++	      -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
++	      -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
++	      -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
++	      -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
++	      -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
++	      -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
++	      -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
++	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
++	      < $(srcdir)/unistd.in.h; \
++	} > $@-t
++	mv $@-t $@
++MOSTLYCLEANFILES += unistd.h unistd.h-t
++
++## end   gnulib module unistd
++
++## begin gnulib module wchar
++
++BUILT_SOURCES += $(WCHAR_H)
++
++# We need the following in order to create <wchar.h> when the system
++# version does not work standalone.
++wchar.h: wchar.in.h
++	rm -f $@-t $@
++	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
++	      -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
++	      -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
++	      -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
++	      -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
++	      -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
++	      -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
++	      -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
++	      -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
++	      -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
++	      -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
++	      -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
++	      -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
++	      -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
++	      -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
++	      -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
++	      -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
++	      -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
++	      -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
++	      -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
++	      -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
++	      -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
++	      -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
++	      -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
++	      -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
++	      -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
++	      -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
++	      -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
++	      -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
++	      -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
++	      -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
++	      -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
++	      -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
++	      -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
++	      -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
++	      -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
++	      -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
++	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
++	    < $(srcdir)/wchar.in.h; \
++	} > $@-t
++	mv $@-t $@
++MOSTLYCLEANFILES += wchar.h wchar.h-t
++
++## end   gnulib module wchar
++
++
++mostlyclean-local: mostlyclean-generic
++	@for dir in '' $(MOSTLYCLEANDIRS); do \
++	  if test -n "$$dir" && test -d $$dir; then \
++	    echo "rmdir $$dir"; rmdir $$dir; \
++	  fi; \
++	done; \
++	:
+diff --git a/gnulib/alloca.in.h b/gnulib/alloca.in.h
+new file mode 100644
+index 0000000..6269607
+--- /dev/null
++++ b/gnulib/alloca.in.h
+@@ -0,0 +1,56 @@
++/* Memory allocation on the stack.
++
++   Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software
++   Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU General Public License as published
++   by the Free Software Foundation; either version 3, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++   USA.  */
++
++/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
++   means there is a real alloca function.  */
++#ifndef _GL_ALLOCA_H
++#define _GL_ALLOCA_H
++
++/* alloca (N) returns a pointer to N bytes of memory
++   allocated on the stack, which will last until the function returns.
++   Use of alloca should be avoided:
++     - inside arguments of function calls - undefined behaviour,
++     - in inline functions - the allocation may actually last until the
++       calling function returns,
++     - for huge N (say, N >= 65536) - you never know how large (or small)
++       the stack is, and when the stack cannot fulfill the memory allocation
++       request, the program just crashes.
++ */
++
++#ifndef alloca
++# ifdef __GNUC__
++#  define alloca __builtin_alloca
++# elif defined _AIX
++#  define alloca __alloca
++# elif defined _MSC_VER
++#  include <malloc.h>
++#  define alloca _alloca
++# elif defined __DECC && defined __VMS
++#  define alloca __ALLOCA
++# else
++#  include <stddef.h>
++#  ifdef  __cplusplus
++extern "C"
++#  endif
++void *alloca (size_t);
++# endif
++#endif
++
++#endif /* _GL_ALLOCA_H */
+diff --git a/gnulib/m4/alloca.m4 b/gnulib/m4/alloca.m4
+new file mode 100644
+index 0000000..4b978e1
+--- /dev/null
++++ b/gnulib/m4/alloca.m4
+@@ -0,0 +1,46 @@
++# alloca.m4 serial 9
++dnl Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++AC_DEFUN([gl_FUNC_ALLOCA],
++[
++  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
++  AC_REQUIRE([AC_PROG_CPP])
++  AC_REQUIRE([AC_PROG_EGREP])
++
++  AC_REQUIRE([AC_FUNC_ALLOCA])
++  if test $ac_cv_func_alloca_works = no; then
++    gl_PREREQ_ALLOCA
++  fi
++
++  # Define an additional variable used in the Makefile substitution.
++  if test $ac_cv_working_alloca_h = yes; then
++    AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
++      AC_EGREP_CPP([Need own alloca], [
++#if defined __GNUC__ || defined _AIX || defined _MSC_VER
++        Need own alloca
++#endif
++        ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
++    ])
++    if test $gl_cv_rpl_alloca = yes; then
++      dnl OK, alloca can be implemented through a compiler built-in.
++      AC_DEFINE([HAVE_ALLOCA], [1],
++        [Define to 1 if you have 'alloca' after including <alloca.h>,
++         a header that may be supplied by this distribution.])
++      ALLOCA_H=alloca.h
++    else
++      dnl alloca exists as a library function, i.e. it is slow and probably
++      dnl a memory leak. Don't define HAVE_ALLOCA in this case.
++      ALLOCA_H=
++    fi
++  else
++    ALLOCA_H=alloca.h
++  fi
++  AC_SUBST([ALLOCA_H])
++])
++
++# Prerequisites of lib/alloca.c.
++# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
++AC_DEFUN([gl_PREREQ_ALLOCA], [:])
+diff --git a/gnulib/m4/eealloc.m4 b/gnulib/m4/eealloc.m4
+new file mode 100644
+index 0000000..3c9c0b5
+--- /dev/null
++++ b/gnulib/m4/eealloc.m4
+@@ -0,0 +1,32 @@
++# eealloc.m4 serial 2
++dnl Copyright (C) 2003, 2009 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++AC_DEFUN([gl_EEALLOC],
++[
++  AC_REQUIRE([gl_EEMALLOC])
++  AC_REQUIRE([gl_EEREALLOC])
++  AC_REQUIRE([AC_C_INLINE])
++])
++
++AC_DEFUN([gl_EEMALLOC],
++[
++  _AC_FUNC_MALLOC_IF(
++    [gl_cv_func_malloc_0_nonnull=1],
++    [gl_cv_func_malloc_0_nonnull=0])
++  AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull],
++    [If malloc(0) is != NULL, define this to 1.  Otherwise define this
++     to 0.])
++])
++
++AC_DEFUN([gl_EEREALLOC],
++[
++  _AC_FUNC_REALLOC_IF(
++    [gl_cv_func_realloc_0_nonnull=1],
++    [gl_cv_func_realloc_0_nonnull=0])
++  AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull],
++    [If realloc(NULL,0) is != NULL, define this to 1.  Otherwise define this
++     to 0.])
++])
+diff --git a/gnulib/m4/environ.m4 b/gnulib/m4/environ.m4
+new file mode 100644
+index 0000000..b17bb60
+--- /dev/null
++++ b/gnulib/m4/environ.m4
+@@ -0,0 +1,36 @@
++# environ.m4 serial 2
++dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++AC_DEFUN([gl_ENVIRON],
++[
++  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
++  dnl Persuade glibc <unistd.h> to declare environ.
++  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
++  gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
++  if test $gt_cv_var_environ_declaration != yes; then
++    HAVE_DECL_ENVIRON=0
++  fi
++])
++
++# Check if a variable is properly declared.
++# gt_CHECK_VAR_DECL(includes,variable)
++AC_DEFUN([gt_CHECK_VAR_DECL],
++[
++  define([gt_cv_var], [gt_cv_var_]$2[_declaration])
++  AC_MSG_CHECKING([if $2 is properly declared])
++  AC_CACHE_VAL([gt_cv_var], [
++    AC_TRY_COMPILE([$1
++      extern struct { int foo; } $2;],
++      [$2.foo = 1;],
++      gt_cv_var=no,
++      gt_cv_var=yes)])
++  AC_MSG_RESULT([$gt_cv_var])
++  if test $gt_cv_var = yes; then
++    AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1,
++              [Define if you have the declaration of $2.])
++  fi
++  undefine([gt_cv_var])
++])
+diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4
+new file mode 100644
+index 0000000..611fcfd
+--- /dev/null
++++ b/gnulib/m4/extensions.m4
+@@ -0,0 +1,94 @@
++# serial 6  -*- Autoconf -*-
++# Enable extensions on systems that normally disable them.
++
++# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
++# Autoconf.  Perhaps we can remove this once we can assume Autoconf
++# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
++# enough in this area it's likely we'll need to redefine
++# AC_USE_SYSTEM_EXTENSIONS for quite some time.
++
++# AC_USE_SYSTEM_EXTENSIONS
++# ------------------------
++# Enable extensions on systems that normally disable them,
++# typically due to standards-conformance issues.
++# Remember that #undef in AH_VERBATIM gets replaced with #define by
++# AC_DEFINE.  The goal here is to define all known feature-enabling
++# macros, then, if reports of conflicts are made, disable macros that
++# cause problems on some platforms (such as __EXTENSIONS__).
++AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
++[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
++AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
++
++  AC_REQUIRE([AC_CANONICAL_HOST])
++
++  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
++  if test "$MINIX" = yes; then
++    AC_DEFINE([_POSIX_SOURCE], [1],
++      [Define to 1 if you need to in order for `stat' and other
++       things to work.])
++    AC_DEFINE([_POSIX_1_SOURCE], [2],
++      [Define to 2 if the system does not provide POSIX.1 features
++       except with this defined.])
++    AC_DEFINE([_MINIX], [1],
++      [Define to 1 if on MINIX.])
++  fi
++
++  dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
++  dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
++  dnl provided.
++  case "$host_os" in
++    hpux*)
++      AC_DEFINE([_XOPEN_SOURCE], [500],
++        [Define to 500 only on HP-UX.])
++      ;;
++  esac
++
++  AH_VERBATIM([__EXTENSIONS__],
++[/* Enable extensions on AIX 3, Interix.  */
++#ifndef _ALL_SOURCE
++# undef _ALL_SOURCE
++#endif
++/* Enable GNU extensions on systems that have them.  */
++#ifndef _GNU_SOURCE
++# undef _GNU_SOURCE
++#endif
++/* Enable threading extensions on Solaris.  */
++#ifndef _POSIX_PTHREAD_SEMANTICS
++# undef _POSIX_PTHREAD_SEMANTICS
++#endif
++/* Enable extensions on HP NonStop.  */
++#ifndef _TANDEM_SOURCE
++# undef _TANDEM_SOURCE
++#endif
++/* Enable general extensions on Solaris.  */
++#ifndef __EXTENSIONS__
++# undef __EXTENSIONS__
++#endif
++])
++  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
++    [ac_cv_safe_to_define___extensions__],
++    [AC_COMPILE_IFELSE(
++       [AC_LANG_PROGRAM([[
++#	  define __EXTENSIONS__ 1
++	  ]AC_INCLUDES_DEFAULT])],
++       [ac_cv_safe_to_define___extensions__=yes],
++       [ac_cv_safe_to_define___extensions__=no])])
++  test $ac_cv_safe_to_define___extensions__ = yes &&
++    AC_DEFINE([__EXTENSIONS__])
++  AC_DEFINE([_ALL_SOURCE])
++  AC_DEFINE([_GNU_SOURCE])
++  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
++  AC_DEFINE([_TANDEM_SOURCE])
++])# AC_USE_SYSTEM_EXTENSIONS
++
++# gl_USE_SYSTEM_EXTENSIONS
++# ------------------------
++# Enable extensions on systems that normally disable them,
++# typically due to standards-conformance issues.
++AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
++  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
+diff --git a/gnulib/m4/gnulib-cache.m4 b/gnulib/m4/gnulib-cache.m4
+new file mode 100644
+index 0000000..49427a5
+--- /dev/null
++++ b/gnulib/m4/gnulib-cache.m4
+@@ -0,0 +1,37 @@
++# Copyright (C) 2002-2009 Free Software Foundation, Inc.
++#
++# This file is free software, distributed under the terms of the GNU
++# General Public License.  As a special exception to the GNU General
++# Public License, this file may be distributed as part of a program
++# that contains a configuration script generated by Autoconf, under
++# the same distribution terms as the rest of that program.
++#
++# Generated by gnulib-tool.
++#
++# This file represents the specification of how gnulib-tool is used.
++# It acts as a cache: It is written and read by gnulib-tool.
++# In projects using CVS, this file is meant to be stored in CVS,
++# like the configure.ac and various Makefile.am files.
++
++
++# Specification in the form of a command-line invocation:
++#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-libtool --macro-prefix=gl setenv stdint strsep unsetenv
++
++# Specification in the form of a few gnulib-tool.m4 macro invocations:
++gl_LOCAL_DIR([])
++gl_MODULES([
++  setenv
++  stdint
++  strsep
++  unsetenv
++])
++gl_AVOID([])
++gl_SOURCE_BASE([gnulib])
++gl_M4_BASE([gnulib/m4])
++gl_PO_BASE([])
++gl_DOC_BASE([doc])
++gl_TESTS_BASE([tests])
++gl_LIB([libgnu])
++gl_MAKEFILE_NAME([])
++gl_MACRO_PREFIX([gl])
++gl_PO_DOMAIN([])
+diff --git a/gnulib/m4/gnulib-common.m4 b/gnulib/m4/gnulib-common.m4
+new file mode 100644
+index 0000000..cfd1b99
+--- /dev/null
++++ b/gnulib/m4/gnulib-common.m4
+@@ -0,0 +1,110 @@
++# gnulib-common.m4 serial 8
++dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++# gl_COMMON
++# is expanded unconditionally through gnulib-tool magic.
++AC_DEFUN([gl_COMMON], [
++  dnl Use AC_REQUIRE here, so that the code is expanded once only.
++  AC_REQUIRE([gl_COMMON_BODY])
++])
++AC_DEFUN([gl_COMMON_BODY], [
++  AH_VERBATIM([isoc99_inline],
++[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
++   the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
++   earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
++   __APPLE__ && __MACH__ test for MacOS X.
++   __APPLE_CC__ tests for the Apple compiler and its version.
++   __STDC_VERSION__ tests for the C99 mode.  */
++#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
++# define __GNUC_STDC_INLINE__ 1
++#endif])
++  AH_VERBATIM([unused_parameter],
++[/* Define as a marker that can be attached to function parameter declarations
++   for parameters that are not used.  This helps to reduce warnings, such as
++   from GCC -Wunused-parameter.  */
++#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
++# define _UNUSED_PARAMETER_ __attribute__ ((__unused__))
++#else
++# define _UNUSED_PARAMETER_
++#endif
++])
++])
++
++# gl_MODULE_INDICATOR([modulename])
++# defines a C macro indicating the presence of the given module.
++AC_DEFUN([gl_MODULE_INDICATOR],
++[
++  AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
++    [Define to 1 when using the gnulib module ]$1[.])
++])
++
++# m4_foreach_w
++# is a backport of autoconf-2.59c's m4_foreach_w.
++# Remove this macro when we can assume autoconf >= 2.60.
++m4_ifndef([m4_foreach_w],
++  [m4_define([m4_foreach_w],
++    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
++
++# AC_PROG_MKDIR_P
++# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
++# Remove this macro when we can assume autoconf >= 2.60.
++m4_ifdef([AC_PROG_MKDIR_P], [], [
++  AC_DEFUN([AC_PROG_MKDIR_P],
++    [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
++     MKDIR_P='$(mkdir_p)'
++     AC_SUBST([MKDIR_P])])])
++
++# AC_C_RESTRICT
++# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
++# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
++# works.
++# This definition can be removed once autoconf >= 2.62 can be assumed.
++AC_DEFUN([AC_C_RESTRICT],
++[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
++  [ac_cv_c_restrict=no
++   # The order here caters to the fact that C++ does not require restrict.
++   for ac_kw in __restrict __restrict__ _Restrict restrict; do
++     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
++      [[typedef int * int_ptr;
++	int foo (int_ptr $ac_kw ip) {
++	return ip[0];
++       }]],
++      [[int s[1];
++	int * $ac_kw t = s;
++	t[0] = 0;
++	return foo(t)]])],
++      [ac_cv_c_restrict=$ac_kw])
++     test "$ac_cv_c_restrict" != no && break
++   done
++  ])
++ AH_VERBATIM([restrict],
++[/* Define to the equivalent of the C99 'restrict' keyword, or to
++   nothing if this is not supported.  Do not define if restrict is
++   supported directly.  */
++#undef restrict
++/* Work around a bug in Sun C++: it does not support _Restrict, even
++   though the corresponding Sun C compiler does, which causes
++   "#define restrict _Restrict" in the previous line.  Perhaps some future
++   version of Sun C++ will work with _Restrict; if so, it'll probably
++   define __RESTRICT, just as Sun C does.  */
++#if defined __SUNPRO_CC && !defined __RESTRICT
++# define _Restrict
++#endif])
++ case $ac_cv_c_restrict in
++   restrict) ;;
++   no) AC_DEFINE([restrict], []) ;;
++   *)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
++ esac
++])
++
++# gl_BIGENDIAN
++# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
++# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some
++# macros invoke AC_C_BIGENDIAN with arguments.
++AC_DEFUN([gl_BIGENDIAN],
++[
++  AC_C_BIGENDIAN
++])
+diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
+new file mode 100644
+index 0000000..1134631
+--- /dev/null
++++ b/gnulib/m4/gnulib-comp.m4
+@@ -0,0 +1,224 @@
++# DO NOT EDIT! GENERATED AUTOMATICALLY!
++# Copyright (C) 2002-2009 Free Software Foundation, Inc.
++#
++# This file is free software, distributed under the terms of the GNU
++# General Public License.  As a special exception to the GNU General
++# Public License, this file may be distributed as part of a program
++# that contains a configuration script generated by Autoconf, under
++# the same distribution terms as the rest of that program.
++#
++# Generated by gnulib-tool.
++#
++# This file represents the compiled summary of the specification in
++# gnulib-cache.m4. It lists the computed macro invocations that need
++# to be invoked from configure.ac.
++# In projects using CVS, this file can be treated like other built files.
++
++
++# This macro should be invoked from ./configure.ac, in the section
++# "Checks for programs", right after AC_PROG_CC, and certainly before
++# any checks for libraries, header files, types and library functions.
++AC_DEFUN([gl_EARLY],
++[
++  m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
++  m4_pattern_allow([^gl_ES$])dnl a valid locale name
++  m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
++  m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
++  AC_REQUIRE([AC_PROG_RANLIB])
++  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
++])
++
++# This macro should be invoked from ./configure.ac, in the section
++# "Check for header files, types and library functions".
++AC_DEFUN([gl_INIT],
++[
++  AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
++  gl_cond_libtool=false
++  gl_libdeps=
++  gl_ltlibdeps=
++  m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
++  m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
++  m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
++  m4_pushdef([gl_LIBSOURCES_LIST], [])
++  m4_pushdef([gl_LIBSOURCES_DIR], [])
++  gl_COMMON
++  gl_source_base='gnulib'
++  gl_FUNC_ALLOCA
++  gl_ENVIRON
++  gl_UNISTD_MODULE_INDICATOR([environ])
++  gl_MALLOCA
++  AC_REQUIRE([gl_MULTIARCH])
++  gl_FUNC_SETENV
++  gl_STDLIB_MODULE_INDICATOR([setenv])
++  gl_STDINT_H
++  gl_STDLIB_H
++  gl_HEADER_STRING_H
++  gl_FUNC_STRSEP
++  gl_STRING_MODULE_INDICATOR([strsep])
++  gl_UNISTD_H
++  gl_FUNC_UNSETENV
++  gl_STDLIB_MODULE_INDICATOR([unsetenv])
++  gl_WCHAR_H
++  m4_ifval(gl_LIBSOURCES_LIST, [
++    m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
++      for gl_file in ]gl_LIBSOURCES_LIST[ ; do
++        if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
++          echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
++          exit 1
++        fi
++      done])dnl
++      m4_if(m4_sysval, [0], [],
++        [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
++  ])
++  m4_popdef([gl_LIBSOURCES_DIR])
++  m4_popdef([gl_LIBSOURCES_LIST])
++  m4_popdef([AC_LIBSOURCES])
++  m4_popdef([AC_REPLACE_FUNCS])
++  m4_popdef([AC_LIBOBJ])
++  AC_CONFIG_COMMANDS_PRE([
++    gl_libobjs=
++    gl_ltlibobjs=
++    if test -n "$gl_LIBOBJS"; then
++      # Remove the extension.
++      sed_drop_objext='s/\.o$//;s/\.obj$//'
++      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
++        gl_libobjs="$gl_libobjs $i.$ac_objext"
++        gl_ltlibobjs="$gl_ltlibobjs $i.lo"
++      done
++    fi
++    AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
++    AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
++  ])
++  gltests_libdeps=
++  gltests_ltlibdeps=
++  m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
++  m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
++  m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
++  m4_pushdef([gltests_LIBSOURCES_LIST], [])
++  m4_pushdef([gltests_LIBSOURCES_DIR], [])
++  gl_COMMON
++  gl_source_base='tests'
++  m4_ifval(gltests_LIBSOURCES_LIST, [
++    m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
++      for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
++        if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then
++          echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2
++          exit 1
++        fi
++      done])dnl
++      m4_if(m4_sysval, [0], [],
++        [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
++  ])
++  m4_popdef([gltests_LIBSOURCES_DIR])
++  m4_popdef([gltests_LIBSOURCES_LIST])
++  m4_popdef([AC_LIBSOURCES])
++  m4_popdef([AC_REPLACE_FUNCS])
++  m4_popdef([AC_LIBOBJ])
++  AC_CONFIG_COMMANDS_PRE([
++    gltests_libobjs=
++    gltests_ltlibobjs=
++    if test -n "$gltests_LIBOBJS"; then
++      # Remove the extension.
++      sed_drop_objext='s/\.o$//;s/\.obj$//'
++      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
++        gltests_libobjs="$gltests_libobjs $i.$ac_objext"
++        gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
++      done
++    fi
++    AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
++    AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
++  ])
++  LIBGNU_LIBDEPS="$gl_libdeps"
++  AC_SUBST([LIBGNU_LIBDEPS])
++  LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
++  AC_SUBST([LIBGNU_LTLIBDEPS])
++])
++
++# Like AC_LIBOBJ, except that the module name goes
++# into gl_LIBOBJS instead of into LIBOBJS.
++AC_DEFUN([gl_LIBOBJ], [
++  AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
++  gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
++])
++
++# Like AC_REPLACE_FUNCS, except that the module name goes
++# into gl_LIBOBJS instead of into LIBOBJS.
++AC_DEFUN([gl_REPLACE_FUNCS], [
++  m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
++  AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
++])
++
++# Like AC_LIBSOURCES, except the directory where the source file is
++# expected is derived from the gnulib-tool parameterization,
++# and alloca is special cased (for the alloca-opt module).
++# We could also entirely rely on EXTRA_lib..._SOURCES.
++AC_DEFUN([gl_LIBSOURCES], [
++  m4_foreach([_gl_NAME], [$1], [
++    m4_if(_gl_NAME, [alloca.c], [], [
++      m4_define([gl_LIBSOURCES_DIR], [gnulib])
++      m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
++    ])
++  ])
++])
++
++# Like AC_LIBOBJ, except that the module name goes
++# into gltests_LIBOBJS instead of into LIBOBJS.
++AC_DEFUN([gltests_LIBOBJ], [
++  AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
++  gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
++])
++
++# Like AC_REPLACE_FUNCS, except that the module name goes
++# into gltests_LIBOBJS instead of into LIBOBJS.
++AC_DEFUN([gltests_REPLACE_FUNCS], [
++  m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
++  AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
++])
++
++# Like AC_LIBSOURCES, except the directory where the source file is
++# expected is derived from the gnulib-tool parameterization,
++# and alloca is special cased (for the alloca-opt module).
++# We could also entirely rely on EXTRA_lib..._SOURCES.
++AC_DEFUN([gltests_LIBSOURCES], [
++  m4_foreach([_gl_NAME], [$1], [
++    m4_if(_gl_NAME, [alloca.c], [], [
++      m4_define([gltests_LIBSOURCES_DIR], [tests])
++      m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
++    ])
++  ])
++])
++
++# This macro records the list of files which have been installed by
++# gnulib-tool and may be removed by future gnulib-tool invocations.
++AC_DEFUN([gl_FILE_LIST], [
++  build-aux/link-warning.h
++  lib/alloca.in.h
++  lib/malloca.c
++  lib/malloca.h
++  lib/malloca.valgrind
++  lib/setenv.c
++  lib/stdint.in.h
++  lib/stdlib.in.h
++  lib/string.in.h
++  lib/strsep.c
++  lib/unistd.in.h
++  lib/unsetenv.c
++  lib/wchar.in.h
++  m4/alloca.m4
++  m4/eealloc.m4
++  m4/environ.m4
++  m4/extensions.m4
++  m4/gnulib-common.m4
++  m4/include_next.m4
++  m4/longlong.m4
++  m4/malloca.m4
++  m4/multiarch.m4
++  m4/setenv.m4
++  m4/stdint.m4
++  m4/stdlib_h.m4
++  m4/string_h.m4
++  m4/strsep.m4
++  m4/unistd_h.m4
++  m4/wchar.m4
++  m4/wint_t.m4
++])
+diff --git a/gnulib/m4/gnulib-tool.m4 b/gnulib/m4/gnulib-tool.m4
+new file mode 100644
+index 0000000..4438d48
+--- /dev/null
++++ b/gnulib/m4/gnulib-tool.m4
+@@ -0,0 +1,57 @@
++# gnulib-tool.m4 serial 2
++dnl Copyright (C) 2004-2005 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++dnl The following macros need not be invoked explicitly.
++dnl Invoking them does nothing except to declare default arguments
++dnl for "gnulib-tool --import".
++
++dnl Usage: gl_LOCAL_DIR([DIR])
++AC_DEFUN([gl_LOCAL_DIR], [])
++
++dnl Usage: gl_MODULES([module1 module2 ...])
++AC_DEFUN([gl_MODULES], [])
++
++dnl Usage: gl_AVOID([module1 module2 ...])
++AC_DEFUN([gl_AVOID], [])
++
++dnl Usage: gl_SOURCE_BASE([DIR])
++AC_DEFUN([gl_SOURCE_BASE], [])
++
++dnl Usage: gl_M4_BASE([DIR])
++AC_DEFUN([gl_M4_BASE], [])
++
++dnl Usage: gl_PO_BASE([DIR])
++AC_DEFUN([gl_PO_BASE], [])
++
++dnl Usage: gl_DOC_BASE([DIR])
++AC_DEFUN([gl_DOC_BASE], [])
++
++dnl Usage: gl_TESTS_BASE([DIR])
++AC_DEFUN([gl_TESTS_BASE], [])
++
++dnl Usage: gl_WITH_TESTS
++AC_DEFUN([gl_WITH_TESTS], [])
++
++dnl Usage: gl_LIB([LIBNAME])
++AC_DEFUN([gl_LIB], [])
++
++dnl Usage: gl_LGPL or gl_LGPL([VERSION])
++AC_DEFUN([gl_LGPL], [])
++
++dnl Usage: gl_MAKEFILE_NAME([FILENAME])
++AC_DEFUN([gl_MAKEFILE_NAME], [])
++
++dnl Usage: gl_LIBTOOL
++AC_DEFUN([gl_LIBTOOL], [])
++
++dnl Usage: gl_MACRO_PREFIX([PREFIX])
++AC_DEFUN([gl_MACRO_PREFIX], [])
++
++dnl Usage: gl_PO_DOMAIN([DOMAIN])
++AC_DEFUN([gl_PO_DOMAIN], [])
++
++dnl Usage: gl_VC_FILES([BOOLEAN])
++AC_DEFUN([gl_VC_FILES], [])
+diff --git a/gnulib/m4/include_next.m4 b/gnulib/m4/include_next.m4
+new file mode 100644
+index 0000000..062753c
+--- /dev/null
++++ b/gnulib/m4/include_next.m4
+@@ -0,0 +1,170 @@
++# include_next.m4 serial 10
++dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++dnl From Paul Eggert and Derek Price.
++
++dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
++dnl
++dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
++dnl 'include' otherwise.
++dnl
++dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler
++dnl supports it in the special case that it is the first include directive in
++dnl the given file, or to 'include' otherwise.
++dnl
++dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next,
++dnl so as to avoid GCC warnings when the gcc option -pedantic is used.
++dnl '#pragma GCC system_header' has the same effect as if the file was found
++dnl through the include search path specified with '-isystem' options (as
++dnl opposed to the search path specified with '-I' options). Namely, gcc
++dnl does not warn about some things, and on some systems (Solaris and Interix)
++dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
++dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
++dnl of plain '__STDC__'.
++
++AC_DEFUN([gl_INCLUDE_NEXT],
++[
++  AC_LANG_PREPROC_REQUIRE()
++  AC_CACHE_CHECK([whether the preprocessor supports include_next],
++    [gl_cv_have_include_next],
++    [rm -rf conftestd1a conftestd1b conftestd2
++     mkdir conftestd1a conftestd1b conftestd2
++     dnl The include of <stdio.h> is because IBM C 9.0 on AIX 6.1 supports
++     dnl include_next when used as first preprocessor directive in a file,
++     dnl but not when preceded by another include directive. Additionally,
++     dnl with this same compiler, include_next is a no-op when used in a
++     dnl header file that was included by specifying its absolute file name.
++     dnl Despite these two bugs, include_next is used in the compiler's
++     dnl <math.h>. By virtue of the second bug, we need to use include_next
++     dnl as well in this case.
++     cat <<EOF > conftestd1a/conftest.h
++#define DEFINED_IN_CONFTESTD1
++#include_next <conftest.h>
++#ifdef DEFINED_IN_CONFTESTD2
++int foo;
++#else
++#error "include_next doesn't work"
++#endif
++EOF
++     cat <<EOF > conftestd1b/conftest.h
++#define DEFINED_IN_CONFTESTD1
++#include <stdio.h>
++#include_next <conftest.h>
++#ifdef DEFINED_IN_CONFTESTD2
++int foo;
++#else
++#error "include_next doesn't work"
++#endif
++EOF
++     cat <<EOF > conftestd2/conftest.h
++#ifndef DEFINED_IN_CONFTESTD1
++#error "include_next test doesn't work"
++#endif
++#define DEFINED_IN_CONFTESTD2
++EOF
++     gl_save_CPPFLAGS="$CPPFLAGS"
++     CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
++     AC_COMPILE_IFELSE([#include <conftest.h>],
++       [gl_cv_have_include_next=yes],
++       [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
++        AC_COMPILE_IFELSE([#include <conftest.h>],
++          [gl_cv_have_include_next=buggy],
++          [gl_cv_have_include_next=no])
++       ])
++     CPPFLAGS="$gl_save_CPPFLAGS"
++     rm -rf conftestd1a conftestd1b conftestd2
++    ])
++  PRAGMA_SYSTEM_HEADER=
++  if test $gl_cv_have_include_next = yes; then
++    INCLUDE_NEXT=include_next
++    INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
++    if test -n "$GCC"; then
++      PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
++    fi
++  else
++    if test $gl_cv_have_include_next = buggy; then
++      INCLUDE_NEXT=include
++      INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
++    else
++      INCLUDE_NEXT=include
++      INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
++    fi
++  fi
++  AC_SUBST([INCLUDE_NEXT])
++  AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
++  AC_SUBST([PRAGMA_SYSTEM_HEADER])
++])
++
++# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
++# ------------------------------------------
++# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
++# '<foo.h>'; otherwise define it to be
++# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
++# That way, a header file with the following line:
++#	#@INCLUDE_NEXT@ @NEXT_FOO_H@
++# behaves (after sed substitution) as if it contained
++#	#include_next <foo.h>
++# even if the compiler does not support include_next.
++# The three "///" are to pacify Sun C 5.8, which otherwise would say
++# "warning: #include of /usr/include/... may be non-portable".
++# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
++# Note: This macro assumes that the header file is not empty after
++# preprocessing, i.e. it does not only define preprocessor macros but also
++# provides some type/enum definitions or function/variable declarations.
++AC_DEFUN([gl_CHECK_NEXT_HEADERS],
++[
++  AC_REQUIRE([gl_INCLUDE_NEXT])
++  AC_REQUIRE([AC_CANONICAL_HOST])
++  AC_CHECK_HEADERS_ONCE([$1])
++
++  m4_foreach_w([gl_HEADER_NAME], [$1],
++    [AS_VAR_PUSHDEF([gl_next_header],
++		    [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
++     if test $gl_cv_have_include_next = yes; then
++       AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
++     else
++       AC_CACHE_CHECK(
++	 [absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
++	 m4_quote(m4_defn([gl_next_header])),
++	 [AS_VAR_PUSHDEF([gl_header_exists],
++			 [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))
++	  if test AS_VAR_GET(gl_header_exists) = yes; then
++	    AC_LANG_CONFTEST(
++	      [AC_LANG_SOURCE(
++		 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
++	       )])
++	    dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
++	    dnl that contain only a #include of other header files and no
++	    dnl non-comment tokens of their own. This leads to a failure to
++	    dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
++	    dnl and others. The workaround is to force preservation of comments
++	    dnl through option -C. This ensures all necessary #line directives
++	    dnl are present. GCC supports option -C as well.
++	    case "$host_os" in
++	      aix*) gl_absname_cpp="$ac_cpp -C" ;;
++	      *)    gl_absname_cpp="$ac_cpp" ;;
++	    esac
++	    dnl eval is necessary to expand gl_absname_cpp.
++	    dnl Ultrix and Pyramid sh refuse to redirect output of eval,
++	    dnl so use subshell.
++	    AS_VAR_SET([gl_next_header],
++	      ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
++	       sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
++		 s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
++		 s#^/[^/]#//&#
++		 p
++		 q
++	       }'`'"'])
++	  else
++	    AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
++	  fi
++	  AS_VAR_POPDEF([gl_header_exists])])
++     fi
++     AC_SUBST(
++       AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))),
++       [AS_VAR_GET([gl_next_header])])
++     AS_VAR_POPDEF([gl_next_header])])
++])
+diff --git a/gnulib/m4/longlong.m4 b/gnulib/m4/longlong.m4
+new file mode 100644
+index 0000000..eedc8d5
+--- /dev/null
++++ b/gnulib/m4/longlong.m4
+@@ -0,0 +1,106 @@
++# longlong.m4 serial 14
++dnl Copyright (C) 1999-2007, 2009 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++dnl From Paul Eggert.
++
++# Define HAVE_LONG_LONG_INT if 'long long int' works.
++# This fixes a bug in Autoconf 2.61, but can be removed once we
++# assume 2.62 everywhere.
++
++# Note: If the type 'long long int' exists but is only 32 bits large
++# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
++# defined. In this case you can treat 'long long int' like 'long int'.
++
++AC_DEFUN([AC_TYPE_LONG_LONG_INT],
++[
++  AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
++    [AC_LINK_IFELSE(
++       [_AC_TYPE_LONG_LONG_SNIPPET],
++       [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
++	dnl If cross compiling, assume the bug isn't important, since
++	dnl nobody cross compiles for this platform as far as we know.
++	AC_RUN_IFELSE(
++	  [AC_LANG_PROGRAM(
++	     [[@%:@include <limits.h>
++	       @%:@ifndef LLONG_MAX
++	       @%:@ define HALF \
++			(1LL << (sizeof (long long int) * CHAR_BIT - 2))
++	       @%:@ define LLONG_MAX (HALF - 1 + HALF)
++	       @%:@endif]],
++	     [[long long int n = 1;
++	       int i;
++	       for (i = 0; ; i++)
++		 {
++		   long long int m = n << i;
++		   if (m >> i != n)
++		     return 1;
++		   if (LLONG_MAX / 2 < m)
++		     break;
++		 }
++	       return 0;]])],
++	  [ac_cv_type_long_long_int=yes],
++	  [ac_cv_type_long_long_int=no],
++	  [ac_cv_type_long_long_int=yes])],
++       [ac_cv_type_long_long_int=no])])
++  if test $ac_cv_type_long_long_int = yes; then
++    AC_DEFINE([HAVE_LONG_LONG_INT], [1],
++      [Define to 1 if the system has the type `long long int'.])
++  fi
++])
++
++# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
++# This fixes a bug in Autoconf 2.61, but can be removed once we
++# assume 2.62 everywhere.
++
++# Note: If the type 'unsigned long long int' exists but is only 32 bits
++# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
++# will not be defined. In this case you can treat 'unsigned long long int'
++# like 'unsigned long int'.
++
++AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
++[
++  AC_CACHE_CHECK([for unsigned long long int],
++    [ac_cv_type_unsigned_long_long_int],
++    [AC_LINK_IFELSE(
++       [_AC_TYPE_LONG_LONG_SNIPPET],
++       [ac_cv_type_unsigned_long_long_int=yes],
++       [ac_cv_type_unsigned_long_long_int=no])])
++  if test $ac_cv_type_unsigned_long_long_int = yes; then
++    AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
++      [Define to 1 if the system has the type `unsigned long long int'.])
++  fi
++])
++
++# Expands to a C program that can be used to test for simultaneous support
++# of 'long long' and 'unsigned long long'. We don't want to say that
++# 'long long' is available if 'unsigned long long' is not, or vice versa,
++# because too many programs rely on the symmetry between signed and unsigned
++# integer types (excluding 'bool').
++AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
++[
++  AC_LANG_PROGRAM(
++    [[/* For now, do not test the preprocessor; as of 2007 there are too many
++	 implementations with broken preprocessors.  Perhaps this can
++	 be revisited in 2012.  In the meantime, code should not expect
++	 #if to work with literals wider than 32 bits.  */
++      /* Test literals.  */
++      long long int ll = 9223372036854775807ll;
++      long long int nll = -9223372036854775807LL;
++      unsigned long long int ull = 18446744073709551615ULL;
++      /* Test constant expressions.   */
++      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
++		     ? 1 : -1)];
++      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
++		     ? 1 : -1)];
++      int i = 63;]],
++    [[/* Test availability of runtime routines for shift and division.  */
++      long long int llmax = 9223372036854775807ll;
++      unsigned long long int ullmax = 18446744073709551615ull;
++      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
++	      | (llmax / ll) | (llmax % ll)
++	      | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
++	      | (ullmax / ull) | (ullmax % ull));]])
++])
+diff --git a/gnulib/m4/malloca.m4 b/gnulib/m4/malloca.m4
+new file mode 100644
+index 0000000..2841ae8
+--- /dev/null
++++ b/gnulib/m4/malloca.m4
+@@ -0,0 +1,14 @@
++# malloca.m4 serial 1
++dnl Copyright (C) 2003-2004, 2006-2007 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++AC_DEFUN([gl_MALLOCA],
++[
++  dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables
++  dnl @ALLOCA@ and @LTALLOCA at .
++  dnl gl_FUNC_ALLOCA   dnl Already brought in by the module dependencies.
++  AC_REQUIRE([gl_EEMALLOC])
++  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
++])
+diff --git a/gnulib/m4/multiarch.m4 b/gnulib/m4/multiarch.m4
+new file mode 100644
+index 0000000..3948e6e
+--- /dev/null
++++ b/gnulib/m4/multiarch.m4
+@@ -0,0 +1,66 @@
++# multiarch.m4 serial 4
++dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++# Determine whether the compiler is or may be producing universal binaries.
++#
++# On MacOS X 10.5 and later systems, the user can create libraries and
++# executables that work on multiple system types--known as "fat" or
++# "universal" binaries--by specifying multiple '-arch' options to the
++# compiler but only a single '-arch' option to the preprocessor.  Like
++# this:
++#
++#     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
++#                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
++#                 CPP="gcc -E" CXXCPP="g++ -E"
++#
++# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
++# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
++
++dnl This macro must pass through AC_REQUIRE (never directly invoke it).
++AC_DEFUN_ONCE([gl_MULTIARCH],
++[
++  dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
++  gl_cv_c_multiarch=no
++  AC_COMPILE_IFELSE(
++    [AC_LANG_SOURCE(
++      [[#ifndef __APPLE_CC__
++         not a universal capable compiler
++        #endif
++        typedef int dummy;
++      ]])],
++    [
++     dnl Check for potential -arch flags.  It is not universal unless
++     dnl there are at least two -arch flags with different values.
++     arch=
++     prev=
++     for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
++       if test -n "$prev"; then
++         case $word in
++           i?86 | x86_64 | ppc | ppc64)
++             if test -z "$arch" || test "$arch" = "$word"; then
++               arch="$word"
++             else
++               gl_cv_c_multiarch=yes
++             fi
++             ;;
++         esac
++         prev=
++       else
++         if test "x$word" = "x-arch"; then
++           prev=arch
++         fi
++       fi
++     done
++    ])
++  if test $gl_cv_c_multiarch = yes; then
++    AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
++      [Define if the compiler is building for multiple architectures of Apple platforms at once.])
++    APPLE_UNIVERSAL_BUILD=1
++  else
++    APPLE_UNIVERSAL_BUILD=0
++  fi
++  AC_SUBST([APPLE_UNIVERSAL_BUILD])
++])
+diff --git a/gnulib/m4/setenv.m4 b/gnulib/m4/setenv.m4
+new file mode 100644
+index 0000000..e28407e
+--- /dev/null
++++ b/gnulib/m4/setenv.m4
+@@ -0,0 +1,71 @@
++# setenv.m4 serial 11
++dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++AC_DEFUN([gl_FUNC_SETENV],
++[
++  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
++  AC_CHECK_FUNCS_ONCE([setenv])
++  if test $ac_cv_func_setenv = no; then
++    HAVE_SETENV=0
++    AC_LIBOBJ([setenv])
++    gl_PREREQ_SETENV
++  fi
++])
++
++# Like gl_FUNC_SETENV, except prepare for separate compilation (no AC_LIBOBJ).
++AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
++[
++  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
++  AC_CHECK_FUNCS_ONCE([setenv])
++  if test $ac_cv_func_setenv = no; then
++    HAVE_SETENV=0
++  fi
++  gl_PREREQ_SETENV
++])
++
++AC_DEFUN([gl_FUNC_UNSETENV],
++[
++  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
++  AC_CHECK_FUNCS([unsetenv])
++  if test $ac_cv_func_unsetenv = no; then
++    HAVE_UNSETENV=0
++    AC_LIBOBJ([unsetenv])
++    gl_PREREQ_UNSETENV
++  else
++    AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
++      [AC_TRY_COMPILE([#include <stdlib.h>
++extern
++#ifdef __cplusplus
++"C"
++#endif
++#if defined(__STDC__) || defined(__cplusplus)
++int unsetenv (const char *name);
++#else
++int unsetenv();
++#endif
++], , gt_cv_func_unsetenv_ret='int', gt_cv_func_unsetenv_ret='void')])
++    if test $gt_cv_func_unsetenv_ret = 'void'; then
++      VOID_UNSETENV=1
++    fi
++  fi
++])
++
++# Prerequisites of lib/setenv.c.
++AC_DEFUN([gl_PREREQ_SETENV],
++[
++  AC_REQUIRE([AC_FUNC_ALLOCA])
++  AC_REQUIRE([gl_ENVIRON])
++  AC_CHECK_HEADERS_ONCE([unistd.h])
++  AC_CHECK_HEADERS([search.h])
++  AC_CHECK_FUNCS([tsearch])
++])
++
++# Prerequisites of lib/unsetenv.c.
++AC_DEFUN([gl_PREREQ_UNSETENV],
++[
++  AC_REQUIRE([gl_ENVIRON])
++  AC_CHECK_HEADERS_ONCE([unistd.h])
++])
+diff --git a/gnulib/m4/stdint.m4 b/gnulib/m4/stdint.m4
+new file mode 100644
+index 0000000..b4194c8
+--- /dev/null
++++ b/gnulib/m4/stdint.m4
+@@ -0,0 +1,404 @@
++# stdint.m4 serial 33
++dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++dnl From Paul Eggert and Bruno Haible.
++dnl Test whether <stdint.h> is supported or must be substituted.
++
++AC_DEFUN([gl_STDINT_H],
++[
++  AC_PREREQ([2.59])dnl
++
++  dnl Check for long long int and unsigned long long int.
++  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
++  if test $ac_cv_type_long_long_int = yes; then
++    HAVE_LONG_LONG_INT=1
++  else
++    HAVE_LONG_LONG_INT=0
++  fi
++  AC_SUBST([HAVE_LONG_LONG_INT])
++  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
++  if test $ac_cv_type_unsigned_long_long_int = yes; then
++    HAVE_UNSIGNED_LONG_LONG_INT=1
++  else
++    HAVE_UNSIGNED_LONG_LONG_INT=0
++  fi
++  AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
++
++  dnl Check for <inttypes.h>.
++  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
++  if test $ac_cv_header_inttypes_h = yes; then
++    HAVE_INTTYPES_H=1
++  else
++    HAVE_INTTYPES_H=0
++  fi
++  AC_SUBST([HAVE_INTTYPES_H])
++
++  dnl Check for <sys/types.h>.
++  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h.
++  if test $ac_cv_header_sys_types_h = yes; then
++    HAVE_SYS_TYPES_H=1
++  else
++    HAVE_SYS_TYPES_H=0
++  fi
++  AC_SUBST([HAVE_SYS_TYPES_H])
++
++  gl_CHECK_NEXT_HEADERS([stdint.h])
++  if test $ac_cv_header_stdint_h = yes; then
++    HAVE_STDINT_H=1
++  else
++    HAVE_STDINT_H=0
++  fi
++  AC_SUBST([HAVE_STDINT_H])
++
++  dnl Now see whether we need a substitute <stdint.h>.
++  if test $ac_cv_header_stdint_h = yes; then
++    AC_CACHE_CHECK([whether stdint.h conforms to C99],
++      [gl_cv_header_working_stdint_h],
++      [gl_cv_header_working_stdint_h=no
++       AC_COMPILE_IFELSE([
++         AC_LANG_PROGRAM([[
++#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
++#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
++#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
++#include <stdint.h>
++/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
++#if !(defined WCHAR_MIN && defined WCHAR_MAX)
++#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
++#endif
++]
++gl_STDINT_INCLUDES
++[
++#ifdef INT8_MAX
++int8_t a1 = INT8_MAX;
++int8_t a1min = INT8_MIN;
++#endif
++#ifdef INT16_MAX
++int16_t a2 = INT16_MAX;
++int16_t a2min = INT16_MIN;
++#endif
++#ifdef INT32_MAX
++int32_t a3 = INT32_MAX;
++int32_t a3min = INT32_MIN;
++#endif
++#ifdef INT64_MAX
++int64_t a4 = INT64_MAX;
++int64_t a4min = INT64_MIN;
++#endif
++#ifdef UINT8_MAX
++uint8_t b1 = UINT8_MAX;
++#else
++typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
++#endif
++#ifdef UINT16_MAX
++uint16_t b2 = UINT16_MAX;
++#endif
++#ifdef UINT32_MAX
++uint32_t b3 = UINT32_MAX;
++#endif
++#ifdef UINT64_MAX
++uint64_t b4 = UINT64_MAX;
++#endif
++int_least8_t c1 = INT8_C (0x7f);
++int_least8_t c1max = INT_LEAST8_MAX;
++int_least8_t c1min = INT_LEAST8_MIN;
++int_least16_t c2 = INT16_C (0x7fff);
++int_least16_t c2max = INT_LEAST16_MAX;
++int_least16_t c2min = INT_LEAST16_MIN;
++int_least32_t c3 = INT32_C (0x7fffffff);
++int_least32_t c3max = INT_LEAST32_MAX;
++int_least32_t c3min = INT_LEAST32_MIN;
++int_least64_t c4 = INT64_C (0x7fffffffffffffff);
++int_least64_t c4max = INT_LEAST64_MAX;
++int_least64_t c4min = INT_LEAST64_MIN;
++uint_least8_t d1 = UINT8_C (0xff);
++uint_least8_t d1max = UINT_LEAST8_MAX;
++uint_least16_t d2 = UINT16_C (0xffff);
++uint_least16_t d2max = UINT_LEAST16_MAX;
++uint_least32_t d3 = UINT32_C (0xffffffff);
++uint_least32_t d3max = UINT_LEAST32_MAX;
++uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
++uint_least64_t d4max = UINT_LEAST64_MAX;
++int_fast8_t e1 = INT_FAST8_MAX;
++int_fast8_t e1min = INT_FAST8_MIN;
++int_fast16_t e2 = INT_FAST16_MAX;
++int_fast16_t e2min = INT_FAST16_MIN;
++int_fast32_t e3 = INT_FAST32_MAX;
++int_fast32_t e3min = INT_FAST32_MIN;
++int_fast64_t e4 = INT_FAST64_MAX;
++int_fast64_t e4min = INT_FAST64_MIN;
++uint_fast8_t f1 = UINT_FAST8_MAX;
++uint_fast16_t f2 = UINT_FAST16_MAX;
++uint_fast32_t f3 = UINT_FAST32_MAX;
++uint_fast64_t f4 = UINT_FAST64_MAX;
++#ifdef INTPTR_MAX
++intptr_t g = INTPTR_MAX;
++intptr_t gmin = INTPTR_MIN;
++#endif
++#ifdef UINTPTR_MAX
++uintptr_t h = UINTPTR_MAX;
++#endif
++intmax_t i = INTMAX_MAX;
++uintmax_t j = UINTMAX_MAX;
++
++#include <limits.h> /* for CHAR_BIT */
++#define TYPE_MINIMUM(t) \
++  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
++#define TYPE_MAXIMUM(t) \
++  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
++struct s {
++  int check_PTRDIFF:
++      PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
++      && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
++      ? 1 : -1;
++  /* Detect bug in FreeBSD 6.0 / ia64.  */
++  int check_SIG_ATOMIC:
++      SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
++      && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
++      ? 1 : -1;
++  int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
++  int check_WCHAR:
++      WCHAR_MIN == TYPE_MINIMUM (wchar_t)
++      && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
++      ? 1 : -1;
++  /* Detect bug in mingw.  */
++  int check_WINT:
++      WINT_MIN == TYPE_MINIMUM (wint_t)
++      && WINT_MAX == TYPE_MAXIMUM (wint_t)
++      ? 1 : -1;
++
++  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
++  int check_UINT8_C:
++        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
++  int check_UINT16_C:
++        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
++
++  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
++#ifdef UINT8_MAX
++  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
++#endif
++#ifdef UINT16_MAX
++  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
++#endif
++#ifdef UINT32_MAX
++  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
++#endif
++#ifdef UINT64_MAX
++  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
++#endif
++  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
++  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
++  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
++  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
++  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
++  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
++  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
++  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
++  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
++  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
++  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
++};
++         ]])],
++         [gl_cv_header_working_stdint_h=yes])])
++  fi
++  if test "$gl_cv_header_working_stdint_h" = yes; then
++    STDINT_H=
++  else
++    dnl Check for <sys/inttypes.h>, and for
++    dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
++    AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
++    if test $ac_cv_header_sys_inttypes_h = yes; then
++      HAVE_SYS_INTTYPES_H=1
++    else
++      HAVE_SYS_INTTYPES_H=0
++    fi
++    AC_SUBST([HAVE_SYS_INTTYPES_H])
++    if test $ac_cv_header_sys_bitypes_h = yes; then
++      HAVE_SYS_BITYPES_H=1
++    else
++      HAVE_SYS_BITYPES_H=0
++    fi
++    AC_SUBST([HAVE_SYS_BITYPES_H])
++
++    dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
++    dnl character support).
++    AC_CHECK_HEADERS_ONCE([wchar.h])
++
++    gl_STDINT_TYPE_PROPERTIES
++    STDINT_H=stdint.h
++  fi
++  AC_SUBST([STDINT_H])
++])
++
++dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
++dnl Determine the size of each of the given types in bits.
++AC_DEFUN([gl_STDINT_BITSIZEOF],
++[
++  dnl Use a shell loop, to avoid bloating configure, and
++  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
++  dnl   config.h.in,
++  dnl - extra AC_SUBST calls, so that the right substitutions are made.
++  m4_foreach_w([gltype], [$1],
++    [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
++       [Define to the number of bits in type ']gltype['.])])
++  for gltype in $1 ; do
++    AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
++      [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT],
++         [$2
++#include <limits.h>], [result=unknown])
++       eval gl_cv_bitsizeof_${gltype}=\$result
++      ])
++    eval result=\$gl_cv_bitsizeof_${gltype}
++    if test $result = unknown; then
++      dnl Use a nonempty default, because some compilers, such as IRIX 5 cc,
++      dnl do a syntax check even on unused #if conditions and give an error
++      dnl on valid C code like this:
++      dnl   #if 0
++      dnl   # if  > 32
++      dnl   # endif
++      dnl   #endif
++      result=0
++    fi
++    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
++    AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
++    eval BITSIZEOF_${GLTYPE}=\$result
++  done
++  m4_foreach_w([gltype], [$1],
++    [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
++])
++
++dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
++dnl Determine the signedness of each of the given types.
++dnl Define HAVE_SIGNED_TYPE if type is signed.
++AC_DEFUN([gl_CHECK_TYPES_SIGNED],
++[
++  dnl Use a shell loop, to avoid bloating configure, and
++  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
++  dnl   config.h.in,
++  dnl - extra AC_SUBST calls, so that the right substitutions are made.
++  m4_foreach_w([gltype], [$1],
++    [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
++       [Define to 1 if ']gltype[' is a signed integer type.])])
++  for gltype in $1 ; do
++    AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
++      [AC_COMPILE_IFELSE(
++         [AC_LANG_PROGRAM([$2[
++            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])],
++         result=yes, result=no)
++       eval gl_cv_type_${gltype}_signed=\$result
++      ])
++    eval result=\$gl_cv_type_${gltype}_signed
++    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
++    if test "$result" = yes; then
++      AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1])
++      eval HAVE_SIGNED_${GLTYPE}=1
++    else
++      eval HAVE_SIGNED_${GLTYPE}=0
++    fi
++  done
++  m4_foreach_w([gltype], [$1],
++    [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
++])
++
++dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
++dnl Determine the suffix to use for integer constants of the given types.
++dnl Define t_SUFFIX for each such type.
++AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
++[
++  dnl Use a shell loop, to avoid bloating configure, and
++  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
++  dnl   config.h.in,
++  dnl - extra AC_SUBST calls, so that the right substitutions are made.
++  m4_foreach_w([gltype], [$1],
++    [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
++       [Define to l, ll, u, ul, ull, etc., as suitable for
++        constants of type ']gltype['.])])
++  for gltype in $1 ; do
++    AC_CACHE_CHECK([for $gltype integer literal suffix],
++      [gl_cv_type_${gltype}_suffix],
++      [eval gl_cv_type_${gltype}_suffix=no
++       eval result=\$gl_cv_type_${gltype}_signed
++       if test "$result" = yes; then
++         glsufu=
++       else
++         glsufu=u
++       fi
++       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
++         case $glsuf in
++           '')  gltype1='int';;
++           l)	gltype1='long int';;
++           ll)	gltype1='long long int';;
++           i64)	gltype1='__int64';;
++           u)	gltype1='unsigned int';;
++           ul)	gltype1='unsigned long int';;
++           ull)	gltype1='unsigned long long int';;
++           ui64)gltype1='unsigned __int64';;
++         esac
++         AC_COMPILE_IFELSE(
++           [AC_LANG_PROGRAM([$2[
++              extern $gltype foo;
++              extern $gltype1 foo;]])],
++           [eval gl_cv_type_${gltype}_suffix=\$glsuf])
++         eval result=\$gl_cv_type_${gltype}_suffix
++         test "$result" != no && break
++       done])
++    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
++    eval result=\$gl_cv_type_${gltype}_suffix
++    test "$result" = no && result=
++    eval ${GLTYPE}_SUFFIX=\$result
++    AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
++  done
++  m4_foreach_w([gltype], [$1],
++    [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
++])
++
++dnl gl_STDINT_INCLUDES
++AC_DEFUN([gl_STDINT_INCLUDES],
++[[
++  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
++     included before <wchar.h>.  */
++  #include <stddef.h>
++  #include <signal.h>
++  #if HAVE_WCHAR_H
++  # include <stdio.h>
++  # include <time.h>
++  # include <wchar.h>
++  #endif
++]])
++
++dnl gl_STDINT_TYPE_PROPERTIES
++dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
++dnl of interest to stdint.in.h.
++AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
++[
++  AC_REQUIRE([gl_MULTIARCH])
++  if test $APPLE_UNIVERSAL_BUILD = 0; then
++    gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
++      [gl_STDINT_INCLUDES])
++  fi
++  gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
++    [gl_STDINT_INCLUDES])
++  gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
++    [gl_STDINT_INCLUDES])
++  gl_cv_type_ptrdiff_t_signed=yes
++  gl_cv_type_size_t_signed=no
++  if test $APPLE_UNIVERSAL_BUILD = 0; then
++    gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
++      [gl_STDINT_INCLUDES])
++  fi
++  gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
++    [gl_STDINT_INCLUDES])
++])
++
++dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
++dnl Remove this when we can assume autoconf >= 2.61.
++m4_ifdef([AC_COMPUTE_INT], [], [
++  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
++])
++
++# Hey Emacs!
++# Local Variables:
++# indent-tabs-mode: nil
++# End:
+diff --git a/gnulib/m4/stdlib_h.m4 b/gnulib/m4/stdlib_h.m4
+new file mode 100644
+index 0000000..582db13
+--- /dev/null
++++ b/gnulib/m4/stdlib_h.m4
+@@ -0,0 +1,62 @@
++# stdlib_h.m4 serial 13
++dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++AC_DEFUN([gl_STDLIB_H],
++[
++  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
++  gl_CHECK_NEXT_HEADERS([stdlib.h])
++  AC_CHECK_TYPES([struct random_data],
++    [], [HAVE_STRUCT_RANDOM_DATA=0],
++    [[#include <stdlib.h>]])
++])
++
++AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
++[
++  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
++  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
++  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
++])
++
++AC_DEFUN([gl_STDLIB_H_DEFAULTS],
++[
++  GNULIB_MALLOC_POSIX=0;  AC_SUBST([GNULIB_MALLOC_POSIX])
++  GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
++  GNULIB_CALLOC_POSIX=0;  AC_SUBST([GNULIB_CALLOC_POSIX])
++  GNULIB_ATOLL=0;         AC_SUBST([GNULIB_ATOLL])
++  GNULIB_GETLOADAVG=0;    AC_SUBST([GNULIB_GETLOADAVG])
++  GNULIB_GETSUBOPT=0;     AC_SUBST([GNULIB_GETSUBOPT])
++  GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
++  GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
++  GNULIB_PUTENV=0;        AC_SUBST([GNULIB_PUTENV])
++  GNULIB_RANDOM_R=0;      AC_SUBST([GNULIB_RANDOM_R])
++  GNULIB_RPMATCH=0;       AC_SUBST([GNULIB_RPMATCH])
++  GNULIB_SETENV=0;        AC_SUBST([GNULIB_SETENV])
++  GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
++  GNULIB_STRTOLL=0;       AC_SUBST([GNULIB_STRTOLL])
++  GNULIB_STRTOULL=0;      AC_SUBST([GNULIB_STRTOULL])
++  GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
++  dnl Assume proper GNU behavior unless another module says otherwise.
++  HAVE_ATOLL=1;              AC_SUBST([HAVE_ATOLL])
++  HAVE_CALLOC_POSIX=1;       AC_SUBST([HAVE_CALLOC_POSIX])
++  HAVE_GETSUBOPT=1;          AC_SUBST([HAVE_GETSUBOPT])
++  HAVE_MALLOC_POSIX=1;       AC_SUBST([HAVE_MALLOC_POSIX])
++  HAVE_MKDTEMP=1;            AC_SUBST([HAVE_MKDTEMP])
++  HAVE_REALLOC_POSIX=1;      AC_SUBST([HAVE_REALLOC_POSIX])
++  HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
++  HAVE_RPMATCH=1;            AC_SUBST([HAVE_RPMATCH])
++  HAVE_SETENV=1;             AC_SUBST([HAVE_SETENV])
++  HAVE_STRTOD=1;             AC_SUBST([HAVE_STRTOD])
++  HAVE_STRTOLL=1;            AC_SUBST([HAVE_STRTOLL])
++  HAVE_STRTOULL=1;           AC_SUBST([HAVE_STRTOULL])
++  HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
++  HAVE_SYS_LOADAVG_H=0;      AC_SUBST([HAVE_SYS_LOADAVG_H])
++  HAVE_UNSETENV=1;           AC_SUBST([HAVE_UNSETENV])
++  HAVE_DECL_GETLOADAVG=1;    AC_SUBST([HAVE_DECL_GETLOADAVG])
++  REPLACE_MKSTEMP=0;         AC_SUBST([REPLACE_MKSTEMP])
++  REPLACE_PUTENV=0;          AC_SUBST([REPLACE_PUTENV])
++  REPLACE_STRTOD=0;          AC_SUBST([REPLACE_STRTOD])
++  VOID_UNSETENV=0;           AC_SUBST([VOID_UNSETENV])
++])
+diff --git a/gnulib/m4/string_h.m4 b/gnulib/m4/string_h.m4
+new file mode 100644
+index 0000000..2d5553c
+--- /dev/null
++++ b/gnulib/m4/string_h.m4
+@@ -0,0 +1,92 @@

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list