Imported Upstream version 1.4.16+git20130902
This commit is contained in:
parent
e76be63abf
commit
e70fb8c051
517 changed files with 44015 additions and 43295 deletions
|
@ -1,5 +1,5 @@
|
|||
# 00gnulib.m4 serial 2
|
||||
dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2009-2013 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.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# alloca.m4 serial 9
|
||||
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
|
||||
# alloca.m4 serial 14
|
||||
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -7,10 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
|
||||
AC_DEFUN([gl_FUNC_ALLOCA],
|
||||
[
|
||||
dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
|
||||
AC_REQUIRE([AC_PROG_CPP])
|
||||
AC_REQUIRE([AC_PROG_EGREP])
|
||||
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])
|
||||
if test $ac_cv_func_alloca_works = no; then
|
||||
gl_PREREQ_ALLOCA
|
||||
|
@ -40,8 +36,86 @@ AC_DEFUN([gl_FUNC_ALLOCA],
|
|||
ALLOCA_H=alloca.h
|
||||
fi
|
||||
AC_SUBST([ALLOCA_H])
|
||||
AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/alloca.c.
|
||||
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
|
||||
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
|
||||
|
||||
# This works around a bug in autoconf <= 2.68.
|
||||
# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
|
||||
|
||||
m4_version_prereq([2.69], [] ,[
|
||||
|
||||
# This is taken from the following Autoconf patch:
|
||||
# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
|
||||
|
||||
# _AC_LIBOBJ_ALLOCA
|
||||
# -----------------
|
||||
# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly
|
||||
# AC_LIBOBJ since we actually set the output variable 'ALLOCA'.
|
||||
# Nevertheless, for Automake, AC_LIBSOURCES it.
|
||||
m4_define([_AC_LIBOBJ_ALLOCA],
|
||||
[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
|
||||
# that cause trouble. Some versions do not even contain alloca or
|
||||
# contain a buggy version. If you still want to use their alloca,
|
||||
# use ar to extract alloca.o from them instead of compiling alloca.c.
|
||||
AC_LIBSOURCES(alloca.c)
|
||||
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
|
||||
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
|
||||
|
||||
AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
|
||||
[AC_EGREP_CPP(webecray,
|
||||
[#if defined CRAY && ! defined CRAY2
|
||||
webecray
|
||||
#else
|
||||
wenotbecray
|
||||
#endif
|
||||
], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
|
||||
if test $ac_cv_os_cray = yes; then
|
||||
for ac_func in _getb67 GETB67 getb67; do
|
||||
AC_CHECK_FUNC($ac_func,
|
||||
[AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
|
||||
[Define to one of '_getb67', 'GETB67',
|
||||
'getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for
|
||||
'alloca.c' support on those systems.])
|
||||
break])
|
||||
done
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([stack direction for C alloca],
|
||||
[ac_cv_c_stack_direction],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE(
|
||||
[AC_INCLUDES_DEFAULT
|
||||
int
|
||||
find_stack_direction (int *addr, int depth)
|
||||
{
|
||||
int dir, dummy = 0;
|
||||
if (! addr)
|
||||
addr = &dummy;
|
||||
*addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
|
||||
dir = depth ? find_stack_direction (addr, depth - 1) : 0;
|
||||
return dir + dummy;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
return find_stack_direction (0, argc + !argv + 20) < 0;
|
||||
}])],
|
||||
[ac_cv_c_stack_direction=1],
|
||||
[ac_cv_c_stack_direction=-1],
|
||||
[ac_cv_c_stack_direction=0])])
|
||||
AH_VERBATIM([STACK_DIRECTION],
|
||||
[/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at runtime.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
@%:@undef STACK_DIRECTION])dnl
|
||||
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
|
||||
])# _AC_LIBOBJ_ALLOCA
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# arpa_inet_h.m4 serial 8
|
||||
dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# arpa_inet_h.m4 serial 13
|
||||
dnl Copyright (C) 2006, 2008-2013 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.
|
||||
|
@ -22,24 +22,22 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
|
|||
dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
|
||||
gl_CHECK_NEXT_HEADERS([arpa/inet.h])
|
||||
|
||||
AC_REQUIRE([gl_FEATURES_H])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use.
|
||||
gl_WARN_ON_USE_PREPARE([[
|
||||
/* On some systems, this header is not self-consistent. */
|
||||
#ifndef __GLIBC__
|
||||
#if !(defined __GLIBC__ || defined __UCLIBC__)
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef __TANDEM
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
]], [inet_ntop inet_pton])
|
||||
])
|
||||
|
||||
dnl Unconditionally enables the replacement of <arpa/inet.h>.
|
||||
AC_DEFUN([gl_REPLACE_ARPA_INET_H],
|
||||
[
|
||||
dnl This is a no-op, because <arpa/inet.h> is always overridden.
|
||||
:
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
|
@ -54,4 +52,6 @@ AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
|
|||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
|
||||
HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
|
||||
REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP])
|
||||
REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON])
|
||||
])
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
# asm-underscore.m4 serial 1
|
||||
dnl Copyright (C) 2010 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. Based on as-underscore.m4 in GNU clisp.
|
||||
|
||||
# gl_ASM_SYMBOL_PREFIX
|
||||
# Tests for the prefix of C symbols at the assembly language level and the
|
||||
# linker level. This prefix is either an underscore or empty. Defines the
|
||||
# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
|
||||
# a stringified variant of this prefix.
|
||||
|
||||
AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
|
||||
[
|
||||
dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
|
||||
dnl 1. It works only for GCC.
|
||||
dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
|
||||
AC_CACHE_CHECK(
|
||||
[whether C symbols are prefixed with underscore at the linker level],
|
||||
[gl_cv_prog_as_underscore],
|
||||
[cat > conftest.c <<EOF
|
||||
#ifdef __cplusplus
|
||||
extern "C" int foo (void);
|
||||
#endif
|
||||
int foo(void) { return 0; }
|
||||
EOF
|
||||
# Look for the assembly language name in the .s file.
|
||||
AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1
|
||||
if grep _foo conftest.s >/dev/null ; then
|
||||
gl_cv_prog_as_underscore=yes
|
||||
else
|
||||
gl_cv_prog_as_underscore=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
])
|
||||
if test $gl_cv_prog_as_underscore = yes; then
|
||||
USER_LABEL_PREFIX=_
|
||||
else
|
||||
USER_LABEL_PREFIX=
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
|
||||
[Define to the prefix of C symbols at the assembler and linker level,
|
||||
either an underscore or empty.])
|
||||
ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
|
||||
AC_SUBST([ASM_SYMBOL_PREFIX])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# base64.m4 serial 3
|
||||
dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
|
||||
# base64.m4 serial 4
|
||||
dnl Copyright (C) 2004, 2006, 2009-2013 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.
|
||||
|
@ -11,6 +11,5 @@ AC_DEFUN([gl_FUNC_BASE64],
|
|||
|
||||
# Prerequisites of lib/base64.c.
|
||||
AC_DEFUN([gl_PREREQ_BASE64], [
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# btowc.m4 serial 6
|
||||
dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
|
||||
# btowc.m4 serial 10
|
||||
dnl Copyright (C) 2008-2013 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.
|
||||
|
@ -26,16 +26,23 @@ AC_DEFUN([gl_FUNC_BTOWC],
|
|||
AC_CACHE_CHECK([whether btowc(0) is correct],
|
||||
[gl_cv_func_btowc_nul],
|
||||
[
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#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>
|
||||
int main ()
|
||||
{
|
||||
if (btowc ('\0') != 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}],
|
||||
}]])],
|
||||
[gl_cv_func_btowc_nul=yes],
|
||||
[gl_cv_func_btowc_nul=no],
|
||||
[
|
||||
|
@ -65,10 +72,17 @@ changequote(,)dnl
|
|||
esac
|
||||
changequote([,])dnl
|
||||
if test $LOCALE_FR != none; then
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <locale.h>
|
||||
#include <stdio.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>
|
||||
int main ()
|
||||
{
|
||||
|
@ -78,7 +92,7 @@ int main ()
|
|||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}],
|
||||
}]])],
|
||||
[gl_cv_func_btowc_eof=yes],
|
||||
[gl_cv_func_btowc_eof=no],
|
||||
[:])
|
||||
|
@ -94,11 +108,6 @@ int main ()
|
|||
*) REPLACE_BTOWC=1 ;;
|
||||
esac
|
||||
fi
|
||||
if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
|
||||
gl_REPLACE_WCHAR_H
|
||||
AC_LIBOBJ([btowc])
|
||||
gl_PREREQ_BTOWC
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/btowc.c.
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
# c-strtod.m4 serial 11
|
||||
|
||||
# Copyright (C) 2004-2006, 2009-2010 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# Written by Paul Eggert.
|
||||
|
||||
AC_DEFUN([gl_C99_STRTOLD],
|
||||
[
|
||||
AC_CACHE_CHECK([whether strtold conforms to C99],
|
||||
[gl_cv_func_c99_strtold],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[/* On HP-UX before 11.23, strtold returns a struct instead of
|
||||
long double. Reject implementations like that, by requiring
|
||||
compatibility with the C99 prototype. */
|
||||
#include <stdlib.h>
|
||||
static long double (*p) (char const *, char **) = strtold;
|
||||
static long double
|
||||
test (char const *nptr, char **endptr)
|
||||
{
|
||||
long double r;
|
||||
r = strtold (nptr, endptr);
|
||||
return r;
|
||||
}]],
|
||||
[[return test ("1.0", NULL) != 1 || p ("1.0", NULL) != 1;]])],
|
||||
[gl_cv_func_c99_strtold=yes],
|
||||
[gl_cv_func_c99_strtold=no])])
|
||||
if test $gl_cv_func_c99_strtold = yes; then
|
||||
AC_DEFINE([HAVE_C99_STRTOLD], [1], [Define to 1 if strtold conforms to C99.])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_C_STRTOD],
|
||||
[
|
||||
AC_LIBOBJ([c-strtod])
|
||||
|
||||
dnl Prerequisites of lib/c-strtod.c.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
:
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_C_STRTOLD],
|
||||
[
|
||||
AC_LIBOBJ([c-strtold])
|
||||
|
||||
dnl Prerequisites of lib/c-strtold.c.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
AC_REQUIRE([gl_C99_STRTOLD])
|
||||
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
:
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# codeset.m4 serial 4 (gettext-0.18)
|
||||
dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
|
||||
# codeset.m4 serial 5 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2000-2002, 2006, 2008-2013 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.
|
||||
|
@ -9,10 +9,12 @@ dnl From Bruno Haible.
|
|||
AC_DEFUN([AM_LANGINFO_CODESET],
|
||||
[
|
||||
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
|
||||
[AC_TRY_LINK([#include <langinfo.h>],
|
||||
[char* cs = nl_langinfo(CODESET); return !cs;],
|
||||
[am_cv_langinfo_codeset=yes],
|
||||
[am_cv_langinfo_codeset=no])
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <langinfo.h>]],
|
||||
[[char* cs = nl_langinfo(CODESET); return !cs;]])],
|
||||
[am_cv_langinfo_codeset=yes],
|
||||
[am_cv_langinfo_codeset=no])
|
||||
])
|
||||
if test $am_cv_langinfo_codeset = yes; then
|
||||
AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
|
||||
|
|
50
gl/m4/configmake.m4
Normal file
50
gl/m4/configmake.m4
Normal file
|
@ -0,0 +1,50 @@
|
|||
# configmake.m4 serial 1
|
||||
dnl Copyright (C) 2010-2013 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_CONFIGMAKE_PREP
|
||||
# ------------------
|
||||
# Guarantee all of the standard directory variables, even when used with
|
||||
# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake
|
||||
# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.).
|
||||
AC_DEFUN([gl_CONFIGMAKE_PREP],
|
||||
[
|
||||
dnl Technically, datadir should default to datarootdir. But if
|
||||
dnl autoconf is too old to provide datarootdir, then reversing the
|
||||
dnl definition is a reasonable compromise. Only AC_SUBST a variable
|
||||
dnl if it was not already defined earlier by autoconf.
|
||||
if test "x$datarootdir" = x; then
|
||||
AC_SUBST([datarootdir], ['${datadir}'])
|
||||
fi
|
||||
dnl Copy the approach used in autoconf 2.60.
|
||||
if test "x$docdir" = x; then
|
||||
AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
|
||||
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
|
||||
['${datarootdir}/doc/${PACKAGE}'])])
|
||||
fi
|
||||
dnl The remaining variables missing from autoconf 2.59 are easier.
|
||||
if test "x$htmldir" = x; then
|
||||
AC_SUBST([htmldir], ['${docdir}'])
|
||||
fi
|
||||
if test "x$dvidir" = x; then
|
||||
AC_SUBST([dvidir], ['${docdir}'])
|
||||
fi
|
||||
if test "x$pdfdir" = x; then
|
||||
AC_SUBST([pdfdir], ['${docdir}'])
|
||||
fi
|
||||
if test "x$psdir" = x; then
|
||||
AC_SUBST([psdir], ['${docdir}'])
|
||||
fi
|
||||
if test "x$lispdir" = x; then
|
||||
AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
|
||||
fi
|
||||
if test "x$localedir" = x; then
|
||||
AC_SUBST([localedir], ['${datarootdir}/locale'])
|
||||
fi
|
||||
|
||||
dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
|
||||
dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
|
||||
AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
#serial 8 -*- autoconf -*-
|
||||
dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
|
||||
#serial 10 -*- autoconf -*-
|
||||
dnl Copyright (C) 2002-2006, 2009-2013 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,18 +7,11 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_DIRNAME],
|
||||
[
|
||||
AC_REQUIRE([gl_DIRNAME_LGPL])
|
||||
AC_LIBOBJ([basename])
|
||||
AC_LIBOBJ([dirname])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_DIRNAME_LGPL],
|
||||
[
|
||||
AC_LIBOBJ([basename-lgpl])
|
||||
AC_LIBOBJ([dirname-lgpl])
|
||||
AC_LIBOBJ([stripslash])
|
||||
|
||||
dnl Prerequisites of lib/dirname.h.
|
||||
AC_REQUIRE([gl_AC_DOS])
|
||||
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
|
||||
|
||||
dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
|
||||
|
|
71
gl/m4/dos.m4
71
gl/m4/dos.m4
|
@ -1,71 +0,0 @@
|
|||
#serial 11 -*- autoconf -*-
|
||||
|
||||
# Define some macros required for proper operation of code in lib/*.c
|
||||
# on MSDOS/Windows systems.
|
||||
|
||||
# Copyright (C) 2000-2001, 2004-2006, 2009-2010 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.
|
||||
|
||||
# From Jim Meyering.
|
||||
|
||||
AC_DEFUN([gl_AC_DOS],
|
||||
[
|
||||
AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
|
||||
[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
|
||||
#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
|
||||
neither MSDOS nor Windows
|
||||
#endif]])],
|
||||
[ac_cv_win_or_dos=yes],
|
||||
[ac_cv_win_or_dos=no])
|
||||
])
|
||||
|
||||
if test x"$ac_cv_win_or_dos" = xyes; then
|
||||
ac_fs_accepts_drive_letter_prefix=1
|
||||
ac_fs_backslash_is_file_name_separator=1
|
||||
AC_CACHE_CHECK([whether drive letter can start relative path],
|
||||
[ac_cv_drive_letter_can_be_relative],
|
||||
[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
|
||||
#if defined __CYGWIN__
|
||||
drive letters are always absolute
|
||||
#endif]])],
|
||||
[ac_cv_drive_letter_can_be_relative=yes],
|
||||
[ac_cv_drive_letter_can_be_relative=no])
|
||||
])
|
||||
if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
|
||||
ac_fs_drive_letter_can_be_relative=1
|
||||
else
|
||||
ac_fs_drive_letter_can_be_relative=0
|
||||
fi
|
||||
else
|
||||
ac_fs_accepts_drive_letter_prefix=0
|
||||
ac_fs_backslash_is_file_name_separator=0
|
||||
ac_fs_drive_letter_can_be_relative=0
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
|
||||
$ac_fs_accepts_drive_letter_prefix,
|
||||
[Define on systems for which file names may have a so-called
|
||||
`drive letter' prefix, define this to compute the length of that
|
||||
prefix, including the colon.])
|
||||
|
||||
AH_VERBATIM(ISSLASH,
|
||||
[#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
#else
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
#endif])
|
||||
|
||||
AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
|
||||
$ac_fs_backslash_is_file_name_separator,
|
||||
[Define if the backslash character may also serve as a file name
|
||||
component separator.])
|
||||
|
||||
AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE],
|
||||
$ac_fs_drive_letter_can_be_relative,
|
||||
[Define if a drive letter prefix denotes a relative path if it is
|
||||
not followed by a file name component separator.])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# double-slash-root.m4 serial 4 -*- Autoconf -*-
|
||||
dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2006, 2008-2013 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.
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
#serial 10
|
||||
dnl Copyright (C) 2002, 2005, 2007, 2009-2010 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_DUP2],
|
||||
[
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CHECK_FUNCS_ONCE([dup2])
|
||||
if test $ac_cv_func_dup2 = no; then
|
||||
HAVE_DUP2=0
|
||||
AC_LIBOBJ([dup2])
|
||||
else
|
||||
AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
|
||||
[AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([[#include <unistd.h>
|
||||
#include <errno.h>]],
|
||||
[if (dup2 (1, 1) == 0)
|
||||
return 1;
|
||||
close (0);
|
||||
if (dup2 (0, 0) != -1)
|
||||
return 2;
|
||||
/* Many gnulib modules require POSIX conformance of EBADF. */
|
||||
if (dup2 (1, 1000000) == -1 && errno != EBADF)
|
||||
return 3;
|
||||
return 0;
|
||||
])
|
||||
],
|
||||
[gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
|
||||
[case "$host_os" in
|
||||
mingw*) # on this platform, dup2 always returns 0 for success
|
||||
gl_cv_func_dup2_works=no;;
|
||||
cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
|
||||
gl_cv_func_dup2_works=no;;
|
||||
linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
|
||||
# closed fd may yield -EBADF instead of -1 / errno=EBADF.
|
||||
gl_cv_func_dup2_works=no;;
|
||||
freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
|
||||
gl_cv_func_dup2_works=no;;
|
||||
*) gl_cv_func_dup2_works=yes;;
|
||||
esac])
|
||||
])
|
||||
if test "$gl_cv_func_dup2_works" = no; then
|
||||
gl_REPLACE_DUP2
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_REPLACE_DUP2],
|
||||
[
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
if test $ac_cv_func_dup2 = yes; then
|
||||
REPLACE_DUP2=1
|
||||
fi
|
||||
AC_LIBOBJ([dup2])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# eealloc.m4 serial 2
|
||||
dnl Copyright (C) 2003, 2009, 2010 Free Software Foundation, Inc.
|
||||
# eealloc.m4 serial 3
|
||||
dnl Copyright (C) 2003, 2009-2013 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,7 +8,6 @@ AC_DEFUN([gl_EEALLOC],
|
|||
[
|
||||
AC_REQUIRE([gl_EEMALLOC])
|
||||
AC_REQUIRE([gl_EEREALLOC])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_EEMALLOC],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# environ.m4 serial 4
|
||||
dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc.
|
||||
# environ.m4 serial 6
|
||||
dnl Copyright (C) 2001-2004, 2006-2013 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.
|
||||
|
@ -9,7 +9,16 @@ AC_DEFUN_ONCE([gl_ENVIRON],
|
|||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
dnl Persuade glibc <unistd.h> to declare environ.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([unistd.h])
|
||||
gt_CHECK_VAR_DECL(
|
||||
[#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
|
||||
#include <stdlib.h>
|
||||
],
|
||||
[environ])
|
||||
if test $gt_cv_var_environ_declaration != yes; then
|
||||
HAVE_DECL_ENVIRON=0
|
||||
fi
|
||||
|
@ -22,11 +31,13 @@ AC_DEFUN([gt_CHECK_VAR_DECL],
|
|||
define([gt_cv_var], [gt_cv_var_]$2[_declaration])
|
||||
AC_MSG_CHECKING([if $2 is properly declared])
|
||||
AC_CACHE_VAL([gt_cv_var], [
|
||||
AC_TRY_COMPILE([$1
|
||||
extern struct { int foo; } $2;],
|
||||
[$2.foo = 1;],
|
||||
gt_cv_var=no,
|
||||
gt_cv_var=yes)])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[$1
|
||||
extern struct { int foo; } $2;]],
|
||||
[[$2.foo = 1;]])],
|
||||
[gt_cv_var=no],
|
||||
[gt_cv_var=yes])])
|
||||
AC_MSG_RESULT([$gt_cv_var])
|
||||
if test $gt_cv_var = yes; then
|
||||
AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# errno_h.m4 serial 6
|
||||
dnl Copyright (C) 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# errno_h.m4 serial 12
|
||||
dnl Copyright (C) 2004, 2006, 2008-2013 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.
|
||||
|
@ -10,6 +10,9 @@ AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
|
|||
AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
|
||||
AC_EGREP_CPP([booboo],[
|
||||
#include <errno.h>
|
||||
#if !defined ETXTBSY
|
||||
booboo
|
||||
#endif
|
||||
#if !defined ENOMSG
|
||||
booboo
|
||||
#endif
|
||||
|
@ -34,11 +37,29 @@ booboo
|
|||
#if !defined ENOTSUP
|
||||
booboo
|
||||
#endif
|
||||
#if !defined ENETRESET
|
||||
booboo
|
||||
#endif
|
||||
#if !defined ECONNABORTED
|
||||
booboo
|
||||
#endif
|
||||
#if !defined ESTALE
|
||||
booboo
|
||||
#endif
|
||||
#if !defined EDQUOT
|
||||
booboo
|
||||
#endif
|
||||
#if !defined ECANCELED
|
||||
booboo
|
||||
#endif
|
||||
#if !defined EOWNERDEAD
|
||||
booboo
|
||||
#endif
|
||||
#if !defined ENOTRECOVERABLE
|
||||
booboo
|
||||
#endif
|
||||
#if !defined EILSEQ
|
||||
booboo
|
||||
#endif
|
||||
],
|
||||
[gl_cv_header_errno_h_complete=no],
|
||||
|
@ -47,10 +68,11 @@ booboo
|
|||
if test $gl_cv_header_errno_h_complete = yes; then
|
||||
ERRNO_H=''
|
||||
else
|
||||
gl_CHECK_NEXT_HEADERS([errno.h])
|
||||
gl_NEXT_HEADERS([errno.h])
|
||||
ERRNO_H='errno.h'
|
||||
fi
|
||||
AC_SUBST([ERRNO_H])
|
||||
AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
|
||||
gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
|
||||
gl_REPLACE_ERRNO_VALUE([ENOLINK])
|
||||
gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#serial 12
|
||||
#serial 14
|
||||
|
||||
# Copyright (C) 1996-1998, 2001-2004, 2009-2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-1998, 2001-2004, 2009-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -8,15 +8,20 @@
|
|||
|
||||
AC_DEFUN([gl_ERROR],
|
||||
[
|
||||
AC_FUNC_ERROR_AT_LINE
|
||||
dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
|
||||
gl_PREREQ_ERROR
|
||||
dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
|
||||
dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
|
||||
AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <error.h>]],
|
||||
[[error_at_line (0, 0, "", 0, "an error occurred");]])],
|
||||
[ac_cv_lib_error_at_line=yes],
|
||||
[ac_cv_lib_error_at_line=no])])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/error.c.
|
||||
AC_DEFUN([gl_PREREQ_ERROR],
|
||||
[
|
||||
AC_REQUIRE([AC_FUNC_STRERROR_R])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
:
|
||||
])
|
||||
|
|
116
gl/m4/exponentd.m4
Normal file
116
gl/m4/exponentd.m4
Normal file
|
@ -0,0 +1,116 @@
|
|||
# exponentd.m4 serial 3
|
||||
dnl Copyright (C) 2007-2008, 2010-2013 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_DOUBLE_EXPONENT_LOCATION],
|
||||
[
|
||||
AC_CACHE_CHECK([where to find the exponent in a 'double'],
|
||||
[gl_cv_cc_double_expbit0],
|
||||
[
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <float.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define NWORDS \
|
||||
((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
|
||||
typedef union { double value; unsigned int word[NWORDS]; } memory_double;
|
||||
static unsigned int ored_words[NWORDS];
|
||||
static unsigned int anded_words[NWORDS];
|
||||
static void add_to_ored_words (double x)
|
||||
{
|
||||
memory_double m;
|
||||
size_t i;
|
||||
/* Clear it first, in case sizeof (double) < sizeof (memory_double). */
|
||||
memset (&m, 0, sizeof (memory_double));
|
||||
m.value = x;
|
||||
for (i = 0; i < NWORDS; i++)
|
||||
{
|
||||
ored_words[i] |= m.word[i];
|
||||
anded_words[i] &= m.word[i];
|
||||
}
|
||||
}
|
||||
int main ()
|
||||
{
|
||||
size_t j;
|
||||
FILE *fp = fopen ("conftest.out", "w");
|
||||
if (fp == NULL)
|
||||
return 1;
|
||||
for (j = 0; j < NWORDS; j++)
|
||||
anded_words[j] = ~ (unsigned int) 0;
|
||||
add_to_ored_words (0.25);
|
||||
add_to_ored_words (0.5);
|
||||
add_to_ored_words (1.0);
|
||||
add_to_ored_words (2.0);
|
||||
add_to_ored_words (4.0);
|
||||
/* Remove bits that are common (e.g. if representation of the first mantissa
|
||||
bit is explicit). */
|
||||
for (j = 0; j < NWORDS; j++)
|
||||
ored_words[j] &= ~anded_words[j];
|
||||
/* Now find the nonzero word. */
|
||||
for (j = 0; j < NWORDS; j++)
|
||||
if (ored_words[j] != 0)
|
||||
break;
|
||||
if (j < NWORDS)
|
||||
{
|
||||
size_t i;
|
||||
for (i = j + 1; i < NWORDS; i++)
|
||||
if (ored_words[i] != 0)
|
||||
{
|
||||
fprintf (fp, "unknown");
|
||||
return (fclose (fp) != 0);
|
||||
}
|
||||
for (i = 0; ; i++)
|
||||
if ((ored_words[j] >> i) & 1)
|
||||
{
|
||||
fprintf (fp, "word %d bit %d", (int) j, (int) i);
|
||||
return (fclose (fp) != 0);
|
||||
}
|
||||
}
|
||||
fprintf (fp, "unknown");
|
||||
return (fclose (fp) != 0);
|
||||
}
|
||||
]])],
|
||||
[gl_cv_cc_double_expbit0=`cat conftest.out`],
|
||||
[gl_cv_cc_double_expbit0="unknown"],
|
||||
[
|
||||
dnl On ARM, there are two 'double' floating-point formats, used by
|
||||
dnl different sets of instructions: The older FPA instructions assume
|
||||
dnl that they are stored in big-endian word order, while the words
|
||||
dnl (like integer types) are stored in little-endian byte order.
|
||||
dnl The newer VFP instructions assume little-endian order
|
||||
dnl consistently.
|
||||
AC_EGREP_CPP([mixed_endianness], [
|
||||
#if defined arm || defined __arm || defined __arm__
|
||||
mixed_endianness
|
||||
#endif
|
||||
],
|
||||
[gl_cv_cc_double_expbit0="unknown"],
|
||||
[
|
||||
pushdef([AC_MSG_CHECKING],[:])dnl
|
||||
pushdef([AC_MSG_RESULT],[:])dnl
|
||||
pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl
|
||||
AC_C_BIGENDIAN(
|
||||
[gl_cv_cc_double_expbit0="word 0 bit 20"],
|
||||
[gl_cv_cc_double_expbit0="word 1 bit 20"],
|
||||
[gl_cv_cc_double_expbit0="unknown"])
|
||||
popdef([AC_MSG_RESULT_UNQUOTED])dnl
|
||||
popdef([AC_MSG_RESULT])dnl
|
||||
popdef([AC_MSG_CHECKING])dnl
|
||||
])
|
||||
])
|
||||
rm -f conftest.out
|
||||
])
|
||||
case "$gl_cv_cc_double_expbit0" in
|
||||
word*bit*)
|
||||
word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
|
||||
bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
|
||||
AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word],
|
||||
[Define as the word index where to find the exponent of 'double'.])
|
||||
AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit],
|
||||
[Define as the bit index in the word where to find bit 0 of the exponent of 'double'.])
|
||||
;;
|
||||
esac
|
||||
])
|
|
@ -1,14 +1,14 @@
|
|||
# serial 9 -*- Autoconf -*-
|
||||
# serial 13 -*- Autoconf -*-
|
||||
# Enable extensions on systems that normally disable them.
|
||||
|
||||
# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003, 2006-2013 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
|
||||
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
|
||||
# Autoconf. Perhaps we can remove this once we can assume Autoconf
|
||||
# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
|
||||
# 2.70 or later everywhere, but since Autoconf mutates rapidly
|
||||
# enough in this area it's likely we'll need to redefine
|
||||
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
|||
# ------------------------
|
||||
# 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
|
||||
|
@ -38,35 +39,31 @@ AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
|
|||
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
|
||||
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
||||
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
|
||||
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
|
||||
[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.])
|
||||
AC_DEFINE([_NETBSD_SOURCE], [1],
|
||||
[Define to 1 to make NetBSD features available. MINIX 3 needs this.])
|
||||
fi
|
||||
|
||||
dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
|
||||
dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
|
||||
dnl provided.
|
||||
case "$host_os" in
|
||||
hpux*)
|
||||
AC_DEFINE([_XOPEN_SOURCE], [500],
|
||||
[Define to 500 only on HP-UX.])
|
||||
;;
|
||||
esac
|
||||
|
||||
AH_VERBATIM([__EXTENSIONS__],
|
||||
dnl Use a different key than __EXTENSIONS__, as that name broke existing
|
||||
dnl configure.ac when using autoheader 2.62.
|
||||
AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
|
||||
[/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on OS X. */
|
||||
#ifndef _DARWIN_C_SOURCE
|
||||
# undef _DARWIN_C_SOURCE
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
|
@ -79,6 +76,12 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
|||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
|
||||
mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
|
||||
whether compiling with -Ae or -D_HPUX_SOURCE=1. */
|
||||
#ifndef _XOPEN_SOURCE
|
||||
# undef _XOPEN_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
|
@ -95,9 +98,26 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
|||
test $ac_cv_safe_to_define___extensions__ = yes &&
|
||||
AC_DEFINE([__EXTENSIONS__])
|
||||
AC_DEFINE([_ALL_SOURCE])
|
||||
AC_DEFINE([_DARWIN_C_SOURCE])
|
||||
AC_DEFINE([_GNU_SOURCE])
|
||||
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
|
||||
AC_DEFINE([_TANDEM_SOURCE])
|
||||
AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
|
||||
[ac_cv_should_define__xopen_source],
|
||||
[ac_cv_should_define__xopen_source=no
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <wchar.h>
|
||||
mbstate_t x;]])],
|
||||
[],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#define _XOPEN_SOURCE 500
|
||||
#include <wchar.h>
|
||||
mbstate_t x;]])],
|
||||
[ac_cv_should_define__xopen_source=yes])])])
|
||||
test $ac_cv_should_define__xopen_source = yes &&
|
||||
AC_DEFINE([_XOPEN_SOURCE], [500])
|
||||
])# AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
# gl_USE_SYSTEM_EXTENSIONS
|
||||
|
|
70
gl/m4/extern-inline.m4
Normal file
70
gl/m4/extern-inline.m4
Normal file
|
@ -0,0 +1,70 @@
|
|||
dnl 'extern inline' a la ISO C99.
|
||||
|
||||
dnl Copyright 2012-2013 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_EXTERN_INLINE],
|
||||
[
|
||||
AH_VERBATIM([extern_inline],
|
||||
[/* Please see the Gnulib manual for how to use these macros.
|
||||
|
||||
Suppress extern inline with HP-UX cc, as it appears to be broken; see
|
||||
<http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
|
||||
|
||||
Suppress extern inline with Sun C in standards-conformance mode, as it
|
||||
mishandles inline functions that call each other. E.g., for 'inline void f
|
||||
(void) { } inline void g (void) { f (); }', c99 incorrectly complains
|
||||
'reference to static identifier "f" in extern inline function'.
|
||||
This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
|
||||
|
||||
Suppress the use of extern inline on Apple's platforms, as Libc at least
|
||||
through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
|
||||
Perhaps Apple will fix this some day. */
|
||||
#if ((__GNUC__ \
|
||||
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
|
||||
: (199901L <= __STDC_VERSION__ \
|
||||
&& !defined __HP_cc \
|
||||
&& !(defined __SUNPRO_C && __STDC__))) \
|
||||
&& !defined __APPLE__)
|
||||
# define _GL_INLINE inline
|
||||
# define _GL_EXTERN_INLINE extern inline
|
||||
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
|
||||
&& !defined __APPLE__)
|
||||
# if __GNUC_GNU_INLINE__
|
||||
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
|
||||
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
|
||||
# else
|
||||
# define _GL_INLINE extern inline
|
||||
# endif
|
||||
# define _GL_EXTERN_INLINE extern
|
||||
#else
|
||||
# define _GL_INLINE static _GL_UNUSED
|
||||
# define _GL_EXTERN_INLINE static _GL_UNUSED
|
||||
#endif
|
||||
|
||||
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
|
||||
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
|
||||
# define _GL_INLINE_HEADER_CONST_PRAGMA
|
||||
# else
|
||||
# define _GL_INLINE_HEADER_CONST_PRAGMA \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
|
||||
# endif
|
||||
/* Suppress GCC's bogus "no previous prototype for 'FOO'"
|
||||
and "no previous declaration for 'FOO'" diagnostics,
|
||||
when FOO is an inline function in the header; see
|
||||
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */
|
||||
# define _GL_INLINE_HEADER_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
|
||||
_GL_INLINE_HEADER_CONST_PRAGMA
|
||||
# define _GL_INLINE_HEADER_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
# define _GL_INLINE_HEADER_BEGIN
|
||||
# define _GL_INLINE_HEADER_END
|
||||
#endif])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# fcntl-o.m4 serial 1
|
||||
dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
|
||||
# fcntl-o.m4 serial 4
|
||||
dnl Copyright (C) 2006, 2009-2013 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,13 +12,26 @@ dnl Written by Paul Eggert.
|
|||
AC_DEFUN([gl_FCNTL_O_FLAGS],
|
||||
[
|
||||
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
|
||||
dnl AC_GNU_SOURCE.
|
||||
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
|
||||
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
|
||||
[AC_REQUIRE([AC_GNU_SOURCE])])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([unistd.h])
|
||||
AC_CHECK_FUNCS_ONCE([symlink])
|
||||
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#else /* on Windows with MSVC */
|
||||
# include <io.h>
|
||||
# include <stdlib.h>
|
||||
# defined sleep(n) _sleep ((n) * 1000)
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#ifndef O_NOATIME
|
||||
#define O_NOATIME 0
|
||||
|
@ -33,34 +46,74 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
|
|||
};
|
||||
]],
|
||||
[[
|
||||
int status = !constants;
|
||||
int result = !constants;
|
||||
#if HAVE_SYMLINK
|
||||
{
|
||||
static char const sym[] = "conftest.sym";
|
||||
if (symlink (".", sym) != 0
|
||||
|| close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
|
||||
status |= 32;
|
||||
if (symlink ("/dev/null", sym) != 0)
|
||||
result |= 2;
|
||||
else
|
||||
{
|
||||
int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
|
||||
if (fd >= 0)
|
||||
{
|
||||
close (fd);
|
||||
result |= 4;
|
||||
}
|
||||
}
|
||||
if (unlink (sym) != 0 || symlink (".", sym) != 0)
|
||||
result |= 2;
|
||||
else
|
||||
{
|
||||
int fd = open (sym, O_RDONLY | O_NOFOLLOW);
|
||||
if (fd >= 0)
|
||||
{
|
||||
close (fd);
|
||||
result |= 4;
|
||||
}
|
||||
}
|
||||
unlink (sym);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
static char const file[] = "confdefs.h";
|
||||
int fd = open (file, O_RDONLY | O_NOATIME);
|
||||
char c;
|
||||
struct stat st0, st1;
|
||||
if (fd < 0
|
||||
|| fstat (fd, &st0) != 0
|
||||
|| sleep (1) != 0
|
||||
|| read (fd, &c, 1) != 1
|
||||
|| close (fd) != 0
|
||||
|| stat (file, &st1) != 0
|
||||
|| st0.st_atime != st1.st_atime)
|
||||
status |= 64;
|
||||
if (fd < 0)
|
||||
result |= 8;
|
||||
else
|
||||
{
|
||||
struct stat st0;
|
||||
if (fstat (fd, &st0) != 0)
|
||||
result |= 16;
|
||||
else
|
||||
{
|
||||
char c;
|
||||
sleep (1);
|
||||
if (read (fd, &c, 1) != 1)
|
||||
result |= 24;
|
||||
else
|
||||
{
|
||||
if (close (fd) != 0)
|
||||
result |= 32;
|
||||
else
|
||||
{
|
||||
struct stat st1;
|
||||
if (stat (file, &st1) != 0)
|
||||
result |= 40;
|
||||
else
|
||||
if (st0.st_atime != st1.st_atime)
|
||||
result |= 64;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return status;]])],
|
||||
return result;]])],
|
||||
[gl_cv_header_working_fcntl_h=yes],
|
||||
[case $? in #(
|
||||
32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
|
||||
4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
|
||||
64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
|
||||
96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
|
||||
68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
|
||||
*) gl_cv_header_working_fcntl_h='no';;
|
||||
esac],
|
||||
[gl_cv_header_working_fcntl_h=cross-compiling])])
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
#serial 7
|
||||
dnl Copyright (C) 2005-2007, 2009-2010 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_FCNTL_SAFER],
|
||||
[
|
||||
AC_LIBOBJ([open-safer])
|
||||
AC_LIBOBJ([creat-safer])
|
||||
# Prerequisites of lib/open-safer.c.
|
||||
AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_OPENAT_SAFER],
|
||||
[
|
||||
AC_REQUIRE([gl_FCNTL_SAFER])
|
||||
AC_LIBOBJ([openat-safer])
|
||||
])
|
|
@ -1,83 +0,0 @@
|
|||
# fcntl.m4 serial 3
|
||||
dnl Copyright (C) 2009, 2010 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.
|
||||
|
||||
# For now, this module ensures that fcntl()
|
||||
# - supports F_DUPFD correctly
|
||||
# - supports or emulates F_DUPFD_CLOEXEC
|
||||
# - supports F_GETFD
|
||||
# Still to be ported to mingw:
|
||||
# - F_SETFD
|
||||
# - F_GETFL, F_SETFL
|
||||
# - F_GETOWN, F_SETOWN
|
||||
# - F_GETLK, F_SETLK, F_SETLKW
|
||||
AC_DEFUN([gl_FUNC_FCNTL],
|
||||
[
|
||||
dnl Persuade glibc to expose F_DUPFD_CLOEXEC.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CHECK_FUNCS_ONCE([fcntl])
|
||||
if test $ac_cv_func_fcntl = no; then
|
||||
gl_REPLACE_FCNTL
|
||||
else
|
||||
dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target
|
||||
AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly],
|
||||
[gl_cv_func_fcntl_f_dupfd_works],
|
||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <fcntl.h>
|
||||
]], [[return fcntl (0, F_DUPFD, -1) != -1;
|
||||
]])],
|
||||
[gl_cv_func_fcntl_f_dupfd_works=yes],
|
||||
[gl_cv_func_fcntl_f_dupfd_works=no],
|
||||
[# Guess that it works on glibc systems
|
||||
case $host_os in #((
|
||||
*-gnu*) gl_cv_func_fcntl_f_dupfd_works="guessing yes";;
|
||||
*) gl_cv_func_fcntl_f_dupfd_works="guessing no";;
|
||||
esac])])
|
||||
case $gl_cv_func_fcntl_f_dupfd_works in
|
||||
*yes) ;;
|
||||
*) gl_REPLACE_FCNTL
|
||||
AC_DEFINE([FCNTL_DUPFD_BUGGY], [1], [Define this to 1 if F_DUPFD
|
||||
behavior does not match POSIX]) ;;
|
||||
esac
|
||||
|
||||
dnl Many systems lack F_DUPFD_CLOEXEC
|
||||
AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
|
||||
[gl_cv_func_fcntl_f_dupfd_cloexec],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <fcntl.h>
|
||||
#ifndef F_DUPFD_CLOEXEC
|
||||
choke me
|
||||
#endif
|
||||
]])],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#ifdef __linux__
|
||||
/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
|
||||
it to support the semantics on older kernels that failed with EINVAL. */
|
||||
choke me
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_func_fcntl_f_dupfd_cloexec=yes],
|
||||
[gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])],
|
||||
[gl_cv_func_fcntl_f_dupfd_cloexec=no])])
|
||||
if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
|
||||
gl_REPLACE_FCNTL
|
||||
dnl No witness macro needed for this bug.
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_REPLACE_FCNTL],
|
||||
[
|
||||
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS_ONCE([fcntl])
|
||||
if test $ac_cv_func_fcntl = no; then
|
||||
HAVE_FCNTL=0
|
||||
else
|
||||
REPLACE_FCNTL=1
|
||||
fi
|
||||
AC_LIBOBJ([fcntl])
|
||||
])
|
|
@ -1,43 +0,0 @@
|
|||
# serial 12
|
||||
# Configure fcntl.h.
|
||||
dnl Copyright (C) 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Written by Paul Eggert.
|
||||
|
||||
AC_DEFUN([gl_FCNTL_H],
|
||||
[
|
||||
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
|
||||
AC_REQUIRE([gl_FCNTL_O_FLAGS])
|
||||
gl_CHECK_NEXT_HEADERS([fcntl.h])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use, if it is not common
|
||||
dnl enough to be declared everywhere.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
|
||||
]], [fcntl openat])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FCNTL_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
|
||||
GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
|
||||
GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
|
||||
HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
|
||||
REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
|
||||
REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
|
||||
REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# float_h.m4 serial 3
|
||||
dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
# float_h.m4 serial 9
|
||||
dnl Copyright (C) 2007, 2009-2013 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.
|
||||
|
@ -9,11 +9,90 @@ AC_DEFUN([gl_FLOAT_H],
|
|||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
FLOAT_H=
|
||||
REPLACE_FLOAT_LDBL=0
|
||||
case "$host_os" in
|
||||
beos* | openbsd*)
|
||||
aix* | beos* | openbsd* | mirbsd* | irix*)
|
||||
FLOAT_H=float.h
|
||||
gl_CHECK_NEXT_HEADERS([float.h])
|
||||
;;
|
||||
freebsd*)
|
||||
case "$host_cpu" in
|
||||
changequote(,)dnl
|
||||
i[34567]86 )
|
||||
changequote([,])dnl
|
||||
FLOAT_H=float.h
|
||||
;;
|
||||
x86_64 )
|
||||
# On x86_64 systems, the C compiler may still be generating
|
||||
# 32-bit code.
|
||||
AC_EGREP_CPP([yes],
|
||||
[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
|
||||
yes
|
||||
#endif],
|
||||
[],
|
||||
[FLOAT_H=float.h])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*)
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
FLOAT_H=float.h
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
case "$host_os" in
|
||||
aix* | freebsd* | linux*)
|
||||
if test -n "$FLOAT_H"; then
|
||||
REPLACE_FLOAT_LDBL=1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Test against glibc-2.7 Linux/SPARC64 bug.
|
||||
REPLACE_ITOLD=0
|
||||
AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
|
||||
[gl_cv_func_itold_works],
|
||||
[
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
int i = -1;
|
||||
volatile long double ld;
|
||||
int main ()
|
||||
{
|
||||
ld += i * 1.0L;
|
||||
if (ld > 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}]])],
|
||||
[gl_cv_func_itold_works=yes],
|
||||
[gl_cv_func_itold_works=no],
|
||||
[case "$host" in
|
||||
sparc*-*-linux*)
|
||||
AC_EGREP_CPP([yes],
|
||||
[#if defined __LP64__ || defined __arch64__
|
||||
yes
|
||||
#endif],
|
||||
[gl_cv_func_itold_works="guessing no"],
|
||||
[gl_cv_func_itold_works="guessing yes"])
|
||||
;;
|
||||
*) gl_cv_func_itold_works="guessing yes" ;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
case "$gl_cv_func_itold_works" in
|
||||
*no)
|
||||
REPLACE_ITOLD=1
|
||||
dnl We add the workaround to <float.h> but also to <math.h>,
|
||||
dnl to increase the chances that the fix function gets pulled in.
|
||||
FLOAT_H=float.h
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -n "$FLOAT_H"; then
|
||||
gl_NEXT_HEADERS([float.h])
|
||||
fi
|
||||
AC_SUBST([FLOAT_H])
|
||||
AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"])
|
||||
AC_SUBST([REPLACE_ITOLD])
|
||||
])
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
# floorf.m4 serial 6
|
||||
dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
|
||||
# floorf.m4 serial 13
|
||||
dnl Copyright (C) 2007, 2009-2013 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],
|
||||
[
|
||||
m4_divert_text([DEFAULTS], [gl_floorf_required=plain])
|
||||
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>])
|
||||
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
|
||||
|
@ -19,11 +20,54 @@ AC_DEFUN([gl_FUNC_FLOORF],
|
|||
dnl libm.so, but not in the libm.so that the compiler uses.
|
||||
REPLACE_FLOORF=1
|
||||
fi
|
||||
m4_ifdef([gl_FUNC_FLOORF_IEEE], [
|
||||
if test $gl_floorf_required = ieee && test $REPLACE_FLOORF = 0; then
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_CACHE_CHECK([whether floorf works according to ISO C 99 with IEC 60559],
|
||||
[gl_cv_func_floorf_ieee],
|
||||
[
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $FLOORF_LIBM"
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#ifndef __NO_MATH_INLINES
|
||||
# define __NO_MATH_INLINES 1 /* for glibc */
|
||||
#endif
|
||||
#include <math.h>
|
||||
]gl_FLOAT_MINUS_ZERO_CODE[
|
||||
]gl_FLOAT_SIGNBIT_CODE[
|
||||
static float dummy (float f) { return 0; }
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
float (*my_floorf) (float) = argc ? floorf : dummy;
|
||||
/* Test whether floorf (-0.0f) is -0.0f. */
|
||||
if (signbitf (minus_zerof) && !signbitf (my_floorf (minus_zerof)))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[gl_cv_func_floorf_ieee=yes],
|
||||
[gl_cv_func_floorf_ieee=no],
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_floorf_ieee="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_floorf_ieee="guessing no" ;;
|
||||
esac
|
||||
])
|
||||
LIBS="$save_LIBS"
|
||||
])
|
||||
case "$gl_cv_func_floorf_ieee" in
|
||||
*yes) ;;
|
||||
*) REPLACE_FLOORF=1 ;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
else
|
||||
HAVE_DECL_FLOORF=0
|
||||
fi
|
||||
if test $HAVE_DECL_FLOORF = 0 || test $REPLACE_FLOORF = 1; then
|
||||
AC_LIBOBJ([floorf])
|
||||
dnl No libraries are needed to link lib/floorf.c.
|
||||
FLOORF_LIBM=
|
||||
fi
|
||||
AC_SUBST([FLOORF_LIBM])
|
||||
|
@ -35,24 +79,28 @@ AC_DEFUN([gl_FUNC_FLOORF_LIBS],
|
|||
[
|
||||
gl_CACHE_VAL_SILENT([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);],
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#ifndef __NO_MATH_INLINES
|
||||
# define __NO_MATH_INLINES 1 /* for glibc */
|
||||
#endif
|
||||
#include <math.h>
|
||||
float (*funcptr) (float) = floorf;
|
||||
float x;]],
|
||||
[[x = funcptr(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);],
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#ifndef __NO_MATH_INLINES
|
||||
# define __NO_MATH_INLINES 1 /* for glibc */
|
||||
#endif
|
||||
#include <math.h>
|
||||
float (*funcptr) (float) = floorf;
|
||||
float x;]],
|
||||
[[x = funcptr(x) + floorf(x);]])],
|
||||
[gl_cv_func_floorf_libm="-lm"])
|
||||
LIBS="$save_LIBS"
|
||||
fi
|
||||
|
|
|
@ -6,7 +6,7 @@ dnl See if struct statfs has the f_fstypename member.
|
|||
dnl If so, define HAVE_STRUCT_STATFS_F_FSTYPENAME.
|
||||
dnl
|
||||
|
||||
# Copyright (C) 1998-1999, 2001, 2004, 2006, 2009-2010 Free Software
|
||||
# Copyright (C) 1998-1999, 2001, 2004, 2006, 2009-2013 Free Software
|
||||
# Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
|
127
gl/m4/fsusage.m4
127
gl/m4/fsusage.m4
|
@ -1,7 +1,7 @@
|
|||
# serial 25
|
||||
# serial 30
|
||||
# Obtaining file system usage information.
|
||||
|
||||
# Copyright (C) 1997-1998, 2000-2001, 2003-2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-1998, 2000-2001, 2003-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -19,10 +19,6 @@ AC_DEFUN([gl_FSUSAGE],
|
|||
#include <sys/param.h>
|
||||
#endif]])
|
||||
gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
|
||||
if test $gl_cv_fs_space = yes; then
|
||||
AC_LIBOBJ([fsusage])
|
||||
gl_PREREQ_FSUSAGE_EXTRA
|
||||
fi
|
||||
])
|
||||
|
||||
# Try to determine how a program can obtain file system usage information.
|
||||
|
@ -33,6 +29,12 @@ AC_DEFUN([gl_FSUSAGE],
|
|||
|
||||
AC_DEFUN([gl_FILE_SYSTEM_USAGE],
|
||||
[
|
||||
dnl Enable large-file support. This has the effect of changing the size
|
||||
dnl of field f_blocks in 'struct statvfs' from 32 bit to 64 bit on
|
||||
dnl glibc/Hurd, HP-UX 11, Solaris (32-bit mode). It also changes the size
|
||||
dnl of field f_blocks in 'struct statfs' from 32 bit to 64 bit on
|
||||
dnl Mac OS X >= 10.5 (32-bit mode).
|
||||
AC_REQUIRE([AC_SYS_LARGEFILE])
|
||||
|
||||
AC_MSG_NOTICE([checking how to get file system space usage])
|
||||
ac_fsusage_space=no
|
||||
|
@ -40,36 +42,98 @@ ac_fsusage_space=no
|
|||
# Perform only the link test since it seems there are no variants of the
|
||||
# statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs])
|
||||
# because that got a false positive on SCO OSR5. Adding the declaration
|
||||
# of a `struct statvfs' causes this test to fail (as it should) on such
|
||||
# of a 'struct statvfs' causes this test to fail (as it should) on such
|
||||
# systems. That system is reported to work fine with STAT_STATFS4 which
|
||||
# is what it gets when this test fails.
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR4
|
||||
# glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
|
||||
# OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
|
||||
AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#if defined __GLIBC__ && defined __linux__
|
||||
Do not use statvfs on systems with GNU libc on Linux, because that function
|
||||
stats all preceding entries in /proc/mounts, and that makes df hang if even
|
||||
one of the corresponding file systems is hard-mounted, but not available.
|
||||
statvfs in GNU libc on Hurd, BeOS, Haiku 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);]])],
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
struct statvfs fsd;
|
||||
|
||||
#if defined __APPLE__ && defined __MACH__
|
||||
#include <limits.h>
|
||||
/* On Mac OS X >= 10.5, f_blocks in 'struct statvfs' is a 32-bit quantity;
|
||||
that commonly limits file systems to 4 TiB. Whereas f_blocks in
|
||||
'struct statfs' is a 64-bit type, thanks to the large-file support
|
||||
that was enabled above. In this case, don't use statvfs(); use statfs()
|
||||
instead. */
|
||||
int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
|
||||
#endif
|
||||
]],
|
||||
[[statvfs (0, &fsd);]])],
|
||||
[fu_cv_sys_stat_statvfs=yes],
|
||||
[fu_cv_sys_stat_statvfs=no])])
|
||||
if test $fu_cv_sys_stat_statvfs = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE([STAT_STATVFS], [1],
|
||||
[ Define if there is a function named statvfs. (SVR4)])
|
||||
# AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs.
|
||||
# glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems
|
||||
# statvfs with large-file support is already equivalent to statvfs64.
|
||||
AC_CACHE_CHECK([whether to use statvfs64],
|
||||
[fu_cv_sys_stat_statvfs64],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>
|
||||
#include <sys/statvfs.h>
|
||||
struct statvfs64 fsd;
|
||||
int check_f_blocks_larger_in_statvfs64
|
||||
[sizeof (((struct statvfs64 *) 0)->f_blocks)
|
||||
> sizeof (((struct statvfs *) 0)->f_blocks)
|
||||
? 1 : -1];
|
||||
]],
|
||||
[[statvfs64 (0, &fsd);]])],
|
||||
[fu_cv_sys_stat_statvfs64=yes],
|
||||
[fu_cv_sys_stat_statvfs64=no])
|
||||
])
|
||||
if test $fu_cv_sys_stat_statvfs64 = yes; then
|
||||
AC_DEFINE([STAT_STATVFS64], [1],
|
||||
[ Define if statvfs64 should be preferred over statvfs.])
|
||||
else
|
||||
AC_DEFINE([STAT_STATVFS], [1],
|
||||
[ Define if there is a function named statvfs. (SVR4)])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for this unconditionally so we have a
|
||||
# good fallback on glibc/Linux > 2.6 < 2.6.36
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.f_frsize member])
|
||||
AC_CACHE_VAL([fu_cv_sys_stat_statfs2_frsize],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_VFS_H
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
fsd.f_frsize = 0;
|
||||
return statfs (".", &fsd) != 0;
|
||||
}]])],
|
||||
[fu_cv_sys_stat_statfs2_frsize=yes],
|
||||
[fu_cv_sys_stat_statfs2_frsize=no],
|
||||
[fu_cv_sys_stat_statfs2_frsize=no])])
|
||||
AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_frsize])
|
||||
if test $fu_cv_sys_stat_statfs2_frsize = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE([STAT_STATFS2_FRSIZE], [1],
|
||||
[ Define if statfs takes 2 args and struct statfs has a field named f_frsize.
|
||||
(glibc/Linux > 2.6)])
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# DEC Alpha running OSF/1
|
||||
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
|
||||
|
@ -97,8 +161,13 @@ if test $ac_fsusage_space = no; then
|
|||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# AIX
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
|
||||
# glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
|
||||
# (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
|
||||
# OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.)
|
||||
# (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
|
||||
# <sys/vfs.h>.)
|
||||
# (On Solaris, statfs has 4 arguments.)
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.f_bsize dnl
|
||||
member (AIX, 4.3BSD)])
|
||||
AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
|
@ -131,7 +200,8 @@ member (AIX, 4.3BSD)])
|
|||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR3
|
||||
# SVR3
|
||||
# (Solaris already handled above.)
|
||||
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
|
||||
AC_CACHE_VAL([fu_cv_sys_stat_statfs4],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
|
@ -150,13 +220,17 @@ if test $ac_fsusage_space = no; then
|
|||
if test $fu_cv_sys_stat_statfs4 = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE([STAT_STATFS4], [1],
|
||||
[ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
|
||||
[ Define if statfs takes 4 args. (SVR3, Dynix, old Irix, old AIX, Dolphin)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# 4.4BSD and NetBSD
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
|
||||
# 4.4BSD and older NetBSD
|
||||
# (OSF/1 already handled above.)
|
||||
# (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
|
||||
# (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
|
||||
# <sys/mount.h>.)
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.f_fsize dnl
|
||||
member (4.4BSD and NetBSD)])
|
||||
AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
|
@ -223,6 +297,7 @@ fi
|
|||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR2
|
||||
# (AIX, HP-UX, OSF/1 already handled above.)
|
||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/filsys.h>
|
||||
]])],
|
||||
[AC_DEFINE([STAT_READ_FILSYS], [1],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# getaddrinfo.m4 serial 23
|
||||
dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
|
||||
# getaddrinfo.m4 serial 30
|
||||
dnl Copyright (C) 2004-2013 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.
|
||||
|
@ -24,6 +24,7 @@ AC_DEFUN([gl_GETADDRINFO],
|
|||
fi])
|
||||
LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
|
||||
|
||||
HAVE_GETADDRINFO=1
|
||||
AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <sys/types.h>
|
||||
|
@ -55,16 +56,14 @@ AC_DEFUN([gl_GETADDRINFO],
|
|||
GETADDRINFO_LIB="-lws2_32"
|
||||
LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
|
||||
else
|
||||
AC_LIBOBJ([getaddrinfo])
|
||||
HAVE_GETADDRINFO=0
|
||||
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_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
AC_CHECK_DECLS([gai_strerror], [], [], [[
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
|
@ -76,11 +75,46 @@ AC_DEFUN([gl_GETADDRINFO],
|
|||
#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])
|
||||
]])
|
||||
if test $ac_cv_have_decl_gai_strerror = yes; then
|
||||
AC_CHECK_DECLS([gai_strerrorA], [], [], [[
|
||||
#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>
|
||||
]])
|
||||
dnl check for correct signature
|
||||
AC_CACHE_CHECK([for gai_strerror with POSIX signature],
|
||||
[gl_cv_func_gai_strerror_posix_signature], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#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>
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
const char *gai_strerror(int);]])],
|
||||
[gl_cv_func_gai_strerror_posix_signature=yes],
|
||||
[gl_cv_func_gai_strerror_posix_signature=no])])
|
||||
if test $gl_cv_func_gai_strerror_posix_signature = no; then
|
||||
REPLACE_GAI_STRERROR=1
|
||||
fi
|
||||
fi
|
||||
|
||||
LIBS="$gai_saved_LIBS"
|
||||
|
@ -100,16 +134,18 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
|
|||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
AC_REQUIRE([gl_SOCKET_FAMILIES])
|
||||
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
dnl Including sys/socket.h is wrong for Windows, but Windows does not
|
||||
dnl have sa_len so the result is correct anyway.
|
||||
AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>])
|
||||
AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([netinet/in.h])
|
||||
|
||||
AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
|
||||
AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[[
|
||||
/* sys/types.h is not needed according to POSIX, but the
|
||||
sys/socket.h in i386-unknown-freebsd4.10 and
|
||||
powerpc-apple-darwin5.5 required it. */
|
||||
|
@ -123,7 +159,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
|
|||
#ifdef HAVE_WS2TCPIP_H
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
])
|
||||
]])
|
||||
if test $ac_cv_have_decl_getaddrinfo = no; then
|
||||
HAVE_DECL_GETADDRINFO=0
|
||||
fi
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
# getdtablesize.m4 serial 1
|
||||
dnl Copyright (C) 2008, 2009, 2010 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_GETDTABLESIZE],
|
||||
[
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS_ONCE([getdtablesize])
|
||||
if test $ac_cv_func_getdtablesize != yes; then
|
||||
HAVE_GETDTABLESIZE=0
|
||||
AC_LIBOBJ([getdtablesize])
|
||||
fi
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# gethostname.m4 serial 9
|
||||
dnl Copyright (C) 2002, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# gethostname.m4 serial 13
|
||||
dnl Copyright (C) 2002, 2008-2013 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.
|
||||
|
@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_GETHOSTNAME],
|
|||
|
||||
dnl Where is gethostname() defined?
|
||||
dnl - On native Windows, it is in ws2_32.dll.
|
||||
dnl - Otherwise is is in libc.
|
||||
dnl - Otherwise it is in libc.
|
||||
GETHOSTNAME_LIB=
|
||||
AC_CHECK_FUNCS([gethostname], , [
|
||||
AC_CACHE_CHECK([for gethostname in winsock2.h and -lws2_32],
|
||||
|
@ -37,12 +37,14 @@ AC_DEFUN([gl_FUNC_GETHOSTNAME],
|
|||
AC_SUBST([GETHOSTNAME_LIB])
|
||||
|
||||
if test "$ac_cv_func_gethostname" = no; then
|
||||
AC_LIBOBJ([gethostname])
|
||||
HAVE_GETHOSTNAME=0
|
||||
gl_PREREQ_GETHOSTNAME
|
||||
fi
|
||||
|
||||
dnl Also provide HOST_NAME_MAX when <limits.h> lacks it.
|
||||
gl_PREREQ_HOST_NAME_MAX
|
||||
])
|
||||
|
||||
# Provide HOST_NAME_MAX when <limits.h> lacks it.
|
||||
AC_DEFUN([gl_PREREQ_HOST_NAME_MAX], [
|
||||
dnl - On most Unix systems, use MAXHOSTNAMELEN from <sys/param.h> instead.
|
||||
dnl - On Solaris, Cygwin, BeOS, use MAXHOSTNAMELEN from <netdb.h> instead.
|
||||
dnl - On mingw, use 256, because
|
||||
|
@ -83,7 +85,11 @@ lucky
|
|||
#if HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
])
|
||||
],
|
||||
[dnl The system does not define MAXHOSTNAMELEN in any of the common
|
||||
dnl headers. Use a safe fallback.
|
||||
gl_cv_decl_HOST_NAME_MAX=256
|
||||
])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
|
|
@ -1,108 +1,78 @@
|
|||
# Check for getloadavg.
|
||||
|
||||
# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2010 Free Software
|
||||
# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2013 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 6
|
||||
|
||||
# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
|
||||
# New applications should use gl_GETLOADAVG instead.
|
||||
|
||||
# gl_GETLOADAVG(LIBOBJDIR)
|
||||
# ------------------------
|
||||
# gl_GETLOADAVG
|
||||
# -------------
|
||||
AC_DEFUN([gl_GETLOADAVG],
|
||||
[AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
|
||||
# Persuade glibc <stdlib.h> to declare getloadavg().
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
gl_have_func=no # yes means we've found a way to get the load average.
|
||||
|
||||
# Make sure getloadavg.c is where it belongs, at configure-time.
|
||||
test -f "$srcdir/$1/getloadavg.c" ||
|
||||
AC_MSG_ERROR([$srcdir/$1/getloadavg.c is missing])
|
||||
|
||||
gl_save_LIBS=$LIBS
|
||||
|
||||
# Check for getloadavg, but be sure not to touch the cache variable.
|
||||
(AC_CHECK_FUNC([getloadavg], [exit 0], [exit 1])) && gl_have_func=yes
|
||||
# getloadvg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
|
||||
# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
|
||||
HAVE_GETLOADAVG=1
|
||||
AC_CHECK_FUNC([getloadavg], [],
|
||||
[gl_func_getloadavg_done=no
|
||||
|
||||
# On HPUX9, an unprivileged user can get load averages through this function.
|
||||
AC_CHECK_FUNCS([pstat_getdynamic])
|
||||
# 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.
|
||||
# For kstat on solaris, we need to test for libelf and libkvm to force the
|
||||
# definition of SVR4 below.
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
|
||||
AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
|
||||
# Check for the 4.4BSD definition of getloadavg.
|
||||
AC_CHECK_LIB([util], [getloadavg],
|
||||
[LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
|
||||
fi
|
||||
|
||||
# Solaris has libkstat which does not require root.
|
||||
AC_CHECK_LIB([kstat], [kstat_open])
|
||||
test $ac_cv_lib_kstat_kstat_open = yes && gl_have_func=yes
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
# There is a commonly available library for RS/6000 AIX.
|
||||
# Since it is not a standard part of AIX, it might be installed locally.
|
||||
gl_getloadavg_LIBS=$LIBS
|
||||
LIBS="-L/usr/local/lib $LIBS"
|
||||
AC_CHECK_LIB([getloadavg], [getloadavg],
|
||||
[LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
|
||||
[LIBS=$gl_getloadavg_LIBS])
|
||||
fi
|
||||
|
||||
# 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
|
||||
# Set up the replacement function if necessary.
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
HAVE_GETLOADAVG=0
|
||||
|
||||
# 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.
|
||||
# For kstat on solaris, we need libelf to force the definition of SVR4 below.
|
||||
if test $gl_have_func = no; then
|
||||
AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
|
||||
fi
|
||||
if test $gl_have_func = no; then
|
||||
AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
|
||||
# Check for the 4.4BSD definition of getloadavg.
|
||||
AC_CHECK_LIB([util], [getloadavg],
|
||||
[LIBS="-lutil $LIBS" gl_have_func=yes gl_cv_func_getloadavg_setgid=yes])
|
||||
fi
|
||||
# Solaris has libkstat which does not require root.
|
||||
AC_CHECK_LIB([kstat], [kstat_open])
|
||||
test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
|
||||
|
||||
if test $gl_have_func = no; then
|
||||
# There is a commonly available library for RS/6000 AIX.
|
||||
# Since it is not a standard part of AIX, it might be installed locally.
|
||||
gl_getloadavg_LIBS=$LIBS
|
||||
LIBS="-L/usr/local/lib $LIBS"
|
||||
AC_CHECK_LIB([getloadavg], [getloadavg],
|
||||
[LIBS="-lgetloadavg $LIBS"], [LIBS=$gl_getloadavg_LIBS])
|
||||
fi
|
||||
# AIX has libperfstat which does not require root
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_LIB([perfstat], [perfstat_cpu_total])
|
||||
test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
|
||||
fi
|
||||
|
||||
# Make sure it is really in the library, if we think we found it,
|
||||
# otherwise set up the replacement function.
|
||||
AC_CHECK_FUNCS([getloadavg], [],
|
||||
[gl_PREREQ_GETLOADAVG])
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_HEADER([sys/dg_sys_info.h],
|
||||
[gl_func_getloadavg_done=yes
|
||||
AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
|
||||
AC_CHECK_LIB([dgc], [dg_sys_info])])
|
||||
fi
|
||||
fi])
|
||||
|
||||
# Some definitions of getloadavg require that the program be installed setgid.
|
||||
AC_CACHE_CHECK([whether getloadavg requires setgid],
|
||||
gl_cv_func_getloadavg_setgid,
|
||||
[AC_EGREP_CPP([Yowza Am I SETGID yet],
|
||||
[#define CONFIGURING_GETLOADAVG
|
||||
#include "$srcdir/$1/getloadavg.c"
|
||||
#ifdef LDAV_PRIVILEGED
|
||||
Yowza Am I SETGID yet
|
||||
#endif
|
||||
],
|
||||
gl_cv_func_getloadavg_setgid=yes,
|
||||
gl_cv_func_getloadavg_setgid=no)])
|
||||
if test $gl_cv_func_getloadavg_setgid = yes; then
|
||||
NEED_SETGID=true
|
||||
AC_DEFINE([GETLOADAVG_PRIVILEGED], [1],
|
||||
[Define to 1 if the `getloadavg' function needs to be run setuid
|
||||
or setgid.])
|
||||
else
|
||||
NEED_SETGID=false
|
||||
fi
|
||||
AC_SUBST([NEED_SETGID])dnl
|
||||
|
||||
if test $gl_cv_func_getloadavg_setgid = yes; then
|
||||
AC_CACHE_CHECK([group of /dev/kmem], [gl_cv_group_kmem],
|
||||
[ # On Solaris, /dev/kmem is a symlink. Get info on the real file.
|
||||
ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
|
||||
# If we got an error (system does not support symlinks), try without -L.
|
||||
test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
|
||||
gl_cv_group_kmem=`echo $ac_ls_output \
|
||||
| sed -ne ['s/[ ][ ]*/ /g
|
||||
s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/
|
||||
/ /s/.* //;p']`
|
||||
])
|
||||
AC_SUBST([KMEM_GROUP], [$gl_cv_group_kmem])dnl
|
||||
fi
|
||||
if test "x$gl_save_LIBS" = x; then
|
||||
GETLOADAVG_LIBS=$LIBS
|
||||
else
|
||||
|
@ -121,58 +91,57 @@ else
|
|||
HAVE_SYS_LOADAVG_H=0
|
||||
fi
|
||||
AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
|
||||
[#if HAVE_SYS_LOADAVG_H
|
||||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
#include <stdlib.h>])
|
||||
[[#if HAVE_SYS_LOADAVG_H
|
||||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
#include <stdlib.h>]])
|
||||
])# gl_GETLOADAVG
|
||||
|
||||
|
||||
# gl_PREREQ_GETLOADAVG
|
||||
# --------------------
|
||||
# Set up the AC_LIBOBJ replacement of `getloadavg'.
|
||||
# Set up the AC_LIBOBJ replacement of 'getloadavg'.
|
||||
AC_DEFUN([gl_PREREQ_GETLOADAVG],
|
||||
[AC_LIBOBJ([getloadavg])
|
||||
AC_DEFINE([C_GETLOADAVG], [1], [Define to 1 if using `getloadavg.c'.])
|
||||
[
|
||||
# Figure out what our getloadavg.c needs.
|
||||
gl_have_func=no
|
||||
AC_CHECK_HEADER([sys/dg_sys_info.h],
|
||||
[gl_have_func=yes
|
||||
AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
|
||||
AC_CHECK_LIB([dgc], [dg_sys_info])])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([sys/param.h])
|
||||
|
||||
# On HPUX9, an unprivileged user can get load averages this way.
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_FUNCS([pstat_getdynamic], [gl_func_getloadavg_done=yes])
|
||||
fi
|
||||
|
||||
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
|
||||
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
|
||||
# Irix 4.0.5F has the header but not the library.
|
||||
if test $gl_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then
|
||||
gl_have_func=yes
|
||||
if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
|
||||
&& test "$ac_cv_lib_kvm_kvm_open" = yes; then
|
||||
gl_func_getloadavg_done=yes
|
||||
AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.])
|
||||
fi
|
||||
|
||||
if test $gl_have_func = no; then
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_HEADER([inq_stats/cpustats.h],
|
||||
[gl_have_func=yes
|
||||
[gl_func_getloadavg_done=yes
|
||||
AC_DEFINE([UMAX], [1], [Define to 1 for Encore UMAX.])
|
||||
AC_DEFINE([UMAX4_3], [1],
|
||||
[Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>.])])
|
||||
fi
|
||||
|
||||
if test $gl_have_func = no; then
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_HEADER([sys/cpustats.h],
|
||||
[gl_have_func=yes; AC_DEFINE([UMAX])])
|
||||
[gl_func_getloadavg_done=yes; AC_DEFINE([UMAX])])
|
||||
fi
|
||||
|
||||
if test $gl_have_func = no; then
|
||||
if test $gl_func_getloadavg_done = no; then
|
||||
AC_CHECK_HEADERS([mach/mach.h])
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS([nlist.h],
|
||||
[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
|
||||
[AC_DEFINE([NLIST_NAME_UNION], [1],
|
||||
[Define to 1 if your `struct nlist' has an
|
||||
`n_un' member. Obsolete, depend on
|
||||
`HAVE_STRUCT_NLIST_N_UN_N_NAME])], [],
|
||||
[], [],
|
||||
[@%:@include <nlist.h>])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
|
||||
[[struct nlist x;
|
||||
|
|
406
gl/m4/getopt.m4
406
gl/m4/getopt.m4
|
@ -1,5 +1,5 @@
|
|||
# getopt.m4 serial 28
|
||||
dnl Copyright (C) 2002-2006, 2008-2010 Free Software Foundation, Inc.
|
||||
# getopt.m4 serial 44
|
||||
dnl Copyright (C) 2002-2006, 2008-2013 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.
|
||||
|
@ -9,10 +9,22 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
|
|||
[
|
||||
m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
gl_GETOPT_IFELSE([
|
||||
gl_REPLACE_GETOPT
|
||||
],
|
||||
[])
|
||||
AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
|
||||
dnl Other modules can request the gnulib implementation of the getopt
|
||||
dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
|
||||
dnl argp.m4 does this.
|
||||
m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
|
||||
REPLACE_GETOPT=1
|
||||
], [
|
||||
REPLACE_GETOPT=0
|
||||
if test -n "$gl_replace_getopt"; then
|
||||
REPLACE_GETOPT=1
|
||||
fi
|
||||
])
|
||||
if test $REPLACE_GETOPT = 1; then
|
||||
dnl Arrange for getopt.h to be created.
|
||||
gl_GETOPT_SUBSTITUTE_HEADER
|
||||
fi
|
||||
])
|
||||
|
||||
# Request a POSIX compliant getopt function with GNU extensions (such as
|
||||
|
@ -25,37 +37,16 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
|
|||
AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
|
||||
])
|
||||
|
||||
# Request the gnulib implementation of the getopt functions unconditionally.
|
||||
# argp.m4 uses this.
|
||||
AC_DEFUN([gl_REPLACE_GETOPT],
|
||||
[
|
||||
dnl Arrange for getopt.h to be created.
|
||||
gl_GETOPT_SUBSTITUTE_HEADER
|
||||
dnl Arrange for unistd.h to include getopt.h.
|
||||
GNULIB_UNISTD_H_GETOPT=1
|
||||
dnl Arrange to compile the getopt implementation.
|
||||
AC_LIBOBJ([getopt])
|
||||
AC_LIBOBJ([getopt1])
|
||||
gl_PREREQ_GETOPT
|
||||
])
|
||||
|
||||
# emacs' configure.in uses this.
|
||||
AC_DEFUN([gl_GETOPT_IFELSE],
|
||||
[
|
||||
AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
|
||||
AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
|
||||
])
|
||||
|
||||
# Determine whether to replace the entire getopt facility.
|
||||
AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON
|
||||
|
||||
dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
gl_CHECK_NEXT_HEADERS([getopt.h])
|
||||
AC_CHECK_HEADERS_ONCE([getopt.h])
|
||||
if test $ac_cv_header_getopt_h = yes; then
|
||||
HAVE_GETOPT_H=1
|
||||
else
|
||||
|
@ -75,25 +66,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
|
|||
AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
|
||||
fi
|
||||
|
||||
dnl BSD getopt_long uses an incompatible method to reset option processing.
|
||||
dnl Existence of the variable, in and of itself, is not a reason to replace
|
||||
dnl getopt, but knowledge of the variable is needed to determine how to
|
||||
dnl reset and whether a reset reparses the environment.
|
||||
dnl Solaris supports neither optreset nor optind=0, but keeps no state that
|
||||
dnl needs a reset beyond setting optind=1; detect Solaris by getopt_clip.
|
||||
if test -z "$gl_replace_getopt"; then
|
||||
AC_CHECK_DECLS([optreset], [],
|
||||
[AC_CHECK_DECLS([getopt_clip], [], [],
|
||||
[[#include <getopt.h>]])
|
||||
],
|
||||
[[#include <getopt.h>]])
|
||||
fi
|
||||
|
||||
dnl mingw's getopt (in libmingwex.a) does weird things when the options
|
||||
dnl strings starts with '+' and it's not the first call. Some internal state
|
||||
dnl is left over from earlier calls, and neither setting optind = 0 nor
|
||||
dnl setting optreset = 1 get rid of this internal state.
|
||||
dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
|
||||
dnl POSIX 2008 does not specify leading '+' behavior, but see
|
||||
dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
|
||||
dnl the next version of POSIX. For now, we only guarantee leading '+'
|
||||
|
@ -102,105 +74,124 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
|
|||
AC_CACHE_CHECK([whether getopt is POSIX compatible],
|
||||
[gl_cv_func_getopt_posix],
|
||||
[
|
||||
dnl This test fails on mingw and succeeds on all other platforms.
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
dnl Merging these three different test programs into a single one
|
||||
dnl would require a reset mechanism. On BSD systems, it can be done
|
||||
dnl through 'optreset'; on some others (glibc), it can be done by
|
||||
dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
|
||||
dnl Solaris 9, musl libc), there is no such mechanism.
|
||||
if test $cross_compiling = no; then
|
||||
dnl Sanity check. Succeeds everywhere (except on MSVC,
|
||||
dnl which lacks <unistd.h> and getopt() entirely).
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if !HAVE_DECL_OPTRESET && !HAVE_DECL_GETOPT_CLIP
|
||||
# define OPTIND_MIN 0
|
||||
#else
|
||||
# define OPTIND_MIN 1
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
static char program[] = "program";
|
||||
static char a[] = "-a";
|
||||
static char foo[] = "foo";
|
||||
static char bar[] = "bar";
|
||||
char *argv[] = { program, a, foo, bar, NULL };
|
||||
int c;
|
||||
|
||||
c = getopt (4, argv, "ab");
|
||||
if (!(c == 'a'))
|
||||
return 1;
|
||||
c = getopt (4, argv, "ab");
|
||||
if (!(c == -1))
|
||||
return 2;
|
||||
if (!(optind == 2))
|
||||
return 3;
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[gl_cv_func_getopt_posix=maybe],
|
||||
[gl_cv_func_getopt_posix=no])
|
||||
if test $gl_cv_func_getopt_posix = maybe; then
|
||||
dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
|
||||
dnl which lacks <unistd.h> and getopt() entirely).
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
{
|
||||
int argc = 0;
|
||||
char *argv[10];
|
||||
int c;
|
||||
|
||||
argv[argc++] = "program";
|
||||
argv[argc++] = "-a";
|
||||
argv[argc++] = "foo";
|
||||
argv[argc++] = "bar";
|
||||
argv[argc] = NULL;
|
||||
optind = OPTIND_MIN;
|
||||
opterr = 0;
|
||||
|
||||
c = getopt (argc, argv, "ab");
|
||||
if (!(c == 'a'))
|
||||
return 1;
|
||||
c = getopt (argc, argv, "ab");
|
||||
if (!(c == -1))
|
||||
return 2;
|
||||
if (!(optind == 2))
|
||||
return 3;
|
||||
}
|
||||
/* Some internal state exists at this point. */
|
||||
{
|
||||
int argc = 0;
|
||||
char *argv[10];
|
||||
int c;
|
||||
|
||||
argv[argc++] = "program";
|
||||
argv[argc++] = "donald";
|
||||
argv[argc++] = "-p";
|
||||
argv[argc++] = "billy";
|
||||
argv[argc++] = "duck";
|
||||
argv[argc++] = "-a";
|
||||
argv[argc++] = "bar";
|
||||
argv[argc] = NULL;
|
||||
optind = OPTIND_MIN;
|
||||
opterr = 0;
|
||||
|
||||
c = getopt (argc, argv, "+abp:q:");
|
||||
if (!(c == -1))
|
||||
return 4;
|
||||
if (!(strcmp (argv[0], "program") == 0))
|
||||
return 5;
|
||||
if (!(strcmp (argv[1], "donald") == 0))
|
||||
return 6;
|
||||
if (!(strcmp (argv[2], "-p") == 0))
|
||||
return 7;
|
||||
if (!(strcmp (argv[3], "billy") == 0))
|
||||
return 8;
|
||||
if (!(strcmp (argv[4], "duck") == 0))
|
||||
return 9;
|
||||
if (!(strcmp (argv[5], "-a") == 0))
|
||||
return 10;
|
||||
if (!(strcmp (argv[6], "bar") == 0))
|
||||
return 11;
|
||||
if (!(optind == 1))
|
||||
return 12;
|
||||
}
|
||||
/* Detect MacOS 10.5 bug. */
|
||||
{
|
||||
char *argv[3] = { "program", "-ab", NULL };
|
||||
optind = OPTIND_MIN;
|
||||
opterr = 0;
|
||||
if (getopt (2, argv, "ab:") != 'a')
|
||||
return 13;
|
||||
if (getopt (2, argv, "ab:") != '?')
|
||||
return 14;
|
||||
if (optopt != 'b')
|
||||
return 15;
|
||||
if (optind != 2)
|
||||
return 16;
|
||||
}
|
||||
static char program[] = "program";
|
||||
static char donald[] = "donald";
|
||||
static char p[] = "-p";
|
||||
static char billy[] = "billy";
|
||||
static char duck[] = "duck";
|
||||
static char a[] = "-a";
|
||||
static char bar[] = "bar";
|
||||
char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
|
||||
int c;
|
||||
|
||||
c = getopt (7, argv, "+abp:q:");
|
||||
if (!(c == -1))
|
||||
return 4;
|
||||
if (!(strcmp (argv[0], "program") == 0))
|
||||
return 5;
|
||||
if (!(strcmp (argv[1], "donald") == 0))
|
||||
return 6;
|
||||
if (!(strcmp (argv[2], "-p") == 0))
|
||||
return 7;
|
||||
if (!(strcmp (argv[3], "billy") == 0))
|
||||
return 8;
|
||||
if (!(strcmp (argv[4], "duck") == 0))
|
||||
return 9;
|
||||
if (!(strcmp (argv[5], "-a") == 0))
|
||||
return 10;
|
||||
if (!(strcmp (argv[6], "bar") == 0))
|
||||
return 11;
|
||||
if (!(optind == 1))
|
||||
return 12;
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
|
||||
[case "$host_os" in
|
||||
mingw*) gl_cv_func_getopt_posix="guessing no";;
|
||||
darwin*) gl_cv_func_getopt_posix="guessing no";;
|
||||
*) gl_cv_func_getopt_posix="guessing yes";;
|
||||
esac
|
||||
])
|
||||
[gl_cv_func_getopt_posix=maybe],
|
||||
[gl_cv_func_getopt_posix=no])
|
||||
fi
|
||||
if test $gl_cv_func_getopt_posix = maybe; then
|
||||
dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
static char program[] = "program";
|
||||
static char ab[] = "-ab";
|
||||
char *argv[3] = { program, ab, NULL };
|
||||
if (getopt (2, argv, "ab:") != 'a')
|
||||
return 13;
|
||||
if (getopt (2, argv, "ab:") != '?')
|
||||
return 14;
|
||||
if (optopt != 'b')
|
||||
return 15;
|
||||
if (optind != 2)
|
||||
return 16;
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[gl_cv_func_getopt_posix=yes],
|
||||
[gl_cv_func_getopt_posix=no])
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
|
||||
*) gl_cv_func_getopt_posix="guessing yes";;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
case "$gl_cv_func_getopt_posix" in
|
||||
*no) gl_replace_getopt=yes ;;
|
||||
|
@ -213,82 +204,154 @@ main ()
|
|||
# optstring is necessary for programs like m4 that have POSIX-mandated
|
||||
# semantics for supporting options interspersed with files.
|
||||
# Also, since getopt_long is a GNU extension, we require optind=0.
|
||||
gl_had_POSIXLY_CORRECT=${POSIXLY_CORRECT:+yes}
|
||||
# Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
|
||||
# so take care to revert to the correct (non-)export state.
|
||||
dnl GNU Coding Standards currently allow awk but not env; besides, env
|
||||
dnl is ambiguous with environment values that contain newlines.
|
||||
gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
|
||||
case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
|
||||
xx) gl_had_POSIXLY_CORRECT=exported ;;
|
||||
x) gl_had_POSIXLY_CORRECT=yes ;;
|
||||
*) gl_had_POSIXLY_CORRECT= ;;
|
||||
esac
|
||||
POSIXLY_CORRECT=1
|
||||
export POSIXLY_CORRECT
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <getopt.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
]GL_NOCRASH[
|
||||
]], [[
|
||||
int result = 0;
|
||||
|
||||
nocrash_init();
|
||||
|
||||
/* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
|
||||
and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
|
||||
and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
|
||||
OSF/1 5.1, Solaris 10. */
|
||||
{
|
||||
char *myargv[3];
|
||||
myargv[0] = "conftest";
|
||||
myargv[1] = "-+";
|
||||
myargv[2] = 0;
|
||||
static char conftest[] = "conftest";
|
||||
static char plus[] = "-+";
|
||||
char *argv[3] = { conftest, plus, NULL };
|
||||
opterr = 0;
|
||||
if (getopt (2, myargv, "+a") != '?')
|
||||
return 1;
|
||||
if (getopt (2, argv, "+a") != '?')
|
||||
result |= 1;
|
||||
}
|
||||
/* This code succeeds on glibc 2.8, mingw,
|
||||
and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
|
||||
and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
|
||||
IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
|
||||
{
|
||||
char *argv[] = { "program", "-p", "foo", "bar", NULL };
|
||||
static char program[] = "program";
|
||||
static char p[] = "-p";
|
||||
static char foo[] = "foo";
|
||||
static char bar[] = "bar";
|
||||
char *argv[] = { program, p, foo, bar, NULL };
|
||||
|
||||
optind = 1;
|
||||
if (getopt (4, argv, "p::") != 'p')
|
||||
return 2;
|
||||
if (optarg != NULL)
|
||||
return 3;
|
||||
if (getopt (4, argv, "p::") != -1)
|
||||
return 4;
|
||||
if (optind != 2)
|
||||
return 5;
|
||||
result |= 2;
|
||||
else if (optarg != NULL)
|
||||
result |= 4;
|
||||
else if (getopt (4, argv, "p::") != -1)
|
||||
result |= 6;
|
||||
else if (optind != 2)
|
||||
result |= 8;
|
||||
}
|
||||
/* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
|
||||
{
|
||||
char *argv[] = { "program", "foo", "-p", NULL };
|
||||
static char program[] = "program";
|
||||
static char foo[] = "foo";
|
||||
static char p[] = "-p";
|
||||
char *argv[] = { program, foo, p, NULL };
|
||||
optind = 0;
|
||||
if (getopt (3, argv, "-p") != 1)
|
||||
return 6;
|
||||
if (getopt (3, argv, "-p") != 'p')
|
||||
return 7;
|
||||
result |= 16;
|
||||
else if (getopt (3, argv, "-p") != 'p')
|
||||
result |= 16;
|
||||
}
|
||||
/* This code fails on glibc 2.11. */
|
||||
{
|
||||
char *argv[] = { "program", "-b", "-a", NULL };
|
||||
static char program[] = "program";
|
||||
static char b[] = "-b";
|
||||
static char a[] = "-a";
|
||||
char *argv[] = { program, b, a, NULL };
|
||||
optind = opterr = 0;
|
||||
if (getopt (3, argv, "+:a:b") != 'b')
|
||||
return 8;
|
||||
if (getopt (3, argv, "+:a:b") != ':')
|
||||
return 9;
|
||||
result |= 32;
|
||||
else if (getopt (3, argv, "+:a:b") != ':')
|
||||
result |= 32;
|
||||
}
|
||||
return 0;
|
||||
/* This code dumps core on glibc 2.14. */
|
||||
{
|
||||
static char program[] = "program";
|
||||
static char w[] = "-W";
|
||||
static char dummy[] = "dummy";
|
||||
char *argv[] = { program, w, dummy, NULL };
|
||||
optind = opterr = 1;
|
||||
if (getopt (3, argv, "W;") != 'W')
|
||||
result |= 64;
|
||||
}
|
||||
return result;
|
||||
]])],
|
||||
[gl_cv_func_getopt_gnu=yes],
|
||||
[gl_cv_func_getopt_gnu=no],
|
||||
[dnl Cross compiling. Guess based on host and declarations.
|
||||
case $host_os:$ac_cv_have_decl_optreset in
|
||||
*-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
|
||||
*:yes) gl_cv_func_getopt_gnu=no;;
|
||||
*) gl_cv_func_getopt_gnu=yes;;
|
||||
esac
|
||||
[dnl Cross compiling. Assume the worst, even on glibc platforms.
|
||||
gl_cv_func_getopt_gnu="guessing no"
|
||||
])
|
||||
if test "$gl_had_POSIXLY_CORRECT" != yes; then
|
||||
AS_UNSET([POSIXLY_CORRECT])
|
||||
fi
|
||||
case $gl_had_POSIXLY_CORRECT in
|
||||
exported) ;;
|
||||
yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;;
|
||||
*) AS_UNSET([POSIXLY_CORRECT]) ;;
|
||||
esac
|
||||
])
|
||||
if test "$gl_cv_func_getopt_gnu" = "no"; then
|
||||
if test "$gl_cv_func_getopt_gnu" != yes; then
|
||||
gl_replace_getopt=yes
|
||||
else
|
||||
AC_CACHE_CHECK([for working GNU getopt_long function],
|
||||
[gl_cv_func_getopt_long_gnu],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <getopt.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
]],
|
||||
[[static const struct option long_options[] =
|
||||
{
|
||||
{ "xtremely-",no_argument, NULL, 1003 },
|
||||
{ "xtra", no_argument, NULL, 1001 },
|
||||
{ "xtreme", no_argument, NULL, 1002 },
|
||||
{ "xtremely", no_argument, NULL, 1003 },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
/* This code fails on OpenBSD 5.0. */
|
||||
{
|
||||
static char program[] = "program";
|
||||
static char xtremel[] = "--xtremel";
|
||||
char *argv[] = { program, xtremel, NULL };
|
||||
int option_index;
|
||||
optind = 1; opterr = 0;
|
||||
if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
]])],
|
||||
[gl_cv_func_getopt_long_gnu=yes],
|
||||
[gl_cv_func_getopt_long_gnu=no],
|
||||
[dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
|
||||
case "$host_os" in
|
||||
openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
|
||||
*) gl_cv_func_getopt_long_gnu="guessing yes";;
|
||||
esac
|
||||
])
|
||||
])
|
||||
case "$gl_cv_func_getopt_long_gnu" in
|
||||
*yes) ;;
|
||||
*) gl_replace_getopt=yes ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
# emacs' configure.in uses this.
|
||||
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
|
||||
[
|
||||
GETOPT_H=getopt.h
|
||||
|
@ -299,7 +362,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
|
|||
])
|
||||
|
||||
# Prerequisites of lib/getopt*.
|
||||
# emacs' configure.in uses this.
|
||||
AC_DEFUN([gl_PREREQ_GETOPT],
|
||||
[
|
||||
AC_CHECK_DECLS_ONCE([getenv])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# gettext.m4 serial 63 (gettext-0.18)
|
||||
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
|
||||
# gettext.m4 serial 66 (gettext-0.18.2)
|
||||
dnl Copyright (C) 1995-2013 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.
|
||||
|
@ -35,7 +35,7 @@ dnl will be ignored. If NEEDSYMBOL is specified and is
|
|||
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
|
||||
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
|
||||
dnl INTLDIR is used to find the intl libraries. If empty,
|
||||
dnl the value `$(top_builddir)/intl/' is used.
|
||||
dnl the value '$(top_builddir)/intl/' is used.
|
||||
dnl
|
||||
dnl The result of the configuration is one of three cases:
|
||||
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
|
||||
|
@ -97,7 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
|
|||
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
|
||||
])
|
||||
|
||||
dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
|
||||
dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
|
||||
gt_INTL_MACOSX
|
||||
|
||||
dnl Set USE_NLS.
|
||||
|
@ -157,12 +157,18 @@ changequote([,])dnl
|
|||
fi
|
||||
|
||||
AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
|
||||
[AC_TRY_LINK([#include <libintl.h>
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <libintl.h>
|
||||
$gt_revision_test_code
|
||||
extern int _nl_msg_cat_cntr;
|
||||
extern int *_nl_domain_bindings;],
|
||||
[bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
|
||||
extern int *_nl_domain_bindings;
|
||||
]],
|
||||
[[
|
||||
bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
|
||||
]])],
|
||||
[eval "$gt_func_gnugettext_libc=yes"],
|
||||
[eval "$gt_func_gnugettext_libc=no"])])
|
||||
|
||||
|
@ -183,35 +189,47 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b
|
|||
gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBINTL"
|
||||
dnl Now see whether libintl exists and does not depend on libiconv.
|
||||
AC_TRY_LINK([#include <libintl.h>
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <libintl.h>
|
||||
$gt_revision_test_code
|
||||
extern int _nl_msg_cat_cntr;
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
const char *_nl_expand_alias (const char *);],
|
||||
[bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
|
||||
const char *_nl_expand_alias (const char *);
|
||||
]],
|
||||
[[
|
||||
bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
|
||||
]])],
|
||||
[eval "$gt_func_gnugettext_libintl=yes"],
|
||||
[eval "$gt_func_gnugettext_libintl=no"])
|
||||
dnl Now see whether libintl exists and depends on libiconv.
|
||||
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
AC_TRY_LINK([#include <libintl.h>
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <libintl.h>
|
||||
$gt_revision_test_code
|
||||
extern int _nl_msg_cat_cntr;
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
const char *_nl_expand_alias (const char *);],
|
||||
[bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
|
||||
[LIBINTL="$LIBINTL $LIBICONV"
|
||||
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
|
||||
eval "$gt_func_gnugettext_libintl=yes"
|
||||
])
|
||||
const char *_nl_expand_alias (const char *);
|
||||
]],
|
||||
[[
|
||||
bindtextdomain ("", "");
|
||||
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
|
||||
]])],
|
||||
[LIBINTL="$LIBINTL $LIBICONV"
|
||||
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
|
||||
eval "$gt_func_gnugettext_libintl=yes"
|
||||
])
|
||||
fi
|
||||
CPPFLAGS="$gt_save_CPPFLAGS"
|
||||
LIBS="$gt_save_LIBS"])
|
||||
|
|
|
@ -1,23 +1,27 @@
|
|||
# glibc21.m4 serial 4
|
||||
dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
|
||||
# glibc21.m4 serial 5
|
||||
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# Test for the GNU C Library, version 2.1 or newer.
|
||||
# Test for the GNU C Library, version 2.1 or newer, or uClibc.
|
||||
# From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_GLIBC21],
|
||||
[
|
||||
AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
|
||||
AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
|
||||
[ac_cv_gnu_library_2_1],
|
||||
[AC_EGREP_CPP([Lucky GNU user],
|
||||
[AC_EGREP_CPP([Lucky],
|
||||
[
|
||||
#include <features.h>
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
|
||||
Lucky GNU user
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __UCLIBC__
|
||||
Lucky user
|
||||
#endif
|
||||
],
|
||||
[ac_cv_gnu_library_2_1=yes],
|
||||
|
|
|
@ -1,21 +1,33 @@
|
|||
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software, distributed under the terms of the GNU
|
||||
# General Public License. As a special exception to the GNU General
|
||||
# Public License, this file may be distributed as part of a program
|
||||
# that contains a configuration script generated by Autoconf, under
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This file is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this file. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License,
|
||||
# this file may be distributed as part of a program that
|
||||
# contains a configuration script generated by Autoconf, under
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
#
|
||||
# This file represents the specification of how gnulib-tool is used.
|
||||
# It acts as a cache: It is written and read by gnulib-tool.
|
||||
# In projects using CVS, this file is meant to be stored in CVS,
|
||||
# like the configure.ac and various Makefile.am files.
|
||||
# In projects that use version control, this file is meant to be put under
|
||||
# version control, like the configure.ac and various Makefile.am files.
|
||||
|
||||
|
||||
# Specification in the form of a command-line invocation:
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files base64 crypto/sha1 dirname environ floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex setenv strsep timegm unsetenv vasprintf vsnprintf
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files base64 crypto/sha1 dirname environ floorf fsusage getaddrinfo gethostname getloadavg getopt-gnu gettext mountlist regex setenv strsep timegm unsetenv vasprintf vsnprintf
|
||||
|
||||
# Specification in the form of a few gnulib-tool.m4 macro invocations:
|
||||
gl_LOCAL_DIR([])
|
||||
|
@ -29,7 +41,7 @@ gl_MODULES([
|
|||
getaddrinfo
|
||||
gethostname
|
||||
getloadavg
|
||||
getopt
|
||||
getopt-gnu
|
||||
gettext
|
||||
mountlist
|
||||
regex
|
||||
|
@ -50,4 +62,5 @@ gl_LIB([libgnu])
|
|||
gl_MAKEFILE_NAME([])
|
||||
gl_MACRO_PREFIX([gl])
|
||||
gl_PO_DOMAIN([])
|
||||
gl_WITNESS_C_MACRO([])
|
||||
gl_VC_FILES([false])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# gnulib-common.m4 serial 20
|
||||
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||
# gnulib-common.m4 serial 33
|
||||
dnl Copyright (C) 2007-2013 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,11 +12,25 @@ AC_DEFUN([gl_COMMON], [
|
|||
AC_REQUIRE([gl_COMMON_BODY])
|
||||
])
|
||||
AC_DEFUN([gl_COMMON_BODY], [
|
||||
AH_VERBATIM([_Noreturn],
|
||||
[/* The _Noreturn keyword of C11. */
|
||||
#if ! (defined _Noreturn \
|
||||
|| (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
|
||||
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||
|| 0x5110 <= __SUNPRO_C)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# elif defined _MSC_VER && 1200 <= _MSC_VER
|
||||
# define _Noreturn __declspec (noreturn)
|
||||
# else
|
||||
# define _Noreturn
|
||||
# endif
|
||||
#endif
|
||||
])
|
||||
AH_VERBATIM([isoc99_inline],
|
||||
[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
|
||||
the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
|
||||
earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
|
||||
__APPLE__ && __MACH__ test for MacOS X.
|
||||
__APPLE__ && __MACH__ test for Mac OS X.
|
||||
__APPLE_CC__ tests for the Apple compiler and its version.
|
||||
__STDC_VERSION__ tests for the C99 mode. */
|
||||
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
|
||||
|
@ -34,6 +48,20 @@ AC_DEFUN([gl_COMMON_BODY], [
|
|||
/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
|
||||
is a misnomer outside of parameter lists. */
|
||||
#define _UNUSED_PARAMETER_ _GL_UNUSED
|
||||
|
||||
/* The __pure__ attribute was added in gcc 2.96. */
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
||||
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
|
||||
#else
|
||||
# define _GL_ATTRIBUTE_PURE /* empty */
|
||||
#endif
|
||||
|
||||
/* The __const__ attribute was added in gcc 2.95. */
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
|
||||
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
|
||||
#else
|
||||
# define _GL_ATTRIBUTE_CONST /* empty */
|
||||
#endif
|
||||
])
|
||||
dnl Preparation for running test programs:
|
||||
dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
|
||||
|
@ -47,16 +75,49 @@ AC_DEFUN([gl_COMMON_BODY], [
|
|||
# expands to a C preprocessor expression that evaluates to 1 or 0, depending
|
||||
# whether a gnulib module that has been requested shall be considered present
|
||||
# or not.
|
||||
AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
|
||||
m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
|
||||
|
||||
# gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
|
||||
# sets the shell variable that indicates the presence of the given module to
|
||||
# a C preprocessor expression that will evaluate to 1.
|
||||
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
|
||||
[
|
||||
GNULIB_[]m4_translit([[$1]],
|
||||
[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
|
||||
[GNULIB_[]m4_translit([[$1]],
|
||||
[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
|
||||
[gl_MODULE_INDICATOR_CONDITION])
|
||||
])
|
||||
|
||||
# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
|
||||
# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
|
||||
# The shell variable's value is a C preprocessor expression that evaluates
|
||||
# to 0 or 1.
|
||||
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
|
||||
[
|
||||
m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
|
||||
[
|
||||
dnl Simplify the expression VALUE || 1 to 1.
|
||||
$1=1
|
||||
],
|
||||
[gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
|
||||
[gl_MODULE_INDICATOR_CONDITION])])
|
||||
])
|
||||
|
||||
# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
|
||||
# modifies the shell variable to include the given condition. The shell
|
||||
# variable's value is a C preprocessor expression that evaluates to 0 or 1.
|
||||
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
|
||||
[
|
||||
dnl Simplify the expression 1 || CONDITION to 1.
|
||||
if test "$[]$1" != 1; then
|
||||
dnl Simplify the expression 0 || CONDITION to CONDITION.
|
||||
if test "$[]$1" = 0; then
|
||||
$1=$2
|
||||
else
|
||||
$1="($[]$1 || $2)"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
# gl_MODULE_INDICATOR([modulename])
|
||||
|
@ -102,6 +163,40 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
|
|||
[Define to 1 when the gnulib module $1 should be tested.])
|
||||
])
|
||||
|
||||
# gl_ASSERT_NO_GNULIB_POSIXCHECK
|
||||
# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
|
||||
# and thereby enables an optimization of configure and config.h.
|
||||
# Used by Emacs.
|
||||
AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
|
||||
[
|
||||
dnl Override gl_WARN_ON_USE_PREPARE.
|
||||
dnl But hide this definition from 'aclocal'.
|
||||
AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
|
||||
])
|
||||
|
||||
# gl_ASSERT_NO_GNULIB_TESTS
|
||||
# asserts that there will be no gnulib tests in the scope of the configure.ac
|
||||
# and thereby enables an optimization of config.h.
|
||||
# Used by Emacs.
|
||||
AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
|
||||
[
|
||||
dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
|
||||
AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
|
||||
])
|
||||
|
||||
# Test whether <features.h> exists.
|
||||
# Set HAVE_FEATURES_H.
|
||||
AC_DEFUN([gl_FEATURES_H],
|
||||
[
|
||||
AC_CHECK_HEADERS_ONCE([features.h])
|
||||
if test $ac_cv_header_features_h = yes; then
|
||||
HAVE_FEATURES_H=1
|
||||
else
|
||||
HAVE_FEATURES_H=0
|
||||
fi
|
||||
AC_SUBST([HAVE_FEATURES_H])
|
||||
])
|
||||
|
||||
# m4_foreach_w
|
||||
# is a backport of autoconf-2.59c's m4_foreach_w.
|
||||
# Remove this macro when we can assume autoconf >= 2.60.
|
||||
|
@ -117,11 +212,90 @@ m4_ifndef([AS_VAR_IF],
|
|||
[m4_define([AS_VAR_IF],
|
||||
[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
|
||||
|
||||
# gl_PROG_CC_C99
|
||||
# Modifies the value of the shell variable CC in an attempt to make $CC
|
||||
# understand ISO C99 source code.
|
||||
# This is like AC_PROG_CC_C99, except that
|
||||
# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
|
||||
# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
|
||||
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
|
||||
# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
|
||||
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>.
|
||||
# Remaining problems:
|
||||
# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
|
||||
# to CC twice
|
||||
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
|
||||
# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
|
||||
AC_DEFUN([gl_PROG_CC_C99],
|
||||
[
|
||||
dnl Change that version number to the minimum Autoconf version that supports
|
||||
dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
|
||||
m4_version_prereq([9.0],
|
||||
[AC_REQUIRE([AC_PROG_CC_C99])],
|
||||
[AC_REQUIRE([AC_PROG_CC_STDC])])
|
||||
])
|
||||
|
||||
# gl_PROG_AR_RANLIB
|
||||
# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
|
||||
# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
|
||||
# the values.
|
||||
AC_DEFUN([gl_PROG_AR_RANLIB],
|
||||
[
|
||||
dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
|
||||
dnl as "cc", and GCC as "gcc". They have different object file formats and
|
||||
dnl library formats. In particular, the GNU binutils programs ar, ranlib
|
||||
dnl produce libraries that work only with gcc, not with cc.
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
|
||||
[
|
||||
AC_EGREP_CPP([Amsterdam],
|
||||
[
|
||||
#ifdef __ACK__
|
||||
Amsterdam
|
||||
#endif
|
||||
],
|
||||
[gl_cv_c_amsterdam_compiler=yes],
|
||||
[gl_cv_c_amsterdam_compiler=no])
|
||||
])
|
||||
if test -z "$AR"; then
|
||||
if test $gl_cv_c_amsterdam_compiler = yes; then
|
||||
AR='cc -c.a'
|
||||
if test -z "$ARFLAGS"; then
|
||||
ARFLAGS='-o'
|
||||
fi
|
||||
else
|
||||
dnl Use the Automake-documented default values for AR and ARFLAGS,
|
||||
dnl but prefer ${host}-ar over ar (useful for cross-compiling).
|
||||
AC_CHECK_TOOL([AR], [ar], [ar])
|
||||
if test -z "$ARFLAGS"; then
|
||||
ARFLAGS='cru'
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test -z "$ARFLAGS"; then
|
||||
ARFLAGS='cru'
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([AR])
|
||||
AC_SUBST([ARFLAGS])
|
||||
if test -z "$RANLIB"; then
|
||||
if test $gl_cv_c_amsterdam_compiler = yes; then
|
||||
RANLIB=':'
|
||||
else
|
||||
dnl Use the ranlib program if it is available.
|
||||
AC_PROG_RANLIB
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([RANLIB])
|
||||
])
|
||||
|
||||
# AC_PROG_MKDIR_P
|
||||
# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
|
||||
# for interoperability with automake-1.9.6 from autoconf-2.62.
|
||||
# Remove this macro when we can assume autoconf >= 2.62 or
|
||||
# autoconf >= 2.60 && automake >= 1.10.
|
||||
# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],[
|
||||
m4_ifdef([AC_PROG_MKDIR_P], [
|
||||
dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
|
||||
m4_define([AC_PROG_MKDIR_P],
|
||||
|
@ -132,13 +306,15 @@ 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.
|
||||
m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[
|
||||
# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],[
|
||||
AC_DEFUN([AC_C_RESTRICT],
|
||||
[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
|
||||
[ac_cv_c_restrict=no
|
||||
|
|
|
@ -1,10 +1,22 @@
|
|||
# DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software, distributed under the terms of the GNU
|
||||
# General Public License. As a special exception to the GNU General
|
||||
# Public License, this file may be distributed as part of a program
|
||||
# that contains a configuration script generated by Autoconf, under
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This file is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this file. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License,
|
||||
# this file may be distributed as part of a program that
|
||||
# contains a configuration script generated by Autoconf, under
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
|
@ -12,7 +24,8 @@
|
|||
# This file represents the compiled summary of the specification in
|
||||
# gnulib-cache.m4. It lists the computed macro invocations that need
|
||||
# to be invoked from configure.ac.
|
||||
# In projects using CVS, this file can be treated like other built files.
|
||||
# In projects that use version control, this file can be treated like
|
||||
# other built files.
|
||||
|
||||
|
||||
# This macro should be invoked from ./configure.in, in the section
|
||||
|
@ -24,42 +37,33 @@ AC_DEFUN([gl_EARLY],
|
|||
m4_pattern_allow([^gl_ES$])dnl a valid locale name
|
||||
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
|
||||
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
|
||||
AC_REQUIRE([AC_PROG_RANLIB])
|
||||
# Code from module alignof:
|
||||
AC_REQUIRE([gl_PROG_AR_RANLIB])
|
||||
AC_REQUIRE([AM_PROG_CC_C_O])
|
||||
# Code from module alloca-opt:
|
||||
# Code from module arg-nonnull:
|
||||
# Code from module arpa_inet:
|
||||
# Code from module base64:
|
||||
# Code from module btowc:
|
||||
# Code from module c++defs:
|
||||
# Code from module c-strtod:
|
||||
# Code from module cloexec:
|
||||
# Code from module close-hook:
|
||||
# Code from module configmake:
|
||||
# Code from module crypto/sha1:
|
||||
# Code from module dirname:
|
||||
# Code from module dirname-lgpl:
|
||||
# Code from module dosname:
|
||||
# Code from module double-slash-root:
|
||||
# Code from module dup2:
|
||||
# Code from module environ:
|
||||
# Code from module errno:
|
||||
# Code from module error:
|
||||
# Code from module exitfail:
|
||||
# Code from module extensions:
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
# Code from module fcntl:
|
||||
# Code from module fcntl-h:
|
||||
# Code from module fcntl-safer:
|
||||
# Code from module extern-inline:
|
||||
# Code from module fd-hook:
|
||||
# Code from module float:
|
||||
# Code from module floorf:
|
||||
# Code from module fsusage:
|
||||
# Code from module full-read:
|
||||
# Code from module full-write:
|
||||
# Code from module getaddrinfo:
|
||||
# Code from module getdtablesize:
|
||||
# Code from module gethostname:
|
||||
# Code from module getloadavg:
|
||||
# Code from module getopt:
|
||||
# Code from module getopt-gnu:
|
||||
# Code from module getopt-posix:
|
||||
# Code from module gettext:
|
||||
|
@ -68,68 +72,81 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module hostent:
|
||||
# Code from module include_next:
|
||||
# Code from module inet_ntop:
|
||||
# Code from module inline:
|
||||
# Code from module intprops:
|
||||
# Code from module langinfo:
|
||||
# Code from module largefile:
|
||||
AC_REQUIRE([AC_SYS_LARGEFILE])
|
||||
# Code from module localcharset:
|
||||
# Code from module locale:
|
||||
# Code from module malloc:
|
||||
# Code from module localeconv:
|
||||
# Code from module lock:
|
||||
# Code from module malloc-gnu:
|
||||
# Code from module malloc-posix:
|
||||
# Code from module malloca:
|
||||
# Code from module math:
|
||||
# Code from module mbrtowc:
|
||||
# Code from module mbsinit:
|
||||
# Code from module mbtowc:
|
||||
# Code from module memchr:
|
||||
# Code from module mktime:
|
||||
# Code from module mktime-internal:
|
||||
# Code from module mountlist:
|
||||
# Code from module msvc-inval:
|
||||
# Code from module msvc-nothrow:
|
||||
# Code from module multiarch:
|
||||
# Code from module netdb:
|
||||
# Code from module netinet_in:
|
||||
# Code from module nl_langinfo:
|
||||
# Code from module open:
|
||||
# Code from module nocrash:
|
||||
# Code from module read:
|
||||
# Code from module regex:
|
||||
# Code from module safe-read:
|
||||
# Code from module safe-write:
|
||||
# Code from module servent:
|
||||
# Code from module setenv:
|
||||
# Code from module size_max:
|
||||
# Code from module snippet/_Noreturn:
|
||||
# Code from module snippet/arg-nonnull:
|
||||
# Code from module snippet/c++defs:
|
||||
# Code from module snippet/warn-on-use:
|
||||
# Code from module snprintf:
|
||||
# Code from module socketlib:
|
||||
# Code from module sockets:
|
||||
# Code from module socklen:
|
||||
# Code from module ssize_t:
|
||||
# Code from module stat:
|
||||
# Code from module stdalign:
|
||||
# Code from module stdbool:
|
||||
# Code from module stddef:
|
||||
# Code from module stdint:
|
||||
# Code from module stdio:
|
||||
# Code from module stdlib:
|
||||
# Code from module strdup-posix:
|
||||
# Code from module streq:
|
||||
# Code from module strerror:
|
||||
# Code from module strerror-override:
|
||||
# Code from module string:
|
||||
# Code from module strndup:
|
||||
# Code from module strnlen:
|
||||
# Code from module strsep:
|
||||
# Code from module strstr-simple:
|
||||
# Code from module sys_socket:
|
||||
# Code from module sys_stat:
|
||||
# Code from module sys_types:
|
||||
# Code from module sys_uio:
|
||||
# Code from module threadlib:
|
||||
gl_THREADLIB_EARLY
|
||||
# Code from module time:
|
||||
# Code from module time_r:
|
||||
# Code from module timegm:
|
||||
# Code from module unistd:
|
||||
# Code from module unistd-safer:
|
||||
# Code from module unsetenv:
|
||||
# Code from module vasnprintf:
|
||||
# Code from module vasprintf:
|
||||
# Code from module verify:
|
||||
# Code from module vsnprintf:
|
||||
# Code from module warn-on-use:
|
||||
# Code from module wchar:
|
||||
# Code from module wcrtomb:
|
||||
# Code from module wctype:
|
||||
# Code from module write:
|
||||
# Code from module wctype-h:
|
||||
# Code from module xalloc:
|
||||
# Code from module xalloc-die:
|
||||
# Code from module xalloc-oversized:
|
||||
# Code from module xsize:
|
||||
# Code from module xstrndup:
|
||||
])
|
||||
|
@ -150,252 +167,296 @@ AC_DEFUN([gl_INIT],
|
|||
m4_pushdef([gl_LIBSOURCES_DIR], [])
|
||||
gl_COMMON
|
||||
gl_source_base='gl'
|
||||
# Code from module alignof:
|
||||
# Code from module alloca-opt:
|
||||
gl_FUNC_ALLOCA
|
||||
# Code from module arg-nonnull:
|
||||
# Code from module arpa_inet:
|
||||
gl_HEADER_ARPA_INET
|
||||
AC_PROG_MKDIR_P
|
||||
# Code from module base64:
|
||||
gl_FUNC_BASE64
|
||||
# Code from module btowc:
|
||||
gl_FUNC_BTOWC
|
||||
if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
|
||||
AC_LIBOBJ([btowc])
|
||||
gl_PREREQ_BTOWC
|
||||
fi
|
||||
gl_WCHAR_MODULE_INDICATOR([btowc])
|
||||
# Code from module c++defs:
|
||||
# Code from module c-strtod:
|
||||
gl_C_STRTOD
|
||||
# Code from module cloexec:
|
||||
gl_CLOEXEC
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
|
||||
# Code from module close-hook:
|
||||
# Code from module configmake:
|
||||
# Code from module crypto/sha1:
|
||||
gl_CONFIGMAKE_PREP
|
||||
gl_SHA1
|
||||
# Code from module dirname:
|
||||
gl_DIRNAME
|
||||
gl_MODULE_INDICATOR([dirname])
|
||||
# Code from module dirname-lgpl:
|
||||
gl_DIRNAME_LGPL
|
||||
# Code from module double-slash-root:
|
||||
gl_DOUBLE_SLASH_ROOT
|
||||
# Code from module dup2:
|
||||
gl_FUNC_DUP2
|
||||
gl_UNISTD_MODULE_INDICATOR([dup2])
|
||||
# Code from module environ:
|
||||
gl_ENVIRON
|
||||
gl_UNISTD_MODULE_INDICATOR([environ])
|
||||
# Code from module errno:
|
||||
gl_HEADER_ERRNO_H
|
||||
# Code from module error:
|
||||
gl_ERROR
|
||||
if test $ac_cv_lib_error_at_line = no; then
|
||||
AC_LIBOBJ([error])
|
||||
gl_PREREQ_ERROR
|
||||
fi
|
||||
m4_ifdef([AM_XGETTEXT_OPTION],
|
||||
[AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
|
||||
AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
|
||||
# Code from module exitfail:
|
||||
# Code from module extensions:
|
||||
# Code from module fcntl:
|
||||
gl_FUNC_FCNTL
|
||||
gl_FCNTL_MODULE_INDICATOR([fcntl])
|
||||
# Code from module fcntl-h:
|
||||
gl_FCNTL_H
|
||||
# Code from module fcntl-safer:
|
||||
gl_FCNTL_SAFER
|
||||
gl_MODULE_INDICATOR([fcntl-safer])
|
||||
# Code from module float:
|
||||
AC_REQUIRE([gl_EXTERN_INLINE])
|
||||
gl_FLOAT_H
|
||||
# Code from module floorf:
|
||||
if test $REPLACE_FLOAT_LDBL = 1; then
|
||||
AC_LIBOBJ([float])
|
||||
fi
|
||||
if test $REPLACE_ITOLD = 1; then
|
||||
AC_LIBOBJ([itold])
|
||||
fi
|
||||
gl_FUNC_FLOORF
|
||||
if test $HAVE_DECL_FLOORF = 0 || test $REPLACE_FLOORF = 1; then
|
||||
AC_LIBOBJ([floorf])
|
||||
fi
|
||||
gl_MATH_MODULE_INDICATOR([floorf])
|
||||
# Code from module fsusage:
|
||||
gl_FSUSAGE
|
||||
# Code from module full-read:
|
||||
# Code from module full-write:
|
||||
# Code from module getaddrinfo:
|
||||
if test $gl_cv_fs_space = yes; then
|
||||
AC_LIBOBJ([fsusage])
|
||||
gl_PREREQ_FSUSAGE_EXTRA
|
||||
fi
|
||||
gl_GETADDRINFO
|
||||
if test $HAVE_GETADDRINFO = 0; then
|
||||
AC_LIBOBJ([getaddrinfo])
|
||||
fi
|
||||
if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then
|
||||
AC_LIBOBJ([gai_strerror])
|
||||
fi
|
||||
gl_NETDB_MODULE_INDICATOR([getaddrinfo])
|
||||
# Code from module getdtablesize:
|
||||
gl_FUNC_GETDTABLESIZE
|
||||
gl_UNISTD_MODULE_INDICATOR([getdtablesize])
|
||||
# Code from module gethostname:
|
||||
gl_FUNC_GETHOSTNAME
|
||||
if test $HAVE_GETHOSTNAME = 0; then
|
||||
AC_LIBOBJ([gethostname])
|
||||
gl_PREREQ_GETHOSTNAME
|
||||
fi
|
||||
gl_UNISTD_MODULE_INDICATOR([gethostname])
|
||||
# Code from module getloadavg:
|
||||
gl_GETLOADAVG([$gl_source_base])
|
||||
gl_GETLOADAVG
|
||||
if test $HAVE_GETLOADAVG = 0; then
|
||||
AC_LIBOBJ([getloadavg])
|
||||
gl_PREREQ_GETLOADAVG
|
||||
fi
|
||||
gl_STDLIB_MODULE_INDICATOR([getloadavg])
|
||||
# Code from module getopt:
|
||||
# Code from module getopt-gnu:
|
||||
gl_FUNC_GETOPT_GNU
|
||||
if test $REPLACE_GETOPT = 1; then
|
||||
AC_LIBOBJ([getopt])
|
||||
AC_LIBOBJ([getopt1])
|
||||
gl_PREREQ_GETOPT
|
||||
dnl Arrange for unistd.h to include getopt.h.
|
||||
GNULIB_GL_UNISTD_H_GETOPT=1
|
||||
fi
|
||||
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
|
||||
# Code from module getopt-posix:
|
||||
gl_FUNC_GETOPT_POSIX
|
||||
# Code from module gettext:
|
||||
if test $REPLACE_GETOPT = 1; then
|
||||
AC_LIBOBJ([getopt])
|
||||
AC_LIBOBJ([getopt1])
|
||||
gl_PREREQ_GETOPT
|
||||
dnl Arrange for unistd.h to include getopt.h.
|
||||
GNULIB_GL_UNISTD_H_GETOPT=1
|
||||
fi
|
||||
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
|
||||
dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
|
||||
AM_GNU_GETTEXT_VERSION([0.18.1])
|
||||
# Code from module gettext-h:
|
||||
AC_SUBST([LIBINTL])
|
||||
AC_SUBST([LTLIBINTL])
|
||||
# Code from module havelib:
|
||||
# Code from module hostent:
|
||||
gl_HOSTENT
|
||||
# Code from module include_next:
|
||||
# Code from module inet_ntop:
|
||||
gl_FUNC_INET_NTOP
|
||||
if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
|
||||
AC_LIBOBJ([inet_ntop])
|
||||
gl_PREREQ_INET_NTOP
|
||||
fi
|
||||
gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
|
||||
# Code from module inline:
|
||||
gl_INLINE
|
||||
# Code from module intprops:
|
||||
# Code from module langinfo:
|
||||
gl_LANGINFO_H
|
||||
# Code from module localcharset:
|
||||
AC_REQUIRE([gl_LARGEFILE])
|
||||
gl_LOCALCHARSET
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
|
||||
AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
|
||||
# Code from module locale:
|
||||
gl_LOCALE_H
|
||||
# Code from module malloc:
|
||||
AC_FUNC_MALLOC
|
||||
AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.])
|
||||
# Code from module malloc-posix:
|
||||
gl_FUNC_LOCALECONV
|
||||
if test $REPLACE_LOCALECONV = 1; then
|
||||
AC_LIBOBJ([localeconv])
|
||||
gl_PREREQ_LOCALECONV
|
||||
fi
|
||||
gl_LOCALE_MODULE_INDICATOR([localeconv])
|
||||
gl_LOCK
|
||||
gl_MODULE_INDICATOR([lock])
|
||||
gl_FUNC_MALLOC_GNU
|
||||
if test $REPLACE_MALLOC = 1; then
|
||||
AC_LIBOBJ([malloc])
|
||||
fi
|
||||
gl_MODULE_INDICATOR([malloc-gnu])
|
||||
gl_FUNC_MALLOC_POSIX
|
||||
if test $REPLACE_MALLOC = 1; then
|
||||
AC_LIBOBJ([malloc])
|
||||
fi
|
||||
gl_STDLIB_MODULE_INDICATOR([malloc-posix])
|
||||
# Code from module malloca:
|
||||
gl_MALLOCA
|
||||
# Code from module math:
|
||||
gl_MATH_H
|
||||
# Code from module mbrtowc:
|
||||
gl_FUNC_MBRTOWC
|
||||
if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
|
||||
AC_LIBOBJ([mbrtowc])
|
||||
gl_PREREQ_MBRTOWC
|
||||
fi
|
||||
gl_WCHAR_MODULE_INDICATOR([mbrtowc])
|
||||
# Code from module mbsinit:
|
||||
gl_FUNC_MBSINIT
|
||||
if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
|
||||
AC_LIBOBJ([mbsinit])
|
||||
gl_PREREQ_MBSINIT
|
||||
fi
|
||||
gl_WCHAR_MODULE_INDICATOR([mbsinit])
|
||||
# Code from module memchr:
|
||||
gl_FUNC_MBTOWC
|
||||
if test $REPLACE_MBTOWC = 1; then
|
||||
AC_LIBOBJ([mbtowc])
|
||||
gl_PREREQ_MBTOWC
|
||||
fi
|
||||
gl_STDLIB_MODULE_INDICATOR([mbtowc])
|
||||
gl_FUNC_MEMCHR
|
||||
if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
|
||||
AC_LIBOBJ([memchr])
|
||||
gl_PREREQ_MEMCHR
|
||||
fi
|
||||
gl_STRING_MODULE_INDICATOR([memchr])
|
||||
# Code from module mktime:
|
||||
gl_FUNC_MKTIME
|
||||
if test $REPLACE_MKTIME = 1; then
|
||||
AC_LIBOBJ([mktime])
|
||||
gl_PREREQ_MKTIME
|
||||
fi
|
||||
gl_TIME_MODULE_INDICATOR([mktime])
|
||||
# Code from module mountlist:
|
||||
gl_FUNC_MKTIME_INTERNAL
|
||||
if test $REPLACE_MKTIME = 1; then
|
||||
AC_LIBOBJ([mktime])
|
||||
gl_PREREQ_MKTIME
|
||||
fi
|
||||
gl_MOUNTLIST
|
||||
# Code from module multiarch:
|
||||
if test $gl_cv_list_mounted_fs = yes; then
|
||||
AC_LIBOBJ([mountlist])
|
||||
gl_PREREQ_MOUNTLIST_EXTRA
|
||||
fi
|
||||
gl_MSVC_INVAL
|
||||
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
|
||||
AC_LIBOBJ([msvc-inval])
|
||||
fi
|
||||
gl_MSVC_NOTHROW
|
||||
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
|
||||
AC_LIBOBJ([msvc-nothrow])
|
||||
fi
|
||||
gl_MULTIARCH
|
||||
# Code from module netdb:
|
||||
gl_HEADER_NETDB
|
||||
# Code from module netinet_in:
|
||||
gl_HEADER_NETINET_IN
|
||||
AC_PROG_MKDIR_P
|
||||
# Code from module nl_langinfo:
|
||||
gl_FUNC_NL_LANGINFO
|
||||
if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
|
||||
AC_LIBOBJ([nl_langinfo])
|
||||
fi
|
||||
gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
|
||||
# Code from module open:
|
||||
gl_FUNC_OPEN
|
||||
gl_FCNTL_MODULE_INDICATOR([open])
|
||||
# Code from module regex:
|
||||
gl_FUNC_READ
|
||||
if test $REPLACE_READ = 1; then
|
||||
AC_LIBOBJ([read])
|
||||
gl_PREREQ_READ
|
||||
fi
|
||||
gl_UNISTD_MODULE_INDICATOR([read])
|
||||
gl_REGEX
|
||||
# Code from module safe-read:
|
||||
gl_SAFE_READ
|
||||
# Code from module safe-write:
|
||||
gl_SAFE_WRITE
|
||||
# Code from module servent:
|
||||
if test $ac_use_included_regex = yes; then
|
||||
AC_LIBOBJ([regex])
|
||||
gl_PREREQ_REGEX
|
||||
fi
|
||||
gl_PREREQ_SAFE_READ
|
||||
gl_SERVENT
|
||||
# Code from module setenv:
|
||||
gl_FUNC_SETENV
|
||||
if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
|
||||
AC_LIBOBJ([setenv])
|
||||
fi
|
||||
gl_STDLIB_MODULE_INDICATOR([setenv])
|
||||
# Code from module size_max:
|
||||
gl_SIZE_MAX
|
||||
# Code from module snprintf:
|
||||
gl_FUNC_SNPRINTF
|
||||
gl_STDIO_MODULE_INDICATOR([snprintf])
|
||||
# Code from module sockets:
|
||||
gl_MODULE_INDICATOR([snprintf])
|
||||
gl_SOCKETLIB
|
||||
gl_SOCKETS
|
||||
# Code from module socklen:
|
||||
gl_TYPE_SOCKLEN_T
|
||||
# Code from module ssize_t:
|
||||
gt_TYPE_SSIZE_T
|
||||
# Code from module stat:
|
||||
gl_FUNC_STAT
|
||||
gl_SYS_STAT_MODULE_INDICATOR([stat])
|
||||
# Code from module stdbool:
|
||||
gl_STDALIGN_H
|
||||
AM_STDBOOL_H
|
||||
# Code from module stddef:
|
||||
gl_STDDEF_H
|
||||
# Code from module stdint:
|
||||
gl_STDINT_H
|
||||
# Code from module stdio:
|
||||
gl_STDIO_H
|
||||
# Code from module stdlib:
|
||||
gl_STDLIB_H
|
||||
# Code from module strdup-posix:
|
||||
gl_FUNC_STRDUP_POSIX
|
||||
gl_STRING_MODULE_INDICATOR([strdup])
|
||||
# Code from module streq:
|
||||
# Code from module strerror:
|
||||
gl_FUNC_STRERROR
|
||||
if test $REPLACE_STRERROR = 1; then
|
||||
AC_LIBOBJ([strerror])
|
||||
fi
|
||||
gl_MODULE_INDICATOR([strerror])
|
||||
gl_STRING_MODULE_INDICATOR([strerror])
|
||||
# Code from module string:
|
||||
AC_REQUIRE([gl_HEADER_ERRNO_H])
|
||||
AC_REQUIRE([gl_FUNC_STRERROR_0])
|
||||
if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
|
||||
AC_LIBOBJ([strerror-override])
|
||||
gl_PREREQ_SYS_H_WINSOCK2
|
||||
fi
|
||||
gl_HEADER_STRING_H
|
||||
# Code from module strndup:
|
||||
gl_FUNC_STRNDUP
|
||||
if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
|
||||
AC_LIBOBJ([strndup])
|
||||
fi
|
||||
gl_STRING_MODULE_INDICATOR([strndup])
|
||||
# Code from module strnlen:
|
||||
gl_FUNC_STRNLEN
|
||||
if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
|
||||
AC_LIBOBJ([strnlen])
|
||||
gl_PREREQ_STRNLEN
|
||||
fi
|
||||
gl_STRING_MODULE_INDICATOR([strnlen])
|
||||
# Code from module strsep:
|
||||
gl_FUNC_STRSEP
|
||||
if test $HAVE_STRSEP = 0; then
|
||||
AC_LIBOBJ([strsep])
|
||||
gl_PREREQ_STRSEP
|
||||
fi
|
||||
gl_STRING_MODULE_INDICATOR([strsep])
|
||||
# Code from module strstr-simple:
|
||||
gl_FUNC_STRSTR_SIMPLE
|
||||
if test $REPLACE_STRSTR = 1; then
|
||||
AC_LIBOBJ([strstr])
|
||||
fi
|
||||
gl_STRING_MODULE_INDICATOR([strstr])
|
||||
# Code from module sys_socket:
|
||||
gl_HEADER_SYS_SOCKET
|
||||
AC_PROG_MKDIR_P
|
||||
# Code from module sys_stat:
|
||||
gl_HEADER_SYS_STAT_H
|
||||
gl_SYS_TYPES_H
|
||||
AC_PROG_MKDIR_P
|
||||
# Code from module time:
|
||||
gl_HEADER_SYS_UIO
|
||||
AC_PROG_MKDIR_P
|
||||
gl_THREADLIB
|
||||
gl_HEADER_TIME_H
|
||||
# Code from module time_r:
|
||||
gl_TIME_R
|
||||
if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
|
||||
AC_LIBOBJ([time_r])
|
||||
gl_PREREQ_TIME_R
|
||||
fi
|
||||
gl_TIME_MODULE_INDICATOR([time_r])
|
||||
# Code from module timegm:
|
||||
gl_FUNC_TIMEGM
|
||||
if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then
|
||||
AC_LIBOBJ([timegm])
|
||||
gl_PREREQ_TIMEGM
|
||||
fi
|
||||
gl_TIME_MODULE_INDICATOR([timegm])
|
||||
# Code from module unistd:
|
||||
gl_UNISTD_H
|
||||
# Code from module unistd-safer:
|
||||
gl_UNISTD_SAFER
|
||||
# Code from module unsetenv:
|
||||
gl_FUNC_UNSETENV
|
||||
if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
|
||||
AC_LIBOBJ([unsetenv])
|
||||
gl_PREREQ_UNSETENV
|
||||
fi
|
||||
gl_STDLIB_MODULE_INDICATOR([unsetenv])
|
||||
# Code from module vasnprintf:
|
||||
gl_FUNC_VASNPRINTF
|
||||
# Code from module vasprintf:
|
||||
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])])
|
||||
# Code from module verify:
|
||||
# Code from module vsnprintf:
|
||||
gl_FUNC_VSNPRINTF
|
||||
gl_STDIO_MODULE_INDICATOR([vsnprintf])
|
||||
# Code from module warn-on-use:
|
||||
# Code from module wchar:
|
||||
gl_WCHAR_H
|
||||
# Code from module wcrtomb:
|
||||
gl_FUNC_WCRTOMB
|
||||
if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
|
||||
AC_LIBOBJ([wcrtomb])
|
||||
gl_PREREQ_WCRTOMB
|
||||
fi
|
||||
gl_WCHAR_MODULE_INDICATOR([wcrtomb])
|
||||
# Code from module wctype:
|
||||
gl_WCTYPE_H
|
||||
# Code from module write:
|
||||
gl_FUNC_WRITE
|
||||
gl_UNISTD_MODULE_INDICATOR([write])
|
||||
# Code from module xalloc:
|
||||
gl_XALLOC
|
||||
# Code from module xalloc-die:
|
||||
# Code from module xsize:
|
||||
gl_XSIZE
|
||||
# Code from module xstrndup:
|
||||
gl_XSTRNDUP
|
||||
# End of code from modules
|
||||
m4_ifval(gl_LIBSOURCES_LIST, [
|
||||
|
@ -537,11 +598,11 @@ AC_DEFUN([gltests_LIBSOURCES], [
|
|||
# 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/arg-nonnull.h
|
||||
build-aux/c++defs.h
|
||||
build-aux/config.rpath
|
||||
build-aux/warn-on-use.h
|
||||
lib/alignof.h
|
||||
build-aux/snippet/_Noreturn.h
|
||||
build-aux/snippet/arg-nonnull.h
|
||||
build-aux/snippet/c++defs.h
|
||||
build-aux/snippet/warn-on-use.h
|
||||
lib/alloca.in.h
|
||||
lib/arpa_inet.in.h
|
||||
lib/asnprintf.c
|
||||
|
@ -551,30 +612,20 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/basename-lgpl.c
|
||||
lib/basename.c
|
||||
lib/btowc.c
|
||||
lib/c-strtod.c
|
||||
lib/c-strtod.h
|
||||
lib/cloexec.c
|
||||
lib/cloexec.h
|
||||
lib/close-hook.c
|
||||
lib/close-hook.h
|
||||
lib/config.charset
|
||||
lib/creat-safer.c
|
||||
lib/dirname-lgpl.c
|
||||
lib/dirname.c
|
||||
lib/dirname.h
|
||||
lib/dup-safer.c
|
||||
lib/dup2.c
|
||||
lib/dosname.h
|
||||
lib/errno.in.h
|
||||
lib/error.c
|
||||
lib/error.h
|
||||
lib/exitfail.c
|
||||
lib/exitfail.h
|
||||
lib/fcntl--.h
|
||||
lib/fcntl-safer.h
|
||||
lib/fcntl.c
|
||||
lib/fcntl.in.h
|
||||
lib/fd-safer.c
|
||||
lib/fd-hook.c
|
||||
lib/fd-hook.h
|
||||
lib/float+.h
|
||||
lib/float.c
|
||||
lib/float.in.h
|
||||
lib/floor.c
|
||||
lib/floorf.c
|
||||
|
@ -583,10 +634,8 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/full-read.c
|
||||
lib/full-read.h
|
||||
lib/full-write.c
|
||||
lib/full-write.h
|
||||
lib/gai_strerror.c
|
||||
lib/getaddrinfo.c
|
||||
lib/getdtablesize.c
|
||||
lib/gethostname.c
|
||||
lib/getloadavg.c
|
||||
lib/getopt.c
|
||||
|
@ -594,35 +643,45 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/getopt1.c
|
||||
lib/getopt_int.h
|
||||
lib/gettext.h
|
||||
lib/glthread/lock.c
|
||||
lib/glthread/lock.h
|
||||
lib/glthread/threadlib.c
|
||||
lib/inet_ntop.c
|
||||
lib/intprops.h
|
||||
lib/itold.c
|
||||
lib/langinfo.in.h
|
||||
lib/localcharset.c
|
||||
lib/localcharset.h
|
||||
lib/locale.in.h
|
||||
lib/localeconv.c
|
||||
lib/malloc.c
|
||||
lib/malloca.c
|
||||
lib/malloca.h
|
||||
lib/malloca.valgrind
|
||||
lib/math.c
|
||||
lib/math.in.h
|
||||
lib/mbrtowc.c
|
||||
lib/mbsinit.c
|
||||
lib/mbtowc-impl.h
|
||||
lib/mbtowc.c
|
||||
lib/memchr.c
|
||||
lib/memchr.valgrind
|
||||
lib/mktime-internal.h
|
||||
lib/mktime.c
|
||||
lib/mountlist.c
|
||||
lib/mountlist.h
|
||||
lib/msvc-inval.c
|
||||
lib/msvc-inval.h
|
||||
lib/msvc-nothrow.c
|
||||
lib/msvc-nothrow.h
|
||||
lib/netdb.in.h
|
||||
lib/netinet_in.in.h
|
||||
lib/nl_langinfo.c
|
||||
lib/open-safer.c
|
||||
lib/open.c
|
||||
lib/pipe-safer.c
|
||||
lib/printf-args.c
|
||||
lib/printf-args.h
|
||||
lib/printf-parse.c
|
||||
lib/printf-parse.h
|
||||
lib/read.c
|
||||
lib/ref-add.sin
|
||||
lib/ref-del.sin
|
||||
lib/regcomp.c
|
||||
|
@ -633,8 +692,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/regexec.c
|
||||
lib/safe-read.c
|
||||
lib/safe-read.h
|
||||
lib/safe-write.c
|
||||
lib/safe-write.h
|
||||
lib/setenv.c
|
||||
lib/sha1.c
|
||||
lib/sha1.h
|
||||
|
@ -642,16 +699,16 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/snprintf.c
|
||||
lib/sockets.c
|
||||
lib/sockets.h
|
||||
lib/stat.c
|
||||
lib/stdalign.in.h
|
||||
lib/stdbool.in.h
|
||||
lib/stddef.in.h
|
||||
lib/stdint.in.h
|
||||
lib/stdio-write.c
|
||||
lib/stdio.in.h
|
||||
lib/stdlib.in.h
|
||||
lib/str-two-way.h
|
||||
lib/strdup.c
|
||||
lib/streq.h
|
||||
lib/strerror-override.c
|
||||
lib/strerror-override.h
|
||||
lib/strerror.c
|
||||
lib/string.in.h
|
||||
lib/stripslash.c
|
||||
|
@ -659,13 +716,14 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/strnlen.c
|
||||
lib/strsep.c
|
||||
lib/strstr.c
|
||||
lib/sys_socket.c
|
||||
lib/sys_socket.in.h
|
||||
lib/sys_stat.in.h
|
||||
lib/sys_types.in.h
|
||||
lib/sys_uio.in.h
|
||||
lib/time.in.h
|
||||
lib/time_r.c
|
||||
lib/timegm.c
|
||||
lib/unistd--.h
|
||||
lib/unistd-safer.h
|
||||
lib/unistd.c
|
||||
lib/unistd.in.h
|
||||
lib/unsetenv.c
|
||||
lib/vasnprintf.c
|
||||
|
@ -676,42 +734,38 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/w32sock.h
|
||||
lib/wchar.in.h
|
||||
lib/wcrtomb.c
|
||||
lib/wctype-h.c
|
||||
lib/wctype.in.h
|
||||
lib/write.c
|
||||
lib/xalloc-die.c
|
||||
lib/xalloc-oversized.h
|
||||
lib/xalloc.h
|
||||
lib/xmalloc.c
|
||||
lib/xsize.c
|
||||
lib/xsize.h
|
||||
lib/xstrndup.c
|
||||
lib/xstrndup.h
|
||||
m4/00gnulib.m4
|
||||
m4/alloca.m4
|
||||
m4/arpa_inet_h.m4
|
||||
m4/asm-underscore.m4
|
||||
m4/base64.m4
|
||||
m4/btowc.m4
|
||||
m4/c-strtod.m4
|
||||
m4/cloexec.m4
|
||||
m4/codeset.m4
|
||||
m4/configmake.m4
|
||||
m4/dirname.m4
|
||||
m4/dos.m4
|
||||
m4/double-slash-root.m4
|
||||
m4/dup2.m4
|
||||
m4/eealloc.m4
|
||||
m4/environ.m4
|
||||
m4/errno_h.m4
|
||||
m4/error.m4
|
||||
m4/exponentd.m4
|
||||
m4/extensions.m4
|
||||
m4/extern-inline.m4
|
||||
m4/fcntl-o.m4
|
||||
m4/fcntl-safer.m4
|
||||
m4/fcntl.m4
|
||||
m4/fcntl_h.m4
|
||||
m4/float_h.m4
|
||||
m4/floorf.m4
|
||||
m4/fstypename.m4
|
||||
m4/fsusage.m4
|
||||
m4/getaddrinfo.m4
|
||||
m4/getdtablesize.m4
|
||||
m4/gethostname.m4
|
||||
m4/getloadavg.m4
|
||||
m4/getopt.m4
|
||||
|
@ -723,7 +777,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/iconv.m4
|
||||
m4/include_next.m4
|
||||
m4/inet_ntop.m4
|
||||
m4/inline.m4
|
||||
m4/intdiv0.m4
|
||||
m4/intl.m4
|
||||
m4/intldir.m4
|
||||
|
@ -733,6 +786,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/inttypes-pri.m4
|
||||
m4/inttypes_h.m4
|
||||
m4/langinfo_h.m4
|
||||
m4/largefile.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lib-ld.m4
|
||||
m4/lib-link.m4
|
||||
|
@ -742,6 +796,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/locale-ja.m4
|
||||
m4/locale-zh.m4
|
||||
m4/locale_h.m4
|
||||
m4/localeconv.m4
|
||||
m4/lock.m4
|
||||
m4/longlong.m4
|
||||
m4/ls-mntd-fs.m4
|
||||
|
@ -751,42 +806,45 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/mbrtowc.m4
|
||||
m4/mbsinit.m4
|
||||
m4/mbstate_t.m4
|
||||
m4/mbtowc.m4
|
||||
m4/memchr.m4
|
||||
m4/mktime.m4
|
||||
m4/mmap-anon.m4
|
||||
m4/mode_t.m4
|
||||
m4/mountlist.m4
|
||||
m4/msvc-inval.m4
|
||||
m4/msvc-nothrow.m4
|
||||
m4/multiarch.m4
|
||||
m4/netdb_h.m4
|
||||
m4/netinet_in_h.m4
|
||||
m4/nl_langinfo.m4
|
||||
m4/nls.m4
|
||||
m4/nocrash.m4
|
||||
m4/off_t.m4
|
||||
m4/onceonly.m4
|
||||
m4/open.m4
|
||||
m4/po.m4
|
||||
m4/printf-posix.m4
|
||||
m4/printf.m4
|
||||
m4/progtest.m4
|
||||
m4/read.m4
|
||||
m4/regex.m4
|
||||
m4/safe-read.m4
|
||||
m4/safe-write.m4
|
||||
m4/servent.m4
|
||||
m4/setenv.m4
|
||||
m4/sha1.m4
|
||||
m4/size_max.m4
|
||||
m4/snprintf.m4
|
||||
m4/socketlib.m4
|
||||
m4/sockets.m4
|
||||
m4/socklen.m4
|
||||
m4/sockpfaf.m4
|
||||
m4/ssize_t.m4
|
||||
m4/stat.m4
|
||||
m4/stdalign.m4
|
||||
m4/stdbool.m4
|
||||
m4/stddef_h.m4
|
||||
m4/stdint.m4
|
||||
m4/stdint_h.m4
|
||||
m4/stdio_h.m4
|
||||
m4/stdlib_h.m4
|
||||
m4/strdup.m4
|
||||
m4/strerror.m4
|
||||
m4/string_h.m4
|
||||
m4/strndup.m4
|
||||
|
@ -794,13 +852,13 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/strsep.m4
|
||||
m4/strstr.m4
|
||||
m4/sys_socket_h.m4
|
||||
m4/sys_stat_h.m4
|
||||
m4/sys_types_h.m4
|
||||
m4/sys_uio_h.m4
|
||||
m4/threadlib.m4
|
||||
m4/time_h.m4
|
||||
m4/time_r.m4
|
||||
m4/timegm.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/unistd-safer.m4
|
||||
m4/unistd_h.m4
|
||||
m4/vasnprintf.m4
|
||||
m4/vasprintf.m4
|
||||
|
@ -812,7 +870,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/wcrtomb.m4
|
||||
m4/wctype_h.m4
|
||||
m4/wint_t.m4
|
||||
m4/write.m4
|
||||
m4/xalloc.m4
|
||||
m4/xsize.m4
|
||||
m4/xstrndup.m4
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# hostent.m4 serial 1
|
||||
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# hostent.m4 serial 2
|
||||
dnl Copyright (C) 2008, 2010-2013 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.
|
||||
|
@ -28,12 +28,16 @@ AC_DEFUN([gl_HOSTENT],
|
|||
[gl_cv_w32_gethostbyname=no
|
||||
gl_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lws2_32"
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
], [gethostbyname(NULL);], [gl_cv_w32_gethostbyname=yes])
|
||||
]],
|
||||
[[gethostbyname(NULL);]])],
|
||||
[gl_cv_w32_gethostbyname=yes])
|
||||
LIBS="$gl_save_LIBS"
|
||||
])
|
||||
if test "$gl_cv_w32_gethostbyname" = "yes"; then
|
||||
|
|
110
gl/m4/iconv.m4
110
gl/m4/iconv.m4
|
@ -1,5 +1,5 @@
|
|||
# iconv.m4 serial 11 (gettext-0.18.1)
|
||||
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
|
||||
# iconv.m4 serial 18 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2000-2002, 2007-2013 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.
|
||||
|
@ -30,27 +30,35 @@ AC_DEFUN([AM_ICONV_LINK],
|
|||
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
|
||||
dnl because if the user has installed libiconv and not disabled its use
|
||||
dnl via --without-libiconv-prefix, he wants to use it. The first
|
||||
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
|
||||
dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
|
||||
|
||||
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>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
]],
|
||||
[[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);]])],
|
||||
[am_cv_func_iconv=yes])
|
||||
if test "$am_cv_func_iconv" != yes; then
|
||||
am_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
]],
|
||||
[[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);]])],
|
||||
[am_cv_lib_iconv=yes]
|
||||
[am_cv_func_iconv=yes])
|
||||
LIBS="$am_save_LIBS"
|
||||
|
@ -58,16 +66,19 @@ AC_DEFUN([AM_ICONV_LINK],
|
|||
])
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
|
||||
dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
|
||||
dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
|
||||
dnl Solaris 10.
|
||||
am_save_LIBS="$LIBS"
|
||||
if test $am_cv_lib_iconv = yes; then
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
fi
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <iconv.h>
|
||||
#include <string.h>
|
||||
int main ()
|
||||
{
|
||||
int result = 0;
|
||||
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
|
||||
returns. */
|
||||
{
|
||||
|
@ -84,7 +95,8 @@ int main ()
|
|||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
return 1;
|
||||
result |= 1;
|
||||
iconv_close (cd_utf8_to_88591);
|
||||
}
|
||||
}
|
||||
/* Test against Solaris 10 bug: Failures are not distinguishable from
|
||||
|
@ -103,7 +115,27 @@ int main ()
|
|||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
return 1;
|
||||
result |= 2;
|
||||
iconv_close (cd_ascii_to_88591);
|
||||
}
|
||||
}
|
||||
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
|
||||
{
|
||||
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
|
||||
if (cd_88591_to_utf8 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\304";
|
||||
static char buf[2] = { (char)0xDE, (char)0xAD };
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = 1;
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = 1;
|
||||
size_t res = iconv (cd_88591_to_utf8,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
|
||||
result |= 4;
|
||||
iconv_close (cd_88591_to_utf8);
|
||||
}
|
||||
}
|
||||
#if 0 /* This bug could be worked around by the caller. */
|
||||
|
@ -122,7 +154,8 @@ int main ()
|
|||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if ((int)res > 0)
|
||||
return 1;
|
||||
result |= 8;
|
||||
iconv_close (cd_88591_to_utf8);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -136,13 +169,19 @@ int main ()
|
|||
&& 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
|
||||
result |= 16;
|
||||
return result;
|
||||
}]])],
|
||||
[am_cv_func_iconv_works=yes],
|
||||
[am_cv_func_iconv_works=no],
|
||||
[
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
|
||||
*) am_cv_func_iconv_works="guessing yes" ;;
|
||||
esac])
|
||||
esac
|
||||
changequote([,])dnl
|
||||
])
|
||||
LIBS="$am_save_LIBS"
|
||||
])
|
||||
case "$am_cv_func_iconv_works" in
|
||||
|
@ -183,32 +222,47 @@ m4_define([gl_iconv_AC_DEFUN],
|
|||
m4_version_prereq([2.64],
|
||||
[[AC_DEFUN_ONCE(
|
||||
[$1], [$2])]],
|
||||
[[AC_DEFUN(
|
||||
[$1], [$2])]]))
|
||||
[m4_ifdef([gl_00GNULIB],
|
||||
[[AC_DEFUN_ONCE(
|
||||
[$1], [$2])]],
|
||||
[[AC_DEFUN(
|
||||
[$1], [$2])]])]))
|
||||
gl_iconv_AC_DEFUN([AM_ICONV],
|
||||
[
|
||||
AM_ICONV_LINK
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_MSG_CHECKING([for iconv declaration])
|
||||
AC_CACHE_VAL([am_cv_proto_iconv], [
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
|
||||
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
|
||||
#else
|
||||
size_t iconv();
|
||||
#endif
|
||||
], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
|
||||
]],
|
||||
[[]])],
|
||||
[am_cv_proto_iconv_arg1=""],
|
||||
[am_cv_proto_iconv_arg1="const"])
|
||||
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
|
||||
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
||||
AC_MSG_RESULT([
|
||||
$am_cv_proto_iconv])
|
||||
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
|
||||
[Define as const if the declaration of iconv() needs const.])
|
||||
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
|
||||
m4_ifdef([gl_ICONV_H_DEFAULTS],
|
||||
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
|
||||
if test -n "$am_cv_proto_iconv_arg1"; then
|
||||
ICONV_CONST="const"
|
||||
fi
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# include_next.m4 serial 14
|
||||
dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
|
||||
# include_next.m4 serial 23
|
||||
dnl Copyright (C) 2006-2013 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.
|
||||
|
@ -24,6 +24,13 @@ dnl does not warn about some things, and on some systems (Solaris and Interix)
|
|||
dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
|
||||
dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
|
||||
dnl of plain '__STDC__'.
|
||||
dnl
|
||||
dnl PRAGMA_COLUMNS can be used in files that override system header files, so
|
||||
dnl as to avoid compilation errors on HP NonStop systems when the gnulib file
|
||||
dnl is included by a system header file that does a "#pragma COLUMNS 80" (which
|
||||
dnl has the effect of truncating the lines of that file and all files that it
|
||||
dnl includes to 80 columns) and the gnulib file has lines longer than 80
|
||||
dnl columns.
|
||||
|
||||
AC_DEFUN([gl_INCLUDE_NEXT],
|
||||
[
|
||||
|
@ -68,10 +75,11 @@ EOF
|
|||
EOF
|
||||
gl_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
|
||||
AC_COMPILE_IFELSE([#include <conftest.h>],
|
||||
dnl We intentionally avoid using AC_LANG_SOURCE here.
|
||||
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
|
||||
[gl_cv_have_include_next=yes],
|
||||
[CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
|
||||
AC_COMPILE_IFELSE([#include <conftest.h>],
|
||||
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
|
||||
[gl_cv_have_include_next=buggy],
|
||||
[gl_cv_have_include_next=no])
|
||||
])
|
||||
|
@ -97,6 +105,24 @@ EOF
|
|||
AC_SUBST([INCLUDE_NEXT])
|
||||
AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
|
||||
AC_SUBST([PRAGMA_SYSTEM_HEADER])
|
||||
AC_CACHE_CHECK([whether system header files limit the line length],
|
||||
[gl_cv_pragma_columns],
|
||||
[dnl HP NonStop systems, which define __TANDEM, have this misfeature.
|
||||
AC_EGREP_CPP([choke me],
|
||||
[
|
||||
#ifdef __TANDEM
|
||||
choke me
|
||||
#endif
|
||||
],
|
||||
[gl_cv_pragma_columns=yes],
|
||||
[gl_cv_pragma_columns=no])
|
||||
])
|
||||
if test $gl_cv_pragma_columns = yes; then
|
||||
PRAGMA_COLUMNS="#pragma COLUMNS 10000"
|
||||
else
|
||||
PRAGMA_COLUMNS=
|
||||
fi
|
||||
AC_SUBST([PRAGMA_COLUMNS])
|
||||
])
|
||||
|
||||
# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
|
||||
|
@ -117,71 +143,128 @@ EOF
|
|||
# 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.
|
||||
# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
|
||||
# Note: This macro assumes that the header file is not empty after
|
||||
# preprocessing, i.e. it does not only define preprocessor macros but also
|
||||
# provides some type/enum definitions or function/variable declarations.
|
||||
#
|
||||
# This macro also checks whether each header exists, by invoking
|
||||
# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
|
||||
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
|
||||
[
|
||||
gl_NEXT_HEADERS_INTERNAL([$1], [check])
|
||||
])
|
||||
|
||||
# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
|
||||
# ------------------------------------
|
||||
# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
|
||||
# This is suitable for headers like <stddef.h> that are standardized by C89
|
||||
# and therefore can be assumed to exist.
|
||||
AC_DEFUN([gl_NEXT_HEADERS],
|
||||
[
|
||||
gl_NEXT_HEADERS_INTERNAL([$1], [assume])
|
||||
])
|
||||
|
||||
# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
|
||||
AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
|
||||
[
|
||||
AC_REQUIRE([gl_INCLUDE_NEXT])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CHECK_HEADERS_ONCE([$1])
|
||||
|
||||
m4_if([$2], [check],
|
||||
[AC_CHECK_HEADERS_ONCE([$1])
|
||||
])
|
||||
|
||||
dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
|
||||
dnl until we can assume autoconf 2.64 or newer.
|
||||
m4_foreach_w([gl_HEADER_NAME], [$1],
|
||||
[AS_VAR_PUSHDEF([gl_next_header],
|
||||
[gl_cv_next_]m4_defn([gl_HEADER_NAME]))
|
||||
if test $gl_cv_have_include_next = yes; then
|
||||
AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
|
||||
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
|
||||
else
|
||||
AC_CACHE_CHECK(
|
||||
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
|
||||
m4_defn([gl_next_header]),
|
||||
[AS_VAR_PUSHDEF([gl_header_exists],
|
||||
[ac_cv_header_]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 AIX "xlc -E" and "cc -E" omit #line directives for header files
|
||||
dnl that contain only a #include of other header files and no
|
||||
dnl non-comment tokens of their own. This leads to a failure to
|
||||
dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
|
||||
dnl and others. The workaround is to force preservation of comments
|
||||
dnl through option -C. This ensures all necessary #line directives
|
||||
dnl are present. GCC supports option -C as well.
|
||||
case "$host_os" in
|
||||
aix*) gl_absname_cpp="$ac_cpp -C" ;;
|
||||
*) gl_absname_cpp="$ac_cpp" ;;
|
||||
esac
|
||||
dnl eval is necessary to expand gl_absname_cpp.
|
||||
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
|
||||
dnl so use subshell.
|
||||
AS_VAR_SET([gl_next_header],
|
||||
['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
|
||||
sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
|
||||
s#.*"\(.*/]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])])
|
||||
[m4_if([$2], [check],
|
||||
[AS_VAR_PUSHDEF([gl_header_exists],
|
||||
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))
|
||||
if test AS_VAR_GET(gl_header_exists) = yes; then
|
||||
AS_VAR_POPDEF([gl_header_exists])
|
||||
])
|
||||
AC_LANG_CONFTEST(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
|
||||
)])
|
||||
dnl AIX "xlc -E" and "cc -E" omit #line directives for header
|
||||
dnl files that contain only a #include of other header files and
|
||||
dnl no non-comment tokens of their own. This leads to a failure
|
||||
dnl to detect the absolute name of <dirent.h>, <signal.h>,
|
||||
dnl <poll.h> and others. The workaround is to force preservation
|
||||
dnl of comments through option -C. This ensures all necessary
|
||||
dnl #line directives are present. GCC supports option -C as well.
|
||||
case "$host_os" in
|
||||
aix*) gl_absname_cpp="$ac_cpp -C" ;;
|
||||
*) gl_absname_cpp="$ac_cpp" ;;
|
||||
esac
|
||||
changequote(,)
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
dnl For the sake of native Windows compilers (excluding gcc),
|
||||
dnl treat backslash as a directory separator, like /.
|
||||
dnl Actually, these compilers use a double-backslash as
|
||||
dnl directory separator, inside the
|
||||
dnl # line "filename"
|
||||
dnl directives.
|
||||
gl_dirsep_regex='[/\\]'
|
||||
;;
|
||||
*)
|
||||
gl_dirsep_regex='\/'
|
||||
;;
|
||||
esac
|
||||
dnl A sed expression that turns a string into a basic regular
|
||||
dnl expression, for use within "/.../".
|
||||
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
|
||||
changequote([,])
|
||||
gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
|
||||
| sed -e "$gl_make_literal_regex_sed"`
|
||||
gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
|
||||
s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
|
||||
changequote(,)dnl
|
||||
s|^/[^/]|//&|
|
||||
changequote([,])dnl
|
||||
p
|
||||
q
|
||||
}'
|
||||
dnl eval is necessary to expand gl_absname_cpp.
|
||||
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
|
||||
dnl so use subshell.
|
||||
AS_VAR_SET(gl_next_header,
|
||||
['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
|
||||
sed -n "$gl_absolute_header_sed"`'"'])
|
||||
m4_if([$2], [check],
|
||||
[else
|
||||
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
|
||||
fi
|
||||
])
|
||||
])
|
||||
fi
|
||||
AC_SUBST(
|
||||
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
|
||||
[AS_VAR_GET([gl_next_header])])
|
||||
[AS_VAR_GET(gl_next_header)])
|
||||
if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
|
||||
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
|
||||
gl_next_as_first_directive='<'gl_HEADER_NAME'>'
|
||||
else
|
||||
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
|
||||
gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
|
||||
gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
|
||||
fi
|
||||
AC_SUBST(
|
||||
AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
|
||||
[$gl_next_as_first_directive])
|
||||
AS_VAR_POPDEF([gl_next_header])])
|
||||
])
|
||||
|
||||
# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE;
|
||||
# this fallback is safe for all earlier autoconf versions.
|
||||
m4_define_default([AC_LANG_DEFINES_PROVIDED])
|
||||
|
|
|
@ -1,38 +1,68 @@
|
|||
# inet_ntop.m4 serial 12
|
||||
dnl Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# inet_ntop.m4 serial 19
|
||||
dnl Copyright (C) 2005-2006, 2008-2013 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_INET_NTOP],
|
||||
[
|
||||
AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
|
||||
|
||||
dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
gl_REPLACE_ARPA_INET_H
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
|
||||
dnl Most platforms that provide inet_ntop define it in libc.
|
||||
dnl Solaris 8..10 provide inet_ntop in libnsl instead.
|
||||
gl_save_LIBS=$LIBS
|
||||
AC_SEARCH_LIBS([inet_ntop], [nsl], [],
|
||||
[AC_REPLACE_FUNCS([inet_ntop])])
|
||||
LIBS=$gl_save_LIBS
|
||||
dnl Solaris 2.6..7 provide inet_ntop in libresolv instead.
|
||||
dnl Native Windows provides it in -lws2_32 instead, with a declaration in
|
||||
dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
|
||||
dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
|
||||
HAVE_INET_NTOP=1
|
||||
INET_NTOP_LIB=
|
||||
if test "$ac_cv_search_inet_ntop" != "no" &&
|
||||
test "$ac_cv_search_inet_ntop" != "none required"; then
|
||||
INET_NTOP_LIB="$ac_cv_search_inet_ntop"
|
||||
gl_PREREQ_SYS_H_WINSOCK2
|
||||
if test $HAVE_WINSOCK2_H = 1; then
|
||||
AC_CHECK_DECLS([inet_ntop],,, [[#include <ws2tcpip.h>]])
|
||||
if test $ac_cv_have_decl_inet_ntop = yes; then
|
||||
dnl It needs to be overridden, because the stdcall calling convention
|
||||
dnl is not compliant with POSIX.
|
||||
REPLACE_INET_NTOP=1
|
||||
INET_NTOP_LIB="-lws2_32"
|
||||
else
|
||||
HAVE_DECL_INET_NTOP=0
|
||||
HAVE_INET_NTOP=0
|
||||
fi
|
||||
else
|
||||
gl_save_LIBS=$LIBS
|
||||
AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [],
|
||||
[AC_CHECK_FUNCS([inet_ntop])
|
||||
if test $ac_cv_func_inet_ntop = no; then
|
||||
HAVE_INET_NTOP=0
|
||||
fi
|
||||
])
|
||||
LIBS=$gl_save_LIBS
|
||||
|
||||
if test "$ac_cv_search_inet_ntop" != "no" \
|
||||
&& test "$ac_cv_search_inet_ntop" != "none required"; then
|
||||
INET_NTOP_LIB="$ac_cv_search_inet_ntop"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([netdb.h])
|
||||
AC_CHECK_DECLS([inet_ntop],,,
|
||||
[[#include <arpa/inet.h>
|
||||
#if HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
]])
|
||||
if test $ac_cv_have_decl_inet_ntop = no; then
|
||||
HAVE_DECL_INET_NTOP=0
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([INET_NTOP_LIB])
|
||||
|
||||
gl_PREREQ_INET_NTOP
|
||||
])
|
||||
|
||||
# Prerequisites of lib/inet_ntop.c.
|
||||
AC_DEFUN([gl_PREREQ_INET_NTOP], [
|
||||
AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
|
||||
if test $ac_cv_have_decl_inet_ntop = no; then
|
||||
HAVE_DECL_INET_NTOP=0
|
||||
fi
|
||||
AC_REQUIRE([gl_SOCKET_FAMILIES])
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
])
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
# inline.m4 serial 4
|
||||
dnl Copyright (C) 2006, 2009, 2010 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 Test for the 'inline' keyword or equivalent.
|
||||
dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
|
||||
dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an
|
||||
dnl equivalent is effectively supported, i.e. if the compiler is likely to
|
||||
dnl drop unused 'static inline' functions.
|
||||
AC_DEFUN([gl_INLINE],
|
||||
[
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_CACHE_CHECK([whether the compiler generally respects inline],
|
||||
[gl_cv_c_inline_effective],
|
||||
[if test $ac_cv_c_inline = no; then
|
||||
gl_cv_c_inline_effective=no
|
||||
else
|
||||
dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is
|
||||
dnl specified.
|
||||
dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result
|
||||
dnl depends on optimization flags, which can be in CFLAGS.
|
||||
dnl (AC_EGREP_CPP looks only at the CPPFLAGS.)
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]],
|
||||
[[#ifdef __NO_INLINE__
|
||||
#error "inline is not effective"
|
||||
#endif]])],
|
||||
[gl_cv_c_inline_effective=yes],
|
||||
[gl_cv_c_inline_effective=no])
|
||||
fi
|
||||
])
|
||||
if test $gl_cv_c_inline_effective = yes; then
|
||||
AC_DEFINE([HAVE_INLINE], [1],
|
||||
[Define to 1 if the compiler supports one of the keywords
|
||||
'inline', '__inline__', '__inline' and effectively inlines
|
||||
functions marked as such.])
|
||||
fi
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# intlmacosx.m4 serial 3 (gettext-0.18)
|
||||
dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
|
||||
# intlmacosx.m4 serial 5 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2004-2013 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.
|
||||
|
@ -13,35 +13,40 @@ 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 Checks for special options needed on Mac OS X.
|
||||
dnl Defines INTL_MACOSX_LIBS.
|
||||
AC_DEFUN([gt_INTL_MACOSX],
|
||||
[
|
||||
dnl Check for API introduced in MacOS X 10.2.
|
||||
dnl Check for API introduced in Mac OS 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)],
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#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.])
|
||||
[Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
|
||||
fi
|
||||
dnl Check for API introduced in MacOS X 10.3.
|
||||
dnl Check for API introduced in Mac OS 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();],
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#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.])
|
||||
[Define to 1 if you have the Mac OS 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# intmax_t.m4 serial 7
|
||||
dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation,
|
||||
# intmax_t.m4 serial 8
|
||||
dnl Copyright (C) 1997-2004, 2006-2007, 2009-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
|
||||
dnl From Paul Eggert.
|
||||
|
||||
AC_PREREQ([2.13])
|
||||
AC_PREREQ([2.53])
|
||||
|
||||
# Define intmax_t to 'long' or 'long long'
|
||||
# if it is not already defined in <stdint.h> or <inttypes.h>.
|
||||
|
@ -38,7 +38,9 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
|
|||
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
|
||||
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
|
||||
AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
|
||||
[AC_TRY_COMPILE([
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#if HAVE_STDINT_H_WITH_UINTMAX
|
||||
|
@ -47,7 +49,10 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
|
|||
#if HAVE_INTTYPES_H_WITH_UINTMAX
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
|
||||
]],
|
||||
[[intmax_t x = -1; return !x;]])],
|
||||
[gt_cv_c_intmax_t=yes],
|
||||
[gt_cv_c_intmax_t=no])])
|
||||
if test $gt_cv_c_intmax_t = yes; then
|
||||
AC_DEFINE([HAVE_INTMAX_T], [1],
|
||||
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# inttypes_h.m4 serial 9
|
||||
dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
|
||||
# inttypes_h.m4 serial 10
|
||||
dnl Copyright (C) 1997-2004, 2006, 2008-2013 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,12 +12,15 @@ dnl From Paul Eggert.
|
|||
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
|
||||
[
|
||||
AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
|
||||
[AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <inttypes.h>],
|
||||
[uintmax_t i = (uintmax_t) -1; return !i;],
|
||||
[gl_cv_header_inttypes_h=yes],
|
||||
[gl_cv_header_inttypes_h=no])])
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
]],
|
||||
[[uintmax_t i = (uintmax_t) -1; return !i;]])],
|
||||
[gl_cv_header_inttypes_h=yes],
|
||||
[gl_cv_header_inttypes_h=no])])
|
||||
if test $gl_cv_header_inttypes_h = yes; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
|
||||
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# langinfo_h.m4 serial 6
|
||||
dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
|
||||
# langinfo_h.m4 serial 7
|
||||
dnl Copyright (C) 2009-2013 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.
|
||||
|
@ -16,12 +16,14 @@ AC_DEFUN([gl_LANGINFO_H],
|
|||
|
||||
dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
|
||||
HAVE_LANGINFO_CODESET=0
|
||||
HAVE_LANGINFO_T_FMT_AMPM=0
|
||||
HAVE_LANGINFO_ERA=0
|
||||
HAVE_LANGINFO_YESEXPR=0
|
||||
AC_CHECK_HEADERS_ONCE([langinfo.h])
|
||||
if test $ac_cv_header_langinfo_h = yes; then
|
||||
HAVE_LANGINFO_H=1
|
||||
dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing
|
||||
dnl on OpenBSD 3.8.
|
||||
dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
|
||||
AC_CACHE_CHECK([whether langinfo.h defines CODESET],
|
||||
[gl_cv_header_langinfo_codeset],
|
||||
[AC_COMPILE_IFELSE(
|
||||
|
@ -34,6 +36,18 @@ int a = CODESET;
|
|||
if test $gl_cv_header_langinfo_codeset = yes; then
|
||||
HAVE_LANGINFO_CODESET=1
|
||||
fi
|
||||
AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM],
|
||||
[gl_cv_header_langinfo_t_fmt_ampm],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <langinfo.h>
|
||||
int a = T_FMT_AMPM;
|
||||
]])],
|
||||
[gl_cv_header_langinfo_t_fmt_ampm=yes],
|
||||
[gl_cv_header_langinfo_t_fmt_ampm=no])
|
||||
])
|
||||
if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
|
||||
HAVE_LANGINFO_T_FMT_AMPM=1
|
||||
fi
|
||||
AC_CACHE_CHECK([whether langinfo.h defines ERA],
|
||||
[gl_cv_header_langinfo_era],
|
||||
[AC_COMPILE_IFELSE(
|
||||
|
@ -46,12 +60,26 @@ int a = ERA;
|
|||
if test $gl_cv_header_langinfo_era = yes; then
|
||||
HAVE_LANGINFO_ERA=1
|
||||
fi
|
||||
AC_CACHE_CHECK([whether langinfo.h defines YESEXPR],
|
||||
[gl_cv_header_langinfo_yesexpr],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <langinfo.h>
|
||||
int a = YESEXPR;
|
||||
]])],
|
||||
[gl_cv_header_langinfo_yesexpr=yes],
|
||||
[gl_cv_header_langinfo_yesexpr=no])
|
||||
])
|
||||
if test $gl_cv_header_langinfo_yesexpr = yes; then
|
||||
HAVE_LANGINFO_YESEXPR=1
|
||||
fi
|
||||
else
|
||||
HAVE_LANGINFO_H=0
|
||||
fi
|
||||
AC_SUBST([HAVE_LANGINFO_H])
|
||||
AC_SUBST([HAVE_LANGINFO_CODESET])
|
||||
AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM])
|
||||
AC_SUBST([HAVE_LANGINFO_ERA])
|
||||
AC_SUBST([HAVE_LANGINFO_YESEXPR])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use.
|
||||
|
|
146
gl/m4/largefile.m4
Normal file
146
gl/m4/largefile.m4
Normal file
|
@ -0,0 +1,146 @@
|
|||
# Enable large files on systems where this is not the default.
|
||||
|
||||
# Copyright 1992-1996, 1998-2013 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# The following implementation works around a problem in autoconf <= 2.69;
|
||||
# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
|
||||
# or configures them incorrectly in some cases.
|
||||
m4_version_prereq([2.70], [] ,[
|
||||
|
||||
# _AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||
# -------------------------------
|
||||
m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
|
||||
[@%:@include <sys/types.h>
|
||||
/* Check that off_t can represent 2**63 - 1 correctly.
|
||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1]];[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
|
||||
# CACHE-VAR,
|
||||
# DESCRIPTION,
|
||||
# PROLOGUE, [FUNCTION-BODY])
|
||||
# --------------------------------------------------------
|
||||
m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
|
||||
[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
|
||||
[while :; do
|
||||
m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
|
||||
[AC_LANG_PROGRAM([$5], [$6])],
|
||||
[$3=no; break])
|
||||
m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
|
||||
[AC_LANG_PROGRAM([@%:@define $1 $2
|
||||
$5], [$6])],
|
||||
[$3=$2; break])
|
||||
$3=unknown
|
||||
break
|
||||
done])
|
||||
case $$3 in #(
|
||||
no | unknown) ;;
|
||||
*) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
|
||||
esac
|
||||
rm -rf conftest*[]dnl
|
||||
])# _AC_SYS_LARGEFILE_MACRO_VALUE
|
||||
|
||||
|
||||
# AC_SYS_LARGEFILE
|
||||
# ----------------
|
||||
# By default, many hosts won't let programs access large files;
|
||||
# one must use special compiler options to get large-file access to work.
|
||||
# For more details about this brain damage please see:
|
||||
# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
|
||||
AC_DEFUN([AC_SYS_LARGEFILE],
|
||||
[AC_ARG_ENABLE(largefile,
|
||||
[ --disable-largefile omit support for large files])
|
||||
if test "$enable_largefile" != no; then
|
||||
|
||||
AC_CACHE_CHECK([for special C compiler options needed for large files],
|
||||
ac_cv_sys_largefile_CC,
|
||||
[ac_cv_sys_largefile_CC=no
|
||||
if test "$GCC" != yes; then
|
||||
ac_save_CC=$CC
|
||||
while :; do
|
||||
# IRIX 6.2 and later do not support large files by default,
|
||||
# so use the C compiler's -n32 option if that helps.
|
||||
AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
|
||||
AC_COMPILE_IFELSE([], [break])
|
||||
CC="$CC -n32"
|
||||
AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
|
||||
break
|
||||
done
|
||||
CC=$ac_save_CC
|
||||
rm -f conftest.$ac_ext
|
||||
fi])
|
||||
if test "$ac_cv_sys_largefile_CC" != no; then
|
||||
CC=$CC$ac_cv_sys_largefile_CC
|
||||
fi
|
||||
|
||||
_AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
|
||||
ac_cv_sys_file_offset_bits,
|
||||
[Number of bits in a file offset, on hosts where this is settable.],
|
||||
[_AC_SYS_LARGEFILE_TEST_INCLUDES])
|
||||
if test $ac_cv_sys_file_offset_bits = unknown; then
|
||||
_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
|
||||
ac_cv_sys_large_files,
|
||||
[Define for large files, on AIX-style hosts.],
|
||||
[_AC_SYS_LARGEFILE_TEST_INCLUDES])
|
||||
fi
|
||||
|
||||
AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
|
||||
[Enable large inode numbers on Mac OS X 10.5.])
|
||||
fi
|
||||
])# AC_SYS_LARGEFILE
|
||||
])# m4_version_prereq 2.70
|
||||
|
||||
# Enable large files on systems where this is implemented by Gnulib, not by the
|
||||
# system headers.
|
||||
# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib
|
||||
# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively.
|
||||
AC_DEFUN([gl_LARGEFILE],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
dnl Native Windows.
|
||||
dnl mingw64 defines off_t to a 64-bit type already, if
|
||||
dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
|
||||
AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>
|
||||
int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
|
||||
]],
|
||||
[[]])],
|
||||
[gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no])
|
||||
])
|
||||
if test $gl_cv_type_off_t_64 = no; then
|
||||
WINDOWS_64_BIT_OFF_T=1
|
||||
else
|
||||
WINDOWS_64_BIT_OFF_T=0
|
||||
fi
|
||||
dnl But all native Windows platforms (including mingw64) have a 32-bit
|
||||
dnl st_size member in 'struct stat'.
|
||||
WINDOWS_64_BIT_ST_SIZE=1
|
||||
;;
|
||||
*)
|
||||
dnl Nothing to do on gnulib's side.
|
||||
dnl A 64-bit off_t is
|
||||
dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX,
|
||||
dnl OSF/1, Cygwin,
|
||||
dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
|
||||
dnl glibc, HP-UX, Solaris,
|
||||
dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX,
|
||||
dnl - impossible to achieve on Minix 3.1.8.
|
||||
WINDOWS_64_BIT_OFF_T=0
|
||||
WINDOWS_64_BIT_ST_SIZE=0
|
||||
;;
|
||||
esac
|
||||
])
|
|
@ -1,50 +1,56 @@
|
|||
# lib-ld.m4 serial 4 (gettext-0.18)
|
||||
dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
|
||||
# lib-ld.m4 serial 6
|
||||
dnl Copyright (C) 1996-2003, 2009-2013 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 Subroutines of libtool.m4,
|
||||
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
|
||||
dnl with libtool.m4.
|
||||
dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
|
||||
dnl collision with libtool.m4.
|
||||
|
||||
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
|
||||
dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
|
||||
AC_DEFUN([AC_LIB_PROG_LD_GNU],
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
[# I'd rather use --version here, but apparently some GNU lds only accept -v.
|
||||
case `$LD -v 2>&1 </dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
acl_cv_prog_gnu_ld=yes ;;
|
||||
acl_cv_prog_gnu_ld=yes
|
||||
;;
|
||||
*)
|
||||
acl_cv_prog_gnu_ld=no ;;
|
||||
acl_cv_prog_gnu_ld=no
|
||||
;;
|
||||
esac])
|
||||
with_gnu_ld=$acl_cv_prog_gnu_ld
|
||||
])
|
||||
|
||||
dnl From libtool-1.4. Sets the variable LD.
|
||||
dnl From libtool-2.4. Sets the variable LD.
|
||||
AC_DEFUN([AC_LIB_PROG_LD],
|
||||
[AC_ARG_WITH([gnu-ld],
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
[AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
|
||||
AC_ARG_WITH([gnu-ld],
|
||||
[AS_HELP_STRING([--with-gnu-ld],
|
||||
[assume the C compiler uses GNU ld [default=no]])],
|
||||
[test "$withval" = no || with_gnu_ld=yes],
|
||||
[with_gnu_ld=no])dnl
|
||||
|
||||
# Prepare PATH_SEPARATOR.
|
||||
# The user is always right.
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
echo "#! /bin/sh" >conf$$.sh
|
||||
echo "exit 0" >>conf$$.sh
|
||||
chmod +x conf$$.sh
|
||||
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
|
||||
PATH_SEPARATOR=';'
|
||||
else
|
||||
PATH_SEPARATOR=:
|
||||
fi
|
||||
rm -f conf$$.sh
|
||||
# Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
|
||||
# contains only /bin. Note that ksh looks also at the FPATH variable,
|
||||
# so we have to set that as well for the test.
|
||||
PATH_SEPARATOR=:
|
||||
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|
||||
&& { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|
||||
|| PATH_SEPARATOR=';'
|
||||
}
|
||||
fi
|
||||
|
||||
ac_prog=ld
|
||||
if test "$GCC" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
AC_MSG_CHECKING([for ld used by $CC])
|
||||
case $host in
|
||||
*-*-mingw*)
|
||||
# gcc leaves a trailing carriage return which upsets mingw
|
||||
|
@ -54,11 +60,11 @@ if test "$GCC" = yes; then
|
|||
esac
|
||||
case $ac_prog in
|
||||
# Accept absolute paths.
|
||||
[[\\/]* | [A-Za-z]:[\\/]*)]
|
||||
[re_direlt='/[^/][^/]*/\.\./']
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
[[\\/]]* | ?:[[\\/]]*)
|
||||
re_direlt='/[[^/]][[^/]]*/\.\./'
|
||||
# Canonicalize the pathname of ld
|
||||
ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
|
||||
while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
|
@ -79,23 +85,26 @@ else
|
|||
fi
|
||||
AC_CACHE_VAL([acl_cv_path_LD],
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
|
||||
for ac_dir in $PATH; do
|
||||
IFS="$acl_save_ifs"
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
acl_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# but apparently some variants of GNU ld only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
|
||||
case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
test "$with_gnu_ld" != no && break ;;
|
||||
test "$with_gnu_ld" != no && break
|
||||
;;
|
||||
*)
|
||||
test "$with_gnu_ld" != yes && break ;;
|
||||
test "$with_gnu_ld" != yes && break
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
IFS="$acl_save_ifs"
|
||||
else
|
||||
acl_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# lib-link.m4 serial 23 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
|
||||
# lib-link.m4 serial 26 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2001-2013 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.
|
||||
|
@ -85,7 +85,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
|||
*" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
|
||||
*) LIBS="$LIB[]NAME $LIBS" ;;
|
||||
esac
|
||||
AC_TRY_LINK([$3], [$4],
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[$3]], [[$4]])],
|
||||
[ac_cv_lib[]Name=yes],
|
||||
[ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
|
||||
LIBS="$ac_save_LIBS"
|
||||
|
@ -115,6 +116,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
|||
dnl Determine the platform dependent parameters needed to use rpath:
|
||||
dnl acl_libext,
|
||||
dnl acl_shlibext,
|
||||
dnl acl_libname_spec,
|
||||
dnl acl_library_names_spec,
|
||||
dnl acl_hardcode_libdir_flag_spec,
|
||||
dnl acl_hardcode_libdir_separator,
|
||||
dnl acl_hardcode_direct,
|
||||
|
@ -165,7 +168,7 @@ AC_DEFUN([AC_LIB_FROMPACKAGE],
|
|||
pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
|
||||
define([acl_libsinpackage_]PACKUP,
|
||||
m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
|
||||
m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
|
||||
popdef([PACKUP])
|
||||
popdef([PACK])
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# lib-prefix.m4 serial 7 (gettext-0.18)
|
||||
dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2001-2005, 2008-2013 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.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# localcharset.m4 serial 7
|
||||
dnl Copyright (C) 2002, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2002, 2004, 2006, 2009-2013 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.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# locale-fr.m4 serial 11
|
||||
dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
|
||||
# locale-fr.m4 serial 17
|
||||
dnl Copyright (C) 2003, 2005-2013 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.
|
||||
|
@ -25,17 +25,30 @@ struct tm t;
|
|||
char buf[16];
|
||||
int main () {
|
||||
/* Check whether the given locale name is recognized by the system. */
|
||||
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
|
||||
/* On native Windows, setlocale(category, "") looks at the system settings,
|
||||
not at the environment variables. Also, when an encoding suffix such
|
||||
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
|
||||
category of the locale to "C". */
|
||||
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|
||||
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
|
||||
return 1;
|
||||
#else
|
||||
if (setlocale (LC_ALL, "") == NULL) return 1;
|
||||
#endif
|
||||
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
|
||||
On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
|
||||
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
|
||||
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
|
||||
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
|
||||
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
|
||||
some unit tests fail. */
|
||||
some unit tests fail.
|
||||
On MirBSD 10, when an unsupported locale is specified, setlocale()
|
||||
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
{
|
||||
const char *cs = nl_langinfo (CODESET);
|
||||
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
|
||||
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|
||||
|| strcmp (cs, "UTF-8") == 0)
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
@ -50,46 +63,67 @@ int main () {
|
|||
one byte long. This excludes the UTF-8 encoding. */
|
||||
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
|
||||
if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
|
||||
#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
|
||||
/* Check whether the decimal separator is a comma.
|
||||
On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
|
||||
are nl_langinfo(RADIXCHAR) are both ".". */
|
||||
if (localeconv () ->decimal_point[0] != ',') return 1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
changequote([,])dnl
|
||||
])])
|
||||
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
|
||||
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
|
||||
# otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
|
||||
# configure script would override the LC_ALL setting. Likewise for
|
||||
# LC_CTYPE, which is also set at the beginning of the configure script.
|
||||
# Test for the usual locale name.
|
||||
if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr_FR
|
||||
else
|
||||
# Test for the locale name with explicit encoding suffix.
|
||||
if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr_FR.ISO-8859-1
|
||||
else
|
||||
# Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
|
||||
if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr_FR.ISO8859-1
|
||||
case "$host_os" in
|
||||
# Handle native Windows specially, because there setlocale() interprets
|
||||
# "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
|
||||
# "fr" or "fra" as "French" or "French_France.1252",
|
||||
# "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
|
||||
# "ja" as "Japanese" or "Japanese_Japan.932",
|
||||
# and similar.
|
||||
mingw*)
|
||||
# Test for the native Windows locale name.
|
||||
if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=French_France.1252
|
||||
else
|
||||
# Test for the HP-UX locale name.
|
||||
if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr_FR.iso88591
|
||||
# None found.
|
||||
gt_cv_locale_fr=none
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
|
||||
# otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
|
||||
# configure script would override the LC_ALL setting. Likewise for
|
||||
# LC_CTYPE, which is also set at the beginning of the configure script.
|
||||
# Test for the usual locale name.
|
||||
if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr_FR
|
||||
else
|
||||
# Test for the locale name with explicit encoding suffix.
|
||||
if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr_FR.ISO-8859-1
|
||||
else
|
||||
# Test for the Solaris 7 locale name.
|
||||
if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr
|
||||
# Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
|
||||
if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr_FR.ISO8859-1
|
||||
else
|
||||
# None found.
|
||||
gt_cv_locale_fr=none
|
||||
# Test for the HP-UX locale name.
|
||||
if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr_FR.iso88591
|
||||
else
|
||||
# Test for the Solaris 7 locale name.
|
||||
if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr=fr
|
||||
else
|
||||
# None found.
|
||||
gt_cv_locale_fr=none
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -fr conftest*
|
||||
])
|
||||
|
@ -119,9 +153,19 @@ int main () {
|
|||
variables, and all locales use the UTF-8 encoding. */
|
||||
#if !(defined __BEOS__ || defined __HAIKU__)
|
||||
/* Check whether the given locale name is recognized by the system. */
|
||||
# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
|
||||
/* On native Windows, setlocale(category, "") looks at the system settings,
|
||||
not at the environment variables. Also, when an encoding suffix such
|
||||
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
|
||||
category of the locale to "C". */
|
||||
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|
||||
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
|
||||
return 1;
|
||||
# else
|
||||
if (setlocale (LC_ALL, "") == NULL) return 1;
|
||||
# endif
|
||||
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
|
||||
On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
|
||||
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
|
||||
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
|
||||
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
|
||||
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
|
||||
|
@ -147,36 +191,57 @@ int main () {
|
|||
|| buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
|
||||
return 1;
|
||||
#endif
|
||||
#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
|
||||
/* Check whether the decimal separator is a comma.
|
||||
On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
|
||||
are nl_langinfo(RADIXCHAR) are both ".". */
|
||||
if (localeconv () ->decimal_point[0] != ',') return 1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
changequote([,])dnl
|
||||
])])
|
||||
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
|
||||
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
|
||||
# otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
|
||||
# configure script would override the LC_ALL setting. Likewise for
|
||||
# LC_CTYPE, which is also set at the beginning of the configure script.
|
||||
# Test for the usual locale name.
|
||||
if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr_utf8=fr_FR
|
||||
else
|
||||
# Test for the locale name with explicit encoding suffix.
|
||||
if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr_utf8=fr_FR.UTF-8
|
||||
else
|
||||
# Test for the Solaris 7 locale name.
|
||||
if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr_utf8=fr.UTF-8
|
||||
case "$host_os" in
|
||||
# Handle native Windows specially, because there setlocale() interprets
|
||||
# "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
|
||||
# "fr" or "fra" as "French" or "French_France.1252",
|
||||
# "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
|
||||
# "ja" as "Japanese" or "Japanese_Japan.932",
|
||||
# and similar.
|
||||
mingw*)
|
||||
# Test for the hypothetical native Windows locale name.
|
||||
if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr_utf8=French_France.65001
|
||||
else
|
||||
# None found.
|
||||
gt_cv_locale_fr_utf8=none
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
|
||||
# otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
|
||||
# configure script would override the LC_ALL setting. Likewise for
|
||||
# LC_CTYPE, which is also set at the beginning of the configure script.
|
||||
# Test for the usual locale name.
|
||||
if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr_utf8=fr_FR
|
||||
else
|
||||
# Test for the locale name with explicit encoding suffix.
|
||||
if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr_utf8=fr_FR.UTF-8
|
||||
else
|
||||
# Test for the Solaris 7 locale name.
|
||||
if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_fr_utf8=fr.UTF-8
|
||||
else
|
||||
# None found.
|
||||
gt_cv_locale_fr_utf8=none
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -fr conftest*
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# locale-ja.m4 serial 7
|
||||
dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
|
||||
# locale-ja.m4 serial 12
|
||||
dnl Copyright (C) 2003, 2005-2013 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,17 +27,30 @@ int main ()
|
|||
{
|
||||
const char *p;
|
||||
/* Check whether the given locale name is recognized by the system. */
|
||||
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
|
||||
/* On native Windows, setlocale(category, "") looks at the system settings,
|
||||
not at the environment variables. Also, when an encoding suffix such
|
||||
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
|
||||
category of the locale to "C". */
|
||||
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|
||||
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
|
||||
return 1;
|
||||
#else
|
||||
if (setlocale (LC_ALL, "") == NULL) return 1;
|
||||
#endif
|
||||
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
|
||||
On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
|
||||
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
|
||||
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
|
||||
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
|
||||
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
|
||||
some unit tests fail. */
|
||||
some unit tests fail.
|
||||
On MirBSD 10, when an unsupported locale is specified, setlocale()
|
||||
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
{
|
||||
const char *cs = nl_langinfo (CODESET);
|
||||
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
|
||||
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|
||||
|| strcmp (cs, "UTF-8") == 0)
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
@ -52,7 +65,7 @@ int main ()
|
|||
if (MB_CUR_MAX == 1)
|
||||
return 1;
|
||||
/* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
|
||||
This excludes the UTF-8 encoding. */
|
||||
This excludes the UTF-8 encoding (except on MirBSD). */
|
||||
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
|
||||
if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
|
||||
for (p = buf; *p != '\0'; p++)
|
||||
|
@ -63,42 +76,58 @@ int main ()
|
|||
changequote([,])dnl
|
||||
])])
|
||||
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
|
||||
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
|
||||
# otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
|
||||
# configure script would override the LC_ALL setting. Likewise for
|
||||
# LC_CTYPE, which is also set at the beginning of the configure script.
|
||||
# Test for the AIX locale name.
|
||||
if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja_JP
|
||||
else
|
||||
# Test for the locale name with explicit encoding suffix.
|
||||
if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja_JP.EUC-JP
|
||||
else
|
||||
# Test for the HP-UX, OSF/1, NetBSD locale name.
|
||||
if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja_JP.eucJP
|
||||
case "$host_os" in
|
||||
# Handle native Windows specially, because there setlocale() interprets
|
||||
# "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
|
||||
# "fr" or "fra" as "French" or "French_France.1252",
|
||||
# "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
|
||||
# "ja" as "Japanese" or "Japanese_Japan.932",
|
||||
# and similar.
|
||||
mingw*)
|
||||
# Note that on native Windows, the Japanese locale is
|
||||
# Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
|
||||
# cannot use it here.
|
||||
gt_cv_locale_ja=none
|
||||
;;
|
||||
*)
|
||||
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
|
||||
# otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
|
||||
# configure script would override the LC_ALL setting. Likewise for
|
||||
# LC_CTYPE, which is also set at the beginning of the configure script.
|
||||
# Test for the AIX locale name.
|
||||
if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja_JP
|
||||
else
|
||||
# Test for the IRIX, FreeBSD locale name.
|
||||
if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja_JP.EUC
|
||||
# Test for the locale name with explicit encoding suffix.
|
||||
if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja_JP.EUC-JP
|
||||
else
|
||||
# Test for the Solaris 7 locale name.
|
||||
if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja
|
||||
# Test for the HP-UX, OSF/1, NetBSD locale name.
|
||||
if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja_JP.eucJP
|
||||
else
|
||||
# Special test for NetBSD 1.6.
|
||||
if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
|
||||
gt_cv_locale_ja=ja_JP.eucJP
|
||||
# Test for the IRIX, FreeBSD locale name.
|
||||
if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja_JP.EUC
|
||||
else
|
||||
# None found.
|
||||
gt_cv_locale_ja=none
|
||||
# Test for the Solaris 7 locale name.
|
||||
if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_ja=ja
|
||||
else
|
||||
# Special test for NetBSD 1.6.
|
||||
if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
|
||||
gt_cv_locale_ja=ja_JP.eucJP
|
||||
else
|
||||
# None found.
|
||||
gt_cv_locale_ja=none
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -fr conftest*
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# locale-zh.m4 serial 6
|
||||
dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
|
||||
# locale-zh.m4 serial 12
|
||||
dnl Copyright (C) 2003, 2005-2013 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.
|
||||
|
@ -28,17 +28,30 @@ int main ()
|
|||
{
|
||||
const char *p;
|
||||
/* Check whether the given locale name is recognized by the system. */
|
||||
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
|
||||
/* On native Windows, setlocale(category, "") looks at the system settings,
|
||||
not at the environment variables. Also, when an encoding suffix such
|
||||
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
|
||||
category of the locale to "C". */
|
||||
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|
||||
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
|
||||
return 1;
|
||||
#else
|
||||
if (setlocale (LC_ALL, "") == NULL) return 1;
|
||||
#endif
|
||||
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
|
||||
On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
|
||||
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
|
||||
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
|
||||
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
|
||||
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
|
||||
some unit tests fail. */
|
||||
some unit tests fail.
|
||||
On MirBSD 10, when an unsupported locale is specified, setlocale()
|
||||
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
{
|
||||
const char *cs = nl_langinfo (CODESET);
|
||||
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
|
||||
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|
||||
|| strcmp (cs, "UTF-8") == 0)
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
@ -49,7 +62,7 @@ int main ()
|
|||
if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
|
||||
#endif
|
||||
/* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
|
||||
This excludes the UTF-8 encoding. */
|
||||
This excludes the UTF-8 encoding (except on MirBSD). */
|
||||
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
|
||||
if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
|
||||
for (p = buf; *p != '\0'; p++)
|
||||
|
@ -64,22 +77,47 @@ int main ()
|
|||
changequote([,])dnl
|
||||
])])
|
||||
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
|
||||
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
|
||||
# otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
|
||||
# configure script would override the LC_ALL setting. Likewise for
|
||||
# LC_CTYPE, which is also set at the beginning of the configure script.
|
||||
# Test for the locale name without encoding suffix.
|
||||
if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_zh_CN=zh_CN
|
||||
else
|
||||
# Test for the locale name with explicit encoding suffix.
|
||||
if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_zh_CN=zh_CN.GB18030
|
||||
else
|
||||
# None found.
|
||||
case "$host_os" in
|
||||
# Handle native Windows specially, because there setlocale() interprets
|
||||
# "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
|
||||
# "fr" or "fra" as "French" or "French_France.1252",
|
||||
# "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
|
||||
# "ja" as "Japanese" or "Japanese_Japan.932",
|
||||
# and similar.
|
||||
mingw*)
|
||||
# Test for the hypothetical native Windows locale name.
|
||||
if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_zh_CN=Chinese_China.54936
|
||||
else
|
||||
# None found.
|
||||
gt_cv_locale_zh_CN=none
|
||||
fi
|
||||
;;
|
||||
solaris2.8)
|
||||
# On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
|
||||
# broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
|
||||
# Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
|
||||
gt_cv_locale_zh_CN=none
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
|
||||
# otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
|
||||
# configure script would override the LC_ALL setting. Likewise for
|
||||
# LC_CTYPE, which is also set at the beginning of the configure script.
|
||||
# Test for the locale name without encoding suffix.
|
||||
if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_zh_CN=zh_CN
|
||||
else
|
||||
# Test for the locale name with explicit encoding suffix.
|
||||
if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
|
||||
gt_cv_locale_zh_CN=zh_CN.GB18030
|
||||
else
|
||||
# None found.
|
||||
gt_cv_locale_zh_CN=none
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# If there was a link error, due to mblen(), the system is so old that
|
||||
# it certainly doesn't have a chinese locale.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# locale_h.m4 serial 10
|
||||
dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
|
||||
# locale_h.m4 serial 19
|
||||
dnl Copyright (C) 2007, 2009-2013 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.
|
||||
|
@ -10,16 +10,30 @@ AC_DEFUN([gl_LOCALE_H],
|
|||
dnl once only, before all statements that occur in other macros.
|
||||
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
|
||||
|
||||
dnl Persuade glibc <locale.h> to define locale_t.
|
||||
dnl Persuade glibc <locale.h> to define locale_t and the int_p_*, int_n_*
|
||||
dnl members of 'struct lconv'.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
|
||||
AC_REQUIRE([gl_STDDEF_H])
|
||||
|
||||
dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv'
|
||||
dnl only if _LCONV_C99 is defined.
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
case "$host_os" in
|
||||
solaris*)
|
||||
AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001],
|
||||
[gl_cv_header_locale_h_posix2001],
|
||||
[AC_TRY_COMPILE([#include <locale.h>
|
||||
int x = LC_MESSAGES;], [],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <locale.h>
|
||||
int x = LC_MESSAGES;
|
||||
int y = sizeof (((struct lconv *) 0)->decimal_point);]],
|
||||
[[]])],
|
||||
[gl_cv_header_locale_h_posix2001=yes],
|
||||
[gl_cv_header_locale_h_posix2001=no])])
|
||||
|
||||
|
@ -28,12 +42,15 @@ int x = LC_MESSAGES;], [],
|
|||
if test $ac_cv_header_xlocale_h = yes; then
|
||||
HAVE_XLOCALE_H=1
|
||||
dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
|
||||
dnl e.g. on MacOS X 10.5. If <locale.h> does not define locale_t by
|
||||
dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
|
||||
dnl itself, we assume that <xlocale.h> will do so.
|
||||
AC_CACHE_CHECK([whether locale.h defines locale_t],
|
||||
[gl_cv_header_locale_has_locale_t],
|
||||
[AC_TRY_COMPILE([#include <locale.h>
|
||||
locale_t x;], [],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <locale.h>
|
||||
locale_t x;]],
|
||||
[[]])],
|
||||
[gl_cv_header_locale_has_locale_t=yes],
|
||||
[gl_cv_header_locale_has_locale_t=no])
|
||||
])
|
||||
|
@ -48,15 +65,29 @@ locale_t x;], [],
|
|||
fi
|
||||
AC_SUBST([HAVE_XLOCALE_H])
|
||||
|
||||
dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
|
||||
gl_CHECK_NEXT_HEADERS([locale.h])
|
||||
|
||||
if test -n "$STDDEF_H" \
|
||||
|| test $gl_cv_header_locale_h_posix2001 = no \
|
||||
|| test $gl_cv_header_locale_h_needs_xlocale_h = yes; then
|
||||
gl_REPLACE_LOCALE_H
|
||||
dnl Check whether 'struct lconv' is complete.
|
||||
dnl Bionic libc's 'struct lconv' is just a dummy.
|
||||
dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x,
|
||||
dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members.
|
||||
AC_CACHE_CHECK([whether struct lconv is properly defined],
|
||||
[gl_cv_sys_struct_lconv_ok],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <locale.h>
|
||||
struct lconv l;
|
||||
int x = sizeof (l.decimal_point);
|
||||
int y = sizeof (l.int_p_cs_precedes);]],
|
||||
[[]])],
|
||||
[gl_cv_sys_struct_lconv_ok=yes],
|
||||
[gl_cv_sys_struct_lconv_ok=no])
|
||||
])
|
||||
if test $gl_cv_sys_struct_lconv_ok = no; then
|
||||
REPLACE_STRUCT_LCONV=1
|
||||
fi
|
||||
|
||||
dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
|
||||
gl_NEXT_HEADERS([locale.h])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <locale.h>
|
||||
|
@ -64,14 +95,8 @@ locale_t x;], [],
|
|||
#if HAVE_XLOCALE_H
|
||||
# include <xlocale.h>
|
||||
#endif
|
||||
]], [duplocale])
|
||||
])
|
||||
|
||||
dnl Unconditionally enables the replacement of <locale.h>.
|
||||
AC_DEFUN([gl_REPLACE_LOCALE_H],
|
||||
[
|
||||
dnl This is a no-op, because <locale.h> is always overridden.
|
||||
:
|
||||
]],
|
||||
[setlocale duplocale])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
|
||||
|
@ -85,8 +110,13 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
|
|||
|
||||
AC_DEFUN([gl_LOCALE_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV])
|
||||
GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE])
|
||||
GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
|
||||
REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
|
||||
HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
|
||||
REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
|
||||
REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
|
||||
REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
|
||||
REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
|
||||
])
|
||||
|
|
22
gl/m4/localeconv.m4
Normal file
22
gl/m4/localeconv.m4
Normal file
|
@ -0,0 +1,22 @@
|
|||
# localeconv.m4 serial 1
|
||||
dnl Copyright (C) 2012-2013 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_LOCALECONV],
|
||||
[
|
||||
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
|
||||
AC_REQUIRE([gl_LOCALE_H])
|
||||
|
||||
if test $REPLACE_STRUCT_LCONV = 1; then
|
||||
REPLACE_LOCALECONV=1
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/localeconv.c.
|
||||
AC_DEFUN([gl_PREREQ_LOCALECONV],
|
||||
[
|
||||
AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
|
||||
[[#include <locale.h>]])
|
||||
])
|
42
gl/m4/lock.m4
Normal file
42
gl/m4/lock.m4
Normal file
|
@ -0,0 +1,42 @@
|
|||
# lock.m4 serial 13 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2005-2013 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.
|
||||
|
||||
AC_DEFUN([gl_LOCK],
|
||||
[
|
||||
AC_REQUIRE([gl_THREADLIB])
|
||||
if test "$gl_threads_api" = posix; then
|
||||
# OSF/1 4.0 and Mac OS 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_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[#include <pthread.h>]],
|
||||
[[
|
||||
#if __FreeBSD__ == 4
|
||||
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
|
||||
#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
|
||||
&& __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
|
||||
error "No, in Mac OS X < 10.7 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
|
||||
gl_PREREQ_LOCK
|
||||
])
|
||||
|
||||
# Prerequisites of lib/glthread/lock.c.
|
||||
AC_DEFUN([gl_PREREQ_LOCK], [:])
|
|
@ -1,5 +1,5 @@
|
|||
# longlong.m4 serial 14
|
||||
dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
|
||||
# longlong.m4 serial 17
|
||||
dnl Copyright (C) 1999-2007, 2009-2013 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.61, but can be removed once we
|
||||
# assume 2.62 everywhere.
|
||||
# This fixes a bug in Autoconf 2.61, and can be faster
|
||||
# than what's in Autoconf 2.62 through 2.68.
|
||||
|
||||
# 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
|
||||
|
@ -16,44 +16,48 @@ dnl From Paul Eggert.
|
|||
|
||||
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
|
||||
[
|
||||
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
|
||||
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
|
||||
[AC_LINK_IFELSE(
|
||||
[_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_LANG_PROGRAM(
|
||||
[[@%:@include <limits.h>
|
||||
@%:@ifndef LLONG_MAX
|
||||
@%:@ define HALF \
|
||||
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
|
||||
@%:@ define LLONG_MAX (HALF - 1 + HALF)
|
||||
@%:@endif]],
|
||||
[[long long int n = 1;
|
||||
int i;
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
long long int m = n << i;
|
||||
if (m >> i != n)
|
||||
return 1;
|
||||
if (LLONG_MAX / 2 < m)
|
||||
break;
|
||||
}
|
||||
return 0;]])],
|
||||
[ac_cv_type_long_long_int=yes],
|
||||
[ac_cv_type_long_long_int=no],
|
||||
[ac_cv_type_long_long_int=yes])],
|
||||
[ac_cv_type_long_long_int=no])])
|
||||
[ac_cv_type_long_long_int=yes
|
||||
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
|
||||
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
|
||||
if test $ac_cv_type_long_long_int = yes; then
|
||||
dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
|
||||
dnl If cross compiling, assume the bug is not important, since
|
||||
dnl nobody cross compiles for this platform as far as we know.
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[@%:@include <limits.h>
|
||||
@%:@ifndef LLONG_MAX
|
||||
@%:@ define HALF \
|
||||
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
|
||||
@%:@ define LLONG_MAX (HALF - 1 + HALF)
|
||||
@%:@endif]],
|
||||
[[long long int n = 1;
|
||||
int i;
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
long long int m = n << i;
|
||||
if (m >> i != n)
|
||||
return 1;
|
||||
if (LLONG_MAX / 2 < m)
|
||||
break;
|
||||
}
|
||||
return 0;]])],
|
||||
[],
|
||||
[ac_cv_type_long_long_int=no],
|
||||
[:])
|
||||
fi
|
||||
fi])
|
||||
if test $ac_cv_type_long_long_int = yes; then
|
||||
AC_DEFINE([HAVE_LONG_LONG_INT], [1],
|
||||
[Define to 1 if the system has the type `long long int'.])
|
||||
[Define to 1 if the system has the type 'long long int'.])
|
||||
fi
|
||||
])
|
||||
|
||||
# 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.
|
||||
# This fixes a bug in Autoconf 2.61, and can be faster
|
||||
# than what's in Autoconf 2.62 through 2.68.
|
||||
|
||||
# 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
|
||||
|
@ -64,13 +68,16 @@ 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_TYPE_LONG_LONG_SNIPPET],
|
||||
[ac_cv_type_unsigned_long_long_int=yes],
|
||||
[ac_cv_type_unsigned_long_long_int=no])])
|
||||
[ac_cv_type_unsigned_long_long_int=yes
|
||||
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
|
||||
AC_LINK_IFELSE(
|
||||
[_AC_TYPE_LONG_LONG_SNIPPET],
|
||||
[],
|
||||
[ac_cv_type_unsigned_long_long_int=no])
|
||||
fi])
|
||||
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'.])
|
||||
[Define to 1 if the system has the type 'unsigned long long int'.])
|
||||
fi
|
||||
])
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# serial 28
|
||||
# serial 30
|
||||
# How to list mounted file systems.
|
||||
|
||||
# Copyright (C) 1998-2004, 2006, 2009-2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998-2004, 2006, 2009-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -70,7 +70,7 @@ AC_FUNC_GETMNTENT
|
|||
# with other getmntent implementations.
|
||||
|
||||
# NOTE: Normally, I wouldn't use a check for system type as I've done for
|
||||
# `CRAY' below since that goes against the whole autoconf philosophy. But
|
||||
# 'CRAY' below since that goes against the whole autoconf philosophy. But
|
||||
# I think there is too great a chance that some non-Cray system has a
|
||||
# function named listmntent to risk the false positive.
|
||||
|
||||
|
@ -110,7 +110,7 @@ if test -z "$ac_list_mounted_fs"; then
|
|||
AC_DEFINE([MOUNTED_VMOUNT], [1],
|
||||
[Define if there is a function named mntctl that can be used to read
|
||||
the list of mounted file systems, and there is a system header file
|
||||
that declares `struct vmount.' (AIX)])
|
||||
that declares 'struct vmount'. (AIX)])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -247,7 +247,11 @@ if test -z "$ac_list_mounted_fs"; then
|
|||
#if HAVE_SYS_STATVFS_H
|
||||
# include <sys/statvfs.h>
|
||||
#endif
|
||||
extern int getmntinfo (struct statfs **, int);
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
int getmntinfo (struct statfs **, int);
|
||||
]], [])],
|
||||
[fu_cv_sys_mounted_getmntinfo2=no],
|
||||
[fu_cv_sys_mounted_getmntinfo2=yes])
|
||||
|
@ -325,6 +329,23 @@ if test -z "$ac_list_mounted_fs"; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# Interix / BSD alike statvfs
|
||||
# the code is really interix specific, so make sure, we're on it.
|
||||
case "$host" in
|
||||
*-interix*)
|
||||
AC_CHECK_FUNCS([statvfs])
|
||||
if test $ac_cv_func_statvfs = yes; then
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE([MOUNTED_INTERIX_STATVFS], [1],
|
||||
[Define if we are on interix, and ought to use statvfs plus
|
||||
some special knowledge on where mounted file systems can be
|
||||
found. (Interix)])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
AC_MSG_ERROR([could not determine how to read list of mounted file systems])
|
||||
# FIXME -- no need to abort building the whole package
|
||||
|
|
|
@ -1,25 +1,78 @@
|
|||
# malloc.m4 serial 9
|
||||
dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
# malloc.m4 serial 14
|
||||
dnl Copyright (C) 2007, 2009-2013 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.
|
||||
|
||||
m4_version_prereq([2.70], [] ,[
|
||||
|
||||
# This is taken from the following Autoconf patch:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
|
||||
AC_DEFUN([_AC_FUNC_MALLOC_IF],
|
||||
[
|
||||
AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
|
||||
AC_CHECK_HEADERS([stdlib.h])
|
||||
AC_CACHE_CHECK([for GNU libc compatible malloc],
|
||||
[ac_cv_func_malloc_0_nonnull],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
#endif
|
||||
]],
|
||||
[[return ! malloc (0);]])
|
||||
],
|
||||
[ac_cv_func_malloc_0_nonnull=yes],
|
||||
[ac_cv_func_malloc_0_nonnull=no],
|
||||
[case "$host_os" in
|
||||
# Guess yes on platforms where we know the result.
|
||||
*-gnu* | freebsd* | netbsd* | openbsd* \
|
||||
| hpux* | solaris* | cygwin* | mingw*)
|
||||
ac_cv_func_malloc_0_nonnull=yes ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) ac_cv_func_malloc_0_nonnull=no ;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
|
||||
])# _AC_FUNC_MALLOC_IF
|
||||
|
||||
])
|
||||
|
||||
# gl_FUNC_MALLOC_GNU
|
||||
# ------------------
|
||||
# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
|
||||
# it is not.
|
||||
AC_DEFUN([gl_FUNC_MALLOC_GNU],
|
||||
[
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
dnl _AC_FUNC_MALLOC_IF is defined in Autoconf.
|
||||
_AC_FUNC_MALLOC_IF(
|
||||
[AC_DEFINE([HAVE_MALLOC_GNU], [1],
|
||||
[Define to 1 if your system has a GNU libc compatible 'malloc'
|
||||
function, and to 0 otherwise.])],
|
||||
[AC_DEFINE([HAVE_MALLOC_GNU], [0])
|
||||
REPLACE_MALLOC=1
|
||||
])
|
||||
])
|
||||
|
||||
# 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_STDLIB_H_DEFAULTS])
|
||||
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
|
||||
REPLACE_MALLOC=1
|
||||
fi
|
||||
AC_SUBST([HAVE_MALLOC_POSIX])
|
||||
])
|
||||
|
||||
# Test whether malloc, realloc, calloc are POSIX compliant,
|
||||
|
@ -32,10 +85,14 @@ AC_DEFUN([gl_CHECK_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])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[]],
|
||||
[[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
choke me
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_func_malloc_posix=yes],
|
||||
[gl_cv_func_malloc_posix=no])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# malloca.m4 serial 1
|
||||
dnl Copyright (C) 2003-2004, 2006-2007, 2009-2010 Free Software Foundation,
|
||||
dnl Copyright (C) 2003-2004, 2006-2007, 2009-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
|
287
gl/m4/math_h.m4
287
gl/m4/math_h.m4
|
@ -1,5 +1,5 @@
|
|||
# math_h.m4 serial 21
|
||||
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||
# math_h.m4 serial 114
|
||||
dnl Copyright (C) 2007-2013 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,7 +8,6 @@ AC_DEFUN([gl_MATH_H],
|
|||
[
|
||||
AC_REQUIRE([gl_MATH_H_DEFAULTS])
|
||||
gl_CHECK_NEXT_HEADERS([math.h])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
|
||||
AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
|
||||
|
@ -38,9 +37,20 @@ AC_DEFUN([gl_MATH_H],
|
|||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <math.h>
|
||||
]], [acosl asinl atanl ceilf ceill cosl expl floorf floorl frexpl
|
||||
ldexpl logb logl round roundf roundl sinl sqrtl tanl trunc truncf truncl])
|
||||
gl_WARN_ON_USE_PREPARE([[#include <math.h>]],
|
||||
[acosf acosl asinf asinl atanf atanl
|
||||
cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
|
||||
expf expl exp2 exp2f exp2l expm1 expm1f expm1l
|
||||
fabsf fabsl floorf floorl fma fmaf fmal
|
||||
fmod fmodf fmodl frexpf frexpl hypotf hypotl
|
||||
ilogb ilogbf ilogbl
|
||||
ldexpf ldexpl
|
||||
log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
|
||||
logb logbf logbl
|
||||
modf modff modfl powf
|
||||
remainder remainderf remainderl
|
||||
rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
|
||||
tanf tanl tanhf trunc truncf truncl])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_MATH_MODULE_INDICATOR],
|
||||
|
@ -54,62 +64,189 @@ AC_DEFUN([gl_MATH_MODULE_INDICATOR],
|
|||
|
||||
AC_DEFUN([gl_MATH_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL])
|
||||
GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL])
|
||||
GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL])
|
||||
GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF])
|
||||
GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL])
|
||||
GNULIB_COSL=0; AC_SUBST([GNULIB_COSL])
|
||||
GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL])
|
||||
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_ISINF=0; AC_SUBST([GNULIB_ISINF])
|
||||
GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN])
|
||||
GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF])
|
||||
GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND])
|
||||
GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL])
|
||||
GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL])
|
||||
GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB])
|
||||
GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL])
|
||||
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_SINL=0; AC_SUBST([GNULIB_SINL])
|
||||
GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL])
|
||||
GNULIB_TANL=0; AC_SUBST([GNULIB_TANL])
|
||||
GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC])
|
||||
GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF])
|
||||
GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL])
|
||||
GNULIB_ACOSF=0; AC_SUBST([GNULIB_ACOSF])
|
||||
GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL])
|
||||
GNULIB_ASINF=0; AC_SUBST([GNULIB_ASINF])
|
||||
GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL])
|
||||
GNULIB_ATANF=0; AC_SUBST([GNULIB_ATANF])
|
||||
GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL])
|
||||
GNULIB_ATAN2F=0; AC_SUBST([GNULIB_ATAN2F])
|
||||
GNULIB_CBRT=0; AC_SUBST([GNULIB_CBRT])
|
||||
GNULIB_CBRTF=0; AC_SUBST([GNULIB_CBRTF])
|
||||
GNULIB_CBRTL=0; AC_SUBST([GNULIB_CBRTL])
|
||||
GNULIB_CEIL=0; AC_SUBST([GNULIB_CEIL])
|
||||
GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF])
|
||||
GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL])
|
||||
GNULIB_COPYSIGN=0; AC_SUBST([GNULIB_COPYSIGN])
|
||||
GNULIB_COPYSIGNF=0; AC_SUBST([GNULIB_COPYSIGNF])
|
||||
GNULIB_COPYSIGNL=0; AC_SUBST([GNULIB_COPYSIGNL])
|
||||
GNULIB_COSF=0; AC_SUBST([GNULIB_COSF])
|
||||
GNULIB_COSL=0; AC_SUBST([GNULIB_COSL])
|
||||
GNULIB_COSHF=0; AC_SUBST([GNULIB_COSHF])
|
||||
GNULIB_EXPF=0; AC_SUBST([GNULIB_EXPF])
|
||||
GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL])
|
||||
GNULIB_EXP2=0; AC_SUBST([GNULIB_EXP2])
|
||||
GNULIB_EXP2F=0; AC_SUBST([GNULIB_EXP2F])
|
||||
GNULIB_EXP2L=0; AC_SUBST([GNULIB_EXP2L])
|
||||
GNULIB_EXPM1=0; AC_SUBST([GNULIB_EXPM1])
|
||||
GNULIB_EXPM1F=0; AC_SUBST([GNULIB_EXPM1F])
|
||||
GNULIB_EXPM1L=0; AC_SUBST([GNULIB_EXPM1L])
|
||||
GNULIB_FABSF=0; AC_SUBST([GNULIB_FABSF])
|
||||
GNULIB_FABSL=0; AC_SUBST([GNULIB_FABSL])
|
||||
GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR])
|
||||
GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF])
|
||||
GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL])
|
||||
GNULIB_FMA=0; AC_SUBST([GNULIB_FMA])
|
||||
GNULIB_FMAF=0; AC_SUBST([GNULIB_FMAF])
|
||||
GNULIB_FMAL=0; AC_SUBST([GNULIB_FMAL])
|
||||
GNULIB_FMOD=0; AC_SUBST([GNULIB_FMOD])
|
||||
GNULIB_FMODF=0; AC_SUBST([GNULIB_FMODF])
|
||||
GNULIB_FMODL=0; AC_SUBST([GNULIB_FMODL])
|
||||
GNULIB_FREXPF=0; AC_SUBST([GNULIB_FREXPF])
|
||||
GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
|
||||
GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL])
|
||||
GNULIB_HYPOT=0; AC_SUBST([GNULIB_HYPOT])
|
||||
GNULIB_HYPOTF=0; AC_SUBST([GNULIB_HYPOTF])
|
||||
GNULIB_HYPOTL=0; AC_SUBST([GNULIB_HYPOTL])
|
||||
GNULIB_ILOGB=0; AC_SUBST([GNULIB_ILOGB])
|
||||
GNULIB_ILOGBF=0; AC_SUBST([GNULIB_ILOGBF])
|
||||
GNULIB_ILOGBL=0; AC_SUBST([GNULIB_ILOGBL])
|
||||
GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
|
||||
GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF])
|
||||
GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN])
|
||||
GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF])
|
||||
GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND])
|
||||
GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL])
|
||||
GNULIB_LDEXPF=0; AC_SUBST([GNULIB_LDEXPF])
|
||||
GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL])
|
||||
GNULIB_LOG=0; AC_SUBST([GNULIB_LOG])
|
||||
GNULIB_LOGF=0; AC_SUBST([GNULIB_LOGF])
|
||||
GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL])
|
||||
GNULIB_LOG10=0; AC_SUBST([GNULIB_LOG10])
|
||||
GNULIB_LOG10F=0; AC_SUBST([GNULIB_LOG10F])
|
||||
GNULIB_LOG10L=0; AC_SUBST([GNULIB_LOG10L])
|
||||
GNULIB_LOG1P=0; AC_SUBST([GNULIB_LOG1P])
|
||||
GNULIB_LOG1PF=0; AC_SUBST([GNULIB_LOG1PF])
|
||||
GNULIB_LOG1PL=0; AC_SUBST([GNULIB_LOG1PL])
|
||||
GNULIB_LOG2=0; AC_SUBST([GNULIB_LOG2])
|
||||
GNULIB_LOG2F=0; AC_SUBST([GNULIB_LOG2F])
|
||||
GNULIB_LOG2L=0; AC_SUBST([GNULIB_LOG2L])
|
||||
GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB])
|
||||
GNULIB_LOGBF=0; AC_SUBST([GNULIB_LOGBF])
|
||||
GNULIB_LOGBL=0; AC_SUBST([GNULIB_LOGBL])
|
||||
GNULIB_MODF=0; AC_SUBST([GNULIB_MODF])
|
||||
GNULIB_MODFF=0; AC_SUBST([GNULIB_MODFF])
|
||||
GNULIB_MODFL=0; AC_SUBST([GNULIB_MODFL])
|
||||
GNULIB_POWF=0; AC_SUBST([GNULIB_POWF])
|
||||
GNULIB_REMAINDER=0; AC_SUBST([GNULIB_REMAINDER])
|
||||
GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF])
|
||||
GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL])
|
||||
GNULIB_RINT=0; AC_SUBST([GNULIB_RINT])
|
||||
GNULIB_RINTF=0; AC_SUBST([GNULIB_RINTF])
|
||||
GNULIB_RINTL=0; AC_SUBST([GNULIB_RINTL])
|
||||
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_SINF=0; AC_SUBST([GNULIB_SINF])
|
||||
GNULIB_SINL=0; AC_SUBST([GNULIB_SINL])
|
||||
GNULIB_SINHF=0; AC_SUBST([GNULIB_SINHF])
|
||||
GNULIB_SQRTF=0; AC_SUBST([GNULIB_SQRTF])
|
||||
GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL])
|
||||
GNULIB_TANF=0; AC_SUBST([GNULIB_TANF])
|
||||
GNULIB_TANL=0; AC_SUBST([GNULIB_TANL])
|
||||
GNULIB_TANHF=0; AC_SUBST([GNULIB_TANHF])
|
||||
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_ACOSF=1; AC_SUBST([HAVE_ACOSF])
|
||||
HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
|
||||
HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
|
||||
HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
|
||||
HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
|
||||
HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
|
||||
HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
|
||||
HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
|
||||
HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
|
||||
HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
|
||||
HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
|
||||
HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
|
||||
HAVE_COSF=1; AC_SUBST([HAVE_COSF])
|
||||
HAVE_COSL=1; AC_SUBST([HAVE_COSL])
|
||||
HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
|
||||
HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
|
||||
HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
|
||||
HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
|
||||
HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
|
||||
HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
|
||||
HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
|
||||
HAVE_FMA=1; AC_SUBST([HAVE_FMA])
|
||||
HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
|
||||
HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
|
||||
HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
|
||||
HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
|
||||
HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
|
||||
HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
|
||||
HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
|
||||
HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
|
||||
HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
|
||||
HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
|
||||
HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
|
||||
HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
|
||||
HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
|
||||
HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
|
||||
HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
|
||||
HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
|
||||
HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
|
||||
HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
|
||||
HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
|
||||
HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
|
||||
HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
|
||||
HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
|
||||
HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
|
||||
HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
|
||||
HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
|
||||
HAVE_POWF=1; AC_SUBST([HAVE_POWF])
|
||||
HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
|
||||
HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
|
||||
HAVE_RINT=1; AC_SUBST([HAVE_RINT])
|
||||
HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
|
||||
HAVE_SINF=1; AC_SUBST([HAVE_SINF])
|
||||
HAVE_SINL=1; AC_SUBST([HAVE_SINL])
|
||||
HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
|
||||
HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
|
||||
HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
|
||||
HAVE_TANF=1; AC_SUBST([HAVE_TANF])
|
||||
HAVE_TANL=1; AC_SUBST([HAVE_TANL])
|
||||
HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
|
||||
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_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
|
||||
HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
|
||||
HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
|
||||
HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
|
||||
HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
|
||||
HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
|
||||
HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
|
||||
HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
|
||||
HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
|
||||
HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
|
||||
HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
|
||||
HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
|
||||
HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
|
||||
HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
|
||||
HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
|
||||
HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
|
||||
HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
|
||||
HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
|
||||
HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
|
||||
HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
|
||||
HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
|
||||
HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
|
||||
HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
|
||||
HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
|
||||
HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
|
||||
HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
|
||||
HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
|
||||
HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
|
||||
|
@ -119,22 +256,98 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
|
|||
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_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
|
||||
REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
|
||||
REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
|
||||
REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
|
||||
REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
|
||||
REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
|
||||
REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
|
||||
REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
|
||||
REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
|
||||
REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
|
||||
REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
|
||||
REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
|
||||
REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
|
||||
REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
|
||||
REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
|
||||
REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
|
||||
REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
|
||||
REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
|
||||
REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
|
||||
REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
|
||||
REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
|
||||
REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
|
||||
REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
|
||||
REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
|
||||
REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
|
||||
REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
|
||||
REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
|
||||
REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
|
||||
REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
|
||||
REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
|
||||
REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
|
||||
REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
|
||||
REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
|
||||
REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
|
||||
REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
|
||||
REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
|
||||
REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
|
||||
REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
|
||||
REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
|
||||
REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
|
||||
REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
|
||||
REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
|
||||
REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
|
||||
REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
|
||||
REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
|
||||
REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
|
||||
REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
|
||||
REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
|
||||
REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
|
||||
REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
|
||||
REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
|
||||
REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
|
||||
REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
|
||||
REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
|
||||
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])
|
||||
REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
|
||||
REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
|
||||
REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
|
||||
REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
|
||||
])
|
||||
|
||||
# gl_LONG_DOUBLE_VS_DOUBLE
|
||||
# determines whether 'long double' and 'double' have the same representation.
|
||||
# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
|
||||
# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
|
||||
# The currently known platforms where this is the case are:
|
||||
# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
|
||||
AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
|
||||
[
|
||||
AC_CACHE_CHECK([whether long double and double are the same],
|
||||
[gl_cv_long_double_equals_double],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <float.h>]],
|
||||
[[typedef int check[sizeof (long double) == sizeof (double)
|
||||
&& LDBL_MANT_DIG == DBL_MANT_DIG
|
||||
&& LDBL_MAX_EXP == DBL_MAX_EXP
|
||||
&& LDBL_MIN_EXP == DBL_MIN_EXP
|
||||
? 1 : -1];
|
||||
]])],
|
||||
[gl_cv_long_double_equals_double=yes],
|
||||
[gl_cv_long_double_equals_double=no])
|
||||
])
|
||||
if test $gl_cv_long_double_equals_double = yes; then
|
||||
AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
|
||||
[Define to 1 if 'long double' and 'double' have the same representation.])
|
||||
HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
|
||||
else
|
||||
HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
|
||||
fi
|
||||
AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
|
||||
])
|
||||
|
|
283
gl/m4/mbrtowc.m4
283
gl/m4/mbrtowc.m4
|
@ -1,5 +1,5 @@
|
|||
# mbrtowc.m4 serial 17
|
||||
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation,
|
||||
# mbrtowc.m4 serial 25
|
||||
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -15,16 +15,40 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
|
|||
AC_CHECK_FUNCS_ONCE([mbrtowc])
|
||||
if test $ac_cv_func_mbrtowc = no; then
|
||||
HAVE_MBRTOWC=0
|
||||
AC_CHECK_DECLS([mbrtowc],,, [[
|
||||
/* 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>
|
||||
]])
|
||||
if test $ac_cv_have_decl_mbrtowc = yes; then
|
||||
dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
|
||||
dnl it does not have the function. Avoid a collision with gnulib's
|
||||
dnl replacement.
|
||||
REPLACE_MBRTOWC=1
|
||||
fi
|
||||
else
|
||||
if test $REPLACE_MBSTATE_T = 1; then
|
||||
REPLACE_MBRTOWC=1
|
||||
else
|
||||
gl_MBRTOWC_NULL_ARG
|
||||
gl_MBRTOWC_NULL_ARG1
|
||||
gl_MBRTOWC_NULL_ARG2
|
||||
gl_MBRTOWC_RETVAL
|
||||
gl_MBRTOWC_NUL_RETVAL
|
||||
case "$gl_cv_func_mbrtowc_null_arg" in
|
||||
case "$gl_cv_func_mbrtowc_null_arg1" in
|
||||
*yes) ;;
|
||||
*) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1],
|
||||
*) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1],
|
||||
[Define if the mbrtowc function has the NULL pwc argument bug.])
|
||||
REPLACE_MBRTOWC=1
|
||||
;;
|
||||
esac
|
||||
case "$gl_cv_func_mbrtowc_null_arg2" in
|
||||
*yes) ;;
|
||||
*) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1],
|
||||
[Define if the mbrtowc function has the NULL string argument bug.])
|
||||
REPLACE_MBRTOWC=1
|
||||
;;
|
||||
|
@ -45,11 +69,6 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
|
|||
esac
|
||||
fi
|
||||
fi
|
||||
if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
|
||||
gl_REPLACE_WCHAR_H
|
||||
AC_LIBOBJ([mbrtowc])
|
||||
gl_PREREQ_MBRTOWC
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
|
||||
|
@ -80,9 +99,6 @@ AC_DEFUN([gl_MBSTATE_T_BROKEN],
|
|||
else
|
||||
REPLACE_MBSTATE_T=1
|
||||
fi
|
||||
if test $REPLACE_MBSTATE_T = 1; then
|
||||
gl_REPLACE_WCHAR_H
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Test whether mbrtowc puts the state into non-initial state when parsing an
|
||||
|
@ -101,16 +117,24 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
|
|||
dnl is present.
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
# Guess no on AIX and OSF/1.
|
||||
osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
|
||||
# Guess yes otherwise.
|
||||
*) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
|
||||
# Guess no on AIX and OSF/1.
|
||||
aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
|
||||
# Guess yes otherwise.
|
||||
*) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
if test $LOCALE_JA != none; then
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <locale.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>
|
||||
int main ()
|
||||
{
|
||||
|
@ -126,7 +150,7 @@ int main ()
|
|||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}],
|
||||
}]])],
|
||||
[gl_cv_func_mbrtowc_incomplete_state=yes],
|
||||
[gl_cv_func_mbrtowc_incomplete_state=no],
|
||||
[:])
|
||||
|
@ -156,10 +180,18 @@ changequote(,)dnl
|
|||
esac
|
||||
changequote([,])dnl
|
||||
if test $LOCALE_ZH_CN != none; then
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <locale.h>
|
||||
#include <stdlib.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>
|
||||
int main ()
|
||||
{
|
||||
|
@ -178,7 +210,7 @@ int main ()
|
|||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}],
|
||||
}]])],
|
||||
[gl_cv_func_mbrtowc_sanitycheck=yes],
|
||||
[gl_cv_func_mbrtowc_sanitycheck=no],
|
||||
[:])
|
||||
|
@ -186,31 +218,109 @@ int main ()
|
|||
])
|
||||
])
|
||||
|
||||
dnl Test whether mbrtowc supports a NULL string argument correctly.
|
||||
dnl Result is gl_cv_func_mbrtowc_null_arg.
|
||||
dnl Test whether mbrtowc supports a NULL pwc argument correctly.
|
||||
dnl Result is gl_cv_func_mbrtowc_null_arg1.
|
||||
|
||||
AC_DEFUN([gl_MBRTOWC_NULL_ARG],
|
||||
AC_DEFUN([gl_MBRTOWC_NULL_ARG1],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([gt_LOCALE_FR_UTF8])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument],
|
||||
[gl_cv_func_mbrtowc_null_arg1],
|
||||
[
|
||||
dnl Initial guess, used when cross-compiling or when no suitable locale
|
||||
dnl is present.
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
# Guess no on Solaris.
|
||||
solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
|
||||
# Guess yes otherwise.
|
||||
*) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
if test $LOCALE_FR_UTF8 != none; then
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <locale.h>
|
||||
#include <stdlib.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>
|
||||
int main ()
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
|
||||
{
|
||||
char input[] = "\303\237er";
|
||||
mbstate_t state;
|
||||
wchar_t wc;
|
||||
size_t ret;
|
||||
|
||||
memset (&state, '\0', sizeof (mbstate_t));
|
||||
wc = (wchar_t) 0xBADFACE;
|
||||
ret = mbrtowc (&wc, input, 5, &state);
|
||||
if (ret != 2)
|
||||
result |= 1;
|
||||
if (!mbsinit (&state))
|
||||
result |= 2;
|
||||
|
||||
memset (&state, '\0', sizeof (mbstate_t));
|
||||
ret = mbrtowc (NULL, input, 5, &state);
|
||||
if (ret != 2) /* Solaris 7 fails here: ret is -1. */
|
||||
result |= 4;
|
||||
if (!mbsinit (&state))
|
||||
result |= 8;
|
||||
}
|
||||
return result;
|
||||
}]])],
|
||||
[gl_cv_func_mbrtowc_null_arg1=yes],
|
||||
[gl_cv_func_mbrtowc_null_arg1=no],
|
||||
[:])
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
dnl Test whether mbrtowc supports a NULL string argument correctly.
|
||||
dnl Result is gl_cv_func_mbrtowc_null_arg2.
|
||||
|
||||
AC_DEFUN([gl_MBRTOWC_NULL_ARG2],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([gt_LOCALE_FR_UTF8])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument],
|
||||
[gl_cv_func_mbrtowc_null_arg],
|
||||
[gl_cv_func_mbrtowc_null_arg2],
|
||||
[
|
||||
dnl Initial guess, used when cross-compiling or when no suitable locale
|
||||
dnl is present.
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
# Guess no on OSF/1.
|
||||
osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;;
|
||||
osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
|
||||
# Guess yes otherwise.
|
||||
*) gl_cv_func_mbrtowc_null_arg="guessing yes" ;;
|
||||
*) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
if test $LOCALE_FR_UTF8 != none; then
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <locale.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>
|
||||
int main ()
|
||||
{
|
||||
|
@ -228,7 +338,10 @@ int main ()
|
|||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:])
|
||||
}]])],
|
||||
[gl_cv_func_mbrtowc_null_arg2=yes],
|
||||
[gl_cv_func_mbrtowc_null_arg2=no],
|
||||
[:])
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
@ -243,7 +356,7 @@ AC_DEFUN([gl_MBRTOWC_RETVAL],
|
|||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([gt_LOCALE_FR_UTF8])
|
||||
AC_REQUIRE([gt_LOCALE_JA])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_CACHE_CHECK([whether mbrtowc has a correct return value],
|
||||
[gl_cv_func_mbrtowc_retval],
|
||||
[
|
||||
|
@ -251,19 +364,30 @@ AC_DEFUN([gl_MBRTOWC_RETVAL],
|
|||
dnl is present.
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
# Guess no on HP-UX and Solaris.
|
||||
hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;;
|
||||
# Guess yes otherwise.
|
||||
*) gl_cv_func_mbrtowc_retval="guessing yes" ;;
|
||||
# Guess no on HP-UX, Solaris, native Windows.
|
||||
hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
|
||||
# Guess yes otherwise.
|
||||
*) gl_cv_func_mbrtowc_retval="guessing yes" ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
|
||||
AC_TRY_RUN([
|
||||
if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
|
||||
|| { case "$host_os" in mingw*) true;; *) false;; esac; }; then
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <locale.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>
|
||||
int main ()
|
||||
{
|
||||
int result = 0;
|
||||
int found_some_locale = 0;
|
||||
/* This fails on Solaris. */
|
||||
if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
|
||||
{
|
||||
|
@ -276,8 +400,9 @@ int main ()
|
|||
{
|
||||
input[1] = '\0';
|
||||
if (mbrtowc (&wc, input + 2, 5, &state) != 1)
|
||||
return 1;
|
||||
result |= 1;
|
||||
}
|
||||
found_some_locale = 1;
|
||||
}
|
||||
/* This fails on HP-UX 11.11. */
|
||||
if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
|
||||
|
@ -291,13 +416,63 @@ int main ()
|
|||
{
|
||||
input[1] = '\0';
|
||||
if (mbrtowc (&wc, input + 2, 5, &state) != 2)
|
||||
return 1;
|
||||
result |= 2;
|
||||
}
|
||||
found_some_locale = 1;
|
||||
}
|
||||
return 0;
|
||||
}],
|
||||
/* This fails on native Windows. */
|
||||
if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
|
||||
{
|
||||
char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
|
||||
mbstate_t state;
|
||||
wchar_t wc;
|
||||
|
||||
memset (&state, '\0', sizeof (mbstate_t));
|
||||
if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
|
||||
{
|
||||
input[3] = '\0';
|
||||
if (mbrtowc (&wc, input + 4, 4, &state) != 1)
|
||||
result |= 4;
|
||||
}
|
||||
found_some_locale = 1;
|
||||
}
|
||||
if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
|
||||
{
|
||||
char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
|
||||
mbstate_t state;
|
||||
wchar_t wc;
|
||||
|
||||
memset (&state, '\0', sizeof (mbstate_t));
|
||||
if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
|
||||
{
|
||||
input[3] = '\0';
|
||||
if (mbrtowc (&wc, input + 4, 4, &state) != 1)
|
||||
result |= 8;
|
||||
}
|
||||
found_some_locale = 1;
|
||||
}
|
||||
if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
|
||||
{
|
||||
char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
|
||||
mbstate_t state;
|
||||
wchar_t wc;
|
||||
|
||||
memset (&state, '\0', sizeof (mbstate_t));
|
||||
if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
|
||||
{
|
||||
input[3] = '\0';
|
||||
if (mbrtowc (&wc, input + 4, 4, &state) != 1)
|
||||
result |= 16;
|
||||
}
|
||||
found_some_locale = 1;
|
||||
}
|
||||
return (found_some_locale ? result : 77);
|
||||
}]])],
|
||||
[gl_cv_func_mbrtowc_retval=yes],
|
||||
[gl_cv_func_mbrtowc_retval=no],
|
||||
[if test $? != 77; then
|
||||
gl_cv_func_mbrtowc_retval=no
|
||||
fi
|
||||
],
|
||||
[:])
|
||||
fi
|
||||
])
|
||||
|
@ -325,9 +500,17 @@ changequote(,)dnl
|
|||
esac
|
||||
changequote([,])dnl
|
||||
if test $LOCALE_ZH_CN != none; then
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <locale.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>
|
||||
int main ()
|
||||
{
|
||||
|
@ -342,7 +525,7 @@ int main ()
|
|||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}],
|
||||
}]])],
|
||||
[gl_cv_func_mbrtowc_nul_retval=yes],
|
||||
[gl_cv_func_mbrtowc_nul_retval=no],
|
||||
[:])
|
||||
|
@ -358,10 +541,8 @@ AC_DEFUN([gl_PREREQ_MBRTOWC], [
|
|||
|
||||
dnl From Paul Eggert
|
||||
|
||||
dnl This override of an autoconf macro can be removed when autoconf 2.60 or
|
||||
dnl newer can be assumed everywhere.
|
||||
dnl This is an override of an autoconf macro.
|
||||
|
||||
m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[
|
||||
AC_DEFUN([AC_FUNC_MBRTOWC],
|
||||
[
|
||||
dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
|
||||
|
@ -369,7 +550,14 @@ AC_DEFUN([AC_FUNC_MBRTOWC],
|
|||
gl_cv_func_mbrtowc,
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <wchar.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>]],
|
||||
[[wchar_t wc;
|
||||
char const s[] = "";
|
||||
size_t n = 1;
|
||||
|
@ -382,4 +570,3 @@ AC_DEFUN([AC_FUNC_MBRTOWC],
|
|||
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# mbsinit.m4 serial 4
|
||||
dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
|
||||
# mbsinit.m4 serial 8
|
||||
dnl Copyright (C) 2008, 2010-2013 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,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_FUNC_MBSINIT],
|
||||
[
|
||||
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
|
||||
AC_REQUIRE([AC_TYPE_MBSTATE_T])
|
||||
gl_MBSTATE_T_BROKEN
|
||||
|
@ -14,16 +15,34 @@ AC_DEFUN([gl_FUNC_MBSINIT],
|
|||
AC_CHECK_FUNCS_ONCE([mbsinit])
|
||||
if test $ac_cv_func_mbsinit = no; then
|
||||
HAVE_MBSINIT=0
|
||||
AC_CHECK_DECLS([mbsinit],,, [[
|
||||
/* 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>
|
||||
]])
|
||||
if test $ac_cv_have_decl_mbsinit = yes; then
|
||||
dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
|
||||
dnl it does not have the function. Avoid a collision with gnulib's
|
||||
dnl replacement.
|
||||
REPLACE_MBSINIT=1
|
||||
fi
|
||||
else
|
||||
if test $REPLACE_MBSTATE_T = 1; then
|
||||
REPLACE_MBSINIT=1
|
||||
else
|
||||
dnl On mingw, mbsinit() always returns 1, which is inappropriate for
|
||||
dnl states produced by mbrtowc() for an incomplete multibyte character
|
||||
dnl in multibyte locales.
|
||||
case "$host_os" in
|
||||
mingw*) REPLACE_MBSINIT=1 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
|
||||
gl_REPLACE_WCHAR_H
|
||||
AC_LIBOBJ([mbsinit])
|
||||
gl_PREREQ_MBSINIT
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/mbsinit.c.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# mbstate_t.m4 serial 12
|
||||
dnl Copyright (C) 2000-2002, 2008-2010 Free Software Foundation, Inc.
|
||||
# mbstate_t.m4 serial 13
|
||||
dnl Copyright (C) 2000-2002, 2008-2013 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.
|
||||
|
@ -20,7 +20,14 @@ AC_DEFUN([AC_TYPE_MBSTATE_T],
|
|||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[AC_INCLUDES_DEFAULT[
|
||||
# include <wchar.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>]],
|
||||
[[mbstate_t x; return sizeof x;]])],
|
||||
[ac_cv_type_mbstate_t=yes],
|
||||
[ac_cv_type_mbstate_t=no])])
|
||||
|
|
19
gl/m4/mbtowc.m4
Normal file
19
gl/m4/mbtowc.m4
Normal file
|
@ -0,0 +1,19 @@
|
|||
# mbtowc.m4 serial 2
|
||||
dnl Copyright (C) 2011-2013 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_MBTOWC],
|
||||
[
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
|
||||
if false; then
|
||||
REPLACE_MBTOWC=1
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/mbtowc.c.
|
||||
AC_DEFUN([gl_PREREQ_MBTOWC], [
|
||||
:
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# memchr.m4 serial 8
|
||||
dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
|
||||
# memchr.m4 serial 12
|
||||
dnl Copyright (C) 2002-2004, 2009-2013 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.
|
||||
|
@ -11,10 +11,16 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
|
|||
AC_CHECK_HEADERS_ONCE([sys/mman.h])
|
||||
AC_CHECK_FUNCS_ONCE([mprotect])
|
||||
|
||||
dnl These days, we assume memchr is present. But just in case...
|
||||
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS_ONCE([memchr])
|
||||
if test $ac_cv_func_memchr = yes; then
|
||||
m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [
|
||||
dnl These days, we assume memchr is present. But if support for old
|
||||
dnl platforms is desired:
|
||||
AC_CHECK_FUNCS_ONCE([memchr])
|
||||
if test $ac_cv_func_memchr = no; then
|
||||
HAVE_MEMCHR=0
|
||||
fi
|
||||
])
|
||||
if test $HAVE_MEMCHR = 1; then
|
||||
# Detect platform-specific bugs in some versions of glibc:
|
||||
# memchr should not dereference anything with length 0
|
||||
# http://bugzilla.redhat.com/499689
|
||||
|
@ -35,6 +41,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
|
|||
# endif
|
||||
#endif
|
||||
]], [[
|
||||
int result = 0;
|
||||
char *fence = NULL;
|
||||
#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
|
||||
# if HAVE_MAP_ANONYMOUS
|
||||
|
@ -58,24 +65,20 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
|
|||
if (fence)
|
||||
{
|
||||
if (memchr (fence, 0, 0))
|
||||
return 1;
|
||||
result |= 1;
|
||||
strcpy (fence - 9, "12345678");
|
||||
if (memchr (fence - 9, 0, 79) != fence - 1)
|
||||
return 2;
|
||||
result |= 2;
|
||||
if (memchr (fence - 1, 0, 3) != fence - 1)
|
||||
result |= 4;
|
||||
}
|
||||
return 0;
|
||||
return result;
|
||||
]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
|
||||
[dnl Be pessimistic for now.
|
||||
gl_cv_func_memchr_works="guessing no"])])
|
||||
if test "$gl_cv_func_memchr_works" != yes; then
|
||||
REPLACE_MEMCHR=1
|
||||
fi
|
||||
else
|
||||
HAVE_MEMCHR=0
|
||||
fi
|
||||
if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
|
||||
AC_LIBOBJ([memchr])
|
||||
gl_PREREQ_MEMCHR
|
||||
fi
|
||||
])
|
||||
|
||||
|
|
143
gl/m4/mktime.m4
143
gl/m4/mktime.m4
|
@ -1,5 +1,5 @@
|
|||
# serial 15
|
||||
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2010 Free Software Foundation,
|
||||
# serial 25
|
||||
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -7,24 +7,24 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
|
||||
dnl From Jim Meyering.
|
||||
|
||||
# Redefine AC_FUNC_MKTIME, to fix a bug in Autoconf 2.61a and earlier.
|
||||
# This redefinition can be removed once a new version of Autoconf is assumed.
|
||||
# The redefinition is taken from
|
||||
# <http://cvs.sv.gnu.org/viewcvs/*checkout*/autoconf/autoconf/lib/autoconf/functions.m4?rev=1.119>.
|
||||
# AC_FUNC_MKTIME
|
||||
# --------------
|
||||
AC_DEFUN([AC_FUNC_MKTIME],
|
||||
[AC_CHECK_HEADERS_ONCE([unistd.h])
|
||||
AC_CHECK_FUNCS_ONCE([alarm])
|
||||
AC_REQUIRE([gl_MULTIARCH])
|
||||
if test $APPLE_UNIVERSAL_BUILD = 1; then
|
||||
# A universal build on Apple MacOS X platforms.
|
||||
# The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
|
||||
# But we need a configuration result that is valid in both modes.
|
||||
ac_cv_func_working_mktime=no
|
||||
fi
|
||||
AC_CACHE_CHECK([for working mktime], [ac_cv_func_working_mktime],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE(
|
||||
AC_DEFUN([gl_FUNC_MKTIME],
|
||||
[
|
||||
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
|
||||
|
||||
dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
|
||||
dnl in Autoconf and because it invokes AC_LIBOBJ.
|
||||
AC_CHECK_HEADERS_ONCE([unistd.h])
|
||||
AC_CHECK_DECLS_ONCE([alarm])
|
||||
AC_REQUIRE([gl_MULTIARCH])
|
||||
if test $APPLE_UNIVERSAL_BUILD = 1; then
|
||||
# A universal build on Apple Mac OS X platforms.
|
||||
# The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
|
||||
# But we need a configuration result that is valid in both modes.
|
||||
gl_cv_func_working_mktime=no
|
||||
fi
|
||||
AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[[/* Test program from Paul Eggert and Tony Leneis. */
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -34,8 +34,8 @@ AC_CACHE_CHECK([for working mktime], [ac_cv_func_working_mktime],
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ALARM
|
||||
# define alarm(X) /* empty */
|
||||
#if HAVE_DECL_ALARM
|
||||
# include <signal.h>
|
||||
#endif
|
||||
|
||||
/* Work around redefinition to rpl_putenv by other config tests. */
|
||||
|
@ -165,22 +165,29 @@ year_2050_test ()
|
|||
int
|
||||
main ()
|
||||
{
|
||||
int result = 0;
|
||||
time_t t, delta;
|
||||
int i, j;
|
||||
int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
|
||||
int time_t_signed = ! ((time_t) 0 < (time_t) -1);
|
||||
|
||||
#if HAVE_DECL_ALARM
|
||||
/* This test makes some buggy mktime implementations loop.
|
||||
Give up after 60 seconds; a mktime slower than that
|
||||
isn't worth using anyway. */
|
||||
signal (SIGALRM, SIG_DFL);
|
||||
alarm (60);
|
||||
#endif
|
||||
|
||||
for (;;)
|
||||
{
|
||||
t = (time_t_max << 1) + 1;
|
||||
if (t <= time_t_max)
|
||||
break;
|
||||
time_t_max = t;
|
||||
}
|
||||
time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
|
||||
time_t_max = (! time_t_signed
|
||||
? (time_t) -1
|
||||
: ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
|
||||
* 2 + 1));
|
||||
time_t_min = (! time_t_signed
|
||||
? (time_t) 0
|
||||
: time_t_signed_magnitude
|
||||
? ~ (time_t) 0
|
||||
: ~ time_t_max);
|
||||
|
||||
delta = time_t_max / 997; /* a suitable prime number */
|
||||
for (i = 0; i < N_STRINGS; i++)
|
||||
|
@ -188,47 +195,59 @@ main ()
|
|||
if (tz_strings[i])
|
||||
putenv (tz_strings[i]);
|
||||
|
||||
for (t = 0; t <= time_t_max - delta; t += delta)
|
||||
for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
|
||||
if (! mktime_test (t))
|
||||
return 1;
|
||||
if (! (mktime_test ((time_t) 1)
|
||||
&& mktime_test ((time_t) (60 * 60))
|
||||
&& mktime_test ((time_t) (60 * 60 * 24))))
|
||||
return 1;
|
||||
result |= 1;
|
||||
if ((result & 2) == 0
|
||||
&& ! (mktime_test ((time_t) 1)
|
||||
&& mktime_test ((time_t) (60 * 60))
|
||||
&& mktime_test ((time_t) (60 * 60 * 24))))
|
||||
result |= 2;
|
||||
|
||||
for (j = 1; ; j <<= 1)
|
||||
if (! bigtime_test (j))
|
||||
return 1;
|
||||
else if (INT_MAX / 2 < j)
|
||||
break;
|
||||
if (! bigtime_test (INT_MAX))
|
||||
return 1;
|
||||
for (j = 1; (result & 4) == 0; j <<= 1)
|
||||
{
|
||||
if (! bigtime_test (j))
|
||||
result |= 4;
|
||||
if (INT_MAX / 2 < j)
|
||||
break;
|
||||
}
|
||||
if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
|
||||
result |= 8;
|
||||
}
|
||||
return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
|
||||
if (! irix_6_4_bug ())
|
||||
result |= 16;
|
||||
if (! spring_forward_gap ())
|
||||
result |= 32;
|
||||
if (! year_2050_test ())
|
||||
result |= 64;
|
||||
return result;
|
||||
}]])],
|
||||
[ac_cv_func_working_mktime=yes],
|
||||
[ac_cv_func_working_mktime=no],
|
||||
[ac_cv_func_working_mktime=no])])
|
||||
if test $ac_cv_func_working_mktime = no; then
|
||||
AC_LIBOBJ([mktime])
|
||||
fi
|
||||
])# AC_FUNC_MKTIME
|
||||
[gl_cv_func_working_mktime=yes],
|
||||
[gl_cv_func_working_mktime=no],
|
||||
[gl_cv_func_working_mktime=no])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FUNC_MKTIME],
|
||||
[
|
||||
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
|
||||
AC_FUNC_MKTIME
|
||||
dnl Note: AC_FUNC_MKTIME does AC_LIBOBJ([mktime]).
|
||||
if test $ac_cv_func_working_mktime = no; then
|
||||
if test $gl_cv_func_working_mktime = no; then
|
||||
REPLACE_MKTIME=1
|
||||
gl_PREREQ_MKTIME
|
||||
else
|
||||
REPLACE_MKTIME=0
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/mktime.c.
|
||||
AC_DEFUN([gl_PREREQ_MKTIME],
|
||||
[
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [
|
||||
AC_REQUIRE([gl_FUNC_MKTIME])
|
||||
if test $REPLACE_MKTIME = 0; then
|
||||
dnl BeOS has __mktime_internal in libc, but other platforms don't.
|
||||
AC_CHECK_FUNC([__mktime_internal],
|
||||
[AC_DEFINE([mktime_internal], [__mktime_internal],
|
||||
[Define to the real name of the mktime_internal function.])
|
||||
],
|
||||
[dnl mktime works but it doesn't export __mktime_internal,
|
||||
dnl so we need to substitute our own mktime implementation.
|
||||
REPLACE_MKTIME=1
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/mktime.c.
|
||||
AC_DEFUN([gl_PREREQ_MKTIME], [:])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# mmap-anon.m4 serial 8
|
||||
dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
|
||||
# mmap-anon.m4 serial 10
|
||||
dnl Copyright (C) 2005, 2007, 2009-2013 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.
|
||||
|
@ -9,16 +9,12 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
|
||||
# and MAP_ANON exist and have the same value.
|
||||
# - On HP-UX, only MAP_ANONYMOUS exists.
|
||||
# - On MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
|
||||
# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
|
||||
# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
|
||||
# used.
|
||||
|
||||
AC_DEFUN([gl_FUNC_MMAP_ANON],
|
||||
[
|
||||
dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
|
||||
AC_REQUIRE([AC_PROG_CPP])
|
||||
AC_REQUIRE([AC_PROG_EGREP])
|
||||
|
||||
dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
|
@ -31,18 +27,18 @@ AC_DEFUN([gl_FUNC_MMAP_ANON],
|
|||
gl_have_mmap_anonymous=no
|
||||
if test $gl_have_mmap = yes; then
|
||||
AC_MSG_CHECKING([for MAP_ANONYMOUS])
|
||||
AC_EGREP_CPP([I cant identify this map.], [
|
||||
AC_EGREP_CPP([I cannot identify this map], [
|
||||
#include <sys/mman.h>
|
||||
#ifdef MAP_ANONYMOUS
|
||||
I cant identify this map.
|
||||
I cannot identify this map
|
||||
#endif
|
||||
],
|
||||
[gl_have_mmap_anonymous=yes])
|
||||
if test $gl_have_mmap_anonymous != yes; then
|
||||
AC_EGREP_CPP([I cant identify this map.], [
|
||||
AC_EGREP_CPP([I cannot identify this map], [
|
||||
#include <sys/mman.h>
|
||||
#ifdef MAP_ANON
|
||||
I cant identify this map.
|
||||
I cannot identify this map
|
||||
#endif
|
||||
],
|
||||
[AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
# mode_t.m4 serial 2
|
||||
dnl Copyright (C) 2009-2010 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.
|
||||
|
||||
# For using mode_t, it's sufficient to use AC_TYPE_MODE_T and
|
||||
# include <sys/types.h>.
|
||||
|
||||
# Define PROMOTED_MODE_T to the type that is the result of "default argument
|
||||
# promotion" (ISO C 6.5.2.2.(6)) of the type mode_t.
|
||||
AC_DEFUN([gl_PROMOTED_TYPE_MODE_T],
|
||||
[
|
||||
AC_REQUIRE([AC_TYPE_MODE_T])
|
||||
AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [
|
||||
dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int',
|
||||
dnl and to itself otherwise. This assumption is not guaranteed by the ISO C
|
||||
dnl standard, but we don't know of any real-world counterexamples.
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
|
||||
[[typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];]])],
|
||||
[gl_cv_promoted_mode_t='int'],
|
||||
[gl_cv_promoted_mode_t='mode_t'])
|
||||
])
|
||||
AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t],
|
||||
[Define to the type that is the result of default argument promotions of type mode_t.])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# serial 10
|
||||
dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
|
||||
# serial 11
|
||||
dnl Copyright (C) 2002-2006, 2009-2013 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,10 +8,6 @@ AC_DEFUN([gl_MOUNTLIST],
|
|||
[
|
||||
gl_LIST_MOUNTED_FILE_SYSTEMS([gl_cv_list_mounted_fs=yes],
|
||||
[gl_cv_list_mounted_fs=no])
|
||||
if test $gl_cv_list_mounted_fs = yes; then
|
||||
AC_LIBOBJ([mountlist])
|
||||
gl_PREREQ_MOUNTLIST_EXTRA
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/mountlist.c not done by gl_LIST_MOUNTED_FILE_SYSTEMS.
|
||||
|
|
19
gl/m4/msvc-inval.m4
Normal file
19
gl/m4/msvc-inval.m4
Normal file
|
@ -0,0 +1,19 @@
|
|||
# msvc-inval.m4 serial 1
|
||||
dnl Copyright (C) 2011-2013 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_MSVC_INVAL],
|
||||
[
|
||||
AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler])
|
||||
if test $ac_cv_func__set_invalid_parameter_handler = yes; then
|
||||
HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
|
||||
AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1],
|
||||
[Define to 1 on MSVC platforms that have the "invalid parameter handler"
|
||||
concept.])
|
||||
else
|
||||
HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
|
||||
fi
|
||||
AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER])
|
||||
])
|
|
@ -1,10 +1,10 @@
|
|||
#serial 6
|
||||
dnl Copyright (C) 2004-2006, 2009-2010 Free Software Foundation, Inc.
|
||||
# msvc-nothrow.m4 serial 1
|
||||
dnl Copyright (C) 2011-2013 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_CLOEXEC],
|
||||
AC_DEFUN([gl_MSVC_NOTHROW],
|
||||
[
|
||||
AC_LIBOBJ([cloexec])
|
||||
AC_REQUIRE([gl_MSVC_INVAL])
|
||||
])
|
|
@ -1,12 +1,12 @@
|
|||
# multiarch.m4 serial 5
|
||||
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# multiarch.m4 serial 7
|
||||
dnl Copyright (C) 2008-2013 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.
|
||||
|
||||
# Determine whether the compiler is or may be producing universal binaries.
|
||||
#
|
||||
# On MacOS X 10.5 and later systems, the user can create libraries and
|
||||
# On Mac OS X 10.5 and later systems, the user can create libraries and
|
||||
# executables that work on multiple system types--known as "fat" or
|
||||
# "universal" binaries--by specifying multiple '-arch' options to the
|
||||
# compiler but only a single '-arch' option to the preprocessor. Like
|
||||
|
@ -16,8 +16,7 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
# CPP="gcc -E" CXXCPP="g++ -E"
|
||||
#
|
||||
# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
|
||||
# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
|
||||
# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
|
||||
|
||||
AC_DEFUN_ONCE([gl_MULTIARCH],
|
||||
[
|
||||
|
@ -55,8 +54,6 @@ AC_DEFUN_ONCE([gl_MULTIARCH],
|
|||
done
|
||||
])
|
||||
if test $gl_cv_c_multiarch = yes; then
|
||||
AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
|
||||
[Define if the compiler is building for multiple architectures of Apple platforms at once.])
|
||||
APPLE_UNIVERSAL_BUILD=1
|
||||
else
|
||||
APPLE_UNIVERSAL_BUILD=0
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# netdb_h.m4 serial 9
|
||||
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# netdb_h.m4 serial 11
|
||||
dnl Copyright (C) 2008-2013 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,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_HEADER_NETDB],
|
||||
[
|
||||
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
|
||||
AC_CHECK_HEADERS_ONCE([netdb.h])
|
||||
gl_CHECK_NEXT_HEADERS([netdb.h])
|
||||
if test $ac_cv_header_netdb_h = yes; then
|
||||
HAVE_NETDB_H=1
|
||||
|
@ -27,6 +26,8 @@ AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
|
|||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_NETDB_H_DEFAULTS],
|
||||
|
@ -38,4 +39,5 @@ AC_DEFUN([gl_NETDB_H_DEFAULTS],
|
|||
HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR])
|
||||
HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO])
|
||||
HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO])
|
||||
REPLACE_GAI_STRERROR=0; AC_SUBST([REPLACE_GAI_STRERROR])
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# netinet_in_h.m4 serial 4
|
||||
dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
|
||||
# netinet_in_h.m4 serial 5
|
||||
dnl Copyright (C) 2006-2013 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,4 +27,5 @@ AC_DEFUN([gl_HEADER_NETINET_IN],
|
|||
AC_SUBST([HAVE_NETINET_IN_H])
|
||||
fi
|
||||
AC_SUBST([NETINET_IN_H])
|
||||
AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"])
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# nl_langinfo.m4 serial 3
|
||||
dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
# nl_langinfo.m4 serial 5
|
||||
dnl Copyright (C) 2009-2013 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.
|
||||
|
@ -9,17 +9,42 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
|
|||
AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
|
||||
AC_REQUIRE([gl_LANGINFO_H])
|
||||
AC_CHECK_FUNCS_ONCE([nl_langinfo])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
if test $ac_cv_func_nl_langinfo = yes; then
|
||||
if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then
|
||||
# On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
|
||||
AC_CACHE_CHECK([whether YESEXPR works],
|
||||
[gl_cv_func_nl_langinfo_yesexpr_works],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <langinfo.h>
|
||||
]], [[return !*nl_langinfo(YESEXPR);
|
||||
]])],
|
||||
[gl_cv_func_nl_langinfo_yesexpr_works=yes],
|
||||
[gl_cv_func_nl_langinfo_yesexpr_works=no],
|
||||
[
|
||||
case "$host_os" in
|
||||
# Guess no on irix systems.
|
||||
irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
|
||||
# Guess yes elsewhere.
|
||||
*) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
|
||||
esac
|
||||
])
|
||||
])
|
||||
case $gl_cv_func_nl_langinfo_yesexpr_works in
|
||||
*yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
|
||||
*) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
|
||||
[$FUNC_NL_LANGINFO_YESEXPR_WORKS],
|
||||
[Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
|
||||
if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \
|
||||
&& test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
|
||||
:
|
||||
else
|
||||
REPLACE_NL_LANGINFO=1
|
||||
AC_DEFINE([REPLACE_NL_LANGINFO], [1],
|
||||
[Define if nl_langinfo exists but is overridden by gnulib.])
|
||||
AC_LIBOBJ([nl_langinfo])
|
||||
fi
|
||||
else
|
||||
HAVE_NL_LANGINFO=0
|
||||
AC_LIBOBJ([nl_langinfo])
|
||||
fi
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# nls.m4 serial 5 (gettext-0.18)
|
||||
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
|
||||
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
|
130
gl/m4/nocrash.m4
Normal file
130
gl/m4/nocrash.m4
Normal file
|
@ -0,0 +1,130 @@
|
|||
# nocrash.m4 serial 4
|
||||
dnl Copyright (C) 2005, 2009-2013 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 Based on libsigsegv, from Bruno Haible and Paolo Bonzini.
|
||||
|
||||
AC_PREREQ([2.13])
|
||||
|
||||
dnl Expands to some code for use in .c programs that will cause the configure
|
||||
dnl test to exit instead of crashing. This is useful to avoid triggering
|
||||
dnl action from a background debugger and to avoid core dumps.
|
||||
dnl Usage: ...
|
||||
dnl ]GL_NOCRASH[
|
||||
dnl ...
|
||||
dnl int main() { nocrash_init(); ... }
|
||||
AC_DEFUN([GL_NOCRASH],[[
|
||||
#include <stdlib.h>
|
||||
#if defined __MACH__ && defined __APPLE__
|
||||
/* Avoid a crash on Mac OS X. */
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_error.h>
|
||||
#include <mach/thread_status.h>
|
||||
#include <mach/exception.h>
|
||||
#include <mach/task.h>
|
||||
#include <pthread.h>
|
||||
/* The exception port on which our thread listens. */
|
||||
static mach_port_t our_exception_port;
|
||||
/* The main function of the thread listening for exceptions of type
|
||||
EXC_BAD_ACCESS. */
|
||||
static void *
|
||||
mach_exception_thread (void *arg)
|
||||
{
|
||||
/* Buffer for a message to be received. */
|
||||
struct {
|
||||
mach_msg_header_t head;
|
||||
mach_msg_body_t msgh_body;
|
||||
char data[1024];
|
||||
} msg;
|
||||
mach_msg_return_t retval;
|
||||
/* Wait for a message on the exception port. */
|
||||
retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
|
||||
our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
|
||||
if (retval != MACH_MSG_SUCCESS)
|
||||
abort ();
|
||||
exit (1);
|
||||
}
|
||||
static void
|
||||
nocrash_init (void)
|
||||
{
|
||||
mach_port_t self = mach_task_self ();
|
||||
/* Allocate a port on which the thread shall listen for exceptions. */
|
||||
if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
|
||||
== KERN_SUCCESS) {
|
||||
/* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
|
||||
if (mach_port_insert_right (self, our_exception_port, our_exception_port,
|
||||
MACH_MSG_TYPE_MAKE_SEND)
|
||||
== KERN_SUCCESS) {
|
||||
/* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
|
||||
for us. */
|
||||
exception_mask_t mask = EXC_MASK_BAD_ACCESS;
|
||||
/* Create the thread listening on the exception port. */
|
||||
pthread_attr_t attr;
|
||||
pthread_t thread;
|
||||
if (pthread_attr_init (&attr) == 0
|
||||
&& pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
|
||||
&& pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
|
||||
pthread_attr_destroy (&attr);
|
||||
/* Replace the exception port info for these exceptions with our own.
|
||||
Note that we replace the exception port for the entire task, not only
|
||||
for a particular thread. This has the effect that when our exception
|
||||
port gets the message, the thread specific exception port has already
|
||||
been asked, and we don't need to bother about it.
|
||||
See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
|
||||
task_set_exception_ports (self, mask, our_exception_port,
|
||||
EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
/* Avoid a crash on native Windows. */
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winerror.h>
|
||||
static LONG WINAPI
|
||||
exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
|
||||
{
|
||||
switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
|
||||
{
|
||||
case EXCEPTION_ACCESS_VIOLATION:
|
||||
case EXCEPTION_IN_PAGE_ERROR:
|
||||
case EXCEPTION_STACK_OVERFLOW:
|
||||
case EXCEPTION_GUARD_PAGE:
|
||||
case EXCEPTION_PRIV_INSTRUCTION:
|
||||
case EXCEPTION_ILLEGAL_INSTRUCTION:
|
||||
case EXCEPTION_DATATYPE_MISALIGNMENT:
|
||||
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
|
||||
case EXCEPTION_NONCONTINUABLE_EXCEPTION:
|
||||
exit (1);
|
||||
}
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
static void
|
||||
nocrash_init (void)
|
||||
{
|
||||
SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
|
||||
}
|
||||
#else
|
||||
/* Avoid a crash on POSIX systems. */
|
||||
#include <signal.h>
|
||||
/* A POSIX signal handler. */
|
||||
static void
|
||||
exception_handler (int sig)
|
||||
{
|
||||
exit (1);
|
||||
}
|
||||
static void
|
||||
nocrash_init (void)
|
||||
{
|
||||
#ifdef SIGSEGV
|
||||
signal (SIGSEGV, exception_handler);
|
||||
#endif
|
||||
#ifdef SIGBUS
|
||||
signal (SIGBUS, exception_handler);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
]])
|
18
gl/m4/off_t.m4
Normal file
18
gl/m4/off_t.m4
Normal file
|
@ -0,0 +1,18 @@
|
|||
# off_t.m4 serial 1
|
||||
dnl Copyright (C) 2012-2013 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 Check whether to override the 'off_t' type.
|
||||
dnl Set WINDOWS_64_BIT_OFF_T.
|
||||
|
||||
AC_DEFUN([gl_TYPE_OFF_T],
|
||||
[
|
||||
m4_ifdef([gl_LARGEFILE], [
|
||||
AC_REQUIRE([gl_LARGEFILE])
|
||||
], [
|
||||
WINDOWS_64_BIT_OFF_T=0
|
||||
])
|
||||
AC_SUBST([WINDOWS_64_BIT_OFF_T])
|
||||
])
|
|
@ -1,9 +1,22 @@
|
|||
# onceonly.m4 serial 7
|
||||
dnl Copyright (C) 2002-2003, 2005-2006, 2008-2010 Free Software Foundation,
|
||||
# onceonly.m4 serial 9
|
||||
dnl Copyright (C) 2002-2003, 2005-2006, 2008-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software, distributed under the terms of the GNU
|
||||
dnl General Public License. As a special exception to the GNU General
|
||||
dnl Public License, this file may be distributed as part of a program
|
||||
dnl
|
||||
dnl This file is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 3 of the License, or
|
||||
dnl (at your option) any later version.
|
||||
dnl
|
||||
dnl This file is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this file. If not, see <http://www.gnu.org/licenses/>.
|
||||
dnl
|
||||
dnl As a special exception to the GNU General Public License,
|
||||
dnl this file may be distributed as part of a program
|
||||
dnl that contains a configuration script generated by Autoconf, under
|
||||
dnl the same distribution terms as the rest of that program.
|
||||
|
||||
|
@ -67,7 +80,7 @@ AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
|
|||
[gl_func_list="$gl_func_list gl_FUNC_NAME"])
|
||||
gl_FUNCS_EXPANSION
|
||||
AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
|
||||
[Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
|
||||
[Define to 1 if you have the ']m4_defn([gl_FUNC_NAME])[' function.])
|
||||
])
|
||||
AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
|
||||
])
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
# open.m4 serial 8
|
||||
dnl Copyright (C) 2007-2010 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_OPEN],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
case "$host_os" in
|
||||
mingw* | pw*)
|
||||
gl_REPLACE_OPEN
|
||||
;;
|
||||
*)
|
||||
dnl open("foo/") should not create a file when the file name has a
|
||||
dnl trailing slash. FreeBSD only has the problem on symlinks.
|
||||
AC_CHECK_FUNCS_ONCE([lstat])
|
||||
AC_CACHE_CHECK([whether open recognizes a trailing slash],
|
||||
[gl_cv_func_open_slash],
|
||||
[# Assume that if we have lstat, we can also check symlinks.
|
||||
if test $ac_cv_func_lstat = yes; then
|
||||
touch conftest.tmp
|
||||
ln -s conftest.tmp conftest.lnk
|
||||
fi
|
||||
AC_TRY_RUN([
|
||||
#include <fcntl.h>
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
int main ()
|
||||
{
|
||||
#if HAVE_LSTAT
|
||||
if (open ("conftest.lnk/", O_RDONLY) != -1) return 2;
|
||||
#endif
|
||||
return open ("conftest.sl/", O_CREAT, 0600) >= 0;
|
||||
}], [gl_cv_func_open_slash=yes], [gl_cv_func_open_slash=no],
|
||||
[
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
freebsd*) gl_cv_func_open_slash="guessing no" ;;
|
||||
solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;;
|
||||
hpux*) gl_cv_func_open_slash="guessing no" ;;
|
||||
*) gl_cv_func_open_slash="guessing yes" ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
])
|
||||
rm -f conftest.sl conftest.tmp conftest.lnk
|
||||
])
|
||||
case "$gl_cv_func_open_slash" in
|
||||
*no)
|
||||
AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
|
||||
[Define to 1 if open() fails to recognize a trailing slash.])
|
||||
gl_REPLACE_OPEN
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_REPLACE_OPEN],
|
||||
[
|
||||
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
|
||||
REPLACE_OPEN=1
|
||||
AC_LIBOBJ([open])
|
||||
gl_PREREQ_OPEN
|
||||
])
|
||||
|
||||
# Prerequisites of lib/open.c.
|
||||
AC_DEFUN([gl_PREREQ_OPEN],
|
||||
[
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
|
||||
:
|
||||
])
|
36
gl/m4/po.m4
36
gl/m4/po.m4
|
@ -1,5 +1,5 @@
|
|||
# po.m4 serial 17 (gettext-0.18)
|
||||
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
|
||||
# po.m4 serial 21 (gettext-0.18.3)
|
||||
dnl Copyright (C) 1995-2013 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.
|
||||
|
@ -17,14 +17,15 @@ dnl Authors:
|
|||
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
|
||||
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
|
||||
|
||||
AC_PREREQ([2.50])
|
||||
AC_PREREQ([2.60])
|
||||
|
||||
dnl Checks for all prerequisites of the po subdirectory.
|
||||
AC_DEFUN([AM_PO_SUBDIRS],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
|
||||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
||||
AC_REQUIRE([AC_PROG_SED])dnl
|
||||
AC_REQUIRE([AM_NLS])dnl
|
||||
|
||||
dnl Release version of the gettext macros. This is used to ensure that
|
||||
|
@ -102,7 +103,7 @@ changequote([,])dnl
|
|||
case "$ac_file" in */Makefile.in)
|
||||
# Adjust a relative srcdir.
|
||||
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
|
||||
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
|
||||
ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
|
||||
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
|
||||
# In autoconf-2.13 it is called $ac_given_srcdir.
|
||||
# In autoconf-2.50 it is called $srcdir.
|
||||
|
@ -118,7 +119,8 @@ changequote([,])dnl
|
|||
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
|
||||
rm -f "$ac_dir/POTFILES"
|
||||
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
|
||||
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
|
||||
gt_tab=`printf '\t'`
|
||||
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
|
||||
POMAKEFILEDEPS="POTFILES.in"
|
||||
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
|
||||
# on $ac_dir but don't depend on user-specified configuration
|
||||
|
@ -129,12 +131,12 @@ changequote([,])dnl
|
|||
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
|
||||
fi
|
||||
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
|
||||
# Hide the ALL_LINGUAS assigment from automake < 1.5.
|
||||
# Hide the ALL_LINGUAS assignment from automake < 1.5.
|
||||
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
|
||||
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
|
||||
else
|
||||
# The set of available languages was given in configure.in.
|
||||
# Hide the ALL_LINGUAS assigment from automake < 1.5.
|
||||
# Hide the ALL_LINGUAS assignment from automake < 1.5.
|
||||
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
|
||||
fi
|
||||
# Compute POFILES
|
||||
|
@ -226,7 +228,7 @@ AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
|
|||
changequote(,)dnl
|
||||
# Adjust a relative srcdir.
|
||||
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
|
||||
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
|
||||
ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
|
||||
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
|
||||
# In autoconf-2.13 it is called $ac_given_srcdir.
|
||||
# In autoconf-2.50 it is called $srcdir.
|
||||
|
@ -254,6 +256,7 @@ EOT
|
|||
fi
|
||||
|
||||
# A sed script that extracts the value of VARIABLE from a Makefile.
|
||||
tab=`printf '\t'`
|
||||
sed_x_variable='
|
||||
# Test if the hold space is empty.
|
||||
x
|
||||
|
@ -261,9 +264,9 @@ s/P/P/
|
|||
x
|
||||
ta
|
||||
# Yes it was empty. Look if we have the expected variable definition.
|
||||
/^[ ]*VARIABLE[ ]*=/{
|
||||
/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
|
||||
# Seen the first line of the variable definition.
|
||||
s/^[ ]*VARIABLE[ ]*=//
|
||||
s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
|
||||
ba
|
||||
}
|
||||
bd
|
||||
|
@ -315,7 +318,7 @@ changequote([,])dnl
|
|||
sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
|
||||
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
|
||||
fi
|
||||
# Hide the ALL_LINGUAS assigment from automake < 1.5.
|
||||
# Hide the ALL_LINGUAS assignment from automake < 1.5.
|
||||
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
|
||||
# Compute POFILES
|
||||
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
|
||||
|
@ -405,14 +408,15 @@ changequote([,])dnl
|
|||
fi
|
||||
|
||||
sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
|
||||
tab=`printf '\t'`
|
||||
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
|
||||
# Add dependencies that cannot be formulated as a simple suffix rule.
|
||||
for lang in $ALL_LINGUAS; do
|
||||
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
|
||||
cat >> "$ac_file.tmp" <<EOF
|
||||
$frobbedlang.msg: $lang.po
|
||||
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
|
||||
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
|
||||
${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
|
||||
${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
|
||||
EOF
|
||||
done
|
||||
fi
|
||||
|
@ -422,8 +426,8 @@ EOF
|
|||
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
|
||||
cat >> "$ac_file.tmp" <<EOF
|
||||
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
|
||||
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
|
||||
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
|
||||
${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
|
||||
${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
|
||||
EOF
|
||||
done
|
||||
fi
|
||||
|
|
1044
gl/m4/printf.m4
1044
gl/m4/printf.m4
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
# progtest.m4 serial 6 (gettext-0.18)
|
||||
dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
|
||||
# progtest.m4 serial 7 (gettext-0.18.2)
|
||||
dnl Copyright (C) 1996-2003, 2005, 2008-2013 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,15 +27,14 @@ AC_DEFUN([AM_PATH_PROG_WITH_TEST],
|
|||
# Prepare PATH_SEPARATOR.
|
||||
# The user is always right.
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
echo "#! /bin/sh" >conf$$.sh
|
||||
echo "exit 0" >>conf$$.sh
|
||||
chmod +x conf$$.sh
|
||||
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
|
||||
PATH_SEPARATOR=';'
|
||||
else
|
||||
PATH_SEPARATOR=:
|
||||
fi
|
||||
rm -f conf$$.sh
|
||||
# Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
|
||||
# contains only /bin. Note that ksh looks also at the FPATH variable,
|
||||
# so we have to set that as well for the test.
|
||||
PATH_SEPARATOR=:
|
||||
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|
||||
&& { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|
||||
|| PATH_SEPARATOR=';'
|
||||
}
|
||||
fi
|
||||
|
||||
# Find out how to test for executable files. Don't use a zero-byte file,
|
||||
|
|
26
gl/m4/read.m4
Normal file
26
gl/m4/read.m4
Normal file
|
@ -0,0 +1,26 @@
|
|||
# read.m4 serial 4
|
||||
dnl Copyright (C) 2011-2013 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_READ],
|
||||
[
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
AC_REQUIRE([gl_MSVC_INVAL])
|
||||
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
|
||||
REPLACE_READ=1
|
||||
fi
|
||||
dnl This ifdef is just an optimization, to avoid performing a configure
|
||||
dnl check whose result is not used. It does not make the test of
|
||||
dnl GNULIB_UNISTD_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
|
||||
m4_ifdef([gl_NONBLOCKING_IO], [
|
||||
gl_NONBLOCKING_IO
|
||||
if test $gl_cv_have_nonblocking != yes; then
|
||||
REPLACE_READ=1
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/read.c.
|
||||
AC_DEFUN([gl_PREREQ_READ], [:])
|
157
gl/m4/regex.m4
157
gl/m4/regex.m4
|
@ -1,7 +1,6 @@
|
|||
# serial 56
|
||||
# serial 64
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
|
||||
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -14,8 +13,6 @@ AC_PREREQ([2.50])
|
|||
|
||||
AC_DEFUN([gl_REGEX],
|
||||
[
|
||||
AC_CHECK_HEADERS_ONCE([locale.h])
|
||||
|
||||
AC_ARG_WITH([included-regex],
|
||||
[AS_HELP_STRING([--without-included-regex],
|
||||
[don't compile regex; this is the default on systems
|
||||
|
@ -30,31 +27,41 @@ AC_DEFUN([gl_REGEX],
|
|||
# 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.
|
||||
AC_CHECK_DECLS_ONCE([alarm])
|
||||
AC_CACHE_CHECK([for working re_compile_pattern],
|
||||
[gl_cv_func_re_compile_pattern_working],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[AC_INCLUDES_DEFAULT[
|
||||
#if HAVE_LOCALE_H
|
||||
[[#include <regex.h>
|
||||
|
||||
#include <locale.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <regex.h>
|
||||
]],
|
||||
[[static struct re_pattern_buffer regex;
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#if HAVE_DECL_ALARM
|
||||
# include <unistd.h>
|
||||
# include <signal.h>
|
||||
#endif
|
||||
]],
|
||||
[[int result = 0;
|
||||
static struct re_pattern_buffer regex;
|
||||
unsigned char folded_chars[UCHAR_MAX + 1];
|
||||
int i;
|
||||
const char *s;
|
||||
struct re_registers regs;
|
||||
|
||||
#if HAVE_LOCALE_H
|
||||
/* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
|
||||
This test needs valgrind to catch the bug on Debian
|
||||
GNU/Linux 3.1 x86, but it might catch the bug better
|
||||
on other platforms and it shouldn't hurt to try the
|
||||
test here. */
|
||||
if (setlocale (LC_ALL, "en_US.UTF-8"))
|
||||
#if HAVE_DECL_ALARM
|
||||
/* Some builds of glibc go into an infinite loop on this test. */
|
||||
signal (SIGALRM, SIG_DFL);
|
||||
alarm (2);
|
||||
#endif
|
||||
if (setlocale (LC_ALL, "en_US.UTF-8"))
|
||||
{
|
||||
{
|
||||
/* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
|
||||
This test needs valgrind to catch the bug on Debian
|
||||
GNU/Linux 3.1 x86, but it might catch the bug better
|
||||
on other platforms and it shouldn't hurt to try the
|
||||
test here. */
|
||||
static char const pat[] = "insert into";
|
||||
static char const data[] =
|
||||
"\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
|
||||
|
@ -63,26 +70,57 @@ AC_DEFUN([gl_REGEX],
|
|||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern (pat, sizeof pat - 1, ®ex);
|
||||
if (s)
|
||||
return 1;
|
||||
if (re_search (®ex, data, sizeof data - 1,
|
||||
0, sizeof data - 1, ®s)
|
||||
!= -1)
|
||||
return 1;
|
||||
if (! setlocale (LC_ALL, "C"))
|
||||
return 1;
|
||||
result |= 1;
|
||||
else if (re_search (®ex, data, sizeof data - 1,
|
||||
0, sizeof data - 1, ®s)
|
||||
!= -1)
|
||||
result |= 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
/* This test is from glibc bug 15078.
|
||||
The test case is from Andreas Schwab in
|
||||
<http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
|
||||
*/
|
||||
static char const pat[] = "[^x]x";
|
||||
static char const data[] =
|
||||
/* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */
|
||||
"\xe1\x80\x80"
|
||||
"\xe1\x80\xbb"
|
||||
"\xe1\x80\xbd"
|
||||
"\xe1\x80\x94"
|
||||
"\xe1\x80\xba"
|
||||
"\xe1\x80\xaf"
|
||||
"\xe1\x80\x95"
|
||||
"\xe1\x80\xba"
|
||||
"x";
|
||||
re_set_syntax (0);
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern (pat, sizeof pat - 1, ®ex);
|
||||
if (s)
|
||||
result |= 1;
|
||||
else
|
||||
{
|
||||
i = re_search (®ex, data, sizeof data - 1,
|
||||
0, sizeof data - 1, 0);
|
||||
if (i != 0 && i != 21)
|
||||
result |= 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (! setlocale (LC_ALL, "C"))
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
result |= 2;
|
||||
/* This should fail, but succeeds for glibc-2.5. */
|
||||
if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1)
|
||||
return 1;
|
||||
else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1)
|
||||
result |= 2;
|
||||
|
||||
/* This regular expression is from Spencer ere test number 75
|
||||
in grep-2.3. */
|
||||
|
@ -94,7 +132,7 @@ AC_DEFUN([gl_REGEX],
|
|||
s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex);
|
||||
/* This should fail with _Invalid character class name_ error. */
|
||||
if (!s)
|
||||
return 1;
|
||||
result |= 4;
|
||||
|
||||
/* Ensure that [b-a] is diagnosed as invalid, when
|
||||
using RE_NO_EMPTY_RANGES. */
|
||||
|
@ -102,34 +140,31 @@ AC_DEFUN([gl_REGEX],
|
|||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("a[b-a]", 6, ®ex);
|
||||
if (s == 0)
|
||||
return 1;
|
||||
result |= 8;
|
||||
|
||||
/* 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)
|
||||
return 1;
|
||||
result |= 8;
|
||||
|
||||
/* The following example is derived from a problem report
|
||||
against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("[an\371]*n", 7, ®ex);
|
||||
if (s)
|
||||
return 1;
|
||||
|
||||
result |= 8;
|
||||
/* This should match, but does not for glibc-2.2.1. */
|
||||
if (re_match (®ex, "an", 2, 0, ®s) != 2)
|
||||
return 1;
|
||||
else if (re_match (®ex, "an", 2, 0, ®s) != 2)
|
||||
result |= 8;
|
||||
|
||||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("x", 1, ®ex);
|
||||
if (s)
|
||||
return 1;
|
||||
|
||||
result |= 8;
|
||||
/* glibc-2.2.93 does not work with a negative RANGE argument. */
|
||||
if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
|
||||
return 1;
|
||||
else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
|
||||
result |= 8;
|
||||
|
||||
/* The version of regex.c in older versions of gnulib
|
||||
ignored RE_ICASE. Detect that problem too. */
|
||||
|
@ -137,10 +172,9 @@ AC_DEFUN([gl_REGEX],
|
|||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("x", 1, ®ex);
|
||||
if (s)
|
||||
return 1;
|
||||
|
||||
if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0)
|
||||
return 1;
|
||||
result |= 16;
|
||||
else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0)
|
||||
result |= 16;
|
||||
|
||||
/* Catch a bug reported by Vin Shelton in
|
||||
http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
|
||||
|
@ -151,21 +185,27 @@ AC_DEFUN([gl_REGEX],
|
|||
memset (®ex, 0, sizeof regex);
|
||||
s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex);
|
||||
if (s)
|
||||
return 1;
|
||||
result |= 32;
|
||||
|
||||
/* REG_STARTEND was added to glibc on 2004-01-15.
|
||||
Reject older versions. */
|
||||
if (! REG_STARTEND)
|
||||
return 1;
|
||||
result |= 64;
|
||||
|
||||
/* 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 0
|
||||
/* It would be nice to reject hosts whose regoff_t values are too
|
||||
narrow (including glibc on hosts with 64-bit ptrdiff_t and
|
||||
32-bit int), but we should wait until glibc implements this
|
||||
feature. Otherwise, support for equivalence classes and
|
||||
multibyte collation symbols would always be broken except
|
||||
when compiling --without-included-regex. */
|
||||
if (sizeof (regoff_t) < sizeof (ptrdiff_t)
|
||||
|| sizeof (regoff_t) < sizeof (ssize_t))
|
||||
return 1;
|
||||
result |= 64;
|
||||
#endif
|
||||
|
||||
return 0;]])],
|
||||
return result;
|
||||
]])],
|
||||
[gl_cv_func_re_compile_pattern_working=yes],
|
||||
[gl_cv_func_re_compile_pattern_working=no],
|
||||
dnl When crosscompiling, assume it is not working.
|
||||
|
@ -180,6 +220,9 @@ AC_DEFUN([gl_REGEX],
|
|||
esac
|
||||
|
||||
if test $ac_use_included_regex = yes; then
|
||||
AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1],
|
||||
[Define if you want <regex.h> to include <limits.h>, so that it
|
||||
consistently overrides <limits.h>'s RE_DUP_MAX.])
|
||||
AC_DEFINE([_REGEX_LARGE_OFFSETS], [1],
|
||||
[Define if you want regoff_t to be at least as wide POSIX requires.])
|
||||
AC_DEFINE([re_syntax_options], [rpl_re_syntax_options],
|
||||
|
@ -212,8 +255,6 @@ AC_DEFUN([gl_REGEX],
|
|||
[Define to rpl_regerror if the replacement should be used.])
|
||||
AC_DEFINE([regfree], [rpl_regfree],
|
||||
[Define to rpl_regfree if the replacement should be used.])
|
||||
AC_LIBOBJ([regex])
|
||||
gl_PREREQ_REGEX
|
||||
fi
|
||||
])
|
||||
|
||||
|
@ -224,7 +265,9 @@ AC_DEFUN([gl_PREREQ_REGEX],
|
|||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
AC_REQUIRE([AC_TYPE_MBSTATE_T])
|
||||
AC_REQUIRE([gl_EEMALLOC])
|
||||
AC_REQUIRE([gl_GLIBC21])
|
||||
AC_CHECK_HEADERS([libintl.h])
|
||||
AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll])
|
||||
AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
|
||||
AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
|
||||
])
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
# safe-read.m4 serial 5
|
||||
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
|
||||
# safe-read.m4 serial 6
|
||||
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2013 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_SAFE_READ],
|
||||
[
|
||||
AC_LIBOBJ([safe-read])
|
||||
|
||||
gl_PREREQ_SAFE_READ
|
||||
])
|
||||
|
||||
# Prerequisites of lib/safe-read.c.
|
||||
AC_DEFUN([gl_PREREQ_SAFE_READ],
|
||||
[
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
# safe-write.m4 serial 3
|
||||
dnl Copyright (C) 2002, 2005-2006, 2009-2010 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_SAFE_WRITE],
|
||||
[
|
||||
AC_LIBOBJ([safe-write])
|
||||
|
||||
gl_PREREQ_SAFE_WRITE
|
||||
])
|
||||
|
||||
# Prerequisites of lib/safe-write.c.
|
||||
AC_DEFUN([gl_PREREQ_SAFE_WRITE],
|
||||
[
|
||||
gl_PREREQ_SAFE_READ
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# servent.m4 serial 1
|
||||
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# servent.m4 serial 2
|
||||
dnl Copyright (C) 2008, 2010-2013 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.
|
||||
|
@ -30,12 +30,16 @@ AC_DEFUN([gl_SERVENT],
|
|||
[gl_cv_w32_getservbyname=no
|
||||
gl_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lws2_32"
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
], [getservbyname(NULL,NULL);], [gl_cv_w32_getservbyname=yes])
|
||||
]],
|
||||
[[getservbyname(NULL,NULL);]])],
|
||||
[gl_cv_w32_getservbyname=yes])
|
||||
LIBS="$gl_save_LIBS"
|
||||
])
|
||||
if test "$gl_cv_w32_getservbyname" = "yes"; then
|
||||
|
|
127
gl/m4/setenv.m4
127
gl/m4/setenv.m4
|
@ -1,5 +1,5 @@
|
|||
# setenv.m4 serial 16
|
||||
dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc.
|
||||
# setenv.m4 serial 26
|
||||
dnl Copyright (C) 2001-2004, 2006-2013 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,16 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_FUNC_SETENV],
|
||||
[
|
||||
AC_REQUIRE([gl_FUNC_SETENV_SEPARATE])
|
||||
if test $HAVE_SETENV$REPLACE_SETENV != 10; then
|
||||
AC_LIBOBJ([setenv])
|
||||
fi
|
||||
])
|
||||
|
||||
# Like gl_FUNC_SETENV, except prepare for separate compilation (no AC_LIBOBJ).
|
||||
AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
|
||||
[
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS_ONCE([setenv])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
if test $ac_cv_func_setenv = no; then
|
||||
HAVE_SETENV=0
|
||||
else
|
||||
|
@ -27,69 +18,127 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
]], [[
|
||||
if (setenv ("", "", 0) != -1) return 1;
|
||||
if (errno != EINVAL) return 2;
|
||||
if (setenv ("a", "=", 1) != 0) return 3;
|
||||
if (strcmp (getenv ("a"), "=") != 0) return 4;
|
||||
int result = 0;
|
||||
{
|
||||
if (setenv ("", "", 0) != -1)
|
||||
result |= 1;
|
||||
else if (errno != EINVAL)
|
||||
result |= 2;
|
||||
}
|
||||
{
|
||||
if (setenv ("a", "=", 1) != 0)
|
||||
result |= 4;
|
||||
else if (strcmp (getenv ("a"), "=") != 0)
|
||||
result |= 8;
|
||||
}
|
||||
return result;
|
||||
]])],
|
||||
[gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
|
||||
[gl_cv_func_setenv_works="guessing no"])])
|
||||
if test "$gl_cv_func_setenv_works" != yes; then
|
||||
REPLACE_SETENV=1
|
||||
AC_LIBOBJ([setenv])
|
||||
fi
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_setenv_works="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_setenv_works="guessing no" ;;
|
||||
esac
|
||||
])])
|
||||
case "$gl_cv_func_setenv_works" in
|
||||
*yes) ;;
|
||||
*)
|
||||
REPLACE_SETENV=1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
# Like gl_FUNC_SETENV, except prepare for separate compilation
|
||||
# (no REPLACE_SETENV, no AC_LIBOBJ).
|
||||
AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
|
||||
[
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
AC_CHECK_DECLS_ONCE([setenv])
|
||||
if test $ac_cv_have_decl_setenv = no; then
|
||||
HAVE_DECL_SETENV=0
|
||||
fi
|
||||
AC_CHECK_FUNCS_ONCE([setenv])
|
||||
gl_PREREQ_SETENV
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FUNC_UNSETENV],
|
||||
[
|
||||
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_CHECK_DECLS_ONCE([unsetenv])
|
||||
if test $ac_cv_have_decl_unsetenv = no; then
|
||||
HAVE_DECL_UNSETENV=0
|
||||
fi
|
||||
AC_CHECK_FUNCS([unsetenv])
|
||||
if test $ac_cv_func_unsetenv = no; then
|
||||
HAVE_UNSETENV=0
|
||||
AC_LIBOBJ([unsetenv])
|
||||
gl_PREREQ_UNSETENV
|
||||
else
|
||||
HAVE_UNSETENV=1
|
||||
dnl Some BSDs return void, failing to do error checking.
|
||||
AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
|
||||
[AC_TRY_COMPILE([#include <stdlib.h>
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#undef _BSD
|
||||
#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
|
||||
#include <stdlib.h>
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
int unsetenv (const char *name);
|
||||
#else
|
||||
int unsetenv();
|
||||
#endif
|
||||
], , gt_cv_func_unsetenv_ret='int', gt_cv_func_unsetenv_ret='void')])
|
||||
]],
|
||||
[[]])],
|
||||
[gt_cv_func_unsetenv_ret='int'],
|
||||
[gt_cv_func_unsetenv_ret='void'])])
|
||||
if test $gt_cv_func_unsetenv_ret = 'void'; then
|
||||
AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
|
||||
instead of int.])
|
||||
REPLACE_UNSETENV=1
|
||||
AC_LIBOBJ([unsetenv])
|
||||
fi
|
||||
|
||||
dnl Solaris 10 unsetenv does not remove all copies of a name.
|
||||
AC_CACHE_CHECK([whether unsetenv works on duplicates],
|
||||
dnl Haiku alpha 2 unsetenv gets confused by assignment to environ.
|
||||
dnl OpenBSD 4.7 unsetenv("") does not fail.
|
||||
AC_CACHE_CHECK([whether unsetenv obeys POSIX],
|
||||
[gl_cv_func_unsetenv_works],
|
||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
extern char **environ;
|
||||
]], [[
|
||||
char entry[] = "b=2";
|
||||
char entry1[] = "a=1";
|
||||
char entry2[] = "b=2";
|
||||
char *env[] = { entry1, entry2, NULL };
|
||||
if (putenv ((char *) "a=1")) return 1;
|
||||
if (putenv (entry)) return 2;
|
||||
entry[0] = 'a';
|
||||
if (putenv (entry2)) return 2;
|
||||
entry2[0] = 'a';
|
||||
unsetenv ("a");
|
||||
if (getenv ("a")) return 3;
|
||||
if (!unsetenv ("") || errno != EINVAL) return 4;
|
||||
entry2[0] = 'b';
|
||||
environ = env;
|
||||
if (!getenv ("a")) return 5;
|
||||
entry2[0] = 'a';
|
||||
unsetenv ("a");
|
||||
if (getenv ("a")) return 6;
|
||||
]])],
|
||||
[gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
|
||||
[gl_cv_func_unsetenv_works="guessing no"])])
|
||||
if test "$gl_cv_func_unsetenv_works" != yes; then
|
||||
REPLACE_UNSETENV=1
|
||||
AC_LIBOBJ([unsetenv])
|
||||
fi
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_unsetenv_works="guessing no" ;;
|
||||
esac
|
||||
])])
|
||||
case "$gl_cv_func_unsetenv_works" in
|
||||
*yes) ;;
|
||||
*)
|
||||
REPLACE_UNSETENV=1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
# sha1.m4 serial 9
|
||||
dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free Software
|
||||
dnl Foundation, Inc.
|
||||
# sha1.m4 serial 11
|
||||
dnl Copyright (C) 2002-2006, 2008-2013 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_SHA1],
|
||||
[
|
||||
AC_LIBOBJ([sha1])
|
||||
|
||||
dnl Prerequisites of lib/sha1.c.
|
||||
AC_REQUIRE([gl_BIGENDIAN])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
:
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# size_max.m4 serial 9
|
||||
dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
|
||||
# size_max.m4 serial 10
|
||||
dnl Copyright (C) 2003, 2005-2006, 2008-2013 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.
|
||||
|
@ -34,10 +34,14 @@ Found it
|
|||
if test $fits_in_uint = 1; then
|
||||
dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
|
||||
dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
|
||||
AC_TRY_COMPILE([#include <stddef.h>
|
||||
extern size_t foo;
|
||||
extern unsigned long foo;
|
||||
], [], [fits_in_uint=0])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <stddef.h>
|
||||
extern size_t foo;
|
||||
extern unsigned long foo;
|
||||
]],
|
||||
[[]])],
|
||||
[fits_in_uint=0])
|
||||
fi
|
||||
dnl We cannot use 'expr' to simplify this expression, because 'expr'
|
||||
dnl works only with 'long' integers in the host environment, while we
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
# snprintf.m4 serial 5
|
||||
dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
|
||||
# snprintf.m4 serial 6
|
||||
dnl Copyright (C) 2002-2004, 2007-2013 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 Libintl 0.17 will replace snprintf only if it does not support %1$s,
|
||||
dnl but defers to any gnulib snprintf replacements. Therefore, gnulib
|
||||
dnl must guarantee that the decision for replacing snprintf is a superset
|
||||
dnl of the reasons checked by libintl.
|
||||
AC_DEFUN([gl_FUNC_SNPRINTF],
|
||||
[
|
||||
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
||||
|
@ -13,7 +17,17 @@ AC_DEFUN([gl_FUNC_SNPRINTF],
|
|||
gl_SNPRINTF_SIZE1
|
||||
case "$gl_cv_func_snprintf_size1" in
|
||||
*yes)
|
||||
gl_cv_func_snprintf_usable=yes
|
||||
gl_SNPRINTF_RETVAL_C99
|
||||
case "$gl_cv_func_snprintf_retval_c99" in
|
||||
*yes)
|
||||
gl_PRINTF_POSITIONS
|
||||
case "$gl_cv_func_printf_positions" in
|
||||
*yes)
|
||||
gl_cv_func_snprintf_usable=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
|
86
gl/m4/socketlib.m4
Normal file
86
gl/m4/socketlib.m4
Normal file
|
@ -0,0 +1,86 @@
|
|||
# socketlib.m4 serial 1
|
||||
dnl Copyright (C) 2008-2013 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 gl_SOCKETLIB
|
||||
dnl Determines the library to use for socket functions.
|
||||
dnl Sets and AC_SUBSTs LIBSOCKET.
|
||||
|
||||
AC_DEFUN([gl_SOCKETLIB],
|
||||
[
|
||||
gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
|
||||
LIBSOCKET=
|
||||
if test $HAVE_WINSOCK2_H = 1; then
|
||||
dnl Native Windows API (not Cygwin).
|
||||
AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32],
|
||||
[gl_cv_func_wsastartup], [
|
||||
gl_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lws2_32"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
#endif]], [[
|
||||
WORD wVersionRequested = MAKEWORD(1, 1);
|
||||
WSADATA wsaData;
|
||||
int err = WSAStartup(wVersionRequested, &wsaData);
|
||||
WSACleanup ();]])],
|
||||
gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no)
|
||||
LIBS="$gl_save_LIBS"
|
||||
])
|
||||
if test "$gl_cv_func_wsastartup" = "yes"; then
|
||||
AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.])
|
||||
LIBSOCKET='-lws2_32'
|
||||
fi
|
||||
else
|
||||
dnl Unix API.
|
||||
dnl Solaris has most socket functions in libsocket.
|
||||
dnl Haiku has most socket functions in libnetwork.
|
||||
dnl BeOS has most socket functions in libnet.
|
||||
AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
|
||||
gl_cv_lib_socket=
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
char setsockopt();]], [[setsockopt();]])],
|
||||
[],
|
||||
[gl_save_LIBS="$LIBS"
|
||||
LIBS="$gl_save_LIBS -lsocket"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
char setsockopt();]], [[setsockopt();]])],
|
||||
[gl_cv_lib_socket="-lsocket"])
|
||||
if test -z "$gl_cv_lib_socket"; then
|
||||
LIBS="$gl_save_LIBS -lnetwork"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
char setsockopt();]], [[setsockopt();]])],
|
||||
[gl_cv_lib_socket="-lnetwork"])
|
||||
if test -z "$gl_cv_lib_socket"; then
|
||||
LIBS="$gl_save_LIBS -lnet"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
char setsockopt();]], [[setsockopt();]])],
|
||||
[gl_cv_lib_socket="-lnet"])
|
||||
fi
|
||||
fi
|
||||
LIBS="$gl_save_LIBS"
|
||||
])
|
||||
if test -z "$gl_cv_lib_socket"; then
|
||||
gl_cv_lib_socket="none needed"
|
||||
fi
|
||||
])
|
||||
if test "$gl_cv_lib_socket" != "none needed"; then
|
||||
LIBSOCKET="$gl_cv_lib_socket"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([LIBSOCKET])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# sockets.m4 serial 6
|
||||
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# sockets.m4 serial 7
|
||||
dnl Copyright (C) 2008-2013 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,80 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_SOCKETS],
|
||||
[
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
|
||||
gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
|
||||
LIBSOCKET=
|
||||
if test $HAVE_WINSOCK2_H = 1; then
|
||||
dnl Native Windows API (not Cygwin).
|
||||
AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32],
|
||||
[gl_cv_func_wsastartup], [
|
||||
gl_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lws2_32"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
#endif]], [[
|
||||
WORD wVersionRequested = MAKEWORD(1, 1);
|
||||
WSADATA wsaData;
|
||||
int err = WSAStartup(wVersionRequested, &wsaData);
|
||||
WSACleanup ();]])],
|
||||
gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no)
|
||||
LIBS="$gl_save_LIBS"
|
||||
])
|
||||
if test "$gl_cv_func_wsastartup" = "yes"; then
|
||||
AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.])
|
||||
LIBSOCKET='-lws2_32'
|
||||
fi
|
||||
else
|
||||
dnl Unix API.
|
||||
dnl Solaris has most socket functions in libsocket.
|
||||
dnl Haiku has most socket functions in libnetwork.
|
||||
dnl BeOS has most socket functions in libnet.
|
||||
AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
|
||||
gl_cv_lib_socket=
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
char setsockopt();]], [[setsockopt();]])],
|
||||
[],
|
||||
[gl_save_LIBS="$LIBS"
|
||||
LIBS="$gl_save_LIBS -lsocket"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
char setsockopt();]], [[setsockopt();]])],
|
||||
[gl_cv_lib_socket="-lsocket"])
|
||||
if test -z "$gl_cv_lib_socket"; then
|
||||
LIBS="$gl_save_LIBS -lnetwork"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
char setsockopt();]], [[setsockopt();]])],
|
||||
[gl_cv_lib_socket="-lnetwork"])
|
||||
if test -z "$gl_cv_lib_socket"; then
|
||||
LIBS="$gl_save_LIBS -lnet"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
char setsockopt();]], [[setsockopt();]])],
|
||||
[gl_cv_lib_socket="-lnet"])
|
||||
fi
|
||||
fi
|
||||
LIBS="$gl_save_LIBS"
|
||||
])
|
||||
if test -z "$gl_cv_lib_socket"; then
|
||||
gl_cv_lib_socket="none needed"
|
||||
fi
|
||||
])
|
||||
if test "$gl_cv_lib_socket" != "none needed"; then
|
||||
LIBSOCKET="$gl_cv_lib_socket"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([LIBSOCKET])
|
||||
AC_REQUIRE([gl_SOCKETLIB])
|
||||
gl_PREREQ_SOCKETS
|
||||
])
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# socklen.m4 serial 7
|
||||
dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
# socklen.m4 serial 10
|
||||
dnl Copyright (C) 2005-2007, 2009-2013 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,15 +8,12 @@ dnl From Albert Chin, Windows fixes from Simon Josefsson.
|
|||
|
||||
dnl Check for socklen_t: historically on BSD it is an int, and in
|
||||
dnl POSIX 1g it is a type of its own, but some platforms use different
|
||||
dnl types for the argument to getsockopt, getpeername, etc. So we
|
||||
dnl have to test to find something that will work.
|
||||
dnl types for the argument to getsockopt, getpeername, etc.:
|
||||
dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS.
|
||||
dnl So we 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 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_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
|
||||
AC_CHECK_TYPE([socklen_t], ,
|
||||
[AC_MSG_CHECKING([for socklen_t equivalent])
|
||||
AC_CACHE_VAL([gl_cv_socklen_t_equiv],
|
||||
|
@ -44,9 +41,37 @@ AC_DEFUN([gl_TYPE_SOCKLEN_T],
|
|||
AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
|
||||
AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
|
||||
[type to use in place of socklen_t if not defined])],
|
||||
[#include <sys/types.h>
|
||||
#if HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#elif HAVE_WS2TCPIP_H
|
||||
# include <ws2tcpip.h>
|
||||
#endif])])
|
||||
[gl_SOCKET_HEADERS])])
|
||||
|
||||
dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
|
||||
dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users
|
||||
dnl of this module should use the same include pattern as gl_SOCKET_HEADERS.
|
||||
dnl When you change this macro, keep also in sync:
|
||||
dnl - gl_CHECK_SOCKET_HEADERS,
|
||||
dnl - the Include section of modules/socklen.
|
||||
AC_DEFUN([gl_SOCKET_HEADERS],
|
||||
[
|
||||
/* <sys/types.h> is not needed according to POSIX, but the
|
||||
<sys/socket.h> in i386-unknown-freebsd4.10 and
|
||||
powerpc-apple-darwin5.5 required it. */
|
||||
#include <sys/types.h>
|
||||
#if HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#elif HAVE_WS2TCPIP_H
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
])
|
||||
|
||||
dnl Tests for the existence of the header for socket facilities.
|
||||
dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H.
|
||||
dnl This macro must match gl_SOCKET_HEADERS.
|
||||
AC_DEFUN([gl_CHECK_SOCKET_HEADERS],
|
||||
[AC_CHECK_HEADERS_ONCE([sys/socket.h])
|
||||
if test $ac_cv_header_sys_socket_h = no; then
|
||||
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([ws2tcpip.h])
|
||||
fi
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# sockpfaf.m4 serial 7
|
||||
dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
|
||||
# sockpfaf.m4 serial 8
|
||||
dnl Copyright (C) 2004, 2006, 2009-2013 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.
|
||||
|
@ -59,3 +59,29 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
|
|||
AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
|
||||
[
|
||||
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
|
||||
AC_CHECK_HEADERS_ONCE([sys/un.h])
|
||||
|
||||
AC_MSG_CHECKING([for UNIX domain sockets])
|
||||
AC_CACHE_VAL([gl_cv_socket_unix],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_UN_H
|
||||
#include <sys/un.h>
|
||||
#endif
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif]],
|
||||
[[int x = AF_UNIX; struct sockaddr_un y;
|
||||
if (&x && &y) return 0;]])],
|
||||
gl_cv_socket_unix=yes, gl_cv_socket_unix=no)])
|
||||
AC_MSG_RESULT([$gl_cv_socket_unix])
|
||||
if test $gl_cv_socket_unix = yes; then
|
||||
AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.])
|
||||
fi
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# ssize_t.m4 serial 4 (gettext-0.15)
|
||||
dnl Copyright (C) 2001-2003, 2006, 2009-2010 Free Software Foundation, Inc.
|
||||
# ssize_t.m4 serial 5 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2001-2003, 2006, 2010-2013 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.
|
||||
|
@ -10,9 +10,11 @@ dnl Test whether ssize_t is defined.
|
|||
AC_DEFUN([gt_TYPE_SSIZE_T],
|
||||
[
|
||||
AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
|
||||
[AC_TRY_COMPILE([#include <sys/types.h>],
|
||||
[int x = sizeof (ssize_t *) + sizeof (ssize_t);
|
||||
return !x;],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>]],
|
||||
[[int x = sizeof (ssize_t *) + sizeof (ssize_t);
|
||||
return !x;]])],
|
||||
[gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
|
||||
if test $gt_cv_ssize_t = no; then
|
||||
AC_DEFINE([ssize_t], [int],
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue