summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-11-26 12:58:05 -0700
committerEric Blake <ebb9@byu.net>2009-11-26 14:41:20 -0700
commit7873c5c3cd64575aec4b69de326aa683309d4ba4 (patch)
tree000fa3264b7c9222b67b305d58c7ea41b79a50c6
parentf6e75bf0240fbf2b4e7f5dfc7d70de546241bbdd (diff)
downloadm4-7873c5c3cd64575aec4b69de326aa683309d4ba4.tar.gz
Update to newer gnulib.
* gnulib: Update. * ltdl/m4/gnulib-cache.m4: Import inttypes, setenv, and unsetenv modules. * modules/m4.c (m4_make_temp): Adjust gen_tempname client. * bootstrap (src_modules): Pick up getopt-gnu and its dependencies. * configure.ac (gl_VERSION_ETC): Support ./configure --with-packager. (AC_CHECK_FUNCS_ONCE): Rely on gnulib for setenv, unsetenv. * ltdl/m4/m4-getopt.m4: Rewrite to match current gnulib. * Makefile.am (src/getopt.h): Likewise. * modules/stdlib.c (setenv, unsetenv): Rely on gnulib. Signed-off-by: Eric Blake <ebb9@byu.net>
-rw-r--r--ChangeLog16
-rw-r--r--Makefile.am19
-rwxr-xr-xbootstrap13
-rw-r--r--configure.ac3
m---------gnulib0
-rw-r--r--ltdl/m4/gnulib-cache.m45
-rw-r--r--ltdl/m4/m4-getopt.m453
-rw-r--r--modules/m4.c2
-rw-r--r--modules/stdlib.c22
9 files changed, 57 insertions, 76 deletions
diff --git a/ChangeLog b/ChangeLog
index 21b662cd..d59f51aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2009-11-26 Eric Blake <ebb9@byu.net>
+
+ Update to newer gnulib.
+ * gnulib: Update.
+ * ltdl/m4/gnulib-cache.m4: Import inttypes, setenv, and unsetenv
+ modules.
+ * modules/m4.c (m4_make_temp): Adjust gen_tempname client.
+ * bootstrap (src_modules): Pick up getopt-gnu and its
+ dependencies.
+ * configure.ac (gl_VERSION_ETC): Support ./configure
+ --with-packager.
+ (AC_CHECK_FUNCS_ONCE): Rely on gnulib for setenv, unsetenv.
+ * ltdl/m4/m4-getopt.m4: Rewrite to match current gnulib.
+ * Makefile.am (src/getopt.h): Likewise.
+ * modules/stdlib.c (setenv, unsetenv): Rely on gnulib.
+
2009-08-24 Eric Blake <ebb9@byu.net>
Pick up gnulib fixes for sub-process execution.
diff --git a/Makefile.am b/Makefile.am
index 6e207a98..fdaab47a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -101,17 +101,26 @@ src_m4_DEPENDENCIES = $(PREOPEN_DEPENDENCIES) m4/libm4.la
## --- PASTED MANUALLY FROM GNULIB --- ##
## To avoid adding unnecessary objects to libm4.la these gnulib ##
## modules are not imported by gnulib-tool, but added manually. ##
-## (from: gnulib-tool --extract-automake-snippet getopt version-etc) ##
+## (from: gnulib-tool --extract-automake-snippet getopt-posix) ##
## ##
+if GETOPT
BUILT_SOURCES += src/$(GETOPT_H)
-EXTRA_DIST += src/getopt.in.h src/getopt_int.h
+endif
+EXTRA_DIST += src/getopt.c src/getopt1.c src/getopt.in.h src/getopt_int.h
# We need the following in order to create an <getopt.h> when the
# system doesn't have one that works with the given compiler.
-all-local: src/$(GETOPT_H)
src/getopt.h: src/getopt.in.h
- cp $(srcdir)/src/getopt.in.h $@-t
- mv $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+ < $(srcdir)/src/getopt.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
MOSTLYCLEANFILES += src/getopt.h src/getopt.h-t
## ##
## --- END OF PASTED GNULIB --- ##
diff --git a/bootstrap b/bootstrap
index c243ba34..ee53aa7a 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
-# bootstrap (GNU M4) version 2009-06-15
+# bootstrap (GNU M4) version 2009-11-25
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software
# Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
@@ -69,7 +69,13 @@ bailout_cb=:
# List dependencies here too; we don't extract them, otherwise dependent
# modules could end up being imported to src/ *and* gnu/!
-src_modules='getopt version-etc-fsf version-etc xstrtol'
+src_modules='
+getopt-gnu
+getopt-posix
+version-etc-fsf
+version-etc
+xstrtol
+'
dirname="s,/[^/]*$,,"
basename="s,^.*/,,g"
@@ -380,7 +386,8 @@ $CONFIG_SHELL gnulib/gnulib-tool --update \
func_echo "fetching modules for src directory"
-for file in `$CONFIG_SHELL gnulib/gnulib-tool --extract-filelist $src_modules`
+for file in `$CONFIG_SHELL gnulib/gnulib-tool --extract-filelist $src_modules \
+ | sort -u`
do
dest=`echo $file | $SED "$basename"`
diff --git a/configure.ac b/configure.ac
index d5f186bf..32eb9da3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,6 +157,8 @@ M4_GNU_GETTEXT
## --------------- ##
M4_INIT
+gl_VERSION_ETC
+
# Gnulib doesn't always do things quite the way M4 would like...
M4_ERROR
M4_GETOPT
@@ -207,7 +209,6 @@ M4_SYS_STACKOVF
AC_STRUCT_TM
AC_FUNC_STRFTIME
AC_CHECK_FUNCS_ONCE([getcwd gethostname mktime uname])
-AC_CHECK_FUNCS_ONCE([setenv unsetenv putenv clearenv])
## ------------------ ##
diff --git a/gnulib b/gnulib
-Subproject 2d8b95d62cc4d6524fa6c4dbc3138d88a583915
+Subproject dfd793fab03429ee3510958eee1ed33de282fbc
diff --git a/ltdl/m4/gnulib-cache.m4 b/ltdl/m4/gnulib-cache.m4
index ec907ec4..3ea93ba9 100644
--- a/ltdl/m4/gnulib-cache.m4
+++ b/ltdl/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=local --lib=libgnu --source-base=gnu --m4-base=ltdl/m4 --doc-base=doc --tests-base=tests/gnu --aux-dir=build-aux --with-tests --libtool --macro-prefix=M4 assert autobuild avltree-oset binary-io bitrotate clean-temp cloexec close-stream closein config-h configmake dirname error execute exit fdl-1.3 fflush filenamecat flexmember fopen fopen-safer freadptr freadseek fseeko gendocs gettext git-version-gen gnumakefile gnupload gpl-3.0 intprops memchr2 memcmp2 memmem mkstemp obstack obstack-printf-posix pipe progname propername quote regex regexprops-generic rename snprintf-posix sprintf-posix stdbool stdlib-safer strnlen strtod strtol tempname unlocked-io vasnprintf-posix verify verror wait-process xalloc xalloc-die xmemdup0 xprintf-posix xstrndup xvasprintf-posix
+# gnulib-tool --import --dir=. --local-dir=local --lib=libgnu --source-base=gnu --m4-base=ltdl/m4 --doc-base=doc --tests-base=tests/gnu --aux-dir=build-aux --with-tests --libtool --macro-prefix=M4 assert autobuild avltree-oset binary-io bitrotate clean-temp cloexec close-stream closein config-h configmake dirname error execute exit fdl-1.3 fflush filenamecat flexmember fopen fopen-safer freadptr freadseek fseeko gendocs gettext git-version-gen gnumakefile gnupload gpl-3.0 intprops inttypes memchr2 memcmp2 memmem mkstemp obstack obstack-printf-posix pipe progname propername quote regex regexprops-generic rename setenv snprintf-posix sprintf-posix stdbool stdlib-safer strnlen strtod strtol tempname unlocked-io unsetenv vasnprintf-posix verify verror wait-process xalloc xalloc-die xmemdup0 xprintf-posix xstrndup xvasprintf-posix
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([local])
@@ -51,6 +51,7 @@ gl_MODULES([
gnupload
gpl-3.0
intprops
+ inttypes
memchr2
memcmp2
memmem
@@ -64,6 +65,7 @@ gl_MODULES([
regex
regexprops-generic
rename
+ setenv
snprintf-posix
sprintf-posix
stdbool
@@ -73,6 +75,7 @@ gl_MODULES([
strtol
tempname
unlocked-io
+ unsetenv
vasnprintf-posix
verify
verror
diff --git a/ltdl/m4/m4-getopt.m4 b/ltdl/m4/m4-getopt.m4
index a58764ec..9c606ddc 100644
--- a/ltdl/m4/m4-getopt.m4
+++ b/ltdl/m4/m4-getopt.m4
@@ -2,7 +2,7 @@
# m4-getopt.m4 -- Use the installed version of getopt.h if available.
# Written by Gary V. Vaughan <gary@gnu.org>
#
-# Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc
+# Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc
#
# This file is part of GNU M4.
#
@@ -19,53 +19,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# serial 2
+# serial 3
# M4_GETOPT
# ---------
# Use the installed version of getopt.h if available.
AC_DEFUN([M4_GETOPT],
-[GETOPT_H=
-AC_SUBST([GETOPT_H])
-
-AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h], [AC_INCLUDES_DEFAULT])
-
-if test -z "$GETOPT_H"; then
- AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
-fi
-
-dnl BSD getopt_log uses an incompatible method to reset option processing,
-dnl and (as of 2004-10-15) mishandles optional option-arguments.
-if test -z "$GETOPT_H"; then
- AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
-fi
-
-if test -z "$GETOPT_H"; then
- AC_CACHE_CHECK([for working gnu getopt function], [gl_cv_func_gnu_getopt],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([#include <getopt.h>],
- [[
- char *myargv[3];
- myargv[0] = "conftest";
- myargv[1] = "-+";
- myargv[2] = 0;
- return getopt (2, myargv, "+a") != '?';
- ]])],
- [gl_cv_func_gnu_getopt=yes],
- [gl_cv_func_gnu_getopt=no],
- [dnl cross compiling - pessimistically gues based on decls
- dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
- dnl option string (as of 2005-05-05).
- AC_CHECK_DECL([getopt_clip],
- [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
- [#include <getopt.h>])])])
- test X"$gl_cv_func_gnu_getopt" = Xno && GETOPT_H=getopt.h
-fi
-
-if test -n "$GETOPT_H"; then
- AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
- [Define to rpl_ if the getopt replacement function should be used.])
-fi
-
-AM_CONDITIONAL([GETOPT], [test -n "$GETOPT_H"])
+[
+ m4_divert_text([INIT_PREPARE], [M4_replace_getopt=])
+ m4_pushdef([AC_LIBOBJ], [M4_replace_getopt=:])
+ AC_REQUIRE([gl_FUNC_GETOPT_GNU])
+ m4_popdef([AC_LIBOBJ])
+ AM_CONDITIONAL([GETOPT], [test -n "$M4_replace_getopt"])
])# M4_GETOPT
diff --git a/modules/m4.c b/modules/m4.c
index 0597fe74..fa75c498 100644
--- a/modules/m4.c
+++ b/modules/m4.c
@@ -742,7 +742,7 @@ m4_make_temp (m4 *context, m4_obstack *obs, const m4_call_info *caller,
/* Make the temporary object. */
errno = 0;
- fd = gen_tempname (name, dir ? GT_DIR : GT_FILE);
+ fd = gen_tempname (name, 0, 0, dir ? GT_DIR : GT_FILE);
if (fd < 0)
{
/* This use of _() will need to change if xgettext ever changes
diff --git a/modules/stdlib.c b/modules/stdlib.c
index 3fce71f8..65df4480 100644
--- a/modules/stdlib.c
+++ b/modules/stdlib.c
@@ -112,24 +112,8 @@ M4BUILTIN_HANDLER (setenv)
&overwrite))
return;
-#if HAVE_SETENV
+ /* TODO - error checking. */
setenv (M4ARG (1), M4ARG (2), overwrite);
-#else
-#if HAVE_PUTENV
- if (!overwrite && getenv (M4ARG (1)) != NULL)
- return;
-
- assert (obstack_object_size (obs) == 0);
- obstack_grow (obs, M4ARG (1), M4ARGLEN (1));
- obstack_1grow (obs, '=');
- obstack_grow0 (obs, M4ARG (2), M4ARGLEN (2));
-
- {
- char *env = (char *) obstack_finish (obs);
- putenv (env);
- }
-#endif /* HAVE_PUTENV */
-#endif /* HAVE_SETENV */
}
/**
@@ -137,10 +121,8 @@ M4BUILTIN_HANDLER (setenv)
**/
M4BUILTIN_HANDLER (unsetenv)
{
-
-#if HAVE_UNSETENV
+ /* TODO - error checking. */
unsetenv (M4ARG (1));
-#endif /* HAVE_UNSETENV */
}
/**