Skip to content

Commit

Permalink
Merge from gnulib: lib/gnulib.mk, m4/*.m4.
Browse files Browse the repository at this point in the history
  • Loading branch information
eggert committed Jun 15, 2011
1 parent 96f00e5 commit a214b5f
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 129 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
2011-06-15 Paul Eggert <eggert@cs.ucla.edu>

* lib/ftoastr.c, lib/stdio.in.h, lib/verify.h: Merge from gnulib.
* lib/ftoastr.c, lib/stdio.in.h, lib/verify.h:
* lib/gnulib.mk, m4/c-strtod.m4, m4/filemode.m4, m4/getloadavg.m4:
* m4/getopt.m4, m4/gl-comp.m4, m4/lstat.m4, m4/md5.m4, m4/mktime.m4:
* m4/readlink.m4, m4/sha1.m4, m4/stat.m4, m4/strftime.m4:
* m4/strtoull.m4, m4/strtoumax.m4, m4/symlink.m4, m4/time_r.m4:
Merge from gnulib.

2011-06-14 Jan Djärv <jan.h.d@swipnet.se>

Expand Down
20 changes: 8 additions & 12 deletions lib/gnulib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,17 @@ EXTRA_DIST += careadlinkat.h

## begin gnulib module crypto/md5

libgnu_a_SOURCES += md5.c

EXTRA_DIST += md5.c md5.h

EXTRA_libgnu_a_SOURCES += md5.c
EXTRA_DIST += md5.h

## end gnulib module crypto/md5

## begin gnulib module crypto/sha1

libgnu_a_SOURCES += sha1.c

EXTRA_DIST += sha1.c sha1.h

EXTRA_libgnu_a_SOURCES += sha1.c
EXTRA_DIST += sha1.h

## end gnulib module crypto/sha1

Expand All @@ -124,10 +122,9 @@ EXTRA_libgnu_a_SOURCES += ftoastr.c

## begin gnulib module filemode

libgnu_a_SOURCES += filemode.c

EXTRA_DIST += filemode.c filemode.h

EXTRA_libgnu_a_SOURCES += filemode.c
EXTRA_DIST += filemode.h

## end gnulib module filemode

Expand Down Expand Up @@ -616,10 +613,9 @@ EXTRA_DIST += stdlib.in.h

## begin gnulib module strftime

libgnu_a_SOURCES += strftime.c

EXTRA_DIST += strftime.c strftime.h

EXTRA_libgnu_a_SOURCES += strftime.c
EXTRA_DIST += strftime.h

## end gnulib module strftime

Expand Down
10 changes: 3 additions & 7 deletions m4/c-strtod.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# c-strtod.m4 serial 12
# c-strtod.m4 serial 14

# Copyright (C) 2004-2006, 2009-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
Expand Down Expand Up @@ -33,23 +33,19 @@ AC_DEFUN([gl_C99_STRTOLD],
fi
])

dnl Prerequisites of lib/c-strtod.c.
AC_DEFUN([gl_C_STRTOD],
[
AC_LIBOBJ([c-strtod])
dnl Prerequisites of lib/c-strtod.c.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS([strtod_l])
AC_REQUIRE([AC_C_INLINE])
:
])

dnl Prerequisites of lib/c-strtold.c.
AC_DEFUN([gl_C_STRTOLD],
[
AC_LIBOBJ([c-strtold])
dnl Prerequisites of lib/c-strtold.c.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_C99_STRTOLD])
AC_CHECK_FUNCS([strtold_l])
Expand Down
3 changes: 1 addition & 2 deletions m4/filemode.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# filemode.m4 serial 7
# filemode.m4 serial 8
dnl Copyright (C) 2002, 2005-2006, 2009-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,
Expand All @@ -7,6 +7,5 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FILEMODE],
[
AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
AC_LIBOBJ([filemode])
AC_CHECK_DECLS_ONCE([strmode])
])
6 changes: 3 additions & 3 deletions m4/getloadavg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

#serial 3
#serial 4

# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
# New applications should use gl_GETLOADAVG instead.
Expand All @@ -24,6 +24,7 @@ gl_save_LIBS=$LIBS
# getloadvg is present in libc on glibc >= 2.2, MacOS X, FreeBSD >= 2.0,
# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
HAVE_GETLOADAVG=1
AC_CHECK_FUNC([getloadavg], [],
[gl_have_func=no
Expand Down Expand Up @@ -52,8 +53,7 @@ AC_CHECK_FUNC([getloadavg], [],
# Set up the replacement function if necessary.
if test $gl_have_func = no; then
AC_LIBOBJ([getloadavg])
gl_PREREQ_GETLOADAVG
HAVE_GETLOADAVG=0
fi])
if test "x$gl_save_LIBS" = x; then
Expand Down
39 changes: 20 additions & 19 deletions m4/getopt.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# getopt.m4 serial 34
# getopt.m4 serial 35
dnl Copyright (C) 2002-2006, 2008-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,
Expand All @@ -9,10 +9,25 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
[
m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
gl_GETOPT_IFELSE([
gl_REPLACE_GETOPT
],
[])
dnl Other modules can request the gnulib implementation of the getopt
dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
dnl argp.m4 does this.
m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
gl_GETOPT_IFELSE([], [])
REPLACE_GETOPT=1
], [
REPLACE_GETOPT=0
gl_GETOPT_IFELSE([
REPLACE_GETOPT=1
],
[])
])
if test $REPLACE_GETOPT = 1; then
dnl Arrange for getopt.h to be created.
gl_GETOPT_SUBSTITUTE_HEADER
dnl Arrange for unistd.h to include getopt.h.
GNULIB_UNISTD_H_GETOPT=1
fi
])

# Request a POSIX compliant getopt function with GNU extensions (such as
Expand All @@ -25,20 +40,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
])

# Request the gnulib implementation of the getopt functions unconditionally.
# argp.m4 uses this.
AC_DEFUN([gl_REPLACE_GETOPT],
[
dnl Arrange for getopt.h to be created.
gl_GETOPT_SUBSTITUTE_HEADER
dnl Arrange for unistd.h to include getopt.h.
GNULIB_UNISTD_H_GETOPT=1
dnl Arrange to compile the getopt implementation.
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_PREREQ_GETOPT
])

# emacs' configure.in uses this.
AC_DEFUN([gl_GETOPT_IFELSE],
[
Expand Down
47 changes: 46 additions & 1 deletion m4/gl-comp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,44 @@ gl_SHA1
AC_REQUIRE([gl_C99_STRTOLD])
gl_FILEMODE
gl_GETLOADAVG
if test $HAVE_GETLOADAVG = 0; then
AC_LIBOBJ([getloadavg])
gl_PREREQ_GETLOADAVG
fi
gl_STDLIB_MODULE_INDICATOR([getloadavg])
gl_FUNC_GETOPT_GNU
if test $REPLACE_GETOPT = 1; then
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_PREREQ_GETOPT
fi
gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
gl_FUNC_GETOPT_POSIX
if test $REPLACE_GETOPT = 1; then
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_PREREQ_GETOPT
fi
AC_REQUIRE([AC_C_INLINE])
gl_INTTYPES_INCOMPLETE
gl_FUNC_LSTAT
if test $REPLACE_LSTAT = 1; then
AC_LIBOBJ([lstat])
gl_PREREQ_LSTAT
fi
gl_SYS_STAT_MODULE_INDICATOR([lstat])
gl_FUNC_MKTIME
if test $REPLACE_MKTIME = 1; then
AC_LIBOBJ([mktime])
gl_PREREQ_MKTIME
fi
gl_TIME_MODULE_INDICATOR([mktime])
gl_MULTIARCH
gl_FUNC_READLINK
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
AC_LIBOBJ([readlink])
gl_PREREQ_READLINK
fi
gl_UNISTD_MODULE_INDICATOR([readlink])
gl_TYPE_SOCKLEN_T
gt_TYPE_SSIZE_T
Expand All @@ -120,13 +146,24 @@ gl_STDIO_H
gl_STDLIB_H
gl_FUNC_GNU_STRFTIME
gl_FUNC_STRTOUMAX
if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then
AC_LIBOBJ([strtoumax])
gl_PREREQ_STRTOUMAX
fi
gl_INTTYPES_MODULE_INDICATOR([strtoumax])
gl_FUNC_SYMLINK
if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
AC_LIBOBJ([symlink])
fi
gl_UNISTD_MODULE_INDICATOR([symlink])
gl_HEADER_SYS_STAT_H
AC_PROG_MKDIR_P
gl_HEADER_TIME_H
gl_TIME_R
if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
AC_LIBOBJ([time_r])
gl_PREREQ_TIME_R
fi
gl_TIME_MODULE_INDICATOR([time_r])
gl_UNISTD_H
gl_gnulib_enabled_dosname=false
Expand All @@ -152,6 +189,10 @@ AC_SUBST([LTLIBINTL])
{
if ! $gl_gnulib_enabled_stat; then
gl_FUNC_STAT
if test $REPLACE_STAT = 1; then
AC_LIBOBJ([stat])
gl_PREREQ_STAT
fi
gl_SYS_STAT_MODULE_INDICATOR([stat])
gl_gnulib_enabled_stat=true
if $condition; then
Expand All @@ -163,6 +204,10 @@ gl_SYS_STAT_MODULE_INDICATOR([stat])
{
if ! $gl_gnulib_enabled_strtoull; then
gl_FUNC_STRTOULL
if test $HAVE_STRTOULL = 0; then
AC_LIBOBJ([strtoull])
gl_PREREQ_STRTOULL
fi
gl_STDLIB_MODULE_INDICATOR([strtoull])
gl_gnulib_enabled_strtoull=true
fi
Expand All @@ -173,7 +218,7 @@ gl_STDLIB_MODULE_INDICATOR([strtoull])
gl_gnulib_enabled_verify=true
fi
}
if test $GNULIB_UNISTD_H_GETOPT = 1; then
if test $REPLACE_GETOPT = 1; then
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
fi
if test $REPLACE_LSTAT = 1; then
Expand Down
35 changes: 18 additions & 17 deletions m4/lstat.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# serial 21
# serial 22

# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
#
Expand All @@ -16,23 +16,27 @@ AC_DEFUN([gl_FUNC_LSTAT],
AC_CHECK_FUNCS_ONCE([lstat])
if test $ac_cv_func_lstat = yes; then
AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]).
if test $gl_cv_func_lstat_dereferences_slashed_symlink = no; then
REPLACE_LSTAT=1
fi
# Prerequisites of lib/lstat.c.
AC_REQUIRE([AC_C_INLINE])
else
HAVE_LSTAT=0
fi
])

# Redefine AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, because it is no longer
# maintained in Autoconf.
AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
# Prerequisites of lib/lstat.c.
AC_DEFUN([gl_PREREQ_LSTAT],
[
AC_REQUIRE([AC_C_INLINE])
:
])

AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
[
dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
[ac_cv_func_lstat_dereferences_slashed_symlink],
[gl_cv_func_lstat_dereferences_slashed_symlink],
[rm -f conftest.sym conftest.file
echo >conftest.file
if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
Expand All @@ -45,25 +49,22 @@ AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
have to compile and use the lstat wrapper. */
return lstat ("conftest.sym/", &sbuf) == 0;
]])],
[ac_cv_func_lstat_dereferences_slashed_symlink=yes],
[ac_cv_func_lstat_dereferences_slashed_symlink=no],
[gl_cv_func_lstat_dereferences_slashed_symlink=yes],
[gl_cv_func_lstat_dereferences_slashed_symlink=no],
[# When cross-compiling, be pessimistic so we will end up using the
# replacement version of lstat that checks for trailing slashes and
# calls lstat a second time when necessary.
ac_cv_func_lstat_dereferences_slashed_symlink=no
gl_cv_func_lstat_dereferences_slashed_symlink=no
])
else
# If the 'ln -s' command failed, then we probably don't even
# have an lstat function.
ac_cv_func_lstat_dereferences_slashed_symlink=no
gl_cv_func_lstat_dereferences_slashed_symlink=no
fi
rm -f conftest.sym conftest.file
])
test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
test $gl_cv_func_lstat_dereferences_slashed_symlink = yes &&
AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
[Define to 1 if `lstat' dereferences a symlink specified
with a trailing slash.])
if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
AC_LIBOBJ([lstat])
fi
])
4 changes: 1 addition & 3 deletions m4/md5.m4
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# md5.m4 serial 11
# md5.m4 serial 12
dnl Copyright (C) 2002-2006, 2008-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,
dnl with or without modifications, as long as this notice is preserved.

AC_DEFUN([gl_MD5],
[
AC_LIBOBJ([md5])
dnl Prerequisites of lib/md5.c.
AC_REQUIRE([gl_BIGENDIAN])
AC_REQUIRE([AC_C_INLINE])
Expand Down
Loading

0 comments on commit a214b5f

Please sign in to comment.