Imported Upstream version 1.4.12
This commit is contained in:
parent
1d1585cd09
commit
4ab9f0d24c
291 changed files with 27277 additions and 11364 deletions
|
@ -1,44 +0,0 @@
|
|||
# absolute-header.m4 serial 6
|
||||
dnl Copyright (C) 2006 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 Derek Price.
|
||||
|
||||
# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
|
||||
# ---------------------------------------
|
||||
# Find the absolute name of a header file, assuming the header exists.
|
||||
# If the header were sys/inttypes.h, this macro would define
|
||||
# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h
|
||||
# in config.h
|
||||
# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
|
||||
# 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.
|
||||
AC_DEFUN([gl_ABSOLUTE_HEADER],
|
||||
[AC_LANG_PREPROC_REQUIRE()dnl
|
||||
AC_FOREACH([gl_HEADER_NAME], [$1],
|
||||
[AS_VAR_PUSHDEF([gl_absolute_header],
|
||||
[gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
|
||||
AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
|
||||
m4_quote(m4_defn([gl_absolute_header])),
|
||||
[AS_VAR_PUSHDEF([ac_header_exists],
|
||||
[ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
|
||||
AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
|
||||
if test AS_VAR_GET(ac_header_exists) = yes; then
|
||||
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
|
||||
dnl eval is necessary to expand ac_cpp.
|
||||
dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
|
||||
AS_VAR_SET(gl_absolute_header,
|
||||
[`(eval "$ac_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;}'`])
|
||||
fi
|
||||
AS_VAR_POPDEF([ac_header_exists])dnl
|
||||
])dnl
|
||||
AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))),
|
||||
["AS_VAR_GET(gl_absolute_header)"],
|
||||
[Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
|
||||
AS_VAR_POPDEF([gl_absolute_header])dnl
|
||||
])dnl
|
||||
])# gl_ABSOLUTE_HEADER
|
|
@ -1,5 +1,5 @@
|
|||
# alloca.m4 serial 7
|
||||
dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc.
|
||||
# alloca.m4 serial 8
|
||||
dnl Copyright (C) 2002-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.
|
||||
|
@ -39,10 +39,6 @@ AC_DEFUN([gl_FUNC_ALLOCA],
|
|||
ALLOCA_H=alloca.h
|
||||
fi
|
||||
AC_SUBST([ALLOCA_H])
|
||||
|
||||
AC_DEFINE(HAVE_ALLOCA_H, 1,
|
||||
[Define HAVE_ALLOCA_H for backward compatibility with older code
|
||||
that includes <alloca.h> only if HAVE_ALLOCA_H is defined.])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/alloca.c.
|
||||
|
|
16
gl/m4/base64.m4
Normal file
16
gl/m4/base64.m4
Normal file
|
@ -0,0 +1,16 @@
|
|||
# base64.m4 serial 3
|
||||
dnl Copyright (C) 2004, 2006 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_BASE64],
|
||||
[
|
||||
gl_PREREQ_BASE64
|
||||
])
|
||||
|
||||
# Prerequisites of lib/base64.c.
|
||||
AC_DEFUN([gl_PREREQ_BASE64], [
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
])
|
|
@ -1,14 +1,14 @@
|
|||
# serial 4 -*- Autoconf -*-
|
||||
# serial 5 -*- Autoconf -*-
|
||||
# Enable extensions on systems that normally disable them.
|
||||
|
||||
# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003, 2006, 2007 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.61 or later everywhere, but since CVS Autoconf mutates rapidly
|
||||
# 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.
|
||||
|
||||
|
@ -16,26 +16,48 @@
|
|||
# ------------------------
|
||||
# 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])
|
||||
AC_BEFORE([$0], [AC_RUN_IFELSE])
|
||||
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
|
||||
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
||||
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
AC_REQUIRE([AC_AIX])
|
||||
AC_REQUIRE([AC_MINIX])
|
||||
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
|
||||
|
||||
AH_VERBATIM([__EXTENSIONS__],
|
||||
[/* Enable extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __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])
|
||||
#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(
|
||||
|
@ -46,9 +68,11 @@ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
|
|||
[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
|
||||
# ------------------------
|
||||
|
|
19
gl/m4/float_h.m4
Normal file
19
gl/m4/float_h.m4
Normal file
|
@ -0,0 +1,19 @@
|
|||
# float_h.m4 serial 3
|
||||
dnl Copyright (C) 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_FLOAT_H],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
FLOAT_H=
|
||||
case "$host_os" in
|
||||
beos* | openbsd*)
|
||||
FLOAT_H=float.h
|
||||
gl_CHECK_NEXT_HEADERS([float.h])
|
||||
;;
|
||||
esac
|
||||
AC_SUBST([FLOAT_H])
|
||||
])
|
62
gl/m4/floorf.m4
Normal file
62
gl/m4/floorf.m4
Normal file
|
@ -0,0 +1,62 @@
|
|||
# floorf.m4 serial 3
|
||||
dnl Copyright (C) 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_FUNC_FLOORF],
|
||||
[
|
||||
AC_REQUIRE([gl_MATH_H_DEFAULTS])
|
||||
dnl Persuade glibc <math.h> to declare floorf().
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
dnl Test whether floorf() is declared.
|
||||
AC_CHECK_DECLS([floorf], , , [#include <math.h>])
|
||||
if test "$ac_cv_have_decl_floorf" = yes; then
|
||||
dnl Test whether floorf() can be used without libm.
|
||||
gl_FUNC_FLOORF_LIBS
|
||||
if test "$FLOORF_LIBM" = "?"; then
|
||||
dnl Sun C 5.0 on Solaris declares floorf() and has it in the system-wide
|
||||
dnl libm.so, but not in the libm.so that the compiler uses.
|
||||
REPLACE_FLOORF=1
|
||||
fi
|
||||
else
|
||||
REPLACE_FLOORF=1
|
||||
fi
|
||||
if test $REPLACE_FLOORF = 1; then
|
||||
AC_LIBOBJ([floorf])
|
||||
FLOORF_LIBM=
|
||||
fi
|
||||
AC_SUBST([REPLACE_FLOORF])
|
||||
AC_SUBST([FLOORF_LIBM])
|
||||
])
|
||||
|
||||
# Determines the libraries needed to get the floorf() function.
|
||||
# Sets FLOORF_LIBM.
|
||||
AC_DEFUN([gl_FUNC_FLOORF_LIBS],
|
||||
[
|
||||
AC_CACHE_VAL([gl_cv_func_floorf_libm], [
|
||||
gl_cv_func_floorf_libm=?
|
||||
AC_TRY_LINK([
|
||||
#ifndef __NO_MATH_INLINES
|
||||
# define __NO_MATH_INLINES 1 /* for glibc */
|
||||
#endif
|
||||
#include <math.h>
|
||||
float x;],
|
||||
[x = floorf(x);],
|
||||
[gl_cv_func_floorf_libm=])
|
||||
if test "$gl_cv_func_floorf_libm" = "?"; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lm"
|
||||
AC_TRY_LINK([
|
||||
#ifndef __NO_MATH_INLINES
|
||||
# define __NO_MATH_INLINES 1 /* for glibc */
|
||||
#endif
|
||||
#include <math.h>
|
||||
float x;],
|
||||
[x = floorf(x);],
|
||||
[gl_cv_func_floorf_libm="-lm"])
|
||||
LIBS="$save_LIBS"
|
||||
fi
|
||||
])
|
||||
FLOORF_LIBM="$gl_cv_func_floorf_libm"
|
||||
])
|
|
@ -1,8 +1,7 @@
|
|||
#serial 22
|
||||
#serial 23
|
||||
# Obtaining file system usage information.
|
||||
|
||||
# Copyright (C) 1997, 1998, 2000, 2001, 2003, 2004, 2005, 2006 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1997, 1998, 2000, 2001, 2003-2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -55,6 +54,11 @@ one of the corresponding file systems is hard-mounted, but not available.
|
|||
statvfs in GNU libc on BeOS operates differently: it only makes a system
|
||||
call.
|
||||
#endif
|
||||
|
||||
#ifdef __osf__
|
||||
"Do not use Tru64's statvfs implementation"
|
||||
#endif
|
||||
|
||||
#include <sys/statvfs.h>],
|
||||
[struct statvfs fsd; statvfs (0, &fsd);],
|
||||
fu_cv_sys_stat_statvfs=yes,
|
||||
|
|
|
@ -1,15 +1,31 @@
|
|||
# getaddrinfo.m4 serial 11
|
||||
dnl Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# getaddrinfo.m4 serial 15
|
||||
dnl Copyright (C) 2004, 2005, 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_GETADDRINFO],
|
||||
[
|
||||
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
|
||||
AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE(netdb.h)
|
||||
|
||||
AC_SEARCH_LIBS(getaddrinfo, [nsl socket])
|
||||
AC_CHECK_FUNCS(getaddrinfo,, [
|
||||
AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
|
||||
AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
], [getaddrinfo("", "", NULL, NULL);],
|
||||
[gl_cv_func_getaddrinfo=yes],
|
||||
[gl_cv_func_getaddrinfo=no])])
|
||||
if test $gl_cv_func_getaddrinfo = no; then
|
||||
AC_CACHE_CHECK(for getaddrinfo in ws2tcpip.h and -lws2_32,
|
||||
gl_cv_w32_getaddrinfo, [
|
||||
gl_cv_w32_getaddrinfo=no
|
||||
|
@ -19,21 +35,46 @@ AC_DEFUN([gl_GETADDRINFO],
|
|||
#ifdef HAVE_WS2TCPIP_H
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
], [getaddrinfo(0, 0, 0, 0);], gl_cv_w32_getaddrinfo=yes)
|
||||
#include <stddef.h>
|
||||
], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes)
|
||||
LIBS="$am_save_LIBS"])
|
||||
if test "$gl_cv_w32_getaddrinfo" = "yes"; then
|
||||
LIBS="$LIBS -lws2_32"
|
||||
else
|
||||
AC_LIBOBJ(getaddrinfo)
|
||||
fi
|
||||
])
|
||||
fi
|
||||
|
||||
# We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
|
||||
# inline function declared in ws2tcpip.h, so we need to get that
|
||||
# header included somehow.
|
||||
AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)],
|
||||
gl_cv_func_gai_strerror, [
|
||||
AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
], [gai_strerror (NULL);],
|
||||
[gl_cv_func_gai_strerror=yes],
|
||||
[gl_cv_func_gai_strerror=no])])
|
||||
if test $gl_cv_func_gai_strerror = no; then
|
||||
AC_LIBOBJ(gai_strerror)
|
||||
fi
|
||||
|
||||
AC_REPLACE_FUNCS(gai_strerror)
|
||||
gl_PREREQ_GETADDRINFO
|
||||
])
|
||||
|
||||
# Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c.
|
||||
AC_DEFUN([gl_PREREQ_GETADDRINFO], [
|
||||
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
|
||||
AC_SEARCH_LIBS(gethostbyname, [inet nsl])
|
||||
AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet])
|
||||
AC_CHECK_FUNCS(gethostbyname,, [
|
||||
|
@ -46,7 +87,8 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
|
|||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
], [gethostbyname(0);], gl_cv_w32_gethostbyname=yes)
|
||||
#include <stddef.h>
|
||||
], [gethostbyname(NULL);], gl_cv_w32_gethostbyname=yes)
|
||||
LIBS="$am_save_LIBS"])
|
||||
if test "$gl_cv_w32_gethostbyname" = "yes"; then
|
||||
LIBS="$LIBS -lws2_32"
|
||||
|
@ -56,7 +98,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
|
|||
AC_REQUIRE([gl_SOCKET_FAMILIES])
|
||||
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h)
|
||||
AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
|
||||
/* sys/types.h is not needed according to POSIX, but the
|
||||
|
|
|
@ -31,6 +31,10 @@ AC_CHECK_FUNCS(pstat_getdynamic)
|
|||
AC_CHECK_LIB(kstat, kstat_open)
|
||||
test $ac_cv_lib_kstat_kstat_open = yes && gl_have_func=yes
|
||||
|
||||
# AIX has libperfstat which does not require root
|
||||
AC_CHECK_LIB(perfstat, perfstat_cpu_total)
|
||||
test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_have_func=yes
|
||||
|
||||
# Some systems with -lutil have (and need) -lkvm as well, some do not.
|
||||
# On Solaris, -lkvm requires nlist from -lelf, so check that first
|
||||
# to get the right answer into the cache.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# gettext.m4 serial 59 (gettext-0.16.1)
|
||||
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
|
||||
# gettext.m4 serial 60 (gettext-0.17)
|
||||
dnl Copyright (C) 1995-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.
|
||||
|
@ -362,44 +362,6 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
|
|||
])
|
||||
|
||||
|
||||
dnl Checks for special options needed on MacOS X.
|
||||
dnl Defines INTL_MACOSX_LIBS.
|
||||
AC_DEFUN([gt_INTL_MACOSX],
|
||||
[
|
||||
dnl Check for API introduced in MacOS X 10.2.
|
||||
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
|
||||
gt_cv_func_CFPreferencesCopyAppValue,
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
|
||||
[CFPreferencesCopyAppValue(NULL, NULL)],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue=yes],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
|
||||
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
|
||||
[Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
|
||||
fi
|
||||
dnl Check for API introduced in MacOS X 10.3.
|
||||
AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
|
||||
[gt_cv_func_CFLocaleCopyCurrent=yes],
|
||||
[gt_cv_func_CFLocaleCopyCurrent=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
|
||||
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
|
||||
[Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
|
||||
fi
|
||||
INTL_MACOSX_LIBS=
|
||||
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
|
||||
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
|
||||
fi
|
||||
AC_SUBST([INTL_MACOSX_LIBS])
|
||||
])
|
||||
|
||||
|
||||
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
|
||||
m4_define([gt_NEEDS_INIT],
|
||||
[
|
||||
|
|
30
gl/m4/glibc21.m4
Normal file
30
gl/m4/glibc21.m4
Normal file
|
@ -0,0 +1,30 @@
|
|||
# glibc21.m4 serial 3
|
||||
dnl Copyright (C) 2000-2002, 2004 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.
|
||||
|
||||
# Test for the GNU C Library, version 2.1 or newer.
|
||||
# From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_GLIBC21],
|
||||
[
|
||||
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
|
||||
ac_cv_gnu_library_2_1,
|
||||
[AC_EGREP_CPP([Lucky GNU user],
|
||||
[
|
||||
#include <features.h>
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
|
||||
Lucky GNU user
|
||||
#endif
|
||||
#endif
|
||||
],
|
||||
ac_cv_gnu_library_2_1=yes,
|
||||
ac_cv_gnu_library_2_1=no)
|
||||
]
|
||||
)
|
||||
AC_SUBST(GLIBC21)
|
||||
GLIBC21="$ac_cv_gnu_library_2_1"
|
||||
]
|
||||
)
|
|
@ -1,4 +1,4 @@
|
|||
# gnulib-common.m4 serial 2
|
||||
# gnulib-common.m4 serial 3
|
||||
dnl Copyright (C) 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,
|
||||
|
@ -20,3 +20,46 @@ m4_ifdef([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
|
||||
])
|
||||
|
|
|
@ -27,78 +27,98 @@ AC_DEFUN([gl_EARLY],
|
|||
AC_REQUIRE([AC_PROG_RANLIB])
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
AC_REQUIRE([gl_LOCK_EARLY])
|
||||
])
|
||||
|
||||
# This macro should be invoked from ./configure.in, in the section
|
||||
# "Check for header files, types and library functions".
|
||||
AC_DEFUN([gl_INIT],
|
||||
[
|
||||
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]))
|
||||
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]))
|
||||
gl_source_base='gl'
|
||||
gl_FUNC_ALLOCA
|
||||
gl_HEADER_ARPA_INET
|
||||
AC_PROG_MKDIR_P
|
||||
gl_FUNC_BASE64
|
||||
gl_C_STRTOD
|
||||
gl_CLOEXEC
|
||||
gl_DIRNAME
|
||||
gl_DOUBLE_SLASH_ROOT
|
||||
gl_ERROR
|
||||
m4_ifdef([AM_XGETTEXT_OPTION],
|
||||
[AM_XGETTEXT_OPTION([--flag=error:3:c-format])
|
||||
AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
|
||||
gl_EXITFAIL
|
||||
dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac.
|
||||
gl_FCNTL_SAFER
|
||||
gl_MODULE_INDICATOR([fcntl-safer])
|
||||
gl_FLOAT_H
|
||||
gl_FUNC_FLOORF
|
||||
gl_MATH_MODULE_INDICATOR([floorf])
|
||||
gl_FSUSAGE
|
||||
gl_GETADDRINFO
|
||||
gl_FUNC_GETHOSTNAME
|
||||
gl_GETLOADAVG([$gl_source_base])
|
||||
gl_GETOPT
|
||||
dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
|
||||
AM_GNU_GETTEXT_VERSION([0.15])
|
||||
AM_GNU_GETTEXT_VERSION([0.17])
|
||||
AC_SUBST([LIBINTL])
|
||||
AC_SUBST([LTLIBINTL])
|
||||
gl_INET_NTOP
|
||||
gl_INLINE
|
||||
gl_LOCALCHARSET
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
|
||||
AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
|
||||
AC_FUNC_MALLOC
|
||||
gl_MBCHAR
|
||||
gl_MBITER
|
||||
gl_FUNC_MEMCHR
|
||||
gl_MINMAX
|
||||
AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.])
|
||||
gl_FUNC_MALLOC_POSIX
|
||||
gl_STDLIB_MODULE_INDICATOR([malloc-posix])
|
||||
gl_MATH_H
|
||||
gl_MOUNTLIST
|
||||
gl_HEADER_NETINET_IN
|
||||
AC_PROG_MKDIR_P
|
||||
gl_REGEX
|
||||
gl_SAFE_READ
|
||||
gl_SAFE_WRITE
|
||||
gl_SIZE_MAX
|
||||
gl_FUNC_SNPRINTF
|
||||
gl_STDIO_MODULE_INDICATOR([snprintf])
|
||||
gl_TYPE_SOCKLEN_T
|
||||
gt_TYPE_SSIZE_T
|
||||
AM_STDBOOL_H
|
||||
gl_STDINT_H
|
||||
gl_STRCASE
|
||||
gl_STDIO_H
|
||||
gl_STDLIB_H
|
||||
gl_FUNC_STRDUP
|
||||
gl_STRING_MODULE_INDICATOR([strdup])
|
||||
gl_FUNC_STRERROR
|
||||
gl_STRING_MODULE_INDICATOR([strerror])
|
||||
gl_HEADER_STRING_H
|
||||
gl_FUNC_STRNDUP
|
||||
gl_STRING_MODULE_INDICATOR([strndup])
|
||||
gl_FUNC_STRNLEN
|
||||
gl_STRING_MODULE_INDICATOR([strnlen])
|
||||
gl_HEADER_SYS_SOCKET
|
||||
AC_PROG_MKDIR_P
|
||||
gl_HEADER_UNISTD
|
||||
gl_UNISTD_H
|
||||
gl_UNISTD_SAFER
|
||||
gl_FUNC_VASNPRINTF
|
||||
gl_FUNC_VASPRINTF
|
||||
gl_STDIO_MODULE_INDICATOR([vasprintf])
|
||||
m4_ifdef([AM_XGETTEXT_OPTION],
|
||||
[AM_XGETTEXT_OPTION([--flag=asprintf:2:c-format])
|
||||
AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
|
||||
gl_FUNC_VSNPRINTF
|
||||
gl_STDIO_MODULE_INDICATOR([vsnprintf])
|
||||
gl_WCHAR_H
|
||||
gl_WCTYPE_H
|
||||
gl_FUNC_WCWIDTH
|
||||
gl_XALLOC
|
||||
gl_XSIZE
|
||||
gl_XSTRNDUP
|
||||
LIBGNU_LIBDEPS="$gl_libdeps"
|
||||
AC_SUBST([LIBGNU_LIBDEPS])
|
||||
LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
|
||||
AC_SUBST([LIBGNU_LTLIBDEPS])
|
||||
m4_popdef([AC_LIBSOURCES])
|
||||
m4_popdef([AC_REPLACE_FUNCS])
|
||||
m4_popdef([AC_LIBOBJ])
|
||||
|
@ -116,48 +136,137 @@ AC_DEFUN([gl_INIT],
|
|||
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]))
|
||||
gl_source_base='tests'
|
||||
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],
|
||||
[gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"])
|
||||
AC_DEFUN([gl_LIBOBJ], [
|
||||
AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
|
||||
gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
|
||||
])
|
||||
|
||||
# m4_foreach_w is provided by autoconf-2.59c and later.
|
||||
# This definition is to accommodate developers using versions
|
||||
# of autoconf older than that.
|
||||
m4_ifndef([m4_foreach_w],
|
||||
[m4_define([m4_foreach_w],
|
||||
[m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
|
||||
|
||||
# Like AC_REPLACE_FUNCS, except that the module name goes
|
||||
# into gl_LIBOBJS instead of into LIBOBJS.
|
||||
AC_DEFUN([gl_REPLACE_FUNCS],
|
||||
[AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])])
|
||||
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 that it does nothing.
|
||||
# We rely on EXTRA_lib..._SOURCES instead.
|
||||
AC_DEFUN([gl_LIBSOURCES],
|
||||
[])
|
||||
# Like AC_LIBSOURCES, except the directory where the source file is
|
||||
# expected is derived from the gnulib-tool parametrization,
|
||||
# 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_syscmd([test -r gl/]_gl_NAME[ || test ! -d gl])dnl
|
||||
m4_if(m4_sysval, [0], [],
|
||||
[AC_FATAL([missing gl/]_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"
|
||||
])
|
||||
|
||||
# m4_foreach_w is provided by autoconf-2.59c and later.
|
||||
# This definition is to accommodate developers using versions
|
||||
# of autoconf older than that.
|
||||
m4_ifndef([m4_foreach_w],
|
||||
[m4_define([m4_foreach_w],
|
||||
[m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
|
||||
|
||||
# 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 parametrization,
|
||||
# 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_syscmd([test -r tests/]_gl_NAME[ || test ! -d tests])dnl
|
||||
m4_if(m4_sysval, [0], [],
|
||||
[AC_FATAL([missing tests/]_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/config.rpath
|
||||
build-aux/link-warning.h
|
||||
lib/alloca.c
|
||||
lib/alloca_.h
|
||||
lib/alloca.in.h
|
||||
lib/asnprintf.c
|
||||
lib/asprintf.c
|
||||
lib/base64.c
|
||||
lib/base64.h
|
||||
lib/basename.c
|
||||
lib/c-strtod.c
|
||||
lib/c-strtod.h
|
||||
lib/cloexec.c
|
||||
lib/cloexec.h
|
||||
lib/config.charset
|
||||
lib/creat-safer.c
|
||||
lib/dirname.c
|
||||
lib/dirname.h
|
||||
lib/dup-safer.c
|
||||
lib/error.c
|
||||
lib/error.h
|
||||
lib/exit.h
|
||||
lib/exitfail.c
|
||||
lib/exitfail.h
|
||||
lib/fcntl--.h
|
||||
lib/fcntl-safer.h
|
||||
lib/fd-safer.c
|
||||
lib/float+.h
|
||||
lib/float.in.h
|
||||
lib/floor.c
|
||||
lib/floorf.c
|
||||
lib/fsusage.c
|
||||
lib/fsusage.h
|
||||
lib/full-read.c
|
||||
|
@ -170,27 +279,28 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/gethostname.c
|
||||
lib/getloadavg.c
|
||||
lib/getopt.c
|
||||
lib/getopt.in.h
|
||||
lib/getopt1.c
|
||||
lib/getopt_.h
|
||||
lib/getopt_int.h
|
||||
lib/gettext.h
|
||||
lib/inet_ntop.c
|
||||
lib/inet_ntop.h
|
||||
lib/intprops.h
|
||||
lib/localcharset.c
|
||||
lib/localcharset.h
|
||||
lib/malloc.c
|
||||
lib/mbchar.c
|
||||
lib/mbchar.h
|
||||
lib/mbuiter.h
|
||||
lib/memchr.c
|
||||
lib/minmax.h
|
||||
lib/math.in.h
|
||||
lib/mountlist.c
|
||||
lib/mountlist.h
|
||||
lib/netinet_in.in.h
|
||||
lib/open-safer.c
|
||||
lib/pipe-safer.c
|
||||
lib/printf-args.c
|
||||
lib/printf-args.h
|
||||
lib/printf-parse.c
|
||||
lib/printf-parse.h
|
||||
lib/ref-add.sin
|
||||
lib/ref-del.sin
|
||||
lib/regcomp.c
|
||||
lib/regex.c
|
||||
lib/regex.h
|
||||
|
@ -203,34 +313,26 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/safe-write.h
|
||||
lib/size_max.h
|
||||
lib/snprintf.c
|
||||
lib/snprintf.h
|
||||
lib/socket_.h
|
||||
lib/stdbool_.h
|
||||
lib/stdint_.h
|
||||
lib/strcase.h
|
||||
lib/strcasecmp.c
|
||||
lib/stdbool.in.h
|
||||
lib/stdint.in.h
|
||||
lib/stdio.in.h
|
||||
lib/stdlib.in.h
|
||||
lib/strdup.c
|
||||
lib/strdup.h
|
||||
lib/strerror.c
|
||||
lib/string.in.h
|
||||
lib/stripslash.c
|
||||
lib/strncasecmp.c
|
||||
lib/strndup.c
|
||||
lib/strndup.h
|
||||
lib/strnlen.c
|
||||
lib/strnlen.h
|
||||
lib/strnlen1.c
|
||||
lib/strnlen1.h
|
||||
lib/sys_socket.in.h
|
||||
lib/unistd--.h
|
||||
lib/unistd-safer.h
|
||||
lib/unistd_.h
|
||||
lib/unistd.in.h
|
||||
lib/vasnprintf.c
|
||||
lib/vasnprintf.h
|
||||
lib/vasprintf.c
|
||||
lib/vasprintf.h
|
||||
lib/vsnprintf.c
|
||||
lib/vsnprintf.h
|
||||
lib/wchar_.h
|
||||
lib/wctype_.h
|
||||
lib/wcwidth.h
|
||||
lib/wchar.in.h
|
||||
lib/wctype.in.h
|
||||
lib/xalloc-die.c
|
||||
lib/xalloc.h
|
||||
lib/xmalloc.c
|
||||
|
@ -240,6 +342,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/absolute-header.m4
|
||||
m4/alloca.m4
|
||||
m4/arpa_inet_h.m4
|
||||
m4/base64.m4
|
||||
m4/c-strtod.m4
|
||||
m4/cloexec.m4
|
||||
m4/codeset.m4
|
||||
|
@ -251,6 +354,8 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/exitfail.m4
|
||||
m4/extensions.m4
|
||||
m4/fcntl-safer.m4
|
||||
m4/float_h.m4
|
||||
m4/floorf.m4
|
||||
m4/fstypename.m4
|
||||
m4/fsusage.m4
|
||||
m4/getaddrinfo.m4
|
||||
|
@ -262,11 +367,13 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/glibc21.m4
|
||||
m4/gnulib-common.m4
|
||||
m4/iconv.m4
|
||||
m4/include_next.m4
|
||||
m4/inet_ntop.m4
|
||||
m4/inline.m4
|
||||
m4/intdiv0.m4
|
||||
m4/intl.m4
|
||||
m4/intldir.m4
|
||||
m4/intlmacosx.m4
|
||||
m4/intmax.m4
|
||||
m4/intmax_t.m4
|
||||
m4/inttypes-pri.m4
|
||||
|
@ -275,15 +382,12 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/lib-ld.m4
|
||||
m4/lib-link.m4
|
||||
m4/lib-prefix.m4
|
||||
m4/localcharset.m4
|
||||
m4/lock.m4
|
||||
m4/longdouble.m4
|
||||
m4/longlong.m4
|
||||
m4/ls-mntd-fs.m4
|
||||
m4/mbchar.m4
|
||||
m4/mbiter.m4
|
||||
m4/mbrtowc.m4
|
||||
m4/memchr.m4
|
||||
m4/minmax.m4
|
||||
m4/malloc.m4
|
||||
m4/math_h.m4
|
||||
m4/mountlist.m4
|
||||
m4/netinet_in_h.m4
|
||||
m4/nls.m4
|
||||
|
@ -302,13 +406,15 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/stdbool.m4
|
||||
m4/stdint.m4
|
||||
m4/stdint_h.m4
|
||||
m4/strcase.m4
|
||||
m4/stdio_h.m4
|
||||
m4/stdlib_h.m4
|
||||
m4/strdup.m4
|
||||
m4/strerror.m4
|
||||
m4/string_h.m4
|
||||
m4/strndup.m4
|
||||
m4/strnlen.m4
|
||||
m4/sys_socket_h.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/ulonglong.m4
|
||||
m4/unistd-safer.m4
|
||||
m4/unistd_h.m4
|
||||
m4/vasnprintf.m4
|
||||
|
@ -318,7 +424,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/wchar.m4
|
||||
m4/wchar_t.m4
|
||||
m4/wctype.m4
|
||||
m4/wcwidth.m4
|
||||
m4/wint_t.m4
|
||||
m4/xalloc.m4
|
||||
m4/xsize.m4
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# iconv.m4 serial AM4 (gettext-0.11.3)
|
||||
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
|
||||
# iconv.m4 serial AM6 (gettext-0.17)
|
||||
dnl Copyright (C) 2000-2002, 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.
|
||||
|
@ -21,6 +21,7 @@ AC_DEFUN([AM_ICONV_LINK],
|
|||
[
|
||||
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
|
||||
dnl those with the standalone portable GNU libiconv installed).
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
|
||||
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
|
||||
dnl accordingly.
|
||||
|
@ -33,7 +34,7 @@ AC_DEFUN([AM_ICONV_LINK],
|
|||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
|
||||
|
||||
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
|
||||
AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [
|
||||
am_cv_func_iconv="no, consider installing GNU libiconv"
|
||||
am_cv_lib_iconv=no
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
|
@ -56,7 +57,85 @@ AC_DEFUN([AM_ICONV_LINK],
|
|||
fi
|
||||
])
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
|
||||
AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [
|
||||
dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
|
||||
am_save_LIBS="$LIBS"
|
||||
if test $am_cv_lib_iconv = yes; then
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
fi
|
||||
AC_TRY_RUN([
|
||||
#include <iconv.h>
|
||||
#include <string.h>
|
||||
int main ()
|
||||
{
|
||||
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
|
||||
returns. */
|
||||
{
|
||||
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
|
||||
if (cd_utf8_to_88591 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\342\202\254"; /* EURO SIGN */
|
||||
char buf[10];
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_utf8_to_88591,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#if 0 /* This bug could be worked around by the caller. */
|
||||
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
|
||||
{
|
||||
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
|
||||
if (cd_88591_to_utf8 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
|
||||
char buf[50];
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_88591_to_utf8,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if ((int)res > 0)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
|
||||
provided. */
|
||||
if (/* Try standardized names. */
|
||||
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
|
||||
/* Try IRIX, OSF/1 names. */
|
||||
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
|
||||
/* Try AIX names. */
|
||||
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
|
||||
/* Try HP-UX names. */
|
||||
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
|
||||
return 1;
|
||||
return 0;
|
||||
}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
|
||||
[case "$host_os" in
|
||||
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
|
||||
*) am_cv_func_iconv_works="guessing yes" ;;
|
||||
esac])
|
||||
LIBS="$am_save_LIBS"
|
||||
])
|
||||
case "$am_cv_func_iconv_works" in
|
||||
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
|
||||
*) am_func_iconv=yes ;;
|
||||
esac
|
||||
else
|
||||
am_func_iconv=no am_cv_lib_iconv=no
|
||||
fi
|
||||
if test "$am_func_iconv" = yes; then
|
||||
AC_DEFINE(HAVE_ICONV, 1,
|
||||
[Define if you have the iconv() function and it works.])
|
||||
fi
|
||||
if test "$am_cv_lib_iconv" = yes; then
|
||||
AC_MSG_CHECKING([how to link with libiconv])
|
||||
|
|
107
gl/m4/include_next.m4
Normal file
107
gl/m4/include_next.m4
Normal file
|
@ -0,0 +1,107 @@
|
|||
# include_next.m4 serial 4
|
||||
dnl Copyright (C) 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.
|
||||
|
||||
dnl From Paul Eggert and Derek Price.
|
||||
|
||||
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 conftestd1 conftestd2
|
||||
mkdir conftestd1 conftestd2
|
||||
cat <<EOF > conftestd1/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 > conftestd2/conftest.h
|
||||
#ifndef DEFINED_IN_CONFTESTD1
|
||||
#error "include_next test doesn't work"
|
||||
#endif
|
||||
#define DEFINED_IN_CONFTESTD2
|
||||
EOF
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2"
|
||||
AC_COMPILE_IFELSE([#include <conftest.h>],
|
||||
[gl_cv_have_include_next=yes],
|
||||
[gl_cv_have_include_next=no])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
rm -rf conftestd1 conftestd2
|
||||
])
|
||||
if test $gl_cv_have_include_next = yes; then
|
||||
|
||||
dnl FIXME: Remove HAVE_INCLUDE_NEXT and update everything that uses it
|
||||
dnl to use @INCLUDE_NEXT@ instead.
|
||||
AC_DEFINE([HAVE_INCLUDE_NEXT], 1,
|
||||
[Define if your compiler supports the #include_next directive.])
|
||||
|
||||
INCLUDE_NEXT=include_next
|
||||
else
|
||||
INCLUDE_NEXT=include
|
||||
fi
|
||||
AC_SUBST([INCLUDE_NEXT])
|
||||
])
|
||||
|
||||
# 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.
|
||||
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
|
||||
[
|
||||
AC_REQUIRE([gl_INCLUDE_NEXT])
|
||||
AC_CHECK_HEADERS_ONCE([$1])
|
||||
|
||||
AC_FOREACH([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 eval is necessary to expand ac_cpp.
|
||||
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
|
||||
dnl so use subshell.
|
||||
AS_VAR_SET([gl_next_header],
|
||||
['"'`(eval "$ac_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])])
|
||||
])
|
51
gl/m4/intlmacosx.m4
Normal file
51
gl/m4/intlmacosx.m4
Normal file
|
@ -0,0 +1,51 @@
|
|||
# intlmacosx.m4 serial 1 (gettext-0.17)
|
||||
dnl Copyright (C) 2004-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.
|
||||
dnl
|
||||
dnl This file can can be used in projects which are not available under
|
||||
dnl the GNU General Public License or the GNU Library General Public
|
||||
dnl License but which still want to provide support for the GNU gettext
|
||||
dnl functionality.
|
||||
dnl Please note that the actual code of the GNU gettext library is covered
|
||||
dnl by the GNU Library General Public License, and the rest of the GNU
|
||||
dnl gettext package package is covered by the GNU General Public License.
|
||||
dnl They are *not* in the public domain.
|
||||
|
||||
dnl Checks for special options needed on MacOS X.
|
||||
dnl Defines INTL_MACOSX_LIBS.
|
||||
AC_DEFUN([gt_INTL_MACOSX],
|
||||
[
|
||||
dnl Check for API introduced in MacOS X 10.2.
|
||||
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
|
||||
gt_cv_func_CFPreferencesCopyAppValue,
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
|
||||
[CFPreferencesCopyAppValue(NULL, NULL)],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue=yes],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
|
||||
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
|
||||
[Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
|
||||
fi
|
||||
dnl Check for API introduced in MacOS X 10.3.
|
||||
AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
|
||||
[gt_cv_func_CFLocaleCopyCurrent=yes],
|
||||
[gt_cv_func_CFLocaleCopyCurrent=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
|
||||
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
|
||||
[Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
|
||||
fi
|
||||
INTL_MACOSX_LIBS=
|
||||
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
|
||||
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
|
||||
fi
|
||||
AC_SUBST([INTL_MACOSX_LIBS])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# intmax_t.m4 serial 5
|
||||
dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
|
||||
# intmax_t.m4 serial 6
|
||||
dnl Copyright (C) 1997-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.
|
||||
|
@ -18,8 +18,8 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T],
|
|||
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
|
||||
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
|
||||
if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
|
||||
AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
|
||||
test $ac_cv_type_long_long = yes \
|
||||
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
|
||||
test $ac_cv_type_long_long_int = yes \
|
||||
&& ac_type='long long' \
|
||||
|| ac_type='long'
|
||||
AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
|
||||
|
@ -51,8 +51,8 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
|
|||
AC_DEFINE(HAVE_INTMAX_T, 1,
|
||||
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
|
||||
else
|
||||
AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
|
||||
test $ac_cv_type_long_long = yes \
|
||||
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
|
||||
test $ac_cv_type_long_long_int = yes \
|
||||
&& ac_type='long long' \
|
||||
|| ac_type='long'
|
||||
AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# lib-link.m4 serial 13 (gettext-0.16.2)
|
||||
# lib-link.m4 serial 13 (gettext-0.17)
|
||||
dnl Copyright (C) 2001-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,
|
||||
|
|
16
gl/m4/localcharset.m4
Normal file
16
gl/m4/localcharset.m4
Normal file
|
@ -0,0 +1,16 @@
|
|||
# localcharset.m4 serial 5
|
||||
dnl Copyright (C) 2002, 2004, 2006 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_LOCALCHARSET],
|
||||
[
|
||||
dnl Prerequisites of lib/localcharset.c.
|
||||
AC_REQUIRE([AM_LANGINFO_CODESET])
|
||||
AC_CHECK_DECLS_ONCE(getc_unlocked)
|
||||
|
||||
dnl Prerequisites of the lib/Makefile.am snippet.
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([gl_GLIBC21])
|
||||
])
|
311
gl/m4/lock.m4
311
gl/m4/lock.m4
|
@ -1,311 +0,0 @@
|
|||
# lock.m4 serial 6 (gettext-0.16)
|
||||
dnl Copyright (C) 2005-2006 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 Bruno Haible.
|
||||
|
||||
dnl Tests for a multithreading library to be used.
|
||||
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
|
||||
dnl USE_PTH_THREADS, USE_WIN32_THREADS
|
||||
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
|
||||
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
|
||||
dnl libtool).
|
||||
dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
|
||||
dnl programs that really need multithread functionality. The difference
|
||||
dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
|
||||
dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
|
||||
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
|
||||
dnl multithread-safe programs.
|
||||
|
||||
AC_DEFUN([gl_LOCK_EARLY],
|
||||
[
|
||||
AC_REQUIRE([gl_LOCK_EARLY_BODY])
|
||||
])
|
||||
|
||||
dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once.
|
||||
|
||||
AC_DEFUN([gl_LOCK_EARLY_BODY],
|
||||
[
|
||||
dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
|
||||
dnl influences the result of the autoconf tests that test for *_unlocked
|
||||
dnl declarations, on AIX 5 at least. Therefore it must come early.
|
||||
AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
|
||||
AC_BEFORE([$0], [gl_ARGP])dnl
|
||||
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
|
||||
dnl Check for multithreading.
|
||||
AC_ARG_ENABLE(threads,
|
||||
AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
|
||||
AC_HELP_STRING([--disable-threads], [build without multithread safety]),
|
||||
[gl_use_threads=$enableval],
|
||||
[case "$host_os" in
|
||||
dnl Disable multithreading by default on OSF/1, because it interferes
|
||||
dnl with fork()/exec(): When msgexec is linked with -lpthread, its child
|
||||
dnl process gets an endless segmentation fault inside execvp().
|
||||
osf*) gl_use_threads=no ;;
|
||||
*) gl_use_threads=yes ;;
|
||||
esac
|
||||
])
|
||||
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
|
||||
# For using <pthread.h>:
|
||||
case "$host_os" in
|
||||
osf*)
|
||||
# On OSF/1, the compiler needs the flag -D_REENTRANT so that it
|
||||
# groks <pthread.h>. cc also understands the flag -pthread, but
|
||||
# we don't use it because 1. gcc-2.95 doesn't understand -pthread,
|
||||
# 2. putting a flag into CPPFLAGS that has an effect on the linker
|
||||
# causes the AC_TRY_LINK test below to succeed unexpectedly,
|
||||
# leading to wrong values of LIBTHREAD and LTLIBTHREAD.
|
||||
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
|
||||
;;
|
||||
esac
|
||||
# Some systems optimize for single-threaded programs by default, and
|
||||
# need special flags to disable these optimizations. For example, the
|
||||
# definition of 'errno' in <errno.h>.
|
||||
case "$host_os" in
|
||||
aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
|
||||
solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
dnl The guts of gl_LOCK. Needs to be expanded only once.
|
||||
|
||||
AC_DEFUN([gl_LOCK_BODY],
|
||||
[
|
||||
AC_REQUIRE([gl_LOCK_EARLY_BODY])
|
||||
gl_threads_api=none
|
||||
LIBTHREAD=
|
||||
LTLIBTHREAD=
|
||||
LIBMULTITHREAD=
|
||||
LTLIBMULTITHREAD=
|
||||
if test "$gl_use_threads" != no; then
|
||||
dnl Check whether the compiler and linker support weak declarations.
|
||||
AC_MSG_CHECKING([whether imported symbols can be declared weak])
|
||||
gl_have_weak=no
|
||||
AC_TRY_LINK([extern void xyzzy ();
|
||||
#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
|
||||
AC_MSG_RESULT([$gl_have_weak])
|
||||
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
|
||||
# On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
|
||||
# it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
|
||||
AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
|
||||
if test "$gl_have_pthread_h" = yes; then
|
||||
# Other possible tests:
|
||||
# -lpthreads (FSU threads, PCthreads)
|
||||
# -lgthreads
|
||||
gl_have_pthread=
|
||||
# Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
|
||||
# in libc. IRIX 6.5 has the first one in both libc and libpthread, but
|
||||
# the second one only in libpthread, and lock.c needs it.
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_mutex_lock((pthread_mutex_t*)0);
|
||||
pthread_mutexattr_init((pthread_mutexattr_t*)0);],
|
||||
[gl_have_pthread=yes])
|
||||
# Test for libpthread by looking for pthread_kill. (Not pthread_self,
|
||||
# since it is defined as a macro on OSF/1.)
|
||||
if test -n "$gl_have_pthread"; then
|
||||
# The program links fine without libpthread. But it may actually
|
||||
# need to link with libpthread in order to create multiple threads.
|
||||
AC_CHECK_LIB(pthread, pthread_kill,
|
||||
[LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
|
||||
# On Solaris and HP-UX, most pthread functions exist also in libc.
|
||||
# Therefore pthread_in_use() needs to actually try to create a
|
||||
# thread: pthread_create from libc will fail, whereas
|
||||
# pthread_create will actually create a thread.
|
||||
case "$host_os" in
|
||||
solaris* | hpux*)
|
||||
AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1,
|
||||
[Define if the pthread_in_use() detection is hard.])
|
||||
esac
|
||||
])
|
||||
else
|
||||
# Some library is needed. Try libpthread and libc_r.
|
||||
AC_CHECK_LIB(pthread, pthread_kill,
|
||||
[gl_have_pthread=yes
|
||||
LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
|
||||
LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
|
||||
if test -z "$gl_have_pthread"; then
|
||||
# For FreeBSD 4.
|
||||
AC_CHECK_LIB(c_r, pthread_kill,
|
||||
[gl_have_pthread=yes
|
||||
LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
|
||||
LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
|
||||
fi
|
||||
fi
|
||||
if test -n "$gl_have_pthread"; then
|
||||
gl_threads_api=posix
|
||||
AC_DEFINE([USE_POSIX_THREADS], 1,
|
||||
[Define if the POSIX multithreading library can be used.])
|
||||
if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
|
||||
if test $gl_have_weak = yes; then
|
||||
AC_DEFINE([USE_POSIX_THREADS_WEAK], 1,
|
||||
[Define if references to the POSIX multithreading library should be made weak.])
|
||||
LIBTHREAD=
|
||||
LTLIBTHREAD=
|
||||
fi
|
||||
fi
|
||||
# OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
|
||||
# pthread_rwlock_* functions.
|
||||
AC_CHECK_TYPE([pthread_rwlock_t],
|
||||
[AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1,
|
||||
[Define if the POSIX multithreading library has read/write locks.])],
|
||||
[],
|
||||
[#include <pthread.h>])
|
||||
# glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
|
||||
AC_TRY_COMPILE([#include <pthread.h>],
|
||||
[#if __FreeBSD__ == 4
|
||||
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
|
||||
#else
|
||||
int x = (int)PTHREAD_MUTEX_RECURSIVE;
|
||||
return !x;
|
||||
#endif],
|
||||
[AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
|
||||
[Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test -z "$gl_have_pthread"; then
|
||||
if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
|
||||
gl_have_solaristhread=
|
||||
gl_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lthread"
|
||||
AC_TRY_LINK([#include <thread.h>
|
||||
#include <synch.h>],
|
||||
[thr_self();],
|
||||
[gl_have_solaristhread=yes])
|
||||
LIBS="$gl_save_LIBS"
|
||||
if test -n "$gl_have_solaristhread"; then
|
||||
gl_threads_api=solaris
|
||||
LIBTHREAD=-lthread
|
||||
LTLIBTHREAD=-lthread
|
||||
LIBMULTITHREAD="$LIBTHREAD"
|
||||
LTLIBMULTITHREAD="$LTLIBTHREAD"
|
||||
AC_DEFINE([USE_SOLARIS_THREADS], 1,
|
||||
[Define if the old Solaris multithreading library can be used.])
|
||||
if test $gl_have_weak = yes; then
|
||||
AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1,
|
||||
[Define if references to the old Solaris multithreading library should be made weak.])
|
||||
LIBTHREAD=
|
||||
LTLIBTHREAD=
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$gl_use_threads" = pth; then
|
||||
gl_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_LINKFLAGS(pth)
|
||||
gl_have_pth=
|
||||
gl_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lpth"
|
||||
AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes)
|
||||
LIBS="$gl_save_LIBS"
|
||||
if test -n "$gl_have_pth"; then
|
||||
gl_threads_api=pth
|
||||
LIBTHREAD="$LIBPTH"
|
||||
LTLIBTHREAD="$LTLIBPTH"
|
||||
LIBMULTITHREAD="$LIBTHREAD"
|
||||
LTLIBMULTITHREAD="$LTLIBTHREAD"
|
||||
AC_DEFINE([USE_PTH_THREADS], 1,
|
||||
[Define if the GNU Pth multithreading library can be used.])
|
||||
if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
|
||||
if test $gl_have_weak = yes; then
|
||||
AC_DEFINE([USE_PTH_THREADS_WEAK], 1,
|
||||
[Define if references to the GNU Pth multithreading library should be made weak.])
|
||||
LIBTHREAD=
|
||||
LTLIBTHREAD=
|
||||
fi
|
||||
fi
|
||||
else
|
||||
CPPFLAGS="$gl_save_CPPFLAGS"
|
||||
fi
|
||||
fi
|
||||
if test -z "$gl_have_pthread"; then
|
||||
if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
|
||||
if { case "$host_os" in
|
||||
mingw*) true;;
|
||||
*) false;;
|
||||
esac
|
||||
}; then
|
||||
gl_threads_api=win32
|
||||
AC_DEFINE([USE_WIN32_THREADS], 1,
|
||||
[Define if the Win32 multithreading API can be used.])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_MSG_CHECKING([for multithread API to use])
|
||||
AC_MSG_RESULT([$gl_threads_api])
|
||||
AC_SUBST(LIBTHREAD)
|
||||
AC_SUBST(LTLIBTHREAD)
|
||||
AC_SUBST(LIBMULTITHREAD)
|
||||
AC_SUBST(LTLIBMULTITHREAD)
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_LOCK],
|
||||
[
|
||||
AC_REQUIRE([gl_LOCK_EARLY])
|
||||
AC_REQUIRE([gl_LOCK_BODY])
|
||||
gl_PREREQ_LOCK
|
||||
])
|
||||
|
||||
# Prerequisites of lib/lock.c.
|
||||
AC_DEFUN([gl_PREREQ_LOCK], [
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
])
|
||||
|
||||
dnl Survey of platforms:
|
||||
dnl
|
||||
dnl Platform Available Compiler Supports test-lock
|
||||
dnl flavours option weak result
|
||||
dnl --------------- --------- --------- -------- ---------
|
||||
dnl Linux 2.4/glibc posix -lpthread Y OK
|
||||
dnl
|
||||
dnl GNU Hurd/glibc posix
|
||||
dnl
|
||||
dnl FreeBSD 5.3 posix -lc_r Y
|
||||
dnl posix -lkse ? Y
|
||||
dnl posix -lpthread ? Y
|
||||
dnl posix -lthr Y
|
||||
dnl
|
||||
dnl FreeBSD 5.2 posix -lc_r Y
|
||||
dnl posix -lkse Y
|
||||
dnl posix -lthr Y
|
||||
dnl
|
||||
dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
|
||||
dnl
|
||||
dnl NetBSD 1.6 --
|
||||
dnl
|
||||
dnl OpenBSD 3.4 posix -lpthread Y OK
|
||||
dnl
|
||||
dnl MacOS X 10.[123] posix -lpthread Y OK
|
||||
dnl
|
||||
dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
|
||||
dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
|
||||
dnl
|
||||
dnl HP-UX 11 posix -lpthread N (cc) OK
|
||||
dnl Y (gcc)
|
||||
dnl
|
||||
dnl IRIX 6.5 posix -lpthread Y 0.5
|
||||
dnl
|
||||
dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
|
||||
dnl
|
||||
dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
|
||||
dnl -lpthread (gcc) Y
|
||||
dnl
|
||||
dnl Cygwin posix -lpthread Y OK
|
||||
dnl
|
||||
dnl Any of the above pth -lpth 0.0
|
||||
dnl
|
||||
dnl Mingw win32 N OK
|
||||
dnl
|
||||
dnl BeOS 5 --
|
||||
dnl
|
||||
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
|
||||
dnl turned off:
|
||||
dnl OK if all three tests terminate OK,
|
||||
dnl 0.5 if the first test terminates OK but the second one loops endlessly,
|
||||
dnl 0.0 if the first test already loops endlessly.
|
|
@ -1,31 +0,0 @@
|
|||
# longdouble.m4 serial 2 (gettext-0.15)
|
||||
dnl Copyright (C) 2002-2003, 2006 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 Bruno Haible.
|
||||
dnl Test whether the compiler supports the 'long double' type.
|
||||
dnl Prerequisite: AC_PROG_CC
|
||||
|
||||
dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
|
||||
dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
|
||||
|
||||
AC_DEFUN([gt_TYPE_LONGDOUBLE],
|
||||
[
|
||||
AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
|
||||
[if test "$GCC" = yes; then
|
||||
gt_cv_c_long_double=yes
|
||||
else
|
||||
AC_TRY_COMPILE([
|
||||
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
|
||||
long double foo = 0.0;
|
||||
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
|
||||
int array [2*(sizeof(long double) >= sizeof(double)) - 1];
|
||||
], ,
|
||||
gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
|
||||
fi])
|
||||
if test $gt_cv_c_long_double = yes; then
|
||||
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
|
||||
fi
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# longlong.m4 serial 10
|
||||
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
|
||||
# longlong.m4 serial 13
|
||||
dnl Copyright (C) 1999-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.
|
||||
|
@ -7,8 +7,8 @@ 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.60, but can be removed once we
|
||||
# assume 2.61 everywhere.
|
||||
# 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
|
||||
|
@ -18,20 +18,11 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
|
|||
[
|
||||
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[long long int ll = 9223372036854775807ll;
|
||||
long long int nll = -9223372036854775807LL;
|
||||
typedef int a[((-9223372036854775807LL < 0
|
||||
&& 0 < 9223372036854775807ll)
|
||||
? 1 : -1)];
|
||||
int i = 63;]],
|
||||
[[long long int llmax = 9223372036854775807ll;
|
||||
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
|
||||
| (llmax / ll) | (llmax % ll));]])],
|
||||
[_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_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[@%:@include <limits.h>
|
||||
@%:@ifndef LLONG_MAX
|
||||
|
@ -60,13 +51,56 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
|
|||
fi
|
||||
])
|
||||
|
||||
# This macro is obsolescent and should go away soon.
|
||||
AC_DEFUN([gl_AC_TYPE_LONG_LONG],
|
||||
# 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_REQUIRE([AC_TYPE_LONG_LONG_INT])
|
||||
ac_cv_type_long_long=$ac_cv_type_long_long_int
|
||||
if test $ac_cv_type_long_long = yes; then
|
||||
AC_DEFINE(HAVE_LONG_LONG, 1,
|
||||
[Define if you have the 'long long' type.])
|
||||
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));]])
|
||||
])
|
||||
|
|
41
gl/m4/malloc.m4
Normal file
41
gl/m4/malloc.m4
Normal file
|
@ -0,0 +1,41 @@
|
|||
# malloc.m4 serial 8
|
||||
dnl Copyright (C) 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.
|
||||
|
||||
# gl_FUNC_MALLOC_POSIX
|
||||
# --------------------
|
||||
# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
|
||||
# fails), and replace malloc if it is not.
|
||||
AC_DEFUN([gl_FUNC_MALLOC_POSIX],
|
||||
[
|
||||
AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
|
||||
if test $gl_cv_func_malloc_posix = yes; then
|
||||
HAVE_MALLOC_POSIX=1
|
||||
AC_DEFINE([HAVE_MALLOC_POSIX], 1,
|
||||
[Define if the 'malloc' function is POSIX compliant.])
|
||||
else
|
||||
AC_LIBOBJ([malloc])
|
||||
HAVE_MALLOC_POSIX=0
|
||||
fi
|
||||
AC_SUBST([HAVE_MALLOC_POSIX])
|
||||
])
|
||||
|
||||
# Test whether malloc, realloc, calloc are POSIX compliant,
|
||||
# Set gl_cv_func_malloc_posix to yes or no accordingly.
|
||||
AC_DEFUN([gl_CHECK_MALLOC_POSIX],
|
||||
[
|
||||
AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant],
|
||||
[gl_cv_func_malloc_posix],
|
||||
[
|
||||
dnl It is too dangerous to try to allocate a large amount of memory:
|
||||
dnl some systems go to their knees when you do that. So assume that
|
||||
dnl all Unix implementations of the function are POSIX compliant.
|
||||
AC_TRY_COMPILE([],
|
||||
[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
choke me
|
||||
#endif
|
||||
], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no])
|
||||
])
|
||||
])
|
66
gl/m4/math_h.m4
Normal file
66
gl/m4/math_h.m4
Normal file
|
@ -0,0 +1,66 @@
|
|||
# math_h.m4 serial 9
|
||||
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_MATH_H],
|
||||
[
|
||||
AC_REQUIRE([gl_MATH_H_DEFAULTS])
|
||||
gl_CHECK_NEXT_HEADERS([math.h])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_MATH_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_MATH_H_DEFAULTS])
|
||||
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_MATH_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF])
|
||||
GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL])
|
||||
GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF])
|
||||
GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL])
|
||||
GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
|
||||
GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL])
|
||||
GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
|
||||
GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL])
|
||||
GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL])
|
||||
GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND])
|
||||
GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF])
|
||||
GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL])
|
||||
GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT])
|
||||
GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC])
|
||||
GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF])
|
||||
GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
|
||||
HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
|
||||
HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
|
||||
HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
|
||||
HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
|
||||
HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
|
||||
HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
|
||||
HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
|
||||
HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
|
||||
HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
|
||||
HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
|
||||
HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
|
||||
HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
|
||||
HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
|
||||
REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
|
||||
REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
|
||||
REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
|
||||
REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
|
||||
REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
|
||||
REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
|
||||
REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
|
||||
REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
|
||||
REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
|
||||
REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
|
||||
REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
|
||||
REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
|
||||
REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
|
||||
])
|
|
@ -1,14 +0,0 @@
|
|||
# mbchar.m4 serial 5
|
||||
dnl Copyright (C) 2005-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.
|
||||
|
||||
dnl autoconf tests required for use of mbchar.m4
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_MBCHAR],
|
||||
[
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
AC_LIBOBJ([mbchar])
|
||||
])
|
|
@ -1,17 +0,0 @@
|
|||
# mbiter.m4 serial 2
|
||||
dnl Copyright (C) 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 autoconf tests required for use of mbiter.h
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_MBITER],
|
||||
[
|
||||
AC_REQUIRE([AC_TYPE_MBSTATE_T])
|
||||
dnl The following line is that so the user can test HAVE_MBRTOWC before
|
||||
dnl #include "mbiter.h" or "mbuiter.h".
|
||||
AC_REQUIRE([gl_FUNC_MBRTOWC])
|
||||
:
|
||||
])
|
|
@ -1,31 +0,0 @@
|
|||
# mbrtowc.m4 serial 8
|
||||
dnl Copyright (C) 2001-2002, 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 From Paul Eggert
|
||||
|
||||
dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with
|
||||
dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere.
|
||||
|
||||
AC_DEFUN([gl_FUNC_MBRTOWC],
|
||||
[
|
||||
dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
|
||||
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
|
||||
gl_cv_func_mbrtowc,
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <wchar.h>]],
|
||||
[[wchar_t wc;
|
||||
char const s[] = "";
|
||||
size_t n = 1;
|
||||
mbstate_t state;
|
||||
return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
|
||||
gl_cv_func_mbrtowc=yes,
|
||||
gl_cv_func_mbrtowc=no)])
|
||||
if test $gl_cv_func_mbrtowc = yes; then
|
||||
AC_DEFINE([HAVE_MBRTOWC], 1,
|
||||
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
|
||||
fi
|
||||
])
|
30
gl/m4/mbstate_t.m4
Normal file
30
gl/m4/mbstate_t.m4
Normal file
|
@ -0,0 +1,30 @@
|
|||
# mbstate_t.m4 serial 9
|
||||
dnl Copyright (C) 2000, 2001, 2002 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.
|
||||
|
||||
# From Paul Eggert.
|
||||
|
||||
# BeOS 5 has <wchar.h> but does not define mbstate_t,
|
||||
# so you can't declare an object of that type.
|
||||
# Check for this incompatibility with Standard C.
|
||||
|
||||
# AC_TYPE_MBSTATE_T
|
||||
# -----------------
|
||||
AC_DEFUN([AC_TYPE_MBSTATE_T],
|
||||
[AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[AC_INCLUDES_DEFAULT
|
||||
# include <wchar.h>],
|
||||
[mbstate_t x; return sizeof x;])],
|
||||
[ac_cv_type_mbstate_t=yes],
|
||||
[ac_cv_type_mbstate_t=no])])
|
||||
if test $ac_cv_type_mbstate_t = yes; then
|
||||
AC_DEFINE([HAVE_MBSTATE_T], 1,
|
||||
[Define to 1 if <wchar.h> declares mbstate_t.])
|
||||
else
|
||||
AC_DEFINE([mbstate_t], int,
|
||||
[Define to a type if <wchar.h> does not define.])
|
||||
fi])
|
|
@ -1,18 +0,0 @@
|
|||
# memchr.m4 serial 4
|
||||
dnl Copyright (C) 2002, 2003, 2004 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_MEMCHR],
|
||||
[
|
||||
AC_REPLACE_FUNCS(memchr)
|
||||
if test $ac_cv_func_memchr = no; then
|
||||
gl_PREREQ_MEMCHR
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/memchr.c.
|
||||
AC_DEFUN([gl_PREREQ_MEMCHR], [
|
||||
AC_CHECK_HEADERS(bp-sym.h)
|
||||
])
|
|
@ -1,41 +0,0 @@
|
|||
# minmax.m4 serial 2
|
||||
dnl Copyright (C) 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.
|
||||
|
||||
AC_PREREQ(2.52)
|
||||
|
||||
AC_DEFUN([gl_MINMAX],
|
||||
[
|
||||
AC_REQUIRE([gl_PREREQ_MINMAX])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/minmax.h.
|
||||
AC_DEFUN([gl_PREREQ_MINMAX],
|
||||
[
|
||||
gl_MINMAX_IN_HEADER([limits.h])
|
||||
gl_MINMAX_IN_HEADER([sys/param.h])
|
||||
])
|
||||
|
||||
dnl gl_MINMAX_IN_HEADER(HEADER)
|
||||
dnl The parameter has to be a literal header name; it cannot be macro,
|
||||
dnl nor a shell variable. (Because autoheader collects only AC_DEFINE
|
||||
dnl invocations with a literal macro name.)
|
||||
AC_DEFUN([gl_MINMAX_IN_HEADER],
|
||||
[
|
||||
m4_pushdef([header], AS_TR_SH([$1]))
|
||||
m4_pushdef([HEADER], AS_TR_CPP([$1]))
|
||||
AC_CACHE_CHECK([whether <$1> defines MIN and MAX],
|
||||
[gl_cv_minmax_in_]header,
|
||||
[AC_TRY_COMPILE([#include <$1>
|
||||
int x = MIN (42, 17);], [],
|
||||
[gl_cv_minmax_in_]header[=yes],
|
||||
[gl_cv_minmax_in_]header[=no])])
|
||||
if test $gl_cv_minmax_in_[]header = yes; then
|
||||
AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1,
|
||||
[Define to 1 if <$1> defines the MIN and MAX macros.])
|
||||
fi
|
||||
m4_popdef([HEADER])
|
||||
m4_popdef([header])
|
||||
])
|
|
@ -1,18 +1,30 @@
|
|||
# netinet_in_h.m4 serial 1
|
||||
dnl Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
# netinet_in_h.m4 serial 3
|
||||
dnl Copyright (C) 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.
|
||||
|
||||
dnl Written by Simon Josefsson
|
||||
|
||||
AC_DEFUN([gl_HEADER_NETINET_IN],
|
||||
[
|
||||
AC_CHECK_HEADERS_ONCE([netinet/in.h])
|
||||
if test $ac_cv_header_netinet_in_h = yes; then
|
||||
AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
|
||||
[gl_cv_header_netinet_in_h_selfcontained],
|
||||
[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netinet/in.h>], [])],
|
||||
[gl_cv_header_netinet_in_h_selfcontained=yes],
|
||||
[gl_cv_header_netinet_in_h_selfcontained=no])
|
||||
])
|
||||
if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
|
||||
NETINET_IN_H=''
|
||||
else
|
||||
NETINET_IN_H='netinet/in.h'
|
||||
AC_CHECK_HEADERS([netinet/in.h])
|
||||
gl_CHECK_NEXT_HEADERS([netinet/in.h])
|
||||
if test $ac_cv_header_netinet_in_h = yes; then
|
||||
HAVE_NETINET_IN_H=1
|
||||
else
|
||||
HAVE_NETINET_IN_H=0
|
||||
fi
|
||||
AC_SUBST([HAVE_NETINET_IN_H])
|
||||
fi
|
||||
AC_SUBST(NETINET_IN_H)
|
||||
AC_SUBST([NETINET_IN_H])
|
||||
])
|
||||
|
|
25
gl/m4/po.m4
25
gl/m4/po.m4
|
@ -1,5 +1,5 @@
|
|||
# po.m4 serial 13 (gettext-0.15)
|
||||
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
|
||||
# po.m4 serial 15 (gettext-0.17)
|
||||
dnl Copyright (C) 1995-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.
|
||||
|
@ -27,6 +27,10 @@ AC_DEFUN([AM_PO_SUBDIRS],
|
|||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
|
||||
AC_REQUIRE([AM_NLS])dnl
|
||||
|
||||
dnl Release version of the gettext macros. This is used to ensure that
|
||||
dnl the gettext macros and po/Makefile.in.in are in sync.
|
||||
AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
|
||||
|
||||
dnl Perform the following tests also if --disable-nls has been given,
|
||||
dnl because they are needed for "make dist" to work.
|
||||
|
||||
|
@ -84,6 +88,10 @@ changequote([,])dnl
|
|||
test -n "$localedir" || localedir='${datadir}/locale'
|
||||
AC_SUBST([localedir])
|
||||
|
||||
dnl Support for AM_XGETTEXT_OPTION.
|
||||
test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
|
||||
AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
|
||||
|
||||
AC_CONFIG_COMMANDS([po-directories], [[
|
||||
for ac_file in $CONFIG_FILES; do
|
||||
# Support "outfile[:infile[:infile...]]"
|
||||
|
@ -426,3 +434,16 @@ EOF
|
|||
fi
|
||||
mv "$ac_file.tmp" "$ac_file"
|
||||
])
|
||||
|
||||
dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
|
||||
AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
|
||||
[
|
||||
XGETTEXT_EXTRA_OPTIONS=
|
||||
])
|
||||
|
||||
dnl Registers an option to be passed to xgettext in the po subdirectory.
|
||||
AC_DEFUN([AM_XGETTEXT_OPTION],
|
||||
[
|
||||
AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
|
||||
XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
|
||||
])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#serial 42
|
||||
#serial 48
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
# 2006, 2007 Free Software Foundation, Inc.
|
||||
|
@ -18,9 +18,12 @@ AC_DEFUN([gl_REGEX],
|
|||
|
||||
AC_ARG_WITH([included-regex],
|
||||
[AC_HELP_STRING([--without-included-regex],
|
||||
[don't compile regex; this is the default on
|
||||
[don't compile regex; this is the default on 32-bit
|
||||
systems with recent-enough versions of the GNU C
|
||||
Library (use with caution on other systems)])])
|
||||
Library (use with caution on other systems).
|
||||
On systems with 64-bit ptrdiff_t and 32-bit int,
|
||||
--with-included-regex is the default, in case
|
||||
regex functions operate on very long strings (>2GB)])])
|
||||
|
||||
case $with_included_regex in #(
|
||||
yes|no) ac_use_included_regex=$with_included_regex
|
||||
|
@ -29,8 +32,7 @@ AC_DEFUN([gl_REGEX],
|
|||
# If the system regex support is good enough that it passes the
|
||||
# following run test, then default to *not* using the included regex.c.
|
||||
# If cross compiling, assume the test would fail and use the included
|
||||
# regex.c. The first failing regular expression is from `Spencer ere
|
||||
# test #75' in grep-2.3.
|
||||
# regex.c.
|
||||
AC_CACHE_CHECK([for working re_compile_pattern],
|
||||
[gl_cv_func_re_compile_pattern_working],
|
||||
[AC_RUN_IFELSE(
|
||||
|
@ -74,68 +76,91 @@ AC_DEFUN([gl_REGEX],
|
|||
}
|
||||
#endif
|
||||
|
||||
/* This test is from glibc bug 3957, reported by Andrew Mackey. */
|
||||
re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("a[^x]b", 6, ®ex);
|
||||
if (s)
|
||||
return 1;
|
||||
|
||||
/* This should fail, but succeeds for glibc-2.5. */
|
||||
if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1)
|
||||
return 1;
|
||||
|
||||
/* This regular expression is from Spencer ere test number 75
|
||||
in grep-2.3. */
|
||||
re_set_syntax (RE_SYNTAX_POSIX_EGREP);
|
||||
memset (®ex, 0, sizeof (regex));
|
||||
memset (®ex, 0, sizeof regex);
|
||||
for (i = 0; i <= UCHAR_MAX; i++)
|
||||
folded_chars[i] = i;
|
||||
regex.translate = folded_chars;
|
||||
s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex);
|
||||
/* This should fail with _Invalid character class name_ error. */
|
||||
if (!s)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
/* This should succeed, but does not for e.g. glibc-2.1.3. */
|
||||
memset (®ex, 0, sizeof (regex));
|
||||
/* This should succeed, but does not for glibc-2.1.3. */
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("{1", 2, ®ex);
|
||||
|
||||
if (s)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
/* The following example is derived from a problem report
|
||||
against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
|
||||
memset (®ex, 0, sizeof (regex));
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("[an\371]*n", 7, ®ex);
|
||||
if (s)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
/* This should match, but does not for e.g. glibc-2.2.1. */
|
||||
/* This should match, but does not for glibc-2.2.1. */
|
||||
if (re_match (®ex, "an", 2, 0, ®s) != 2)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
memset (®ex, 0, sizeof (regex));
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("x", 1, ®ex);
|
||||
if (s)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
/* The version of regex.c in e.g. GNU libc-2.2.93 did not
|
||||
work with a negative RANGE argument. */
|
||||
/* glibc-2.2.93 does not work with a negative RANGE argument. */
|
||||
if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
/* The version of regex.c in older versions of gnulib
|
||||
ignored RE_ICASE. Detect that problem too. */
|
||||
memset (®ex, 0, sizeof (regex));
|
||||
re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("x", 1, ®ex);
|
||||
if (s)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
/* Catch a bug reported by Vin Shelton in
|
||||
http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
|
||||
*/
|
||||
re_set_syntax (RE_SYNTAX_POSIX_BASIC
|
||||
& ~RE_CONTEXT_INVALID_DUP
|
||||
& ~RE_NO_EMPTY_RANGES);
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex);
|
||||
if (s)
|
||||
return 1;
|
||||
|
||||
/* REG_STARTEND was added to glibc on 2004-01-15.
|
||||
Reject older versions. */
|
||||
if (! REG_STARTEND)
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
/* Reject hosts whose regoff_t values are too narrow.
|
||||
These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t
|
||||
and 32-bit int. */
|
||||
if (sizeof (regoff_t) < sizeof (ptrdiff_t)
|
||||
|| sizeof (regoff_t) < sizeof (ssize_t))
|
||||
exit (1);
|
||||
return 1;
|
||||
|
||||
exit (0);]])],
|
||||
return 0;]])],
|
||||
[gl_cv_func_re_compile_pattern_working=yes],
|
||||
[gl_cv_func_re_compile_pattern_working=no],
|
||||
dnl When crosscompiling, assume it is not working.
|
||||
|
@ -190,9 +215,8 @@ AC_DEFUN([gl_REGEX],
|
|||
# Prerequisites of lib/regex.c and lib/regex_internal.c.
|
||||
AC_DEFUN([gl_PREREQ_REGEX],
|
||||
[
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
AC_REQUIRE([AM_LANGINFO_CODESET])
|
||||
AC_CHECK_FUNCS_ONCE([iswctype mbrtowc mempcpy wcrtomb wcscoll])
|
||||
AC_CHECK_FUNCS_ONCE([isblank iswctype mbrtowc wcrtomb wcscoll])
|
||||
AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
|
||||
])
|
||||
|
|
|
@ -1,13 +1,29 @@
|
|||
# snprintf.m4 serial 2
|
||||
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
# snprintf.m4 serial 4
|
||||
dnl Copyright (C) 2002, 2003, 2004, 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_FUNC_SNPRINTF],
|
||||
[
|
||||
AC_REPLACE_FUNCS(snprintf)
|
||||
AC_CHECK_DECLS_ONCE(snprintf)
|
||||
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS([snprintf])
|
||||
if test $ac_cv_func_snprintf = no; then
|
||||
gl_REPLACE_SNPRINTF
|
||||
fi
|
||||
AC_CHECK_DECLS_ONCE([snprintf])
|
||||
if test $ac_cv_have_decl_snprintf = no; then
|
||||
HAVE_DECL_SNPRINTF=0
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_REPLACE_SNPRINTF],
|
||||
[
|
||||
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
||||
AC_LIBOBJ([snprintf])
|
||||
if test $ac_cv_func_snprintf = yes; then
|
||||
REPLACE_SNPRINTF=1
|
||||
fi
|
||||
gl_PREREQ_SNPRINTF
|
||||
])
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# socklen.m4 serial 4
|
||||
dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
# socklen.m4 serial 6
|
||||
dnl Copyright (C) 2005, 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.
|
||||
|
@ -12,14 +12,14 @@ dnl types for the argument to getsockopt, getpeername, etc. So we
|
|||
dnl have to test to find something that will work.
|
||||
|
||||
dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
|
||||
dnl it there first. That file is included by gnulib's socket_.h, which
|
||||
dnl it there first. That file is included by gnulib's sys_socket.in.h, which
|
||||
dnl all users of this module should include. Cygwin must not include
|
||||
dnl ws2tcpip.h.
|
||||
AC_DEFUN([gl_TYPE_SOCKLEN_T],
|
||||
[AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl
|
||||
AC_CHECK_TYPE([socklen_t], ,
|
||||
[AC_MSG_CHECKING([for socklen_t equivalent])
|
||||
AC_CACHE_VAL([gl_cv_gl_cv_socklen_t_equiv],
|
||||
AC_CACHE_VAL([gl_cv_socklen_t_equiv],
|
||||
[# Systems have either "struct sockaddr *" or
|
||||
# "void *" as the second argument to getpeername
|
||||
gl_cv_socklen_t_equiv=
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# stdint.m4 serial 22
|
||||
dnl Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc.
|
||||
# stdint.m4 serial 29
|
||||
dnl Copyright (C) 2001-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.
|
||||
|
@ -45,32 +45,32 @@ AC_DEFUN([gl_STDINT_H],
|
|||
fi
|
||||
AC_SUBST([HAVE_SYS_TYPES_H])
|
||||
|
||||
dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_stdint_h.
|
||||
gl_CHECK_NEXT_HEADERS([stdint.h])
|
||||
if test $ac_cv_header_stdint_h = yes; then
|
||||
gl_ABSOLUTE_HEADER([stdint.h])
|
||||
ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\"
|
||||
HAVE_STDINT_H=1
|
||||
else
|
||||
ABSOLUTE_STDINT_H=\"no/such/file/stdint.h\"
|
||||
HAVE_STDINT_H=0
|
||||
fi
|
||||
AC_SUBST([ABSOLUTE_STDINT_H])
|
||||
AC_SUBST([HAVE_STDINT_H])
|
||||
|
||||
dnl Now see whether we need a substitute <stdint.h>. Use
|
||||
dnl ABSOLUTE_STDINT_H, not <stdint.h>, so that it also works during
|
||||
dnl a "config.status --recheck" if a stdint.h has been
|
||||
dnl created in the build directory.
|
||||
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([[
|
||||
#include <stddef.h>
|
||||
#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 */
|
||||
#include ABSOLUTE_STDINT_H
|
||||
#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;
|
||||
|
@ -142,12 +142,32 @@ 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 < 0 && 0 < PTRDIFF_MAX ? 1 : -1;
|
||||
int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= 0 && 0 < SIG_ATOMIC_MAX ? 1 : -1;
|
||||
int check_SIZE: 0 < SIZE_MAX ? 1 : -1;
|
||||
int check_WCHAR: WCHAR_MIN <= 0 && 0 < WCHAR_MAX ? 1 : -1;
|
||||
int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1;
|
||||
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:
|
||||
|
@ -202,6 +222,10 @@ struct s {
|
|||
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
|
||||
|
@ -337,14 +361,16 @@ AC_DEFUN([gl_STDINT_INCLUDES],
|
|||
included before <wchar.h>. */
|
||||
#include <stddef.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <wchar.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_.h.
|
||||
dnl of interest to stdint.in.h.
|
||||
AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
|
||||
[
|
||||
gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
|
||||
|
|
85
gl/m4/stdio_h.m4
Normal file
85
gl/m4/stdio_h.m4
Normal file
|
@ -0,0 +1,85 @@
|
|||
# stdio_h.m4 serial 9
|
||||
dnl Copyright (C) 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_STDIO_H],
|
||||
[
|
||||
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
||||
gl_CHECK_NEXT_HEADERS([stdio.h])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
||||
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_STDIO_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
|
||||
GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
|
||||
GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
|
||||
GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
|
||||
GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
|
||||
GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
|
||||
GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
|
||||
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
|
||||
GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
|
||||
GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
|
||||
GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
|
||||
GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
|
||||
GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
|
||||
GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
|
||||
GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
|
||||
GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
|
||||
GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
|
||||
GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
|
||||
REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
|
||||
REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
|
||||
REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
|
||||
REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
|
||||
HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
|
||||
REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
|
||||
HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
|
||||
REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
|
||||
REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
|
||||
HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
|
||||
REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
|
||||
REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
|
||||
REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
|
||||
HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
|
||||
REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
|
||||
REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
|
||||
HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
|
||||
REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
|
||||
REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
|
||||
REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
|
||||
HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
|
||||
HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
|
||||
REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
|
||||
])
|
||||
|
||||
dnl Code shared by fseeko and ftello. Determine if large files are supported,
|
||||
dnl but stdin does not start as a large file by default.
|
||||
AC_DEFUN([gl_STDIN_LARGE_OFFSET],
|
||||
[
|
||||
AC_CACHE_CHECK([whether stdin defaults to large file offsets],
|
||||
[gl_cv_var_stdin_large_offset],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],
|
||||
[#if defined __SL64 && defined __SCLE /* cygwin */
|
||||
/* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
|
||||
fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
|
||||
it is easier to do a version check than building a runtime test. */
|
||||
# include <cygwin/version.h>
|
||||
# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
|
||||
choke me
|
||||
# endif
|
||||
#endif])],
|
||||
[gl_cv_var_stdin_large_offset=yes],
|
||||
[gl_cv_var_stdin_large_offset=no])])
|
||||
])
|
42
gl/m4/stdlib_h.m4
Normal file
42
gl/m4/stdlib_h.m4
Normal file
|
@ -0,0 +1,42 @@
|
|||
# stdlib_h.m4 serial 5
|
||||
dnl Copyright (C) 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_STDLIB_H],
|
||||
[
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
gl_CHECK_NEXT_HEADERS([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_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_SETENV=0; AC_SUBST([GNULIB_SETENV])
|
||||
GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
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_SETENV=1; AC_SUBST([HAVE_SETENV])
|
||||
HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
|
||||
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
|
||||
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
|
||||
VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV])
|
||||
])
|
|
@ -1,39 +0,0 @@
|
|||
# strcase.m4 serial 4
|
||||
dnl Copyright (C) 2002, 2005-2006 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_STRCASE],
|
||||
[
|
||||
gl_FUNC_STRCASECMP
|
||||
gl_FUNC_STRNCASECMP
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FUNC_STRCASECMP],
|
||||
[
|
||||
dnl No known system has a strcasecmp() function that works correctly in
|
||||
dnl multibyte locales. Therefore we use our version always.
|
||||
AC_LIBOBJ(strcasecmp)
|
||||
gl_PREREQ_STRCASECMP
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FUNC_STRNCASECMP],
|
||||
[
|
||||
AC_REPLACE_FUNCS(strncasecmp)
|
||||
AC_CHECK_DECLS(strncasecmp)
|
||||
if test $ac_cv_func_strncasecmp = no; then
|
||||
gl_PREREQ_STRNCASECMP
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/strcasecmp.c.
|
||||
AC_DEFUN([gl_PREREQ_STRCASECMP], [
|
||||
AC_REQUIRE([gl_FUNC_MBRTOWC])
|
||||
:
|
||||
])
|
||||
|
||||
# Prerequisites of lib/strncasecmp.c.
|
||||
AC_DEFUN([gl_PREREQ_STRNCASECMP], [
|
||||
:
|
||||
])
|
|
@ -1,13 +1,20 @@
|
|||
# strdup.m4 serial 7
|
||||
dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# strdup.m4 serial 9
|
||||
|
||||
dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
||||
dnl 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_STRDUP],
|
||||
[
|
||||
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
|
||||
AC_REPLACE_FUNCS(strdup)
|
||||
AC_CHECK_DECLS_ONCE(strdup)
|
||||
if test $ac_cv_have_decl_strdup = no; then
|
||||
HAVE_DECL_STRDUP=0
|
||||
fi
|
||||
gl_PREREQ_STRDUP
|
||||
])
|
||||
|
||||
|
|
47
gl/m4/strerror.m4
Normal file
47
gl/m4/strerror.m4
Normal file
|
@ -0,0 +1,47 @@
|
|||
# strerror.m4 serial 7
|
||||
dnl Copyright (C) 2002, 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_FUNC_STRERROR],
|
||||
[
|
||||
AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
|
||||
if test $gl_cv_func_working_strerror = no; then
|
||||
AC_LIBOBJ([strerror])
|
||||
AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
|
||||
[Define this to 1 if strerror is broken.])
|
||||
fi
|
||||
])
|
||||
|
||||
# Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ).
|
||||
AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
|
||||
[
|
||||
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
|
||||
AC_CACHE_CHECK([for working strerror function],
|
||||
[gl_cv_func_working_strerror],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <string.h>
|
||||
],
|
||||
[return !*strerror (-2);])],
|
||||
[gl_cv_func_working_strerror=yes],
|
||||
[gl_cv_func_working_strerror=no],
|
||||
[dnl Assume crossbuild works if it compiles.
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <string.h>
|
||||
],
|
||||
[return !*strerror (-2);])],
|
||||
[gl_cv_func_working_strerror=yes],
|
||||
[gl_cv_func_working_strerror=no])])])
|
||||
if test $gl_cv_func_working_strerror = no ; then
|
||||
REPLACE_STRERROR=1
|
||||
gl_PREREQ_STRERROR
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/strerror.c.
|
||||
AC_DEFUN([gl_PREREQ_STRERROR], [
|
||||
AC_CHECK_DECLS([strerror])
|
||||
])
|
87
gl/m4/string_h.m4
Normal file
87
gl/m4/string_h.m4
Normal file
|
@ -0,0 +1,87 @@
|
|||
# Configure a GNU-like replacement for <string.h>.
|
||||
|
||||
# Copyright (C) 2007, 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.
|
||||
|
||||
# serial 4
|
||||
|
||||
# Written by Paul Eggert.
|
||||
|
||||
AC_DEFUN([gl_HEADER_STRING_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_STRING_H_BODY])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_HEADER_STRING_H_BODY],
|
||||
[
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
|
||||
gl_CHECK_NEXT_HEADERS([string.h])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_STRING_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
|
||||
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
|
||||
GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
|
||||
GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
|
||||
GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY])
|
||||
GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY])
|
||||
GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL])
|
||||
GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP])
|
||||
GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP])
|
||||
GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN])
|
||||
GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK])
|
||||
GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP])
|
||||
GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR])
|
||||
GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR])
|
||||
GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R])
|
||||
GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN])
|
||||
GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN])
|
||||
GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR])
|
||||
GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR])
|
||||
GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR])
|
||||
GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP])
|
||||
GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
|
||||
GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
|
||||
GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR])
|
||||
GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN])
|
||||
GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK])
|
||||
GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN])
|
||||
GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP])
|
||||
GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R])
|
||||
GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
|
||||
GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
|
||||
HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
|
||||
HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
|
||||
HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
|
||||
HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
|
||||
HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
|
||||
HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
|
||||
HAVE_STRNDUP=1; AC_SUBST([HAVE_STRNDUP])
|
||||
HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
|
||||
HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
|
||||
HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
|
||||
HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
|
||||
HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
|
||||
HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
|
||||
HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR])
|
||||
HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
|
||||
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
|
||||
REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
|
||||
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
|
||||
REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
|
||||
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# strndup.m4 serial 11
|
||||
dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
|
||||
# strndup.m4 serial 14
|
||||
dnl Copyright (C) 2002-2003, 2005-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.
|
||||
|
@ -7,15 +7,19 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_FUNC_STRNDUP],
|
||||
[
|
||||
dnl Persuade glibc <string.h> to declare strndup().
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
|
||||
AC_CHECK_DECLS_ONCE([strndup])
|
||||
if test $ac_cv_have_decl_strndup = no; then
|
||||
HAVE_DECL_STRNDUP=0
|
||||
fi
|
||||
|
||||
# AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
|
||||
AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup,
|
||||
[AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([#include <string.h>
|
||||
#include <stdlib.h>], [[
|
||||
#include <stdlib.h>], [[
|
||||
#ifndef HAVE_DECL_STRNDUP
|
||||
extern char *strndup (const char *, size_t);
|
||||
#endif
|
||||
|
@ -39,6 +43,7 @@ AC_DEFUN([gl_FUNC_STRNDUP],
|
|||
AC_DEFINE([HAVE_STRNDUP], 1,
|
||||
[Define if you have the strndup() function and it works.])
|
||||
else
|
||||
HAVE_STRNDUP=0
|
||||
AC_LIBOBJ([strndup])
|
||||
gl_PREREQ_STRNDUP
|
||||
fi
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# strnlen.m4 serial 6
|
||||
dnl Copyright (C) 2002-2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
# strnlen.m4 serial 9
|
||||
dnl Copyright (C) 2002-2003, 2005-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.
|
||||
|
@ -7,11 +7,17 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_FUNC_STRNLEN],
|
||||
[
|
||||
dnl Persuade glibc <string.h> to declare strnlen().
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
|
||||
AC_CHECK_DECLS_ONCE([strnlen])
|
||||
if test $ac_cv_have_decl_strnlen = no; then
|
||||
HAVE_DECL_STRNLEN=0
|
||||
fi
|
||||
|
||||
AC_FUNC_STRNLEN
|
||||
if test $ac_cv_func_strnlen_working = no; then
|
||||
# This is necessary because automake-1.6.1 doens't understand
|
||||
# This is necessary because automake-1.6.1 doesn't understand
|
||||
# that the above use of AC_FUNC_STRNLEN means we may have to use
|
||||
# lib/strnlen.c.
|
||||
#AC_LIBOBJ(strnlen)
|
||||
|
@ -22,6 +28,4 @@ AC_DEFUN([gl_FUNC_STRNLEN],
|
|||
])
|
||||
|
||||
# Prerequisites of lib/strnlen.c.
|
||||
AC_DEFUN([gl_PREREQ_STRNLEN], [
|
||||
AC_CHECK_DECLS_ONCE(strnlen)
|
||||
])
|
||||
AC_DEFUN([gl_PREREQ_STRNLEN], [:])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# sys_socket_h.m4 serial 2
|
||||
dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
# sys_socket_h.m4 serial 4
|
||||
dnl Copyright (C) 2005, 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.
|
||||
|
@ -8,16 +8,44 @@ dnl From Simon Josefsson.
|
|||
|
||||
AC_DEFUN([gl_HEADER_SYS_SOCKET],
|
||||
[
|
||||
AC_CHECK_HEADERS_ONCE([sys/socket.h])
|
||||
if test $ac_cv_header_sys_socket_h = yes; then
|
||||
AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
|
||||
[gl_cv_header_sys_socket_h_selfcontained],
|
||||
[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h>], [])],
|
||||
[gl_cv_header_sys_socket_h_selfcontained=yes],
|
||||
[gl_cv_header_sys_socket_h_selfcontained=no])
|
||||
])
|
||||
if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
|
||||
SYS_SOCKET_H=''
|
||||
else
|
||||
dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
|
||||
dnl the check for those headers unconditional; yet cygwin reports
|
||||
dnl that the headers are present but cannot be compiled (since on
|
||||
dnl cygwin, all socket information should come from sys/socket.h).
|
||||
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
|
||||
SYS_SOCKET_H='sys/socket.h'
|
||||
|
||||
gl_CHECK_NEXT_HEADERS([sys/socket.h])
|
||||
if test $ac_cv_header_sys_socket_h = yes; then
|
||||
HAVE_SYS_SOCKET_H=1
|
||||
HAVE_WINSOCK2_H=0
|
||||
HAVE_WS2TCPIP_H=0
|
||||
else
|
||||
HAVE_SYS_SOCKET_H=0
|
||||
dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
|
||||
dnl the check for those headers unconditional; yet cygwin reports
|
||||
dnl that the headers are present but cannot be compiled (since on
|
||||
dnl cygwin, all socket information should come from sys/socket.h).
|
||||
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
|
||||
if test $ac_cv_header_winsock2_h = yes; then
|
||||
HAVE_WINSOCK2_H=1
|
||||
else
|
||||
HAVE_WINSOCK2_H=0
|
||||
fi
|
||||
if test $ac_cv_header_ws2tcpip_h = yes; then
|
||||
HAVE_WS2TCPIP_H=1
|
||||
else
|
||||
HAVE_WS2TCPIP_H=0
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([HAVE_SYS_SOCKET_H])
|
||||
AC_SUBST([HAVE_WINSOCK2_H])
|
||||
AC_SUBST([HAVE_WS2TCPIP_H])
|
||||
fi
|
||||
AC_SUBST(SYS_SOCKET_H)
|
||||
AC_SUBST([SYS_SOCKET_H])
|
||||
])
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
# ulonglong.m4 serial 6
|
||||
dnl Copyright (C) 1999-2006 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_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
|
||||
# This fixes a bug in Autoconf 2.60, but can be removed once we
|
||||
# assume 2.61 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_LANG_PROGRAM(
|
||||
[[unsigned long long int ull = 18446744073709551615ULL;
|
||||
typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1
|
||||
? 1 : -1)];
|
||||
int i = 63;]],
|
||||
[[unsigned long long int ullmax = 18446744073709551615ull;
|
||||
return (ull << 63 | ull >> 63 | ull << i | ull >> i
|
||||
| ullmax / ull | ullmax % ull);]])],
|
||||
[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
|
||||
])
|
||||
|
||||
# This macro is obsolescent and should go away soon.
|
||||
AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
|
||||
[
|
||||
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
|
||||
ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int
|
||||
if test $ac_cv_type_unsigned_long_long = yes; then
|
||||
AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
|
||||
[Define if you have the 'unsigned long long' type.])
|
||||
fi
|
||||
])
|
|
@ -1,32 +1,61 @@
|
|||
# unistd_h.m4 serial 3
|
||||
dnl Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
# unistd_h.m4 serial 10
|
||||
dnl Copyright (C) 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.
|
||||
|
||||
dnl Written by Simon Josefsson
|
||||
dnl Written by Simon Josefsson, Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_HEADER_UNISTD],
|
||||
AC_DEFUN([gl_UNISTD_H],
|
||||
[
|
||||
AC_CHECK_HEADERS([unistd.h], [
|
||||
UNISTD_H=''
|
||||
], [
|
||||
UNISTD_H='unistd.h'
|
||||
])
|
||||
AC_SUBST(UNISTD_H)
|
||||
dnl This module decides to build unistd.h if it is missing.
|
||||
dnl The fchdir module decides to build unistd.h if fchdir() is missing.
|
||||
dnl Therefore check for the prerequisites of lib/unistd.h always.
|
||||
gl_PREREQ_UNISTD
|
||||
])
|
||||
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_UNISTD_H_DEFAULTS])
|
||||
|
||||
gl_CHECK_NEXT_HEADERS([unistd.h])
|
||||
|
||||
dnl Prerequisites of lib/unistd.h.
|
||||
AC_DEFUN([gl_PREREQ_UNISTD],
|
||||
[
|
||||
AC_CHECK_HEADERS_ONCE([unistd.h])
|
||||
if test $ac_cv_header_unistd_h = yes; then
|
||||
gl_ABSOLUTE_HEADER([unistd.h])
|
||||
ABSOLUTE_UNISTD_H=\"$gl_cv_absolute_unistd_h\"
|
||||
HAVE_UNISTD_H=1
|
||||
else
|
||||
HAVE_UNISTD_H=0
|
||||
fi
|
||||
AC_SUBST([ABSOLUTE_UNISTD_H])
|
||||
AC_SUBST([HAVE_UNISTD_H])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_UNISTD_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
|
||||
GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
|
||||
GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
|
||||
GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
|
||||
GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
|
||||
GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
|
||||
GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
|
||||
GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
|
||||
GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
|
||||
GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
|
||||
GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_DUP2=1; AC_SUBST([HAVE_DUP2])
|
||||
HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
|
||||
HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
|
||||
HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
|
||||
HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
|
||||
HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
|
||||
HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
|
||||
HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
|
||||
REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
|
||||
REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR])
|
||||
REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
|
||||
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
|
||||
REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
|
||||
REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vasnprintf.m4 serial 7
|
||||
dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc.
|
||||
# vasnprintf.m4 serial 24
|
||||
dnl Copyright (C) 2002-2004, 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.
|
||||
|
@ -7,23 +7,33 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_FUNC_VASNPRINTF],
|
||||
[
|
||||
AC_REQUIRE([gl_EOVERFLOW])
|
||||
AC_REPLACE_FUNCS(vasnprintf)
|
||||
AC_CHECK_FUNCS_ONCE([vasnprintf])
|
||||
if test $ac_cv_func_vasnprintf = no; then
|
||||
AC_LIBOBJ(printf-args)
|
||||
AC_LIBOBJ(printf-parse)
|
||||
AC_LIBOBJ(asnprintf)
|
||||
gl_PREREQ_PRINTF_ARGS
|
||||
gl_PREREQ_PRINTF_PARSE
|
||||
gl_PREREQ_VASNPRINTF
|
||||
gl_PREREQ_ASNPRINTF
|
||||
gl_REPLACE_VASNPRINTF
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_REPLACE_VASNPRINTF],
|
||||
[
|
||||
AC_CHECK_FUNCS_ONCE([vasnprintf])
|
||||
AC_LIBOBJ([vasnprintf])
|
||||
AC_LIBOBJ([printf-args])
|
||||
AC_LIBOBJ([printf-parse])
|
||||
AC_LIBOBJ([asnprintf])
|
||||
if test $ac_cv_func_vasnprintf = yes; then
|
||||
AC_DEFINE([REPLACE_VASNPRINTF], 1,
|
||||
[Define if vasnprintf exists but is overridden by gnulib.])
|
||||
fi
|
||||
gl_PREREQ_PRINTF_ARGS
|
||||
gl_PREREQ_PRINTF_PARSE
|
||||
gl_PREREQ_VASNPRINTF
|
||||
gl_PREREQ_ASNPRINTF
|
||||
])
|
||||
|
||||
# Prequisites of lib/printf-args.h, lib/printf-args.c.
|
||||
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
|
||||
[
|
||||
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
|
||||
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
|
||||
AC_REQUIRE([gt_TYPE_WCHAR_T])
|
||||
AC_REQUIRE([gt_TYPE_WINT_T])
|
||||
])
|
||||
|
@ -32,11 +42,13 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
|
|||
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
|
||||
[
|
||||
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
|
||||
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
|
||||
AC_REQUIRE([gt_TYPE_WCHAR_T])
|
||||
AC_REQUIRE([gt_TYPE_WINT_T])
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])
|
||||
AC_CHECK_TYPES(ptrdiff_t)
|
||||
AC_CHECK_TYPE([ptrdiff_t], ,
|
||||
[AC_DEFINE([ptrdiff_t], [long],
|
||||
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
|
||||
])
|
||||
AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
|
||||
])
|
||||
|
||||
|
@ -45,10 +57,202 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
|
|||
[
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])
|
||||
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
|
||||
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
|
||||
AC_REQUIRE([gt_TYPE_WCHAR_T])
|
||||
AC_REQUIRE([gt_TYPE_WINT_T])
|
||||
AC_CHECK_FUNCS(snprintf wcslen)
|
||||
dnl Use the _snprintf function only if it is declared (because on NetBSD it
|
||||
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
|
||||
AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
|
||||
# arguments.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
|
||||
case "$gl_cv_func_printf_long_double" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
'long double' arguments.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double'
|
||||
# arguments.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_INFINITE])
|
||||
case "$gl_cv_func_printf_infinite" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
infinite 'double' arguments.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double'
|
||||
# arguments.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
|
||||
dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if
|
||||
dnl NEED_PRINTF_LONG_DOUBLE is already set.
|
||||
AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE])
|
||||
case "$gl_cv_func_printf_long_double" in
|
||||
*yes)
|
||||
case "$gl_cv_func_printf_infinite_long_double" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
infinite 'long double' arguments.])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
|
||||
case "$gl_cv_func_printf_directive_a" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
the 'a' and 'A' directives.])
|
||||
AC_CHECK_FUNCS([nl_langinfo])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
|
||||
case "$gl_cv_func_printf_directive_f" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
the 'F' directive.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
|
||||
case "$gl_cv_func_printf_flag_grouping" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1,
|
||||
[Define if the vasnprintf implementation needs special code for the
|
||||
' flag.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
|
||||
case "$gl_cv_func_printf_flag_leftadjust" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1,
|
||||
[Define if the vasnprintf implementation needs special code for the
|
||||
'-' flag.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
|
||||
case "$gl_cv_func_printf_flag_zero" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1,
|
||||
[Define if the vasnprintf implementation needs special code for the
|
||||
0 flag.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_PRECISION])
|
||||
case "$gl_cv_func_printf_precision" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
supporting large precisions without arbitrary bounds.])
|
||||
AC_DEFINE([NEED_PRINTF_DOUBLE], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
'double' arguments.])
|
||||
AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
'long double' arguments.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory
|
||||
# conditions.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
|
||||
[
|
||||
AC_REQUIRE([gl_PRINTF_ENOMEM])
|
||||
case "$gl_cv_func_printf_enomem" in
|
||||
*yes)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([NEED_PRINTF_ENOMEM], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
surviving out-of-memory conditions.])
|
||||
AC_DEFINE([NEED_PRINTF_DOUBLE], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
'double' arguments.])
|
||||
AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
|
||||
[Define if the vasnprintf implementation needs special code for
|
||||
'long double' arguments.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
|
||||
AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
|
||||
[
|
||||
AC_REQUIRE([gl_PREREQ_VASNPRINTF])
|
||||
gl_PREREQ_VASNPRINTF_LONG_DOUBLE
|
||||
gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
|
||||
gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
|
||||
gl_PREREQ_VASNPRINTF_DIRECTIVE_A
|
||||
gl_PREREQ_VASNPRINTF_DIRECTIVE_F
|
||||
gl_PREREQ_VASNPRINTF_FLAG_GROUPING
|
||||
gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
|
||||
gl_PREREQ_VASNPRINTF_FLAG_ZERO
|
||||
gl_PREREQ_VASNPRINTF_PRECISION
|
||||
gl_PREREQ_VASNPRINTF_ENOMEM
|
||||
])
|
||||
|
||||
# Prerequisites of lib/asnprintf.c.
|
||||
|
|
|
@ -1,25 +1,37 @@
|
|||
# vasprintf.m4 serial 2
|
||||
dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
|
||||
# vasprintf.m4 serial 6
|
||||
dnl Copyright (C) 2002-2003, 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_FUNC_VASPRINTF],
|
||||
[
|
||||
AC_REPLACE_FUNCS(vasprintf)
|
||||
AC_CHECK_FUNCS([vasprintf])
|
||||
if test $ac_cv_func_vasprintf = no; then
|
||||
AC_LIBOBJ(asprintf)
|
||||
gl_PREREQ_VASPRINTF_H
|
||||
gl_PREREQ_VASPRINTF
|
||||
gl_PREREQ_ASPRINTF
|
||||
gl_REPLACE_VASPRINTF
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/vasprintf.h.
|
||||
AC_DEFUN([gl_REPLACE_VASPRINTF],
|
||||
[
|
||||
AC_LIBOBJ([vasprintf])
|
||||
AC_LIBOBJ([asprintf])
|
||||
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
||||
if test $ac_cv_func_vasprintf = yes; then
|
||||
REPLACE_VASPRINTF=1
|
||||
else
|
||||
HAVE_VASPRINTF=0
|
||||
fi
|
||||
gl_PREREQ_VASPRINTF_H
|
||||
gl_PREREQ_VASPRINTF
|
||||
gl_PREREQ_ASPRINTF
|
||||
])
|
||||
|
||||
# Prerequisites of the vasprintf portion of lib/stdio.h.
|
||||
AC_DEFUN([gl_PREREQ_VASPRINTF_H],
|
||||
[
|
||||
dnl Persuade glibc <stdio.h> to declare asprintf() and vasprintf().
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/vasprintf.c.
|
||||
|
|
|
@ -1,13 +1,29 @@
|
|||
# vsnprintf.m4 serial 2
|
||||
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
# vsnprintf.m4 serial 4
|
||||
dnl Copyright (C) 2002, 2003, 2004, 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_FUNC_VSNPRINTF],
|
||||
[
|
||||
AC_REPLACE_FUNCS(vsnprintf)
|
||||
AC_CHECK_DECLS_ONCE(vsnprintf)
|
||||
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS([vsnprintf])
|
||||
if test $ac_cv_func_vsnprintf = no; then
|
||||
gl_REPLACE_VSNPRINTF
|
||||
fi
|
||||
AC_CHECK_DECLS_ONCE([vsnprintf])
|
||||
if test $ac_cv_have_decl_vsnprintf = no; then
|
||||
HAVE_DECL_VSNPRINTF=0
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_REPLACE_VSNPRINTF],
|
||||
[
|
||||
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
||||
AC_LIBOBJ([vsnprintf])
|
||||
if test $ac_cv_func_vsnprintf = yes; then
|
||||
REPLACE_VSNPRINTF=1
|
||||
fi
|
||||
gl_PREREQ_VSNPRINTF
|
||||
])
|
||||
|
||||
|
|
|
@ -7,23 +7,48 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
|
||||
dnl Written by Eric Blake.
|
||||
|
||||
# wchar.m4 serial 1
|
||||
# wchar.m4 serial 4
|
||||
|
||||
AC_DEFUN([gl_WCHAR_H],
|
||||
[
|
||||
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
|
||||
AC_CACHE_CHECK([whether <wchar.h> is standalone],
|
||||
[gl_cv_header_wchar_h_standalone],
|
||||
[AC_COMPILE_IFELSE([[#include <wchar.h>
|
||||
wchar_t w;]],
|
||||
[gl_cv_header_wchar_h_standalone=yes],
|
||||
[gl_cv_header_wchar_h_standalone=no])])
|
||||
if test $gl_cv_header_wchar_h_standalone = yes; then
|
||||
WCHAR_H=
|
||||
else
|
||||
gl_ABSOLUTE_HEADER([wchar.h])
|
||||
ABSOLUTE_WCHAR_H=\"$gl_cv_absolute_wchar_h\"
|
||||
if test $gl_cv_header_wchar_h_standalone != yes; then
|
||||
WCHAR_H=wchar.h
|
||||
fi
|
||||
AC_SUBST([ABSOLUTE_WCHAR_H])
|
||||
|
||||
dnl Prepare for creating substitute <wchar.h>.
|
||||
dnl Do it always: WCHAR_H may be empty here but can be set later.
|
||||
dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
|
||||
dnl character support).
|
||||
AC_CHECK_HEADERS_ONCE([wchar.h])
|
||||
if test $ac_cv_header_wchar_h = yes; then
|
||||
HAVE_WCHAR_H=1
|
||||
else
|
||||
HAVE_WCHAR_H=0
|
||||
fi
|
||||
AC_SUBST([HAVE_WCHAR_H])
|
||||
gl_CHECK_NEXT_HEADERS([wchar.h])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
|
||||
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_WCHAR_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
|
||||
REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
|
||||
WCHAR_H=
|
||||
AC_SUBST([WCHAR_H])
|
||||
])
|
||||
|
|
|
@ -10,6 +10,12 @@ dnl Written by Paul Eggert.
|
|||
AC_DEFUN([gl_WCTYPE_H],
|
||||
[
|
||||
AC_CHECK_FUNCS_ONCE([iswcntrl])
|
||||
if test $ac_cv_func_iswcntrl = yes; then
|
||||
HAVE_ISWCNTRL=1
|
||||
else
|
||||
HAVE_ISWCNTRL=0
|
||||
fi
|
||||
AC_SUBST([HAVE_ISWCNTRL])
|
||||
AC_CHECK_HEADERS_ONCE([wctype.h])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
|
||||
|
@ -23,19 +29,16 @@ AC_DEFUN([gl_WCTYPE_H],
|
|||
|
||||
WCTYPE_H=wctype.h
|
||||
if test $ac_cv_header_wctype_h = yes; then
|
||||
if test "$ac_cv_func_iswcntrl" = yes; then
|
||||
if test $ac_cv_func_iswcntrl = yes; then
|
||||
WCTYPE_H=
|
||||
fi
|
||||
dnl Compute ABSOLUTE_WCTYPE_H even if WCTYPE_H is empty,
|
||||
dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty,
|
||||
dnl for the benefit of builds from non-distclean directories.
|
||||
gl_ABSOLUTE_HEADER([wctype.h])
|
||||
ABSOLUTE_WCTYPE_H=\"$gl_cv_absolute_wctype_h\"
|
||||
gl_CHECK_NEXT_HEADERS([wctype.h])
|
||||
HAVE_WCTYPE_H=1
|
||||
else
|
||||
ABSOLUTE_WCTYPE_H=\"no/such/file/wctype.h\"
|
||||
HAVE_WCTYPE_H=0
|
||||
fi
|
||||
AC_SUBST([ABSOLUTE_WCTYPE_H])
|
||||
AC_SUBST([HAVE_WCTYPE_H])
|
||||
AC_SUBST([WCTYPE_H])
|
||||
])
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
# wcwidth.m4 serial 8
|
||||
dnl Copyright (C) 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_FUNC_WCWIDTH],
|
||||
[
|
||||
dnl Persuade glibc <wchar.h> to declare wcwidth().
|
||||
AC_REQUIRE([AC_GNU_SOURCE])
|
||||
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([gt_TYPE_WCHAR_T])
|
||||
AC_REQUIRE([gt_TYPE_WINT_T])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([wchar.h])
|
||||
AC_CHECK_FUNCS_ONCE([wcwidth])
|
||||
|
||||
AC_CHECK_DECLS([wcwidth], [], [], [
|
||||
/* AIX 3.2.5 declares wcwidth in <string.h>. */
|
||||
#include <string.h>
|
||||
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
|
||||
<wchar.h>.
|
||||
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 <stdio.h>
|
||||
#include <time.h>
|
||||
#include <wchar.h>
|
||||
])])
|
|
@ -1,4 +1,4 @@
|
|||
# wint_t.m4 serial 2 (gettext-0.12)
|
||||
# wint_t.m4 serial 2 (gettext-0.17)
|
||||
dnl Copyright (C) 2003, 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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue