gnulib: upgrade and install the mkstemp module.
gnulib 9e117ae955a5c6a0406140e62b76c3ef50e3bc2b. * lib/fcntl.in.h, lib/gettimeofday.c, lib/lstat.c, lib/mkstemp.c, lib/pathmax.h, lib/stat.c, lib/sys_stat.in.h, lib/sys_time.in.h, lib/tempname.c, lib/tempname.h, lib/time.in.h, lib/xsize.c, m4/extern-inline.m4, m4/fcntl-o.m4, m4/fcntl_h.m4, m4/gettimeofday.m4, m4/largefile.m4, m4/lstat.m4, m4/mkstemp.m4, m4/pathmax.m4, m4/stat.m4, m4/sys_stat_h.m4, m4/sys_time_h.m4, m4/tempname.m4, m4/time_h.m4: New files. * lib/xsize.h, m4/gnulib-cache.m4, m4/gnulib-comp.m4, m4/xsize.m4, lib/Makefile.am: Upgrade.
This commit is contained in:
parent
8ecf2ab1fd
commit
f38405002a
30 changed files with 3855 additions and 10 deletions
57
m4/extern-inline.m4
Normal file
57
m4/extern-inline.m4
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
dnl 'extern inline' a la ISO C99.
|
||||
|
||||
dnl Copyright 2012 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_EXTERN_INLINE],
|
||||
[
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AH_VERBATIM([extern_inline],
|
||||
[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
|
||||
_GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
|
||||
_GL_INLINE_HEADER_BEGIN contains useful stuff to put
|
||||
in an include file, before uses of _GL_INLINE.
|
||||
It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
|
||||
when FOO is an inline function in the header; see
|
||||
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
|
||||
_GL_INLINE_HEADER_END contains useful stuff to put
|
||||
in the same include file, after uses of _GL_INLINE. */
|
||||
#if (__GNUC__ \
|
||||
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
|
||||
: 199901L <= __STDC_VERSION__)
|
||||
# define _GL_INLINE inline
|
||||
# define _GL_EXTERN_INLINE extern inline
|
||||
#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
|
||||
# if __GNUC_GNU_INLINE__
|
||||
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
|
||||
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
|
||||
# else
|
||||
# define _GL_INLINE extern inline
|
||||
# endif
|
||||
# define _GL_EXTERN_INLINE extern
|
||||
#else
|
||||
# define _GL_INLINE static inline
|
||||
# define _GL_EXTERN_INLINE static inline
|
||||
#endif
|
||||
|
||||
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
|
||||
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
|
||||
# define _GL_INLINE_HEADER_CONST_PRAGMA
|
||||
# else
|
||||
# define _GL_INLINE_HEADER_CONST_PRAGMA \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
|
||||
# endif
|
||||
# define _GL_INLINE_HEADER_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
|
||||
_GL_INLINE_HEADER_CONST_PRAGMA
|
||||
# define _GL_INLINE_HEADER_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
# define _GL_INLINE_HEADER_BEGIN
|
||||
# define _GL_INLINE_HEADER_END
|
||||
#endif])
|
||||
])
|
||||
134
m4/fcntl-o.m4
Normal file
134
m4/fcntl-o.m4
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
# fcntl-o.m4 serial 4
|
||||
dnl Copyright (C) 2006, 2009-2012 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 Written by Paul Eggert.
|
||||
|
||||
# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
|
||||
# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
|
||||
# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
|
||||
AC_DEFUN([gl_FCNTL_O_FLAGS],
|
||||
[
|
||||
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
|
||||
dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
|
||||
dnl AC_GNU_SOURCE.
|
||||
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
|
||||
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
|
||||
[AC_REQUIRE([AC_GNU_SOURCE])])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([unistd.h])
|
||||
AC_CHECK_FUNCS_ONCE([symlink])
|
||||
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#else /* on Windows with MSVC */
|
||||
# include <io.h>
|
||||
# include <stdlib.h>
|
||||
# defined sleep(n) _sleep ((n) * 1000)
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#ifndef O_NOATIME
|
||||
#define O_NOATIME 0
|
||||
#endif
|
||||
#ifndef O_NOFOLLOW
|
||||
#define O_NOFOLLOW 0
|
||||
#endif
|
||||
static int const constants[] =
|
||||
{
|
||||
O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
|
||||
O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
|
||||
};
|
||||
]],
|
||||
[[
|
||||
int result = !constants;
|
||||
#if HAVE_SYMLINK
|
||||
{
|
||||
static char const sym[] = "conftest.sym";
|
||||
if (symlink ("/dev/null", sym) != 0)
|
||||
result |= 2;
|
||||
else
|
||||
{
|
||||
int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
|
||||
if (fd >= 0)
|
||||
{
|
||||
close (fd);
|
||||
result |= 4;
|
||||
}
|
||||
}
|
||||
if (unlink (sym) != 0 || symlink (".", sym) != 0)
|
||||
result |= 2;
|
||||
else
|
||||
{
|
||||
int fd = open (sym, O_RDONLY | O_NOFOLLOW);
|
||||
if (fd >= 0)
|
||||
{
|
||||
close (fd);
|
||||
result |= 4;
|
||||
}
|
||||
}
|
||||
unlink (sym);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
static char const file[] = "confdefs.h";
|
||||
int fd = open (file, O_RDONLY | O_NOATIME);
|
||||
if (fd < 0)
|
||||
result |= 8;
|
||||
else
|
||||
{
|
||||
struct stat st0;
|
||||
if (fstat (fd, &st0) != 0)
|
||||
result |= 16;
|
||||
else
|
||||
{
|
||||
char c;
|
||||
sleep (1);
|
||||
if (read (fd, &c, 1) != 1)
|
||||
result |= 24;
|
||||
else
|
||||
{
|
||||
if (close (fd) != 0)
|
||||
result |= 32;
|
||||
else
|
||||
{
|
||||
struct stat st1;
|
||||
if (stat (file, &st1) != 0)
|
||||
result |= 40;
|
||||
else
|
||||
if (st0.st_atime != st1.st_atime)
|
||||
result |= 64;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;]])],
|
||||
[gl_cv_header_working_fcntl_h=yes],
|
||||
[case $? in #(
|
||||
4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
|
||||
64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
|
||||
68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
|
||||
*) gl_cv_header_working_fcntl_h='no';;
|
||||
esac],
|
||||
[gl_cv_header_working_fcntl_h=cross-compiling])])
|
||||
|
||||
case $gl_cv_header_working_fcntl_h in #(
|
||||
*O_NOATIME* | no | cross-compiling) ac_val=0;; #(
|
||||
*) ac_val=1;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
|
||||
[Define to 1 if O_NOATIME works.])
|
||||
|
||||
case $gl_cv_header_working_fcntl_h in #(
|
||||
*O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
|
||||
*) ac_val=1;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
|
||||
[Define to 1 if O_NOFOLLOW works.])
|
||||
])
|
||||
50
m4/fcntl_h.m4
Normal file
50
m4/fcntl_h.m4
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# serial 15
|
||||
# Configure fcntl.h.
|
||||
dnl Copyright (C) 2006-2007, 2009-2012 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 Written by Paul Eggert.
|
||||
|
||||
AC_DEFUN([gl_FCNTL_H],
|
||||
[
|
||||
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
|
||||
AC_REQUIRE([gl_FCNTL_O_FLAGS])
|
||||
gl_NEXT_HEADERS([fcntl.h])
|
||||
|
||||
dnl Ensure the type pid_t gets defined.
|
||||
AC_REQUIRE([AC_TYPE_PID_T])
|
||||
|
||||
dnl Ensure the type mode_t gets defined.
|
||||
AC_REQUIRE([AC_TYPE_MODE_T])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use, if it is not common
|
||||
dnl enough to be declared everywhere.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
|
||||
]], [fcntl openat])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FCNTL_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
|
||||
GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING])
|
||||
GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
|
||||
GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
|
||||
HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
|
||||
REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
|
||||
REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
|
||||
REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
|
||||
])
|
||||
140
m4/gettimeofday.m4
Normal file
140
m4/gettimeofday.m4
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
# serial 20
|
||||
|
||||
# Copyright (C) 2001-2003, 2005, 2007, 2009-2012 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.
|
||||
|
||||
dnl From Jim Meyering.
|
||||
|
||||
AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
|
||||
[
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
AC_REQUIRE([gl_HEADER_SYS_TIME_H])
|
||||
AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS_ONCE([gettimeofday])
|
||||
|
||||
gl_gettimeofday_timezone=void
|
||||
if test $ac_cv_func_gettimeofday != yes; then
|
||||
HAVE_GETTIMEOFDAY=0
|
||||
else
|
||||
gl_FUNC_GETTIMEOFDAY_CLOBBER
|
||||
AC_CACHE_CHECK([for gettimeofday with POSIX signature],
|
||||
[gl_cv_func_gettimeofday_posix_signature],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/time.h>
|
||||
struct timeval c;
|
||||
int gettimeofday (struct timeval *restrict, void *restrict);
|
||||
]],
|
||||
[[/* glibc uses struct timezone * rather than the POSIX void *
|
||||
if _GNU_SOURCE is defined. However, since the only portable
|
||||
use of gettimeofday uses NULL as the second parameter, and
|
||||
since the glibc definition is actually more typesafe, it is
|
||||
not worth wrapping this to get a compliant signature. */
|
||||
int (*f) (struct timeval *restrict, void *restrict)
|
||||
= gettimeofday;
|
||||
int x = f (&c, 0);
|
||||
return !(x | c.tv_sec | c.tv_usec);
|
||||
]])],
|
||||
[gl_cv_func_gettimeofday_posix_signature=yes],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/time.h>
|
||||
int gettimeofday (struct timeval *restrict, struct timezone *restrict);
|
||||
]])],
|
||||
[gl_cv_func_gettimeofday_posix_signature=almost],
|
||||
[gl_cv_func_gettimeofday_posix_signature=no])])])
|
||||
if test $gl_cv_func_gettimeofday_posix_signature = almost; then
|
||||
gl_gettimeofday_timezone='struct timezone'
|
||||
elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
|
||||
REPLACE_GETTIMEOFDAY=1
|
||||
fi
|
||||
dnl If we override 'struct timeval', we also have to override gettimeofday.
|
||||
if test $REPLACE_STRUCT_TIMEVAL = 1; then
|
||||
REPLACE_GETTIMEOFDAY=1
|
||||
fi
|
||||
m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
|
||||
gl_FUNC_TZSET_CLOBBER
|
||||
case "$gl_cv_func_tzset_clobber" in
|
||||
*yes)
|
||||
REPLACE_GETTIMEOFDAY=1
|
||||
gl_GETTIMEOFDAY_REPLACE_LOCALTIME
|
||||
AC_DEFINE([tzset], [rpl_tzset],
|
||||
[Define to rpl_tzset if the wrapper function should be used.])
|
||||
AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
|
||||
[Define if tzset clobbers localtime's static buffer.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
|
||||
[Define this to 'void' or 'struct timezone' to match the system's
|
||||
declaration of the second argument to gettimeofday.])
|
||||
])
|
||||
|
||||
|
||||
dnl See if gettimeofday clobbers the static buffer that localtime uses
|
||||
dnl for its return value. The gettimeofday function from Mac OS X 10.0.4
|
||||
dnl (i.e., Darwin 1.3.7) has this problem.
|
||||
dnl
|
||||
dnl If it does, then arrange to use gettimeofday and localtime only via
|
||||
dnl the wrapper functions that work around the problem.
|
||||
|
||||
AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
|
||||
[
|
||||
AC_REQUIRE([gl_HEADER_SYS_TIME_H])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
|
||||
AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
|
||||
[gl_cv_func_gettimeofday_clobber],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
]],
|
||||
[[
|
||||
time_t t = 0;
|
||||
struct tm *lt;
|
||||
struct tm saved_lt;
|
||||
struct timeval tv;
|
||||
lt = localtime (&t);
|
||||
saved_lt = *lt;
|
||||
gettimeofday (&tv, NULL);
|
||||
return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
|
||||
]])],
|
||||
[gl_cv_func_gettimeofday_clobber=no],
|
||||
[gl_cv_func_gettimeofday_clobber=yes],
|
||||
[# When cross-compiling:
|
||||
case "$host_os" in
|
||||
# Guess all is fine on glibc systems.
|
||||
*-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
|
||||
esac
|
||||
])])
|
||||
|
||||
case "$gl_cv_func_gettimeofday_clobber" in
|
||||
*yes)
|
||||
REPLACE_GETTIMEOFDAY=1
|
||||
gl_GETTIMEOFDAY_REPLACE_LOCALTIME
|
||||
AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
|
||||
[Define if gettimeofday clobbers the localtime buffer.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
|
||||
AC_DEFINE([gmtime], [rpl_gmtime],
|
||||
[Define to rpl_gmtime if the replacement function should be used.])
|
||||
AC_DEFINE([localtime], [rpl_localtime],
|
||||
[Define to rpl_localtime if the replacement function should be used.])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/gettimeofday.c.
|
||||
AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
|
||||
AC_CHECK_HEADERS([sys/timeb.h])
|
||||
AC_CHECK_FUNCS([_ftime])
|
||||
])
|
||||
|
|
@ -27,13 +27,16 @@
|
|||
|
||||
|
||||
# Specification in the form of a command-line invocation:
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=tools --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error progname
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=tools --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files --no-libtool --no-vc-files argp error mkstemp progname
|
||||
|
||||
# Specification in the form of a few gnulib-tool.m4 macro invocations:
|
||||
gl_LOCAL_DIR([])
|
||||
gl_MODULES([
|
||||
--no-libtool
|
||||
--no-vc-files
|
||||
argp
|
||||
error
|
||||
mkstemp
|
||||
progname
|
||||
])
|
||||
gl_AVOID([])
|
||||
|
|
|
|||
|
|
@ -48,20 +48,28 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module error:
|
||||
# Code from module extensions:
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
# Code from module extern-inline:
|
||||
# Code from module fcntl-h:
|
||||
# Code from module float:
|
||||
# Code from module getopt-gnu:
|
||||
# Code from module getopt-posix:
|
||||
# Code from module gettext-h:
|
||||
# Code from module gettimeofday:
|
||||
# Code from module include_next:
|
||||
# Code from module intprops:
|
||||
# Code from module largefile:
|
||||
AC_REQUIRE([AC_SYS_LARGEFILE])
|
||||
# Code from module lstat:
|
||||
# Code from module malloc-gnu:
|
||||
# Code from module malloc-posix:
|
||||
# Code from module memchr:
|
||||
# Code from module mempcpy:
|
||||
# Code from module mkstemp:
|
||||
# Code from module msvc-inval:
|
||||
# Code from module msvc-nothrow:
|
||||
# Code from module multiarch:
|
||||
# Code from module nocrash:
|
||||
# Code from module pathmax:
|
||||
# Code from module progname:
|
||||
# Code from module rawmemchr:
|
||||
# Code from module size_max:
|
||||
|
|
@ -71,6 +79,7 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module snippet/c++defs:
|
||||
# Code from module snippet/warn-on-use:
|
||||
# Code from module ssize_t:
|
||||
# Code from module stat:
|
||||
# Code from module stdalign:
|
||||
# Code from module stdbool:
|
||||
# Code from module stddef:
|
||||
|
|
@ -85,8 +94,12 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module strings:
|
||||
# Code from module strndup:
|
||||
# Code from module strnlen:
|
||||
# Code from module sys_stat:
|
||||
# Code from module sys_time:
|
||||
# Code from module sys_types:
|
||||
# Code from module sysexits:
|
||||
# Code from module tempname:
|
||||
# Code from module time:
|
||||
# Code from module unistd:
|
||||
# Code from module vasnprintf:
|
||||
# Code from module verify:
|
||||
|
|
@ -127,6 +140,8 @@ AC_DEFUN([gl_INIT],
|
|||
m4_ifdef([AM_XGETTEXT_OPTION],
|
||||
[AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
|
||||
AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
|
||||
AC_REQUIRE([gl_EXTERN_INLINE])
|
||||
gl_FCNTL_H
|
||||
gl_FLOAT_H
|
||||
if test $REPLACE_FLOAT_LDBL = 1; then
|
||||
AC_LIBOBJ([float])
|
||||
|
|
@ -155,6 +170,19 @@ AC_DEFUN([gl_INIT],
|
|||
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
|
||||
AC_SUBST([LIBINTL])
|
||||
AC_SUBST([LTLIBINTL])
|
||||
gl_FUNC_GETTIMEOFDAY
|
||||
if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
|
||||
AC_LIBOBJ([gettimeofday])
|
||||
gl_PREREQ_GETTIMEOFDAY
|
||||
fi
|
||||
gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
|
||||
AC_REQUIRE([gl_LARGEFILE])
|
||||
gl_FUNC_LSTAT
|
||||
if test $REPLACE_LSTAT = 1; then
|
||||
AC_LIBOBJ([lstat])
|
||||
gl_PREREQ_LSTAT
|
||||
fi
|
||||
gl_SYS_STAT_MODULE_INDICATOR([lstat])
|
||||
gl_FUNC_MALLOC_GNU
|
||||
if test $REPLACE_MALLOC = 1; then
|
||||
AC_LIBOBJ([malloc])
|
||||
|
|
@ -177,6 +205,12 @@ AC_DEFUN([gl_INIT],
|
|||
gl_PREREQ_MEMPCPY
|
||||
fi
|
||||
gl_STRING_MODULE_INDICATOR([mempcpy])
|
||||
gl_FUNC_MKSTEMP
|
||||
if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
|
||||
AC_LIBOBJ([mkstemp])
|
||||
gl_PREREQ_MKSTEMP
|
||||
fi
|
||||
gl_STDLIB_MODULE_INDICATOR([mkstemp])
|
||||
gl_MSVC_INVAL
|
||||
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
|
||||
AC_LIBOBJ([msvc-inval])
|
||||
|
|
@ -186,6 +220,7 @@ AC_DEFUN([gl_INIT],
|
|||
AC_LIBOBJ([msvc-nothrow])
|
||||
fi
|
||||
gl_MULTIARCH
|
||||
gl_PATHMAX
|
||||
AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
|
||||
AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
|
||||
gl_FUNC_RAWMEMCHR
|
||||
|
|
@ -201,6 +236,12 @@ AC_DEFUN([gl_INIT],
|
|||
fi
|
||||
gl_UNISTD_MODULE_INDICATOR([sleep])
|
||||
gt_TYPE_SSIZE_T
|
||||
gl_FUNC_STAT
|
||||
if test $REPLACE_STAT = 1; then
|
||||
AC_LIBOBJ([stat])
|
||||
gl_PREREQ_STAT
|
||||
fi
|
||||
gl_SYS_STAT_MODULE_INDICATOR([stat])
|
||||
gl_STDALIGN_H
|
||||
AM_STDBOOL_H
|
||||
gl_STDDEF_H
|
||||
|
|
@ -247,9 +288,15 @@ AC_DEFUN([gl_INIT],
|
|||
gl_PREREQ_STRNLEN
|
||||
fi
|
||||
gl_STRING_MODULE_INDICATOR([strnlen])
|
||||
gl_HEADER_SYS_STAT_H
|
||||
AC_PROG_MKDIR_P
|
||||
gl_HEADER_SYS_TIME_H
|
||||
AC_PROG_MKDIR_P
|
||||
gl_SYS_TYPES_H
|
||||
AC_PROG_MKDIR_P
|
||||
gl_SYSEXITS
|
||||
gl_FUNC_GEN_TEMPNAME
|
||||
gl_HEADER_TIME_H
|
||||
gl_UNISTD_H
|
||||
gl_FUNC_VASNPRINTF
|
||||
gl_FUNC_VSNPRINTF
|
||||
|
|
@ -423,6 +470,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/errno.in.h
|
||||
lib/error.c
|
||||
lib/error.h
|
||||
lib/fcntl.in.h
|
||||
lib/float+.h
|
||||
lib/float.c
|
||||
lib/float.in.h
|
||||
|
|
@ -431,16 +479,20 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/getopt1.c
|
||||
lib/getopt_int.h
|
||||
lib/gettext.h
|
||||
lib/gettimeofday.c
|
||||
lib/intprops.h
|
||||
lib/itold.c
|
||||
lib/lstat.c
|
||||
lib/malloc.c
|
||||
lib/memchr.c
|
||||
lib/memchr.valgrind
|
||||
lib/mempcpy.c
|
||||
lib/mkstemp.c
|
||||
lib/msvc-inval.c
|
||||
lib/msvc-inval.h
|
||||
lib/msvc-nothrow.c
|
||||
lib/msvc-nothrow.h
|
||||
lib/pathmax.h
|
||||
lib/printf-args.c
|
||||
lib/printf-args.h
|
||||
lib/printf-parse.c
|
||||
|
|
@ -451,6 +503,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/rawmemchr.valgrind
|
||||
lib/size_max.h
|
||||
lib/sleep.c
|
||||
lib/stat.c
|
||||
lib/stdalign.in.h
|
||||
lib/stdbool.in.h
|
||||
lib/stddef.in.h
|
||||
|
|
@ -469,14 +522,20 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/strncasecmp.c
|
||||
lib/strndup.c
|
||||
lib/strnlen.c
|
||||
lib/sys_stat.in.h
|
||||
lib/sys_time.in.h
|
||||
lib/sys_types.in.h
|
||||
lib/sysexits.in.h
|
||||
lib/tempname.c
|
||||
lib/tempname.h
|
||||
lib/time.in.h
|
||||
lib/unistd.in.h
|
||||
lib/vasnprintf.c
|
||||
lib/vasnprintf.h
|
||||
lib/verify.h
|
||||
lib/vsnprintf.c
|
||||
lib/wchar.in.h
|
||||
lib/xsize.c
|
||||
lib/xsize.h
|
||||
m4/00gnulib.m4
|
||||
m4/alloca.m4
|
||||
|
|
@ -487,28 +546,37 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/error.m4
|
||||
m4/exponentd.m4
|
||||
m4/extensions.m4
|
||||
m4/extern-inline.m4
|
||||
m4/fcntl-o.m4
|
||||
m4/fcntl_h.m4
|
||||
m4/float_h.m4
|
||||
m4/getopt.m4
|
||||
m4/gettimeofday.m4
|
||||
m4/gnulib-common.m4
|
||||
m4/include_next.m4
|
||||
m4/intmax_t.m4
|
||||
m4/inttypes_h.m4
|
||||
m4/largefile.m4
|
||||
m4/longlong.m4
|
||||
m4/lstat.m4
|
||||
m4/malloc.m4
|
||||
m4/math_h.m4
|
||||
m4/memchr.m4
|
||||
m4/mempcpy.m4
|
||||
m4/mkstemp.m4
|
||||
m4/mmap-anon.m4
|
||||
m4/msvc-inval.m4
|
||||
m4/msvc-nothrow.m4
|
||||
m4/multiarch.m4
|
||||
m4/nocrash.m4
|
||||
m4/off_t.m4
|
||||
m4/pathmax.m4
|
||||
m4/printf.m4
|
||||
m4/rawmemchr.m4
|
||||
m4/size_max.m4
|
||||
m4/sleep.m4
|
||||
m4/ssize_t.m4
|
||||
m4/stat.m4
|
||||
m4/stdalign.m4
|
||||
m4/stdbool.m4
|
||||
m4/stddef_h.m4
|
||||
|
|
@ -524,8 +592,12 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/strndup.m4
|
||||
m4/strnlen.m4
|
||||
m4/sys_socket_h.m4
|
||||
m4/sys_stat_h.m4
|
||||
m4/sys_time_h.m4
|
||||
m4/sys_types_h.m4
|
||||
m4/sysexits.m4
|
||||
m4/tempname.m4
|
||||
m4/time_h.m4
|
||||
m4/unistd_h.m4
|
||||
m4/vasnprintf.m4
|
||||
m4/vsnprintf.m4
|
||||
|
|
|
|||
149
m4/largefile.m4
Normal file
149
m4/largefile.m4
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
# Enable large files on systems where this is not the default.
|
||||
|
||||
# Copyright 1992-1996, 1998-2012 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.
|
||||
|
||||
# The following implementation works around a problem in autoconf <= 2.68;
|
||||
# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5.
|
||||
m4_version_prereq([2.69], [] ,[
|
||||
|
||||
# _AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||
# -------------------------------
|
||||
m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
|
||||
[@%:@include <sys/types.h>
|
||||
/* Check that off_t can represent 2**63 - 1 correctly.
|
||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1]];[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
|
||||
# CACHE-VAR,
|
||||
# DESCRIPTION,
|
||||
# PROLOGUE, [FUNCTION-BODY])
|
||||
# --------------------------------------------------------
|
||||
m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
|
||||
[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
|
||||
[while :; do
|
||||
m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
|
||||
[AC_LANG_PROGRAM([$5], [$6])],
|
||||
[$3=no; break])
|
||||
m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
|
||||
[AC_LANG_PROGRAM([@%:@define $1 $2
|
||||
$5], [$6])],
|
||||
[$3=$2; break])
|
||||
$3=unknown
|
||||
break
|
||||
done])
|
||||
case $$3 in #(
|
||||
no | unknown) ;;
|
||||
*) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
|
||||
esac
|
||||
rm -rf conftest*[]dnl
|
||||
])# _AC_SYS_LARGEFILE_MACRO_VALUE
|
||||
|
||||
|
||||
# AC_SYS_LARGEFILE
|
||||
# ----------------
|
||||
# By default, many hosts won't let programs access large files;
|
||||
# one must use special compiler options to get large-file access to work.
|
||||
# For more details about this brain damage please see:
|
||||
# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
|
||||
AC_DEFUN([AC_SYS_LARGEFILE],
|
||||
[AC_ARG_ENABLE(largefile,
|
||||
[ --disable-largefile omit support for large files])
|
||||
if test "$enable_largefile" != no; then
|
||||
|
||||
AC_CACHE_CHECK([for special C compiler options needed for large files],
|
||||
ac_cv_sys_largefile_CC,
|
||||
[ac_cv_sys_largefile_CC=no
|
||||
if test "$GCC" != yes; then
|
||||
ac_save_CC=$CC
|
||||
while :; do
|
||||
# IRIX 6.2 and later do not support large files by default,
|
||||
# so use the C compiler's -n32 option if that helps.
|
||||
AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
|
||||
AC_COMPILE_IFELSE([], [break])
|
||||
CC="$CC -n32"
|
||||
AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
|
||||
break
|
||||
done
|
||||
CC=$ac_save_CC
|
||||
rm -f conftest.$ac_ext
|
||||
fi])
|
||||
if test "$ac_cv_sys_largefile_CC" != no; then
|
||||
CC=$CC$ac_cv_sys_largefile_CC
|
||||
fi
|
||||
|
||||
_AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
|
||||
ac_cv_sys_file_offset_bits,
|
||||
[Number of bits in a file offset, on hosts where this is settable.],
|
||||
[_AC_SYS_LARGEFILE_TEST_INCLUDES])
|
||||
if test $ac_cv_sys_file_offset_bits = unknown; then
|
||||
_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
|
||||
ac_cv_sys_large_files,
|
||||
[Define for large files, on AIX-style hosts.],
|
||||
[_AC_SYS_LARGEFILE_TEST_INCLUDES])
|
||||
fi
|
||||
|
||||
AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
|
||||
[/* Enable large inode numbers on Mac OS X. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif])
|
||||
fi
|
||||
])# AC_SYS_LARGEFILE
|
||||
|
||||
])# m4_version_prereq 2.69
|
||||
|
||||
# Enable large files on systems where this is implemented by Gnulib, not by the
|
||||
# system headers.
|
||||
# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib
|
||||
# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively.
|
||||
AC_DEFUN([gl_LARGEFILE],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
dnl Native Windows.
|
||||
dnl mingw64 defines off_t to a 64-bit type already, if
|
||||
dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
|
||||
AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>
|
||||
int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
|
||||
]],
|
||||
[[]])],
|
||||
[gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no])
|
||||
])
|
||||
if test $gl_cv_type_off_t_64 = no; then
|
||||
WINDOWS_64_BIT_OFF_T=1
|
||||
else
|
||||
WINDOWS_64_BIT_OFF_T=0
|
||||
fi
|
||||
dnl But all native Windows platforms (including mingw64) have a 32-bit
|
||||
dnl st_size member in 'struct stat'.
|
||||
WINDOWS_64_BIT_ST_SIZE=1
|
||||
;;
|
||||
*)
|
||||
dnl Nothing to do on gnulib's side.
|
||||
dnl A 64-bit off_t is
|
||||
dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX,
|
||||
dnl OSF/1, Cygwin,
|
||||
dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
|
||||
dnl glibc, HP-UX, Solaris,
|
||||
dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX,
|
||||
dnl - impossible to achieve on Minix 3.1.8.
|
||||
WINDOWS_64_BIT_OFF_T=0
|
||||
WINDOWS_64_BIT_ST_SIZE=0
|
||||
;;
|
||||
esac
|
||||
])
|
||||
77
m4/lstat.m4
Normal file
77
m4/lstat.m4
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
# serial 25
|
||||
|
||||
# Copyright (C) 1997-2001, 2003-2012 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.
|
||||
|
||||
dnl From Jim Meyering.
|
||||
|
||||
AC_DEFUN([gl_FUNC_LSTAT],
|
||||
[
|
||||
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
|
||||
dnl If lstat does not exist, the replacement <sys/stat.h> does
|
||||
dnl "#define lstat stat", and lstat.c is a no-op.
|
||||
AC_CHECK_FUNCS_ONCE([lstat])
|
||||
if test $ac_cv_func_lstat = yes; then
|
||||
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
|
||||
case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
|
||||
*no)
|
||||
REPLACE_LSTAT=1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
HAVE_LSTAT=0
|
||||
fi
|
||||
])
|
||||
|
||||
# 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],
|
||||
[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
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[AC_INCLUDES_DEFAULT],
|
||||
[[struct stat sbuf;
|
||||
/* Linux will dereference the symlink and fail, as required by
|
||||
POSIX. That is better in the sense that it means we will not
|
||||
have to compile and use the lstat wrapper. */
|
||||
return lstat ("conftest.sym/", &sbuf) == 0;
|
||||
]])],
|
||||
[gl_cv_func_lstat_dereferences_slashed_symlink=yes],
|
||||
[gl_cv_func_lstat_dereferences_slashed_symlink=no],
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
|
||||
esac
|
||||
])
|
||||
else
|
||||
# If the 'ln -s' command failed, then we probably don't even
|
||||
# have an lstat function.
|
||||
gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
|
||||
fi
|
||||
rm -f conftest.sym conftest.file
|
||||
])
|
||||
case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
|
||||
*yes)
|
||||
AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
|
||||
[Define to 1 if 'lstat' dereferences a symlink specified
|
||||
with a trailing slash.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
82
m4/mkstemp.m4
Normal file
82
m4/mkstemp.m4
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
#serial 23
|
||||
|
||||
# Copyright (C) 2001, 2003-2007, 2009-2012 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.
|
||||
|
||||
# On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
|
||||
# silly limit that it can create no more than 26 files from a given template.
|
||||
# Other systems lack mkstemp altogether.
|
||||
# On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create
|
||||
# only 32 files per process.
|
||||
# On some hosts, mkstemp creates files with mode 0666, which is a security
|
||||
# problem and a violation of POSIX 2008.
|
||||
# On systems like the above, arrange to use the replacement function.
|
||||
AC_DEFUN([gl_FUNC_MKSTEMP],
|
||||
[
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
|
||||
AC_CHECK_FUNCS_ONCE([mkstemp])
|
||||
if test $ac_cv_func_mkstemp = yes; then
|
||||
AC_CACHE_CHECK([for working mkstemp],
|
||||
[gl_cv_func_working_mkstemp],
|
||||
[
|
||||
mkdir conftest.mkstemp
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[AC_INCLUDES_DEFAULT],
|
||||
[[int result = 0;
|
||||
int i;
|
||||
off_t large = (off_t) 4294967295u;
|
||||
if (large < 0)
|
||||
large = 2147483647;
|
||||
umask (0);
|
||||
for (i = 0; i < 70; i++)
|
||||
{
|
||||
char templ[] = "conftest.mkstemp/coXXXXXX";
|
||||
int (*mkstemp_function) (char *) = mkstemp;
|
||||
int fd = mkstemp_function (templ);
|
||||
if (fd < 0)
|
||||
result |= 1;
|
||||
else
|
||||
{
|
||||
struct stat st;
|
||||
if (lseek (fd, large, SEEK_SET) != large)
|
||||
result |= 2;
|
||||
if (fstat (fd, &st) < 0)
|
||||
result |= 4;
|
||||
else if (st.st_mode & 0077)
|
||||
result |= 8;
|
||||
if (close (fd))
|
||||
result |= 16;
|
||||
}
|
||||
}
|
||||
return result;]])],
|
||||
[gl_cv_func_working_mkstemp=yes],
|
||||
[gl_cv_func_working_mkstemp=no],
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_working_mkstemp="guessing no" ;;
|
||||
esac
|
||||
])
|
||||
rm -rf conftest.mkstemp
|
||||
])
|
||||
case "$gl_cv_func_working_mkstemp" in
|
||||
*yes) ;;
|
||||
*)
|
||||
REPLACE_MKSTEMP=1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
HAVE_MKSTEMP=0
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/mkstemp.c.
|
||||
AC_DEFUN([gl_PREREQ_MKSTEMP],
|
||||
[
|
||||
])
|
||||
42
m4/pathmax.m4
Normal file
42
m4/pathmax.m4
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# pathmax.m4 serial 10
|
||||
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation,
|
||||
dnl 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_PATHMAX],
|
||||
[
|
||||
dnl Prerequisites of lib/pathmax.h.
|
||||
AC_CHECK_HEADERS_ONCE([sys/param.h])
|
||||
])
|
||||
|
||||
# Expands to a piece of C program that defines PATH_MAX in the same way as
|
||||
# "pathmax.h" will do.
|
||||
AC_DEFUN([gl_PATHMAX_SNIPPET], [[
|
||||
/* Arrange to define PATH_MAX, like "pathmax.h" does. */
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#if !defined PATH_MAX && defined MAXPATHLEN
|
||||
# define PATH_MAX MAXPATHLEN
|
||||
#endif
|
||||
#ifdef __hpux
|
||||
# undef PATH_MAX
|
||||
# define PATH_MAX 1024
|
||||
#endif
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
# undef PATH_MAX
|
||||
# define PATH_MAX 260
|
||||
#endif
|
||||
]])
|
||||
|
||||
# Prerequisites of gl_PATHMAX_SNIPPET.
|
||||
AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
|
||||
[
|
||||
AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
|
||||
])
|
||||
75
m4/stat.m4
Normal file
75
m4/stat.m4
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# serial 10
|
||||
|
||||
# Copyright (C) 2009-2012 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.
|
||||
|
||||
AC_DEFUN([gl_FUNC_STAT],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS_ONCE([lstat])
|
||||
dnl mingw is the only known platform where stat(".") and stat("./") differ
|
||||
AC_CACHE_CHECK([whether stat handles trailing slashes on directories],
|
||||
[gl_cv_func_stat_dir_slash],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/stat.h>
|
||||
]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])],
|
||||
[gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no],
|
||||
[case $host_os in
|
||||
mingw*) gl_cv_func_stat_dir_slash="guessing no";;
|
||||
*) gl_cv_func_stat_dir_slash="guessing yes";;
|
||||
esac])])
|
||||
dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
|
||||
dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
|
||||
dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
|
||||
AC_CACHE_CHECK([whether stat handles trailing slashes on files],
|
||||
[gl_cv_func_stat_file_slash],
|
||||
[touch conftest.tmp
|
||||
# Assume that if we have lstat, we can also check symlinks.
|
||||
if test $ac_cv_func_lstat = yes; then
|
||||
ln -s conftest.tmp conftest.lnk
|
||||
fi
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/stat.h>
|
||||
]], [[int result = 0;
|
||||
struct stat st;
|
||||
if (!stat ("conftest.tmp/", &st))
|
||||
result |= 1;
|
||||
#if HAVE_LSTAT
|
||||
if (!stat ("conftest.lnk/", &st))
|
||||
result |= 2;
|
||||
#endif
|
||||
return result;
|
||||
]])],
|
||||
[gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_stat_file_slash="guessing no" ;;
|
||||
esac
|
||||
])
|
||||
rm -f conftest.tmp conftest.lnk])
|
||||
case $gl_cv_func_stat_dir_slash in
|
||||
*no) REPLACE_STAT=1
|
||||
AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs
|
||||
help when passed a directory name with a trailing slash]);;
|
||||
esac
|
||||
case $gl_cv_func_stat_file_slash in
|
||||
*no) REPLACE_STAT=1
|
||||
AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
|
||||
help when passed a file name with a trailing slash]);;
|
||||
esac
|
||||
])
|
||||
|
||||
# Prerequisites of lib/stat.c.
|
||||
AC_DEFUN([gl_PREREQ_STAT],
|
||||
[
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
:
|
||||
])
|
||||
96
m4/sys_stat_h.m4
Normal file
96
m4/sys_stat_h.m4
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
# sys_stat_h.m4 serial 28 -*- Autoconf -*-
|
||||
dnl Copyright (C) 2006-2012 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 Eric Blake.
|
||||
dnl Provide a GNU-like <sys/stat.h>.
|
||||
|
||||
AC_DEFUN([gl_HEADER_SYS_STAT_H],
|
||||
[
|
||||
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
|
||||
|
||||
dnl Check for broken stat macros.
|
||||
AC_REQUIRE([AC_HEADER_STAT])
|
||||
|
||||
gl_CHECK_NEXT_HEADERS([sys/stat.h])
|
||||
|
||||
dnl Ensure the type mode_t gets defined.
|
||||
AC_REQUIRE([AC_TYPE_MODE_T])
|
||||
|
||||
dnl Whether to override 'struct stat'.
|
||||
m4_ifdef([gl_LARGEFILE], [
|
||||
AC_REQUIRE([gl_LARGEFILE])
|
||||
], [
|
||||
WINDOWS_64_BIT_ST_SIZE=0
|
||||
])
|
||||
AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
|
||||
if test $WINDOWS_64_BIT_ST_SIZE = 1; then
|
||||
AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1],
|
||||
[Define to 1 if Gnulib overrides 'struct stat' on Windows so that
|
||||
struct stat.st_size becomes 64-bit.])
|
||||
fi
|
||||
|
||||
dnl Define types that are supposed to be defined in <sys/types.h> or
|
||||
dnl <sys/stat.h>.
|
||||
AC_CHECK_TYPE([nlink_t], [],
|
||||
[AC_DEFINE([nlink_t], [int],
|
||||
[Define to the type of st_nlink in struct stat, or a supertype.])],
|
||||
[#include <sys/types.h>
|
||||
#include <sys/stat.h>])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
|
||||
]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
|
||||
mknod mknodat stat utimensat])
|
||||
]) # gl_HEADER_SYS_STAT_H
|
||||
|
||||
AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
|
||||
[
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
|
||||
GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT])
|
||||
GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT])
|
||||
GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT])
|
||||
GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS])
|
||||
GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
|
||||
GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT])
|
||||
GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT])
|
||||
GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO])
|
||||
GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT])
|
||||
GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD])
|
||||
GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT])
|
||||
GNULIB_STAT=0; AC_SUBST([GNULIB_STAT])
|
||||
GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT])
|
||||
HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT])
|
||||
HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS])
|
||||
HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD])
|
||||
HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT])
|
||||
HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT])
|
||||
HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO])
|
||||
HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT])
|
||||
HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD])
|
||||
HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
|
||||
HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT])
|
||||
REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
|
||||
REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
|
||||
REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS])
|
||||
REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT])
|
||||
REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
|
||||
REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO])
|
||||
REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD])
|
||||
REPLACE_STAT=0; AC_SUBST([REPLACE_STAT])
|
||||
REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT])
|
||||
])
|
||||
110
m4/sys_time_h.m4
Normal file
110
m4/sys_time_h.m4
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
# Configure a replacement for <sys/time.h>.
|
||||
# serial 8
|
||||
|
||||
# Copyright (C) 2007, 2009-2012 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.
|
||||
|
||||
# Written by Paul Eggert and Martin Lambers.
|
||||
|
||||
AC_DEFUN([gl_HEADER_SYS_TIME_H],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement
|
||||
dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1
|
||||
dnl statements that occur in other macros.
|
||||
AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
|
||||
[
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
|
||||
AC_CHECK_HEADERS_ONCE([sys/time.h])
|
||||
gl_CHECK_NEXT_HEADERS([sys/time.h])
|
||||
|
||||
if test $ac_cv_header_sys_time_h != yes; then
|
||||
HAVE_SYS_TIME_H=0
|
||||
fi
|
||||
|
||||
dnl On native Windows with MSVC, 'struct timeval' is defined in <winsock2.h>
|
||||
dnl only. So include that header in the list.
|
||||
gl_PREREQ_SYS_H_WINSOCK2
|
||||
AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#if HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
#if HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
]],
|
||||
[[static struct timeval x; x.tv_sec = x.tv_usec;]])],
|
||||
[gl_cv_sys_struct_timeval=yes],
|
||||
[gl_cv_sys_struct_timeval=no])
|
||||
])
|
||||
if test $gl_cv_sys_struct_timeval != yes; then
|
||||
HAVE_STRUCT_TIMEVAL=0
|
||||
else
|
||||
dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined
|
||||
dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only
|
||||
dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is
|
||||
dnl smaller than the 'time_t' type mandated by POSIX.
|
||||
dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but
|
||||
dnl that is good enough.
|
||||
AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member],
|
||||
[gl_cv_sys_struct_timeval_tv_sec],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#if HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
#if HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
]],
|
||||
[[static struct timeval x;
|
||||
typedef int verify_tv_sec_type[
|
||||
sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
|
||||
];
|
||||
]])],
|
||||
[gl_cv_sys_struct_timeval_tv_sec=yes],
|
||||
[gl_cv_sys_struct_timeval_tv_sec=no])
|
||||
])
|
||||
if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
|
||||
REPLACE_STRUCT_TIMEVAL=1
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use.
|
||||
gl_WARN_ON_USE_PREPARE([[
|
||||
#if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
]], [gettimeofday])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY])
|
||||
dnl Assume POSIX behavior unless another module says otherwise.
|
||||
HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY])
|
||||
HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL])
|
||||
HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H])
|
||||
REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY])
|
||||
REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL])
|
||||
])
|
||||
19
m4/tempname.m4
Normal file
19
m4/tempname.m4
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#serial 5
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2012 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.
|
||||
|
||||
# glibc provides __gen_tempname as a wrapper for mk[ds]temp. Expose
|
||||
# it as a public API, and provide it on systems that are lacking.
|
||||
AC_DEFUN([gl_FUNC_GEN_TEMPNAME],
|
||||
[
|
||||
gl_PREREQ_TEMPNAME
|
||||
])
|
||||
|
||||
# Prerequisites of lib/tempname.c.
|
||||
AC_DEFUN([gl_PREREQ_TEMPNAME],
|
||||
[
|
||||
:
|
||||
])
|
||||
109
m4/time_h.m4
Normal file
109
m4/time_h.m4
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
# Configure a more-standard replacement for <time.h>.
|
||||
|
||||
# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
|
||||
|
||||
# serial 7
|
||||
|
||||
# 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.
|
||||
|
||||
# Written by Paul Eggert and Jim Meyering.
|
||||
|
||||
AC_DEFUN([gl_HEADER_TIME_H],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default behavior below is expanded
|
||||
dnl once only, before all statements that occur in other macros.
|
||||
AC_REQUIRE([gl_HEADER_TIME_H_BODY])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_HEADER_TIME_H_BODY],
|
||||
[
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
|
||||
gl_NEXT_HEADERS([time.h])
|
||||
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
|
||||
])
|
||||
|
||||
dnl Check whether 'struct timespec' is declared
|
||||
dnl in time.h, sys/time.h, or pthread.h.
|
||||
|
||||
AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
|
||||
[
|
||||
AC_CHECK_HEADERS_ONCE([sys/time.h])
|
||||
AC_CACHE_CHECK([for struct timespec in <time.h>],
|
||||
[gl_cv_sys_struct_timespec_in_time_h],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <time.h>
|
||||
]],
|
||||
[[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
|
||||
[gl_cv_sys_struct_timespec_in_time_h=yes],
|
||||
[gl_cv_sys_struct_timespec_in_time_h=no])])
|
||||
|
||||
TIME_H_DEFINES_STRUCT_TIMESPEC=0
|
||||
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
|
||||
PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
|
||||
if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
|
||||
TIME_H_DEFINES_STRUCT_TIMESPEC=1
|
||||
else
|
||||
AC_CACHE_CHECK([for struct timespec in <sys/time.h>],
|
||||
[gl_cv_sys_struct_timespec_in_sys_time_h],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/time.h>
|
||||
]],
|
||||
[[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
|
||||
[gl_cv_sys_struct_timespec_in_sys_time_h=yes],
|
||||
[gl_cv_sys_struct_timespec_in_sys_time_h=no])])
|
||||
if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
|
||||
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
|
||||
else
|
||||
AC_CACHE_CHECK([for struct timespec in <pthread.h>],
|
||||
[gl_cv_sys_struct_timespec_in_pthread_h],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <pthread.h>
|
||||
]],
|
||||
[[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
|
||||
[gl_cv_sys_struct_timespec_in_pthread_h=yes],
|
||||
[gl_cv_sys_struct_timespec_in_pthread_h=no])])
|
||||
if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
|
||||
PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
|
||||
AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
|
||||
AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_TIME_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME])
|
||||
GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP])
|
||||
GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME])
|
||||
GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM])
|
||||
GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R])
|
||||
HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP])
|
||||
HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME])
|
||||
HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM])
|
||||
dnl If another module says to replace or to not replace, do that.
|
||||
dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
|
||||
dnl this lets maintainers check for portability.
|
||||
REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
|
||||
REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
|
||||
REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
|
||||
REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
|
||||
])
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# xsize.m4 serial 4
|
||||
# xsize.m4 serial 5
|
||||
dnl Copyright (C) 2003-2004, 2008-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
|
@ -8,6 +8,5 @@ AC_DEFUN([gl_XSIZE],
|
|||
[
|
||||
dnl Prerequisites of lib/xsize.h.
|
||||
AC_REQUIRE([gl_SIZE_MAX])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_CHECK_HEADERS([stdint.h])
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue