summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-05-03 23:11:49 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-05-03 23:11:49 -0700
commit19548d0861ced228dd0598240a410bf6a720b59e (patch)
tree9946821c8f9f86452e68e9a19677062d9c45dfd3
parent13c15c6d700e63469a20679651649bd523f9de02 (diff)
downloademacs-19548d0861ced228dd0598240a410bf6a720b59e.tar.gz
* Makefile.in (GNULIB_TOOL_FLAG): Add --conditional-dependencies.
This new gnulib-tool option saves 'configure' the trouble of checking for strtoull when strtoumax exists.
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.in3
-rw-r--r--lib/gnulib.mk10
-rw-r--r--lib/stdlib.in.h3
-rw-r--r--m4/gl-comp.m4186
-rw-r--r--m4/stdio_h.m44
6 files changed, 126 insertions, 86 deletions
diff --git a/ChangeLog b/ChangeLog
index 31e8c869e52..a9446476bc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * Makefile.in (GNULIB_TOOL_FLAG): Add --conditional-dependencies.
+ This new gnulib-tool option saves 'configure' the trouble of
+ checking for strtoull when strtoumax exists.
+
2011-04-29 Paul Eggert <eggert@cs.ucla.edu>
* configure.in (BITS_PER_LONG_LONG): New macro.
diff --git a/Makefile.in b/Makefile.in
index e5828b35199..180f7e5be16 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -335,7 +335,8 @@ GNULIB_MODULES = \
ignore-value intprops lstat mktime readlink \
socklen stdio strftime strtoumax symlink sys_stat
GNULIB_TOOL_FLAGS = \
- --import --no-changelog --no-vc-files --makefile-name=gnulib.mk
+ --conditional-dependencies --import --no-changelog --no-vc-files \
+ --makefile-name=gnulib.mk
sync-from-gnulib: $(gnulib_srcdir)
-cd $(srcdir)/m4 && cp $(DOS_gnulib_comp.m4) gnulib-comp.m4
cd $(srcdir) && \
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index f686137d38d..faf89aaa0e6 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -96,7 +96,9 @@ EXTRA_libgnu_a_SOURCES += md5.c
## begin gnulib module dosname
+if gl_GNULIB_ENABLED_dosname
+endif
EXTRA_DIST += dosname.h
## end gnulib module dosname
@@ -157,8 +159,10 @@ EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c
## begin gnulib module gettext-h
+if gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36
libgnu_a_SOURCES += gettext.h
+endif
## end gnulib module gettext-h
## begin gnulib module ignore-value
@@ -245,7 +249,9 @@ EXTRA_libgnu_a_SOURCES += readlink.c
## begin gnulib module stat
+if gl_GNULIB_ENABLED_stat
+endif
EXTRA_DIST += stat.c
EXTRA_libgnu_a_SOURCES += stat.c
@@ -576,7 +582,9 @@ EXTRA_libgnu_a_SOURCES += strftime.c
## begin gnulib module strtoull
+if gl_GNULIB_ENABLED_strtoull
+endif
EXTRA_DIST += strtol.c strtoul.c strtoull.c
EXTRA_libgnu_a_SOURCES += strtol.c strtoul.c strtoull.c
@@ -847,8 +855,10 @@ EXTRA_DIST += unistd.in.h
## begin gnulib module verify
+if gl_GNULIB_ENABLED_verify
libgnu_a_SOURCES += verify.h
+endif
## end gnulib module verify
## begin gnulib module warn-on-use
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index b9ada2cd1a8..7513553b672 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -81,8 +81,9 @@ struct random_data
# endif
#endif
-#if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
/* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
+/* On MacOS X 10.5, only <unistd.h> declares mkstemps. */
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
/* But avoid namespace pollution on glibc systems and native Windows. */
# include <unistd.h>
diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4
index 3b7bdfc5673..4338f2036b1 100644
--- a/m4/gl-comp.m4
+++ b/m4/gl-comp.m4
@@ -84,87 +84,110 @@ AC_DEFUN([gl_INIT],
m4_pushdef([gl_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='lib'
- # Code from module allocator:
- # Code from module arg-nonnull:
- # Code from module c++defs:
- # Code from module careadlinkat:
- AC_CHECK_FUNCS_ONCE([readlinkat])
- # Code from module crypto/md5:
- gl_MD5
- # Code from module dosname:
- # Code from module dtoastr:
- AC_REQUIRE([gl_C99_STRTOLD])
- # Code from module extensions:
- # Code from module filemode:
- gl_FILEMODE
- # Code from module getloadavg:
- gl_GETLOADAVG([$gl_source_base])
- gl_STDLIB_MODULE_INDICATOR([getloadavg])
- # Code from module getopt-gnu:
- gl_FUNC_GETOPT_GNU
- gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
- # Code from module getopt-posix:
- gl_FUNC_GETOPT_POSIX
- # Code from module gettext-h:
- AC_SUBST([LIBINTL])
- AC_SUBST([LTLIBINTL])
- # Code from module ignore-value:
- AC_REQUIRE([AC_C_INLINE])
- # Code from module include_next:
- # Code from module intprops:
- # Code from module inttypes-incomplete:
- gl_INTTYPES_INCOMPLETE
- # Code from module lstat:
- gl_FUNC_LSTAT
- gl_SYS_STAT_MODULE_INDICATOR([lstat])
- # Code from module mktime:
- gl_FUNC_MKTIME
- gl_TIME_MODULE_INDICATOR([mktime])
- # Code from module multiarch:
- gl_MULTIARCH
- # Code from module readlink:
- gl_FUNC_READLINK
- gl_UNISTD_MODULE_INDICATOR([readlink])
- # Code from module socklen:
- gl_TYPE_SOCKLEN_T
- # Code from module ssize_t:
- gt_TYPE_SSIZE_T
- # Code from module stat:
- gl_FUNC_STAT
- gl_SYS_STAT_MODULE_INDICATOR([stat])
- # Code from module stdbool:
- AM_STDBOOL_H
- # Code from module stddef:
- gl_STDDEF_H
- # Code from module stdint:
- gl_STDINT_H
- # Code from module stdio:
- gl_STDIO_H
- # Code from module stdlib:
- gl_STDLIB_H
- # Code from module strftime:
- gl_FUNC_GNU_STRFTIME
- # Code from module strtoull:
- gl_FUNC_STRTOULL
- gl_STDLIB_MODULE_INDICATOR([strtoull])
- # Code from module strtoumax:
- gl_FUNC_STRTOUMAX
- gl_INTTYPES_MODULE_INDICATOR([strtoumax])
- # Code from module symlink:
- gl_FUNC_SYMLINK
- gl_UNISTD_MODULE_INDICATOR([symlink])
- # Code from module sys_stat:
- gl_HEADER_SYS_STAT_H
- AC_PROG_MKDIR_P
- # Code from module time:
- gl_HEADER_TIME_H
- # Code from module time_r:
- gl_TIME_R
- gl_TIME_MODULE_INDICATOR([time_r])
- # Code from module unistd:
- gl_UNISTD_H
- # Code from module verify:
- # Code from module warn-on-use:
+AC_CHECK_FUNCS_ONCE([readlinkat])
+gl_MD5
+AC_REQUIRE([gl_C99_STRTOLD])
+gl_FILEMODE
+gl_GETLOADAVG([$gl_source_base])
+gl_STDLIB_MODULE_INDICATOR([getloadavg])
+gl_FUNC_GETOPT_GNU
+gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
+gl_FUNC_GETOPT_POSIX
+AC_REQUIRE([AC_C_INLINE])
+gl_INTTYPES_INCOMPLETE
+gl_FUNC_LSTAT
+gl_SYS_STAT_MODULE_INDICATOR([lstat])
+gl_FUNC_MKTIME
+gl_TIME_MODULE_INDICATOR([mktime])
+gl_MULTIARCH
+gl_FUNC_READLINK
+gl_UNISTD_MODULE_INDICATOR([readlink])
+gl_TYPE_SOCKLEN_T
+gt_TYPE_SSIZE_T
+AM_STDBOOL_H
+gl_STDDEF_H
+gl_STDINT_H
+gl_STDIO_H
+gl_STDLIB_H
+gl_FUNC_GNU_STRFTIME
+gl_FUNC_STRTOUMAX
+gl_INTTYPES_MODULE_INDICATOR([strtoumax])
+gl_FUNC_SYMLINK
+gl_UNISTD_MODULE_INDICATOR([symlink])
+gl_HEADER_SYS_STAT_H
+AC_PROG_MKDIR_P
+gl_HEADER_TIME_H
+gl_TIME_R
+gl_TIME_MODULE_INDICATOR([time_r])
+gl_UNISTD_H
+ gl_gnulib_enabled_dosname=false
+ gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
+ gl_gnulib_enabled_stat=false
+ gl_gnulib_enabled_strtoull=false
+ gl_gnulib_enabled_verify=false
+ func_gl_gnulib_m4code_dosname ()
+ {
+ if ! $gl_gnulib_enabled_dosname; then
+ gl_gnulib_enabled_dosname=true
+ fi
+ }
+ func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 ()
+ {
+ if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then
+AC_SUBST([LIBINTL])
+AC_SUBST([LTLIBINTL])
+ gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
+ fi
+ }
+ func_gl_gnulib_m4code_stat ()
+ {
+ if ! $gl_gnulib_enabled_stat; then
+gl_FUNC_STAT
+gl_SYS_STAT_MODULE_INDICATOR([stat])
+ gl_gnulib_enabled_stat=true
+ if $condition; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ fi
+ }
+ func_gl_gnulib_m4code_strtoull ()
+ {
+ if ! $gl_gnulib_enabled_strtoull; then
+gl_FUNC_STRTOULL
+gl_STDLIB_MODULE_INDICATOR([strtoull])
+ gl_gnulib_enabled_strtoull=true
+ fi
+ }
+ func_gl_gnulib_m4code_verify ()
+ {
+ if ! $gl_gnulib_enabled_verify; then
+ gl_gnulib_enabled_verify=true
+ fi
+ }
+ if test $GNULIB_UNISTD_H_GETOPT = 1; then
+ func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
+ fi
+ if test $REPLACE_LSTAT = 1; then
+ func_gl_gnulib_m4code_dosname
+ fi
+ if test $REPLACE_LSTAT = 1; then
+ func_gl_gnulib_m4code_stat
+ fi
+ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
+ func_gl_gnulib_m4code_stat
+ fi
+ if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then
+ func_gl_gnulib_m4code_verify
+ fi
+ if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes; then
+ func_gl_gnulib_m4code_strtoull
+ fi
+ m4_pattern_allow([^gl_GNULIB_ENABLED_])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoull], [$gl_gnulib_enabled_strtoull])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_verify], [$gl_gnulib_enabled_verify])
# End of code from modules
m4_ifval(gl_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
@@ -211,6 +234,7 @@ changequote([, ])dnl
AC_SUBST([gltests_WITNESS])
gl_module_indicator_condition=$gltests_WITNESS
m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+ m4_pattern_allow([^gl_GNULIB_ENABLED_])
m4_popdef([gl_MODULE_INDICATOR_CONDITION])
m4_ifval(gltests_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 8b013c2f352..a8326f3c349 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 36
+# stdio_h.m4 serial 37
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -14,8 +14,6 @@ AC_DEFUN([gl_STDIO_H],
dnl <stdio.h> likely needs them.
GNULIB_FSCANF=1
GNULIB_SCANF=1
- GNULIB_VFSCANF=1
- GNULIB_VSCANF=1
GNULIB_FGETC=1
GNULIB_GETC=1
GNULIB_GETCHAR=1