Commit dfe13614 dfe136143306b3b190bb69473432ad10e1d03a0e by Sergey Poznyakoff

Remove

1 parent 81b0da52
# absolute-header.m4 serial 6
dnl Copyright (C) 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Derek Price.
# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
# ---------------------------------------
# Find the absolute name of a header file, assuming the header exists.
# If the header were sys/inttypes.h, this macro would define
# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h
# in config.h
# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
# The three "///" are to pacify Sun C 5.8, which otherwise would say
# "warning: #include of /usr/include/... may be non-portable".
# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
AC_DEFUN([gl_ABSOLUTE_HEADER],
[AC_LANG_PREPROC_REQUIRE()dnl
AC_FOREACH([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_absolute_header],
[gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
m4_quote(m4_defn([gl_absolute_header])),
[AS_VAR_PUSHDEF([ac_header_exists],
[ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
if test AS_VAR_GET(ac_header_exists) = yes; then
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
dnl eval is necessary to expand ac_cpp.
dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
AS_VAR_SET(gl_absolute_header,
[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;s#^/[^/]#//&#;p;q;}'`])
fi
AS_VAR_POPDEF([ac_header_exists])dnl
])dnl
AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))),
["AS_VAR_GET(gl_absolute_header)"],
[Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
AS_VAR_POPDEF([gl_absolute_header])dnl
])dnl
])# gl_ABSOLUTE_HEADER
# alloca.m4 serial 5
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_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
fi
# Define an additional variable used in the Makefile substitution.
if test $ac_cv_working_alloca_h = yes; then
AC_EGREP_CPP([Need own alloca], [
#if defined __GNUC__ || defined _AIX || defined _MSC_VER
Need own alloca
#endif
],
[AC_DEFINE(HAVE_ALLOCA, 1,
[Define to 1 if you have `alloca' after including <alloca.h>,
a header that may be supplied by this distribution.])
ALLOCA_H=alloca.h],
[ALLOCA_H=])
else
ALLOCA_H=alloca.h
fi
AC_SUBST([ALLOCA_H])
AC_DEFINE(HAVE_ALLOCA_H, 1,
[Define HAVE_ALLOCA_H for backward compatibility with older code
that includes <alloca.h> only if HAVE_ALLOCA_H is defined.])
])
# Prerequisites of lib/alloca.c.
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
# allocsa.m4 serial 3
dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ALLOCSA],
[
dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables
dnl @ALLOCA@ and @LTALLOCA@.
AC_REQUIRE([gl_FUNC_ALLOCA])
AC_REQUIRE([gl_EEMALLOC])
AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
])
# argp.m4 serial 7
dnl Copyright (C) 2003-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ARGP],
[
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_GETOPT_SUBSTITUTE])
AC_CHECK_DECL([program_invocation_name],
[AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_NAME, 1,
[Define if program_invocation_name is declared])],
[AC_DEFINE(GNULIB_PROGRAM_INVOCATION_NAME, 1,
[Define to 1 to add extern declaration of program_invocation_name to argp.h])],
[#include <errno.h>])
AC_CHECK_DECL([program_invocation_short_name],
[AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME, 1,
[Define if program_invocation_short_name is declared])],
[AC_DEFINE(GNULIB_PROGRAM_INVOCATION_SHORT_NAME, 1,
[Define to 1 to add extern declaration of program_invocation_short_name to argp.h])],
[#include <errno.h>])
# Check if program_invocation_name and program_invocation_short_name
# are defined elsewhere. It is improbable that only one of them will
# be defined and other not, I prefer to stay on the safe side and to
# test each one separately.
AC_MSG_CHECKING(whether program_invocation_name is defined)
AC_TRY_COMPILE([#include <argp.h>],
[ program_invocation_name = "test"; ],
[ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1,
[Define if program_invocation_name is defined])
AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no)] )
AC_MSG_CHECKING(whether program_invocation_short_name is defined)
AC_TRY_COMPILE([#include <argp.h>],
[ program_invocation_short_name = "test"; ],
[ AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME,1,
[Define if program_invocation_short_name is defined])
AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no)] )
AC_CHECK_DECLS_ONCE([clearerr_unlocked])
AC_CHECK_DECLS_ONCE([feof_unlocked])
AC_CHECK_DECLS_ONCE([ferror_unlocked])
AC_CHECK_DECLS_ONCE([fflush_unlocked])
AC_CHECK_DECLS_ONCE([fgets_unlocked])
AC_CHECK_DECLS_ONCE([fputc_unlocked])
AC_CHECK_DECLS_ONCE([fputs_unlocked])
AC_CHECK_DECLS_ONCE([fread_unlocked])
AC_CHECK_DECLS_ONCE([fwrite_unlocked])
AC_CHECK_DECLS_ONCE([getc_unlocked])
AC_CHECK_DECLS_ONCE([getchar_unlocked])
AC_CHECK_DECLS_ONCE([putc_unlocked])
AC_CHECK_DECLS_ONCE([putchar_unlocked])
AC_CHECK_FUNCS_ONCE([flockfile funlockfile])
AC_CHECK_HEADERS_ONCE([features.h linewrap.h])
])
# codeset.m4 serial AM1 (gettext-0.10.40)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
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);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
])
#serial 9
dnl From Jim Meyering.
dnl
dnl Check whether struct dirent has a member named d_type.
dnl
# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
# Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
[AC_CACHE_CHECK([for d_type member in directory struct],
jm_cv_struct_dirent_d_type,
[AC_TRY_LINK(dnl
[
#include <sys/types.h>
#include <dirent.h>
],
[struct dirent dp; dp.d_type = 0;],
jm_cv_struct_dirent_d_type=yes,
jm_cv_struct_dirent_d_type=no)
]
)
if test $jm_cv_struct_dirent_d_type = yes; then
AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
[Define if there is a member named d_type in the struct describing
directory headers.])
fi
]
)
# eealloc.m4 serial 1
dnl Copyright (C) 2003 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_EEALLOC],
[
AC_REQUIRE([gl_EEMALLOC])
AC_REQUIRE([gl_EEREALLOC])
AC_REQUIRE([AC_C_INLINE])
])
AC_DEFUN([gl_EEMALLOC],
[
_AC_FUNC_MALLOC_IF(
[gl_cv_func_malloc_0_nonnull=1],
[gl_cv_func_malloc_0_nonnull=0])
AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], $gl_cv_func_malloc_0_nonnull,
[If malloc(0) is != NULL, define this to 1. Otherwise define this
to 0.])
])
AC_DEFUN([gl_EEREALLOC],
[
_AC_FUNC_REALLOC_IF(
[gl_cv_func_realloc_0_nonnull=1],
[gl_cv_func_realloc_0_nonnull=0])
AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], $gl_cv_func_realloc_0_nonnull,
[If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this
to 0.])
])
# eoverflow.m4 serial 1
dnl Copyright (C) 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
# POSIX. But some systems (like AIX 3) don't define it, and some systems
# (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
# Define EOVERFLOW as a C macro and as a substituted macro in such a way that
# 1. on all systems, after inclusion of <errno.h>, EOVERFLOW is usable,
# 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric
# value.
AC_DEFUN([gl_EOVERFLOW],
[
AC_REQUIRE([AC_PROG_CC])dnl
AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [
AC_EGREP_CPP(yes,[
#include <errno.h>
#ifdef EOVERFLOW
yes
#endif
], have_eoverflow=1)
if test -n "$have_eoverflow"; then
dnl EOVERFLOW exists in <errno.h>. Don't need to define EOVERFLOW ourselves.
ac_cv_decl_EOVERFLOW=yes
else
AC_EGREP_CPP(yes,[
#define _XOPEN_SOURCE_EXTENDED 1
#include <errno.h>
#ifdef EOVERFLOW
yes
#endif
], have_eoverflow=1)
if test -n "$have_eoverflow"; then
dnl EOVERFLOW exists but is hidden.
dnl Define it to the same value.
_AC_COMPUTE_INT([EOVERFLOW], ac_cv_decl_EOVERFLOW, [
#define _XOPEN_SOURCE_EXTENDED 1
#include <errno.h>
/* The following two lines are a workaround against an autoconf-2.52 bug. */
#include <stdio.h>
#include <stdlib.h>
])
else
dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but
dnl don't define it as EINVAL, because snprintf() callers want to
dnl distinguish EINVAL and EOVERFLOW.
ac_cv_decl_EOVERFLOW=E2BIG
fi
fi
])
if test "$ac_cv_decl_EOVERFLOW" != yes; then
AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW],
[Define as good substitute value for EOVERFLOW.])
EOVERFLOW="$ac_cv_decl_EOVERFLOW"
AC_SUBST(EOVERFLOW)
fi
])
#serial 11
# Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004 Free Software
# Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ERROR],
[
AC_FUNC_ERROR_AT_LINE
dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
gl_PREREQ_ERROR
])
# Prerequisites of lib/error.c.
AC_DEFUN([gl_PREREQ_ERROR],
[
AC_REQUIRE([AC_FUNC_STRERROR_R])
:
])
# exitfail.m4 serial 6
dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_EXITFAIL],
[
AC_LIBOBJ([exitfail])
dnl No prerequisites of lib/exitfail.c.
:
])
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006 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 file is only needed in autoconf <= 2.59. Newer versions of autoconf
# have a macro AC_USE_SYSTEM_EXTENSIONS with identical semantics.
# gl_USE_SYSTEM_EXTENSIONS
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [
AC_BEFORE([$0], [AC_COMPILE_IFELSE])
AC_BEFORE([$0], [AC_RUN_IFELSE])
AC_REQUIRE([AC_GNU_SOURCE])
AC_REQUIRE([AC_AIX])
AC_REQUIRE([AC_MINIX])
AH_VERBATIM([__EXTENSIONS__],
[/* Enable extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif])
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
[ac_cv_safe_to_define___extensions__],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
#define __EXTENSIONS__ 1
AC_INCLUDES_DEFAULT])],
[ac_cv_safe_to_define___extensions__=yes],
[ac_cv_safe_to_define___extensions__=no])])
test $ac_cv_safe_to_define___extensions__ = yes &&
AC_DEFINE([__EXTENSIONS__])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
])
# Check for fnmatch.
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 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.
# Autoconf defines AC_FUNC_FNMATCH, but that is obsolescent.
# New applications should use the macros below instead.
# _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE)
# -------------------------------------------------------------------------
# If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise
# IF-FALSE. Use CACHE_VAR.
AC_DEFUN([_AC_FUNC_FNMATCH_IF],
[AC_CACHE_CHECK(
[for working $1 fnmatch],
[$2],
[dnl Some versions of Solaris, SCO, and the GNU C Library
dnl have a broken or incompatible fnmatch.
dnl So we run a test program. If we are cross-compiling, take no chance.
dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this test.
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[
# include <stdlib.h>
# include <fnmatch.h>
# define y(a, b, c) (fnmatch (a, b, c) == 0)
# define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
static int
fnm (char const *pattern, char const *string, int flags)
{
return fnmatch (pattern, string, flags);
}
],
[exit
(!((fnm ? fnm : fnmatch) ("a*", "", 0) == FNM_NOMATCH
&& y ("a*", "abc", 0)
&& n ("d*/*1", "d/s/1", FNM_PATHNAME)
&& y ("a\\\\bc", "abc", 0)
&& n ("a\\\\bc", "abc", FNM_NOESCAPE)
&& y ("*x", ".x", 0)
&& n ("*x", ".x", FNM_PERIOD)
&& m4_if([$1], [GNU],
[y ("xxXX", "xXxX", FNM_CASEFOLD)
&& y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)
&& n ("d*/*1", "d/s/1", FNM_FILE_NAME)
&& y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)
&& y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)
&& y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)],
1)));])],
[$2=yes],
[$2=no],
[$2=cross])])
AS_IF([test $$2 = yes], [$3], [$4])
])# _AC_FUNC_FNMATCH_IF
# _MU_LIBOBJ_FNMATCH
# ------------------
# Prepare the replacement of fnmatch.
AC_DEFUN([_MU_LIBOBJ_FNMATCH],
[AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl
AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy])
AC_CHECK_HEADERS([wchar.h wctype.h])
MU_LIBOBJ([fnmatch])
FNMATCH_H=fnmatch.h
])# _MU_LIBOBJ_FNMATCH
AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
[
FNMATCH_H=
_AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_posix],
[rm -f lib/fnmatch.h],
[_MU_LIBOBJ_FNMATCH])
if test $ac_cv_func_fnmatch_posix != yes; then
dnl We must choose a different name for our function, since on ELF systems
dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
dnl compiled into a shared library.
AC_DEFINE([fnmatch], [posix_fnmatch],
[Define to a replacement function name for fnmatch().])
fi
AC_SUBST([FNMATCH_H])
])
AC_DEFUN([gl_FUNC_FNMATCH_GNU],
[
dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
AC_REQUIRE([AC_GNU_SOURCE])
FNMATCH_H=
_AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
[rm -f lib/fnmatch.h],
[_MU_LIBOBJ_FNMATCH])
if test $ac_cv_func_fnmatch_gnu != yes; then
dnl We must choose a different name for our function, since on ELF systems
dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
dnl compiled into a shared library.
AC_DEFINE([fnmatch], [gnu_fnmatch],
[Define to a replacement function name for fnmatch().])
fi
AC_SUBST([FNMATCH_H])
])
# full-header-path.m4 serial 2
dnl Copyright (C) 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Derek Price.
# gl_FULL_HEADER_PATH(HEADER1 HEADER2 ...)
# ----------------------------------------
# Find the full path to a header file, assuming the header exists.
# If the header were sys/inttypes.h, this macro would define
# FULL_PATH_SYS_INTTYPES_H to the `<>' quoted full path to sys/inttypes.h
# in config.h
# (e.g. `#define FULL_PATH_SYS_INTTYPES_H </usr/include/sys/inttypes.h>').
AC_DEFUN([gl_FULL_HEADER_PATH],
[AC_LANG_PREPROC_REQUIRE()dnl
AC_FOREACH([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_full_header_path],
[gl_cv_full_path_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
AC_CACHE_CHECK([full path to <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
m4_quote(m4_defn([gl_full_header_path])),
[AS_VAR_PUSHDEF([ac_header_exists],
[ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
if test AS_VAR_GET(ac_header_exists) = yes; then
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
dnl eval is necessary to expand ac_cpp.
dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
AS_VAR_SET(gl_full_header_path,
[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;p;q;}'`])
fi
AS_VAR_POPDEF([ac_header_exists])dnl
])dnl
AC_DEFINE_UNQUOTED(AS_TR_CPP([FULL_PATH_]m4_quote(m4_defn([gl_HEADER_NAME]))),
[<AS_VAR_GET(gl_full_header_path)>],
[Define this to the full path to <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
AS_VAR_POPDEF([gl_full_header_path])dnl
])dnl
])# gl_FULL_HEADER_PATH
# getdelim.m4 serial 2
dnl Copyright (C) 2005, 2006 Free Software dnl Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_PREREQ(2.52)
AC_DEFUN([gl_FUNC_GETDELIM],
[
dnl Persuade glibc <stdio.h> to declare getdelim().
AC_REQUIRE([AC_GNU_SOURCE])
MU_REPLACE_FUNCS(getdelim)
AC_CHECK_DECLS_ONCE(getdelim)
if test $ac_cv_func_getdelim = no; then
gl_PREREQ_GETDELIM
fi
])
# Prerequisites of lib/getdelim.c.
AC_DEFUN([gl_PREREQ_GETDELIM],
[
AC_CHECK_FUNCS([flockfile funlockfile])
])
# getline.m4 serial 15
dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software
dnl Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_PREREQ(2.52)
dnl See if there's a working, system-supplied version of the getline function.
dnl We can't just do MU_REPLACE_FUNCS(getline) because some systems
dnl have a function by that name in -linet that doesn't have anything
dnl to do with the function we need.
AC_DEFUN([gl_FUNC_GETLINE],
[
dnl Persuade glibc <stdio.h> to declare getline().
AC_REQUIRE([AC_GNU_SOURCE])
AC_CHECK_DECLS([getline])
gl_getline_needs_run_time_check=no
AC_CHECK_FUNC(getline,
dnl Found it in some library. Verify that it works.
gl_getline_needs_run_time_check=yes,
am_cv_func_working_getline=no)
if test $gl_getline_needs_run_time_check = yes; then
AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data
AC_TRY_RUN([
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
int main ()
{ /* Based on a test program from Karl Heuer. */
char *line = NULL;
size_t siz = 0;
int len;
FILE *in = fopen ("./conftest.data", "r");
if (!in)
return 1;
len = getline (&line, &siz, in);
exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
}
], am_cv_func_working_getline=yes dnl The library version works.
, am_cv_func_working_getline=no dnl The library version does NOT work.
, dnl We're cross compiling. Assume it works on glibc2 systems.
[AC_EGREP_CPP([Lucky GNU user],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ >= 2)
Lucky GNU user
#endif
#endif
],
[am_cv_func_working_getline=yes],
[am_cv_func_working_getline=no])]
)])
fi
if test $am_cv_func_working_getline = no; then
dnl We must choose a different name for our function, since on ELF systems
dnl a broken getline() in libc.so would override our getline() in
dnl libgettextlib.so.
AC_DEFINE([getline], [gnu_getline],
[Define to a replacement function name for getline().])
MU_LIBOBJ(getline)
gl_PREREQ_GETLINE
fi
])
# Prerequisites of lib/getline.c.
AC_DEFUN([gl_PREREQ_GETLINE],
[
gl_FUNC_GETDELIM
])
#serial 3
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl From Derek Price
dnl
dnl Provide getlogin_r when the system lacks it.
dnl
AC_DEFUN([gl_GETLOGIN_R_SUBSTITUTE],
[
gl_PREREQ_GETLOGIN_R
MU_LIBOBJ([getlogin_r])
])
AC_DEFUN([gl_GETLOGIN_R],
[
MU_REPLACE_FUNCS([getlogin_r])
if test $ac_cv_func_getlogin_r = no; then
gl_GETLOGIN_R_SUBSTITUTE
fi
])
AC_DEFUN([gl_PREREQ_GETLOGIN_R],
[
AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_DECLS_ONCE([getlogin])
AC_CHECK_DECLS_ONCE([getlogin_r])
])
# getndelim2.m4 serial 4
dnl Copyright (C) 2003 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_GETNDELIM2],
[
# Avoid multiple inclusions of getndelim2.o into LIBOBJS.
# This hack won't be needed after gnulib requires Autoconf 2.58 or later.
case " $LIB@&t@OBJS " in
*" getndelim2.$ac_objext "* ) ;;
*) MU_LIBOBJ(getndelim2);;
esac
gl_PREREQ_GETNDELIM2
])
# Prerequisites of lib/getndelim2.h and lib/getndelim2.c.
AC_DEFUN([gl_PREREQ_GETNDELIM2],
[
dnl Prerequisites of lib/getndelim2.h.
AC_REQUIRE([gt_TYPE_SSIZE_T])
dnl No prerequisites of lib/getndelim2.c.
])
# getopt.m4 serial 13
dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# The getopt module assume you want GNU getopt, with getopt_long etc,
# rather than vanilla POSIX getopt. This means your code should
# always include <getopt.h> for the getopt prototypes.
AC_DEFUN([gl_GETOPT_SUBSTITUTE],
[
MU_LIBOBJ([getopt])
MU_LIBOBJ([getopt1])
gl_GETOPT_SUBSTITUTE_HEADER
gl_PREREQ_GETOPT
])
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
[
GETOPT_H=getopt.h
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
[Define to rpl_ if the getopt replacement functions and variables
should be used.])
AC_SUBST([GETOPT_H])
])
AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
[
if test -z "$GETOPT_H"; then
AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
fi
if test -z "$GETOPT_H"; then
AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
fi
dnl BSD getopt_long uses an incompatible method to reset option processing,
dnl and (as of 2004-10-15) mishandles optional option-arguments.
if test -z "$GETOPT_H"; then
AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
fi
dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
dnl option string (as of 2005-05-05).
if test -z "$GETOPT_H"; then
AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([#include <getopt.h>],
[[
char *myargv[3];
myargv[0] = "conftest";
myargv[1] = "-+";
myargv[2] = 0;
return getopt (2, myargv, "+a") != '?';
]])],
[gl_cv_func_gnu_getopt=yes],
[gl_cv_func_gnu_getopt=no],
[dnl cross compiling - pessimistically guess based on decls
dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
dnl option string (as of 2005-05-05).
AC_CHECK_DECL([getopt_clip],
[gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
[#include <getopt.h>])])])
if test "$gl_cv_func_gnu_getopt" = "no"; then
GETOPT_H=getopt.h
fi
fi
])
AC_DEFUN([gl_GETOPT_IFELSE],
[
AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
AS_IF([test -n "$GETOPT_H"], [$1], [$2])
])
AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
# Prerequisites of lib/getopt*.
AC_DEFUN([gl_PREREQ_GETOPT],
[
AC_CHECK_DECLS_ONCE([getenv])
])
# getpass.m4 serial 9
dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Provide a getpass() function if the system doesn't have it.
AC_DEFUN([gl_FUNC_GETPASS],
[
AC_REPLACE_FUNCS(getpass)
AC_CHECK_DECLS_ONCE(getpass)
if test $ac_cv_func_getpass = no; then
gl_PREREQ_GETPASS
fi
])
# Provide the GNU getpass() implementation. It supports passwords of
# arbitrary length (not just 8 bytes as on HP-UX).
AC_DEFUN([gl_FUNC_GETPASS_GNU],
[
AC_CHECK_DECLS_ONCE(getpass)
dnl TODO: Detect when GNU getpass() is already found in glibc.
AC_LIBOBJ(getpass)
gl_PREREQ_GETPASS
dnl We must choose a different name for our function, since on ELF systems
dnl an unusable getpass() in libc.so would override our getpass() if it is
dnl compiled into a shared library.
AC_DEFINE([getpass], [gnu_getpass],
[Define to a replacement function name for getpass().])
])
# Prerequisites of lib/getpass.c.
AC_DEFUN([gl_PREREQ_GETPASS], [
AC_CHECK_HEADERS_ONCE(stdio_ext.h termios.h)
AC_CHECK_FUNCS_ONCE(__fsetlocking tcgetattr tcsetattr)
AC_CHECK_DECLS_ONCE([fflush_unlocked])
AC_CHECK_DECLS_ONCE([flockfile])
AC_CHECK_DECLS_ONCE([fputs_unlocked])
AC_CHECK_DECLS_ONCE([funlockfile])
AC_CHECK_DECLS_ONCE([putc_unlocked])
:
])
# glibc2.m4 serial 1
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Test for the GNU C Library, version 2.0 or newer.
# From Bruno Haible.
AC_DEFUN([gt_GLIBC2],
[
AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
ac_cv_gnu_library_2,
[AC_EGREP_CPP([Lucky GNU user],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ >= 2)
Lucky GNU user
#endif
#endif
],
ac_cv_gnu_library_2=yes,
ac_cv_gnu_library_2=no)
]
)
AC_SUBST(GLIBC2)
GLIBC2="$ac_cv_gnu_library_2"
]
)
# glibc21.m4 serial 3
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Test for the GNU C Library, version 2.1 or newer.
# From Bruno Haible.
AC_DEFUN([gl_GLIBC21],
[
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
ac_cv_gnu_library_2_1,
[AC_EGREP_CPP([Lucky GNU user],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
Lucky GNU user
#endif
#endif
],
ac_cv_gnu_library_2_1=yes,
ac_cv_gnu_library_2_1=no)
]
)
AC_SUBST(GLIBC21)
GLIBC21="$ac_cv_gnu_library_2_1"
]
)
# glob.m4 serial 7
dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# The glob module assumes you want GNU glob, with glob_pattern_p etc,
# rather than vanilla POSIX glob. This means your code should
# always include <glob.h> for the glob prototypes.
AC_DEFUN([gl_GLOB_SUBSTITUTE],
[
gl_PREREQ_GLOB
GLOB_H=glob.h
MU_LIBOBJ([glob])
AC_SUBST([GLOB_H])
])
AC_DEFUN([gl_GLOB],
[ GLOB_H=
AC_CHECK_HEADERS([glob.h], [], [GLOB_H=glob.h])
if test -z "$GLOB_H"; then
AC_CACHE_CHECK([for GNU glob interface version 1],
[gl_cv_gnu_glob_interface_version_1],
[ AC_COMPILE_IFELSE(
[[#include <gnu-versions.h>
char a[_GNU_GLOB_INTERFACE_VERSION == 1 ? 1 : -1];]],
[gl_cv_gnu_glob_interface_version_1=yes],
[gl_cv_gnu_glob_interface_version_1=no])])
if test "$gl_cv_gnu_glob_interface_version_1" = "no"; then
GLOB_H=glob.h
fi
fi
if test -z "$GLOB_H"; then
AC_CACHE_CHECK([whether glob lists broken symlinks],
[gl_cv_glob_lists_symlinks],
[ if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
gl_cv_glob_lists_symlinks=maybe
else
# If we can't make a symlink, then we cannot test this issue. Be
# pessimistic about this.
gl_cv_glob_lists_symlinks=no
fi
if test $gl_cv_glob_lists_symlinks = maybe; then
AC_RUN_IFELSE(
AC_LANG_PROGRAM(
[[#include <stddef.h>
#include <glob.h>]],
[[glob_t found;
if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH) return 1;]]),
[gl_cv_glob_lists_symlinks=yes],
[gl_cv_glob_lists_symlinks=no], [gl_cv_glob_lists_symlinks=no])
fi])
if test $gl_cv_glob_lists_symlinks = no; then
GLOB_H=glob.h
fi
fi
rm -f conf$$-globtest
if test -n "$GLOB_H"; then
gl_GLOB_SUBSTITUTE
fi
])
# Prerequisites of lib/glob.*.
AC_DEFUN([gl_PREREQ_GLOB],
[ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])dnl
AC_REQUIRE([AC_C_RESTRICT])dnl
AC_REQUIRE([AC_GNU_SOURCE])dnl
AC_CHECK_HEADERS_ONCE([sys/cdefs.h unistd.h])dnl
AC_CHECK_FUNCS_ONCE([getlogin_r getpwnam_r])dnl
:])
# This file is generated automatically. Please, do not edit.
#
AC_DEFUN([libmuaux_GNULIB],[
# allocsa
gl_ALLOCSA
# error
gl_ERROR
# exit
# exitfail
gl_EXITFAIL
# xalloc
gl_XALLOC
# xalloc
gl_XALLOC
# getpass-gnu
gl_FUNC_GETPASS_GNU
# mbswidth
gl_MBSWIDTH
# obstack
AC_FUNC_OBSTACK
dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]).
# realloc
AC_FUNC_REALLOC
# setenv
gt_FUNC_SETENV
# snprintf
gl_FUNC_SNPRINTF
# vasprintf
gl_FUNC_VASPRINTF
# xalloc-die
# xsize
gl_XSIZE
])
AC_DEFUN([libmailutils_GNULIB],[
# alloca
# alloca-opt
gl_FUNC_ALLOCA
# argp
gl_ARGP
# getline
gl_FUNC_GETLINE
# regex
gl_REGEX
# strtok_r
gl_FUNC_STRTOK_R
# md5
gl_MD5
# glob
gl_GLOB
# inttostr
gl_INTTOSTR
# sha1
gl_SHA1
# d-type
gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE
# extensions
dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac.
# fnmatch
# No macro. You should also use one of fnmatch-posix or fnmatch-gnu.
# getdelim
gl_FUNC_GETDELIM
# getlogin_r
gl_GETLOGIN_R
# getopt
gl_GETOPT
# gettext-h
# intprops
# malloc
AC_FUNC_MALLOC
# mbchar
gl_MBCHAR
# mbuiter
gl_MBITER
# memchr
gl_FUNC_MEMCHR
# mempcpy
gl_FUNC_MEMPCPY
# minmax
gl_MINMAX
# size_max
gl_SIZE_MAX
# ssize_t
gt_TYPE_SSIZE_T
# stat-macros
gl_STAT_MACROS
# stdbool
AM_STDBOOL_H
# stdint
gl_STDINT_H
# strcase
gl_STRCASE
# strchrnul
gl_FUNC_STRCHRNUL
# strdup
gl_FUNC_STRDUP
# strndup
gl_FUNC_STRNDUP
# strnlen
gl_FUNC_STRNLEN
# strnlen1
# sysexits
gl_SYSEXITS
# unistd
gl_HEADER_UNISTD
# vasnprintf
gl_FUNC_VASNPRINTF
# vsnprintf
gl_FUNC_VSNPRINTF
# wcwidth
gl_FUNC_WCWIDTH
# xsize
gl_XSIZE
])
# iconv.m4 serial AM4 (gettext-0.11.3)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([iconv])
])
AC_DEFUN([AM_ICONV_LINK],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
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.
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);],
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);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
fi
if test "$am_cv_lib_iconv" = yes; then
AC_MSG_CHECKING([how to link with libiconv])
AC_MSG_RESULT([$LIBICONV])
else
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
dnl either.
CPPFLAGS="$am_save_CPPFLAGS"
LIBICONV=
LTLIBICONV=
fi
AC_SUBST(LIBICONV)
AC_SUBST(LTLIBICONV)
])
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([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || 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="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([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
])
# intdiv0.m4 serial 1 (gettext-0.11.3)
dnl Copyright (C) 2002 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_DEFUN([gt_INTDIV0],
[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
gt_cv_int_divbyzero_sigfpe,
[
AC_TRY_RUN([
#include <stdlib.h>
#include <signal.h>
static void
#ifdef __cplusplus
sigfpe_handler (int sig)
#else
sigfpe_handler (sig) int sig;
#endif
{
/* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
exit (sig != SIGFPE);
}
int x = 1;
int y = 0;
int z;
int nan;
int main ()
{
signal (SIGFPE, sigfpe_handler);
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
signal (SIGTRAP, sigfpe_handler);
#endif
/* Linux/SPARC yields signal SIGILL. */
#if defined (__sparc__) && defined (__linux__)
signal (SIGILL, sigfpe_handler);
#endif
z = x / y;
nan = y / y;
exit (1);
}
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
[
# Guess based on the CPU.
case "$host_cpu" in
alpha* | i[34567]86 | m68k | s390*)
gt_cv_int_divbyzero_sigfpe="guessing yes";;
*)
gt_cv_int_divbyzero_sigfpe="guessing no";;
esac
])
])
case "$gt_cv_int_divbyzero_sigfpe" in
*yes) value=1;;
*) value=0;;
esac
AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
[Define if integer division by zero raises signal SIGFPE.])
])
# isc-posix.m4 serial 2 (gettext-0.11.2)
dnl Copyright (C) 1995-2002 Free Software Foundation, 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 that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
# This test replaces the one in autoconf.
# Currently this macro should have the same name as the autoconf macro
# because gettext's gettext.m4 (distributed in the automake package)
# still uses it. Otherwise, the use in gettext.m4 makes autoheader
# give these diagnostics:
# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
undefine([AC_ISC_POSIX])
AC_DEFUN([AC_ISC_POSIX],
[
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
]
)
# lcmessage.m4 serial 4 (gettext-0.14.2)
dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
# Check whether LC_MESSAGES is available in <locale.h>.
AC_DEFUN([gt_LC_MESSAGES],
[
AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
if test $gt_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
[Define if your <locale.h> file defines LC_MESSAGES.])
fi
])
# lib-ld.m4 serial 3 (gettext-0.13)
dnl Copyright (C) 1996-2003 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 From libtool-1.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.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
acl_cv_prog_gnu_ld=yes ;;
*)
acl_cv_prog_gnu_ld=no ;;
esac])
with_gnu_ld=$acl_cv_prog_gnu_ld
])
dnl From libtool-1.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_CANONICAL_HOST])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
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])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
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
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(acl_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
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.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break ;;
*)
test "$with_gnu_ld" != yes && break ;;
esac
fi
done
IFS="$ac_save_ifs"
else
acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$acl_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])
# lib-prefix.m4 serial 5 (gettext-0.15)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl require excessive bracketing.
ifdef([AC_HELP_STRING],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
dnl with the same --prefix option.
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
dnl libraries, but is otherwise very convenient.
AC_DEFUN([AC_LIB_PREFIX],
[
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib-prefix],
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
--without-lib-prefix don't search for libraries in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/$acl_libdirstem"
fi
fi
])
if test $use_additional = yes; then
dnl Potentially add $additional_includedir to $CPPFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's already present in $CPPFLAGS,
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
for x in $CPPFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $CPPFLAGS.
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
fi
fi
fi
fi
dnl Potentially add $additional_libdir to $LDFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's already present in $LDFLAGS,
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
haveit=
for x in $LDFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LDFLAGS.
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
fi
fi
fi
fi
fi
])
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
dnl acl_final_exec_prefix, containing the values to which $prefix and
dnl $exec_prefix will expand at the end of the configure script.
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
[
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
acl_final_prefix="$ac_default_prefix"
else
acl_final_prefix="$prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
acl_final_exec_prefix='${prefix}'
else
acl_final_exec_prefix="$exec_prefix"
fi
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
prefix="$acl_save_prefix"
])
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
dnl variables prefix and exec_prefix bound to the values they will have
dnl at the end of the configure script.
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
[
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
exec_prefix="$acl_final_exec_prefix"
$1
exec_prefix="$acl_save_exec_prefix"
prefix="$acl_save_prefix"
])
dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
dnl the basename of the libdir, either "lib" or "lib64".
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
[
dnl There is no formal standard regarding lib and lib64. The current
dnl practice is that on a system supporting 32-bit and 64-bit instruction
dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
dnl libraries go under $prefix/lib. We determine the compiler's default
dnl mode by looking at the compiler's library search path. If at least
dnl of its elements ends in /lib64 or points to a directory whose absolute
dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
dnl default, namely "lib".
acl_libdirstem=lib
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
if test -n "$searchpath"; then
acl_save_IFS="${IFS= }"; IFS=":"
for searchdir in $searchpath; do
if test -d "$searchdir"; then
case "$searchdir" in
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
*) searchdir=`cd "$searchdir" && pwd`
case "$searchdir" in
*/lib64 ) acl_libdirstem=lib64 ;;
esac ;;
esac
fi
done
IFS="$acl_save_IFS"
fi
])
# longdouble.m4 serial 2 (gettext-0.15)
dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Test whether the compiler supports the 'long double' type.
dnl Prerequisite: AC_PROG_CC
dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
AC_DEFUN([gt_TYPE_LONGDOUBLE],
[
AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
[if test "$GCC" = yes; then
gt_cv_c_long_double=yes
else
AC_TRY_COMPILE([
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
long double foo = 0.0;
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
int array [2*(sizeof(long double) >= sizeof(double)) - 1];
], ,
gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
fi])
if test $gt_cv_c_long_double = yes; then
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
fi
])
# longlong.m4 serial 5
dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
# Define HAVE_LONG_LONG if 'long long' works.
AC_DEFUN([gl_AC_TYPE_LONG_LONG],
[
AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
[AC_TRY_LINK([long long ll = 1LL; int i = 63;],
[long long llmax = (long long) -1;
return ll << i | ll >> i | llmax / ll | llmax % ll;],
ac_cv_type_long_long=yes,
ac_cv_type_long_long=no)])
if test $ac_cv_type_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG, 1,
[Define if you have the 'long long' type.])
fi
])
# mbchar.m4 serial 4
dnl Copyright (C) 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl autoconf tests required for use of mbchar.m4
dnl From Bruno Haible.
AC_DEFUN([gl_MBCHAR],
[
AC_REQUIRE([AC_GNU_SOURCE])
dnl The following line is that so the user can test HAVE_WCHAR_H
dnl before #include "mbchar.h".
AC_CHECK_HEADERS_ONCE([wchar.h])
dnl Compile mbchar.c only if HAVE_WCHAR_H.
if test $ac_cv_header_wchar_h = yes; then
MU_LIBOBJ([mbchar])
dnl Prerequisites of mbchar.h and mbchar.c.
AC_CHECK_HEADERS_ONCE([wctype.h])
AC_CHECK_FUNCS([iswcntrl])
fi
])
# mbiter.m4 serial 2
dnl Copyright (C) 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl autoconf tests required for use of mbiter.h
dnl From Bruno Haible.
AC_DEFUN([gl_MBITER],
[
AC_REQUIRE([AC_TYPE_MBSTATE_T])
dnl The following line is that so the user can test HAVE_MBRTOWC before
dnl #include "mbiter.h" or "mbuiter.h".
AC_REQUIRE([gl_FUNC_MBRTOWC])
:
])
# mbrtowc.m4 serial 8
dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert
dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with
dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere.
AC_DEFUN([gl_FUNC_MBRTOWC],
[
dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
gl_cv_func_mbrtowc,
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <wchar.h>]],
[[wchar_t wc;
char const s[] = "";
size_t n = 1;
mbstate_t state;
return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
gl_cv_func_mbrtowc=yes,
gl_cv_func_mbrtowc=no)])
if test $gl_cv_func_mbrtowc = yes; then
AC_DEFINE([HAVE_MBRTOWC], 1,
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
fi
])
# mbstate_t.m4 serial 9
dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# From Paul Eggert.
# BeOS 5 has <wchar.h> but does not define mbstate_t,
# so you can't declare an object of that type.
# Check for this incompatibility with Standard C.
# AC_TYPE_MBSTATE_T
# -----------------
AC_DEFUN([AC_TYPE_MBSTATE_T],
[AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT
# include <wchar.h>],
[mbstate_t x; return sizeof x;])],
[ac_cv_type_mbstate_t=yes],
[ac_cv_type_mbstate_t=no])])
if test $ac_cv_type_mbstate_t = yes; then
AC_DEFINE([HAVE_MBSTATE_T], 1,
[Define to 1 if <wchar.h> declares mbstate_t.])
else
AC_DEFINE([mbstate_t], int,
[Define to a type if <wchar.h> does not define.])
fi])
# mbswidth.m4 serial 12
dnl Copyright (C) 2000-2002, 2004, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl autoconf tests required for use of mbswidth.c
dnl From Bruno Haible.
AC_DEFUN([gl_MBSWIDTH],
[
AC_CHECK_HEADERS_ONCE([wchar.h wctype.h])
AC_CHECK_FUNCS_ONCE([isascii mbsinit])
AC_CHECK_FUNCS([iswcntrl])
gl_FUNC_MBRTOWC
dnl UnixWare 7.1.1 <wchar.h> has a declaration of a function mbswidth()
dnl that clashes with ours.
AC_CACHE_CHECK([whether mbswidth is declared in <wchar.h>],
ac_cv_have_decl_mbswidth,
[AC_TRY_COMPILE([
#if HAVE_WCHAR_H
# include <wchar.h>
#endif
], [
char *p = (char *) mbswidth;
], ac_cv_have_decl_mbswidth=yes, ac_cv_have_decl_mbswidth=no)])
if test $ac_cv_have_decl_mbswidth = yes; then
ac_val=1
else
ac_val=0
fi
AC_DEFINE_UNQUOTED(HAVE_DECL_MBSWIDTH_IN_WCHAR_H, $ac_val,
[Define to 1 if you have a declaration of mbswidth() in <wchar.h>, and to 0 otherwise.])
AC_TYPE_MBSTATE_T
])
# memchr.m4 serial 4
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_MEMCHR],
[
MU_REPLACE_FUNCS(memchr)
if test $ac_cv_func_memchr = no; then
gl_PREREQ_MEMCHR
fi
])
# Prerequisites of lib/memchr.c.
AC_DEFUN([gl_PREREQ_MEMCHR], [
AC_CHECK_HEADERS(bp-sym.h)
])
# mempcpy.m4 serial 4
dnl Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_MEMPCPY],
[
dnl Persuade glibc <string.h> to declare mempcpy().
AC_REQUIRE([AC_GNU_SOURCE])
MU_REPLACE_FUNCS(mempcpy)
if test $ac_cv_func_mempcpy = no; then
gl_PREREQ_MEMPCPY
fi
])
# Prerequisites of lib/mempcpy.c.
AC_DEFUN([gl_PREREQ_MEMPCPY], [
:
])
# minmax.m4 serial 2
dnl Copyright (C) 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_PREREQ(2.52)
AC_DEFUN([gl_MINMAX],
[
AC_REQUIRE([gl_PREREQ_MINMAX])
])
# Prerequisites of lib/minmax.h.
AC_DEFUN([gl_PREREQ_MINMAX],
[
gl_MINMAX_IN_HEADER([limits.h])
gl_MINMAX_IN_HEADER([sys/param.h])
])
dnl gl_MINMAX_IN_HEADER(HEADER)
dnl The parameter has to be a literal header name; it cannot be macro,
dnl nor a shell variable. (Because autoheader collects only AC_DEFINE
dnl invocations with a literal macro name.)
AC_DEFUN([gl_MINMAX_IN_HEADER],
[
m4_pushdef([header], AS_TR_SH([$1]))
m4_pushdef([HEADER], AS_TR_CPP([$1]))
AC_CACHE_CHECK([whether <$1> defines MIN and MAX],
[gl_cv_minmax_in_]header,
[AC_TRY_COMPILE([#include <$1>
int x = MIN (42, 17);], [],
[gl_cv_minmax_in_]header[=yes],
[gl_cv_minmax_in_]header[=no])])
if test $gl_cv_minmax_in_[]header = yes; then
AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1,
[Define to 1 if <$1> defines the MIN and MAX macros.])
fi
m4_popdef([HEADER])
m4_popdef([header])
])
# obstack.m4 serial 4
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_OBSTACK],
[
AC_FUNC_OBSTACK
dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]).
if test $ac_cv_func_obstack = no; then
gl_PREREQ_OBSTACK
fi
])
# Prerequisites of lib/obstack.c.
AC_DEFUN([gl_PREREQ_OBSTACK],
[
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])
:
])
# onceonly_2_57.m4 serial 4
dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, 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 that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl This file defines some "once only" variants of standard autoconf macros.
dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
dnl AC_REQUIRE([AC_FUNC_STRCOLL]) like AC_FUNC_STRCOLL
dnl The advantage is that the check for each of the headers/functions/decls
dnl will be put only once into the 'configure' file. It keeps the size of
dnl the 'configure' file down, and avoids redundant output when 'configure'
dnl is run.
dnl The drawback is that the checks cannot be conditionalized. If you write
dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
dnl empty, and the check will be inserted before the body of the AC_DEFUNed
dnl function.
dnl This is like onceonly.m4, except that it uses diversions to named sections
dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once,
dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The
dnl size reduction is ca. 9%.
dnl Autoconf version 2.57 or newer is recommended.
AC_PREREQ(2.57)
# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
:
AC_FOREACH([gl_HEADER_NAME], [$1], [
AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
[./-], [___])), [
m4_divert_text([INIT_PREPARE],
[gl_header_list="$gl_header_list gl_HEADER_NAME"])
gl_HEADERS_EXPANSION
AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
[Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
])
AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
[./-], [___])))
])
])
m4_define([gl_HEADERS_EXPANSION], [
m4_divert_text([DEFAULTS], [gl_header_list=])
AC_CHECK_HEADERS([$gl_header_list])
m4_define([gl_HEADERS_EXPANSION], [])
])
# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
:
AC_FOREACH([gl_FUNC_NAME], [$1], [
AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
m4_divert_text([INIT_PREPARE],
[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.])
])
AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
])
])
m4_define([gl_FUNCS_EXPANSION], [
m4_divert_text([DEFAULTS], [gl_func_list=])
AC_CHECK_FUNCS([$gl_func_list])
m4_define([gl_FUNCS_EXPANSION], [])
])
# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
# AC_CHECK_DECLS(DECL1, DECL2, ...).
AC_DEFUN([AC_CHECK_DECLS_ONCE], [
:
AC_FOREACH([gl_DECL_NAME], [$1], [
AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
])
AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
])
])
# printf-posix.m4 serial 2 (gettext-0.13.1)
dnl Copyright (C) 2003 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Test whether the printf() function supports POSIX/XSI format strings with
dnl positions.
AC_DEFUN([gt_PRINTF_POSIX],
[
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
gt_cv_func_printf_posix,
[
AC_TRY_RUN([
#include <stdio.h>
#include <string.h>
/* The string "%2$d %1$d", with dollar characters protected from the shell's
dollar expansion (possibly an autoconf bug). */
static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
static char buf[100];
int main ()
{
sprintf (buf, format, 33, 55);
return (strcmp (buf, "55 33") != 0);
}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
[
AC_EGREP_CPP(notposix, [
#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
notposix
#endif
], gt_cv_func_printf_posix="guessing no",
gt_cv_func_printf_posix="guessing yes")
])
])
case $gt_cv_func_printf_posix in
*yes)
AC_DEFINE(HAVE_POSIX_PRINTF, 1,
[Define if your printf() function supports format strings with positions.])
;;
esac
])
# progtest.m4 serial 4 (gettext-0.14.2)
dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
AC_PREREQ(2.50)
# Search path for a program which passes the given test.
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
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
fi
# Find out how to test for executable files. Don't use a zero-byte file,
# as systems may use methods other than mode bits to determine executability.
cat >conf$$.file <<_ASEOF
#! /bin/sh
exit 0
_ASEOF
chmod +x conf$$.file
if test -x conf$$.file >/dev/null 2>&1; then
ac_executable_p="test -x"
else
ac_executable_p="test -f"
fi
rm -f conf$$.file
# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
[[\\/]]* | ?:[[\\/]]*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in ifelse([$5], , $PATH, [$5]); do
IFS="$ac_save_IFS"
test -z "$ac_dir" && ac_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
break 2
fi
fi
done
done
IFS="$ac_save_IFS"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
#serial 39
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl Initially derived from code in GNU grep.
dnl Mostly written by Jim Meyering.
AC_PREREQ([2.50])
AC_DEFUN([gl_REGEX],
[
AC_ARG_WITH([included-regex],
[AC_HELP_STRING([--without-included-regex],
[don't compile regex; this is the default on
systems with recent-enough versions of the GNU C
Library (use with caution on other systems)])])
case $with_included_regex in #(
yes|no) ac_use_included_regex=$with_included_regex
;;
'')
# If the system regex support is good enough that it passes the
# following run test, then default to *not* using the included regex.c.
# If cross compiling, assume the test would fail and use the included
# regex.c. The first failing regular expression is from `Spencer ere
# test #75' in grep-2.3.
AC_CACHE_CHECK([for working re_compile_pattern],
[gl_cv_func_re_compile_pattern_working],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT
#include <limits.h>
#include <regex.h>
],
[[static struct re_pattern_buffer regex;
unsigned char folded_chars[UCHAR_MAX + 1];
int i;
const char *s;
struct re_registers regs;
re_set_syntax (RE_SYNTAX_POSIX_EGREP);
memset (&regex, 0, sizeof (regex));
for (i = 0; i <= UCHAR_MAX; i++)
folded_chars[i] = i;
regex.translate = folded_chars;
s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
/* This should fail with _Invalid character class name_ error. */
if (!s)
exit (1);
/* This should succeed, but does not for e.g. glibc-2.1.3. */
memset (&regex, 0, sizeof (regex));
s = re_compile_pattern ("{1", 2, &regex);
if (s)
exit (1);
/* The following example is derived from a problem report
against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
memset (&regex, 0, sizeof (regex));
s = re_compile_pattern ("[an\371]*n", 7, &regex);
if (s)
exit (1);
/* This should match, but does not for e.g. glibc-2.2.1. */
if (re_match (&regex, "an", 2, 0, &regs) != 2)
exit (1);
memset (&regex, 0, sizeof (regex));
s = re_compile_pattern ("x", 1, &regex);
if (s)
exit (1);
/* The version of regex.c in e.g. GNU libc-2.2.93 did not
work with a negative RANGE argument. */
if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
exit (1);
/* The version of regex.c in older versions of gnulib
ignored RE_ICASE. Detect that problem too. */
memset (&regex, 0, sizeof (regex));
re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
s = re_compile_pattern ("x", 1, &regex);
if (s)
exit (1);
if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
exit (1);
/* REG_STARTEND was added to glibc on 2004-01-15.
Reject older versions. */
if (! REG_STARTEND)
exit (1);
/* Reject hosts whose regoff_t values are too narrow.
These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t
and 32-bit int. */
if (sizeof (regoff_t) < sizeof (ptrdiff_t)
|| sizeof (regoff_t) < sizeof (ssize_t))
exit (1);
exit (0);]])],
[gl_cv_func_re_compile_pattern_working=yes],
[gl_cv_func_re_compile_pattern_working=no],
dnl When crosscompiling, assume it is not working.
[gl_cv_func_re_compile_pattern_working=no])])
case $gl_cv_func_re_compile_pattern_working in #(
yes) ac_use_included_regex=no;; #(
no) ac_use_included_regex=yes;;
esac
;;
*) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex])
;;
esac
if test $ac_use_included_regex = yes; then
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],
[Define to rpl_re_syntax_options if the replacement should be used.])
AC_DEFINE([re_set_syntax], [rpl_re_set_syntax],
[Define to rpl_re_set_syntax if the replacement should be used.])
AC_DEFINE([re_compile_pattern], [rpl_re_compile_pattern],
[Define to rpl_re_compile_pattern if the replacement should be used.])
AC_DEFINE([re_compile_fastmap], [rpl_re_compile_fastmap],
[Define to rpl_re_compile_fastmap if the replacement should be used.])
AC_DEFINE([re_search], [rpl_re_search],
[Define to rpl_re_search if the replacement should be used.])
AC_DEFINE([re_search_2], [rpl_re_search_2],
[Define to rpl_re_search_2 if the replacement should be used.])
AC_DEFINE([re_match], [rpl_re_match],
[Define to rpl_re_match if the replacement should be used.])
AC_DEFINE([re_match_2], [rpl_re_match_2],
[Define to rpl_re_match_2 if the replacement should be used.])
AC_DEFINE([re_set_registers], [rpl_re_set_registers],
[Define to rpl_re_set_registers if the replacement should be used.])
AC_DEFINE([re_comp], [rpl_re_comp],
[Define to rpl_re_comp if the replacement should be used.])
AC_DEFINE([re_exec], [rpl_re_exec],
[Define to rpl_re_exec if the replacement should be used.])
AC_DEFINE([regcomp], [rpl_regcomp],
[Define to rpl_regcomp if the replacement should be used.])
AC_DEFINE([regexec], [rpl_regexec],
[Define to rpl_regexec if the replacement should be used.])
AC_DEFINE([regerror], [rpl_regerror],
[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.])
MU_LIBOBJ([regex])
gl_PREREQ_REGEX
fi
])
# Prerequisites of lib/regex.c and lib/regex_internal.c.
AC_DEFUN([gl_PREREQ_REGEX],
[
AC_REQUIRE([AC_GNU_SOURCE])
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CHECK_HEADERS_ONCE([locale.h wchar.h wctype.h])
AC_CHECK_FUNCS_ONCE([mbrtowc mempcpy wcrtomb wcscoll])
AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
])
#serial 1003
dnl Copyright (C) 2003 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.
# This macro can be removed once we can rely on Autoconf 2.57a or later,
# since we can then use its AC_C_RESTRICT.
# gl_C_RESTRICT
# --------------
# Determine whether the C/C++ compiler supports the "restrict" keyword
# introduced in ANSI C99, or an equivalent. Do nothing if the compiler
# accepts it. Otherwise, if the compiler supports an equivalent,
# define "restrict" to be that. Here are some variants:
# - GCC supports both __restrict and __restrict__
# - older DEC Alpha C compilers support only __restrict
# - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C
# Otherwise, define "restrict" to be empty.
AC_DEFUN([gl_C_RESTRICT],
[AC_CACHE_CHECK([for C/C++ restrict keyword], gl_cv_c_restrict,
[gl_cv_c_restrict=no
# Try the official restrict keyword, then gcc's __restrict, and
# the less common variants.
for ac_kw in restrict __restrict __restrict__ _Restrict; do
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[float * $ac_kw x;])],
[gl_cv_c_restrict=$ac_kw; break])
done
])
case $gl_cv_c_restrict in
restrict) ;;
no) AC_DEFINE(restrict,,
[Define to equivalent of C99 restrict keyword, or to nothing if this
is not supported. Do not define if restrict is supported directly.]) ;;
*) AC_DEFINE_UNQUOTED(restrict, $gl_cv_c_restrict) ;;
esac
])
# setenv.m4 serial 6
dnl Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gt_FUNC_SETENV],
[
AC_REPLACE_FUNCS(setenv unsetenv)
if test $ac_cv_func_setenv = no; then
gl_PREREQ_SETENV
fi
if test $ac_cv_func_unsetenv = no; then
gl_PREREQ_UNSETENV
else
AC_CACHE_CHECK([for unsetenv() return type], gt_cv_func_unsetenv_ret,
[AC_TRY_COMPILE([#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')])
if test $gt_cv_func_unsetenv_ret = 'void'; then
AC_DEFINE(VOID_UNSETENV, 1, [Define if unsetenv() returns void, not int.])
fi
fi
])
# Check if a variable is properly declared.
# gt_CHECK_VAR_DECL(includes,variable)
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_MSG_RESULT($gt_cv_var)
if test $gt_cv_var = yes; then
AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1,
[Define if you have the declaration of $2.])
fi
])
# Prerequisites of lib/setenv.c.
AC_DEFUN([gl_PREREQ_SETENV],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_HEADERS(search.h)
AC_CHECK_FUNCS(tsearch)
gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
])
# Prerequisites of lib/unsetenv.c.
AC_DEFUN([gl_PREREQ_UNSETENV],
[
AC_CHECK_HEADERS_ONCE(unistd.h)
gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
])
# signed.m4 serial 1 (gettext-0.10.40)
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_DEFUN([bh_C_SIGNED],
[
AC_CACHE_CHECK([for signed], bh_cv_c_signed,
[AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
if test $bh_cv_c_signed = no; then
AC_DEFINE(signed, ,
[Define to empty if the C compiler doesn't support this keyword.])
fi
])
# size_max.m4 serial 4
dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_DEFUN([gl_SIZE_MAX],
[
AC_CHECK_HEADERS(stdint.h)
dnl First test whether the system already has SIZE_MAX.
AC_MSG_CHECKING([for SIZE_MAX])
result=
AC_EGREP_CPP([Found it], [
#include <limits.h>
#if HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef SIZE_MAX
Found it
#endif
], result=yes)
if test -z "$result"; then
dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
dnl than the type 'unsigned long'. Try hard to find a definition that can
dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
_AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
[#include <stddef.h>
#include <limits.h>], size_t_bits_minus_1=)
_AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
[#include <stddef.h>], fits_in_uint=)
if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
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)
fi
dnl We cannot use 'expr' to simplify this expression, because 'expr'
dnl works only with 'long' integers in the host environment, while we
dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
if test $fits_in_uint = 1; then
result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
else
result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
fi
else
dnl Shouldn't happen, but who knows...
result='((size_t)~(size_t)0)'
fi
fi
AC_MSG_RESULT([$result])
if test "$result" != yes; then
AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
[Define as the maximum value of type 'size_t', if the system doesn't define it.])
fi
])
# snprintf.m4 serial 2
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_SNPRINTF],
[
AC_REPLACE_FUNCS(snprintf)
AC_CHECK_DECLS_ONCE(snprintf)
gl_PREREQ_SNPRINTF
])
# Prerequisites of lib/snprintf.c.
AC_DEFUN([gl_PREREQ_SNPRINTF], [:])
# ssize_t.m4 serial 4 (gettext-0.15)
dnl Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Test whether 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;],
[gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
if test $gt_cv_ssize_t = no; then
AC_DEFINE([ssize_t], [int],
[Define as a signed type of the same size as size_t.])
fi
])
#serial 3
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_STAT_MACROS],
[
AC_REQUIRE([AC_HEADER_STAT])
])
# Check for stdbool.h that conforms to C99.
dnl Copyright (C) 2002-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Prepare for substituting <stdbool.h> if it is not supported.
AC_DEFUN([AM_STDBOOL_H],
[
AC_REQUIRE([AC_HEADER_STDBOOL])
# Define two additional variables used in the Makefile substitution.
if test "$ac_cv_header_stdbool_h" = yes; then
STDBOOL_H=''
else
STDBOOL_H='stdbool.h'
fi
AC_SUBST([STDBOOL_H])
if test "$ac_cv_type__Bool" = yes; then
HAVE__BOOL=1
else
HAVE__BOOL=0
fi
AC_SUBST([HAVE__BOOL])
])
# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf
# have this macro built-in.
AC_DEFUN([AC_HEADER_STDBOOL],
[AC_CACHE_CHECK([for stdbool.h that conforms to C99],
[ac_cv_header_stdbool_h],
[AC_TRY_COMPILE(
[
#include <stdbool.h>
#ifndef bool
"error: bool is not defined"
#endif
#ifndef false
"error: false is not defined"
#endif
#if false
"error: false is not 0"
#endif
#ifndef true
"error: true is not defined"
#endif
#if true != 1
"error: true is not 1"
#endif
#ifndef __bool_true_false_are_defined
"error: __bool_true_false_are_defined is not defined"
#endif
struct s { _Bool s: 1; _Bool t; } s;
char a[true == 1 ? 1 : -1];
char b[false == 0 ? 1 : -1];
char c[__bool_true_false_are_defined == 1 ? 1 : -1];
char d[(bool) 0.5 == true ? 1 : -1];
bool e = &s;
char f[(_Bool) 0.0 == false ? 1 : -1];
char g[true];
char h[sizeof (_Bool)];
char i[sizeof s.t];
enum { j = false, k = true, l = false * true, m = true * 256 };
_Bool n[m];
char o[sizeof n == m * sizeof n[0] ? 1 : -1];
char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
#if defined __xlc__ || defined __GNUC__
/* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
reported by James Lemley on 2005-10-05; see
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
This test is not quite right, since xlc is allowed to
reject this program, as the initializer for xlcbug is
not one of the forms that C requires support for.
However, doing the test right would require a run-time
test, and that would make cross-compilation harder.
Let us hope that IBM fixes the xlc bug, and also adds
support for this kind of constant expression. In the
meantime, this test will reject xlc, which is OK, since
our stdbool.h substitute should suffice. We also test
this with GCC, where it should work, to detect more
quickly whether someone messes up the test in the
future. */
char digs[] = "0123456789";
int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
#endif
/* Catch a bug in an HP-UX C compiler. See
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
*/
_Bool q = true;
_Bool *pq = &q;
],
[
*pq |= q;
*pq |= ! q;
/* Refer to every declared value, to avoid compiler optimizations. */
return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ !m + !n + !o + !p + !q + !pq);
],
[ac_cv_header_stdbool_h=yes],
[ac_cv_header_stdbool_h=no])])
AC_CHECK_TYPES([_Bool])
if test $ac_cv_header_stdbool_h = yes; then
AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
fi])
# stdint_h.m4 serial 5
dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
# doesn't clash with <sys/types.h>, and declares uintmax_t.
AC_DEFUN([gl_AC_HEADER_STDINT_H],
[
AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
[AC_TRY_COMPILE(
[#include <sys/types.h>
#include <stdint.h>],
[uintmax_t i = (uintmax_t) -1;],
gl_cv_header_stdint_h=yes,
gl_cv_header_stdint_h=no)])
if test $gl_cv_header_stdint_h = yes; then
AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
and declares uintmax_t. ])
fi
])
# strcase.m4 serial 3
dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_STRCASE],
[
gl_FUNC_STRCASECMP
gl_FUNC_STRNCASECMP
])
AC_DEFUN([gl_FUNC_STRCASECMP],
[
dnl No known system has a strcasecmp() function that works correctly in
dnl multibyte locales. Therefore we use our version always.
MU_LIBOBJ(strcasecmp)
AC_DEFINE(strcasecmp, rpl_strcasecmp, [Define to rpl_strcasecmp always.])
gl_PREREQ_STRCASECMP
])
AC_DEFUN([gl_FUNC_STRNCASECMP],
[
MU_REPLACE_FUNCS(strncasecmp)
if test $ac_cv_func_strncasecmp = no; then
gl_PREREQ_STRNCASECMP
fi
])
# Prerequisites of lib/strcasecmp.c.
AC_DEFUN([gl_PREREQ_STRCASECMP], [
AC_REQUIRE([gl_FUNC_MBRTOWC])
:
])
# Prerequisites of lib/strncasecmp.c.
AC_DEFUN([gl_PREREQ_STRNCASECMP], [
:
])
# strchrnul.m4 serial 3
dnl Copyright (C) 2003 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_STRCHRNUL],
[
dnl Persuade glibc <string.h> to declare strchrnul().
AC_REQUIRE([AC_GNU_SOURCE])
MU_REPLACE_FUNCS(strchrnul)
if test $ac_cv_func_strchrnul = no; then
gl_PREREQ_STRCHRNUL
fi
])
# Prerequisites of lib/strchrnul.c.
AC_DEFUN([gl_PREREQ_STRCHRNUL], [:])
# strdup.m4 serial 7
dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRDUP],
[
MU_REPLACE_FUNCS(strdup)
AC_CHECK_DECLS_ONCE(strdup)
gl_PREREQ_STRDUP
])
# Prerequisites of lib/strdup.c.
AC_DEFUN([gl_PREREQ_STRDUP], [:])
#serial 1004
# This file is not needed if you can assume Autoconf 2.54 or later.
# Experimental replacement for the function in the latest CVS autoconf.
# Use with the error.c file in ../lib.
# Copyright (C) 2001 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.
undefine([AC_FUNC_STRERROR_R])
# AC_FUNC_STRERROR_R
# ------------------
AC_DEFUN([AC_FUNC_STRERROR_R],
[AC_CHECK_DECLS([strerror_r])
AC_CHECK_FUNCS([strerror_r])
AC_CACHE_CHECK([whether strerror_r returns char *],
ac_cv_func_strerror_r_char_p,
[
ac_cv_func_strerror_r_char_p=no
if test $ac_cv_have_decl_strerror_r = yes; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[
char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
char *p = strerror_r (0, buf, sizeof buf);
return !p || x;
]])],
ac_cv_func_strerror_r_char_p=yes)
else
# strerror_r is not declared. Choose between
# systems that have relatively inaccessible declarations for the
# function. BeOS and DEC UNIX 4.0 fall in this category, but the
# former has a strerror_r that returns char*, while the latter
# has a strerror_r that returns `int'.
# This test should segfault on the DEC system.
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
extern char *strerror_r ();],
[[char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
exit (!isalpha (x));]])],
ac_cv_func_strerror_r_char_p=yes, , :)
fi
])
if test $ac_cv_func_strerror_r_char_p = yes; then
AC_DEFINE([STRERROR_R_CHAR_P], 1,
[Define to 1 if strerror_r returns char *.])
fi
])# AC_FUNC_STRERROR_R
# strndup.m4 serial 8
dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRNDUP],
[
dnl Persuade glibc <string.h> to declare strndup().
AC_REQUIRE([AC_GNU_SOURCE])
AC_CHECK_DECLS_ONCE([strndup])
# AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup,
[AC_RUN_IFELSE([
AC_LANG_PROGRAM([#include <string.h>], [[
#ifndef HAVE_DECL_STRNDUP
extern char *strndup (const char *, size_t);
#endif
char *s;
s = strndup ("some longer string", 15);
free (s);
s = strndup ("shorter string", 13);
return s[13] != '\0';]])],
[gl_cv_func_strndup=yes],
[gl_cv_func_strndup=no],
[AC_CHECK_FUNC([strndup],
[AC_EGREP_CPP([too risky], [
#ifdef _AIX
too risky
#endif
],
[gl_cv_func_strndup=no],
[gl_cv_func_strndup=yes])],
[gl_cv_func_strndup=no])])])
if test $gl_cv_func_strndup = yes; then
AC_DEFINE([HAVE_STRNDUP], 1,
[Define if you have the strndup() function and it works.])
else
MU_LIBOBJ([strndup])
AC_DEFINE(strndup, rpl_strndup,
[Define to rpl_strndup if the replacement function should be used,])
gl_PREREQ_STRNDUP
fi
])
# Prerequisites of lib/strndup.c.
AC_DEFUN([gl_PREREQ_STRNDUP], [:])
# strnlen.m4 serial 6
dnl Copyright (C) 2002-2003, 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRNLEN],
[
dnl Persuade glibc <string.h> to declare strnlen().
AC_REQUIRE([AC_GNU_SOURCE])
AC_FUNC_STRNLEN
if test $ac_cv_func_strnlen_working = no; then
# This is necessary because automake-1.6.1 doens't understand
# that the above use of AC_FUNC_STRNLEN means we may have to use
# lib/strnlen.c.
#MU_LIBOBJ(strnlen)
AC_DEFINE(strnlen, rpl_strnlen,
[Define to rpl_strnlen if the replacement function should be used.])
gl_PREREQ_STRNLEN
fi
])
# Prerequisites of lib/strnlen.c.
AC_DEFUN([gl_PREREQ_STRNLEN], [
AC_CHECK_DECLS_ONCE(strnlen)
])
# strtok_r.m4 serial 3
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRTOK_R],
[
MU_REPLACE_FUNCS(strtok_r)
AC_CHECK_DECLS_ONCE(strtok_r)
gl_PREREQ_STRTOK_R
])
# Prerequisites of lib/strtok_r.h and lib/strtok_r.c.
AC_DEFUN([gl_PREREQ_STRTOK_R], [
AC_REQUIRE([AC_C_RESTRICT])
])
# sysexits.m4 serial 2
dnl Copyright (C) 2003,2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_SYSEXITS],
[
AC_CHECK_HEADERS(sysexits.h,
[SYSEXITS_H=],
[SYSEXITS_H=sysexits.h])
AC_SUBST([SYSEXITS_H])
])
# uint32_t.m4 serial 4
# Copyright (C) 2004 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_AC_TYPE_UINT32_T],
[
AC_CACHE_CHECK([for uint32_t], gl_cv_c_uint32_t,
[gl_cv_c_uint32_t=no
for ac_type in "uint32_t" "unsigned int" \
"unsigned long int" "unsigned short int"; do
AC_COMPILE_IFELSE(
[AC_LANG_BOOL_COMPILE_TRY(
[AC_INCLUDES_DEFAULT],
[[($ac_type) -1 == 4294967295U]])],
[gl_cv_c_uint32_t=$ac_type])
test "$gl_cv_c_uint32_t" != no && break
done])
case "$gl_cv_c_uint32_t" in
no|uint32_t) ;;
*)
AC_DEFINE(_UINT32_T, 1,
[Define for Solaris 2.5.1 so uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef was
allowed, the #define below would cause a syntax error.])
AC_DEFINE_UNQUOTED(uint32_t, $gl_cv_c_uint32_t,
[Define to the type of a unsigned integer type of width exactly 32 bits
if such a type exists and the standard includes do not define it.])
;;
esac
AC_CACHE_CHECK([for UINT32_MAX], gl_cv_c_uint32_max,
[AC_COMPILE_IFELSE(
[AC_LANG_BOOL_COMPILE_TRY(
[AC_INCLUDES_DEFAULT],
[[UINT32_MAX == 4294967295U]])],
[gl_cv_c_uint32_max=yes],
[gl_cv_c_uint32_max=no])])
case $gl_cv_c_uint32_max,$gl_cv_c_uint32_t in
yes,*) ;;
*,no) ;;
*)
AC_DEFINE(UINT32_MAX, 4294967295U,
[Define to its maximum value if an unsigned integer type of width
exactly 32 bits exists and the standard includes do not define
UINT32_MAX.])
;;
esac
])
# uintmax_t.m4 serial 9
dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
AC_PREREQ(2.13)
# Define uintmax_t to 'unsigned long' or 'unsigned long long'
# if it is not already defined in <stdint.h> or <inttypes.h>.
AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
[
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG])
test $ac_cv_type_unsigned_long_long = yes \
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
[Define to unsigned long or unsigned long long
if <stdint.h> and <inttypes.h> don't define.])
else
AC_DEFINE(HAVE_UINTMAX_T, 1,
[Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
fi
])
# ulonglong.m4 serial 4
dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
[
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
[AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
[unsigned long long ullmax = (unsigned long long) -1;
return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
ac_cv_type_unsigned_long_long=yes,
ac_cv_type_unsigned_long_long=no)])
if test $ac_cv_type_unsigned_long_long = yes; then
AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
[Define if you have the 'unsigned long long' type.])
fi
])
# unistd_h.m4 serial 2
dnl Copyright (C) 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Written by Simon Josefsson
AC_DEFUN([gl_HEADER_UNISTD],
[
dnl Prerequisites of lib/unistd.h.
AC_CHECK_HEADERS([unistd.h], [
UNISTD_H=''
], [
UNISTD_H='unistd.h'
])
AC_SUBST(UNISTD_H)
])
# unlocked-io.m4 serial 12
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
# Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl From Jim Meyering.
dnl
dnl See if the glibc *_unlocked I/O macros or functions are available.
dnl Use only those *_unlocked macros or functions that are declared
dnl (because some of them were declared in Solaris 2.5.1 but were removed
dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
dnl on Solaris 2.6).
AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO],
[
MU_LIBSOURCES([unlocked-io.h])
AC_DEFINE([USE_UNLOCKED_IO], 1,
[Define to 1 if you want getc etc. to use unlocked I/O if available.
Unlocked I/O can improve performance in unithreaded apps,
but it is not safe for multithreaded apps.])
dnl Persuade glibc and Solaris <stdio.h> to declare
dnl fgets_unlocked(), fputs_unlocked() etc.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_DECLS_ONCE(
[clearerr_unlocked feof_unlocked ferror_unlocked
fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
fread_unlocked fwrite_unlocked getc_unlocked
getchar_unlocked putc_unlocked putchar_unlocked])
])
# vasnprintf.m4 serial 5
dnl Copyright (C) 2002-2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_VASNPRINTF],
[
AC_REQUIRE([gl_EOVERFLOW])
MU_REPLACE_FUNCS(vasnprintf)
if test $ac_cv_func_vasnprintf = no; then
MU_LIBOBJ(printf-args)
MU_LIBOBJ(printf-parse)
MU_LIBOBJ(asnprintf)
gl_PREREQ_PRINTF_ARGS
gl_PREREQ_PRINTF_PARSE
gl_PREREQ_VASNPRINTF
gl_PREREQ_ASNPRINTF
fi
])
# Prequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
AC_REQUIRE([bh_C_SIGNED])
AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
])
# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_REQUIRE([AC_TYPE_SIZE_T])
AC_CHECK_TYPES(ptrdiff_t)
AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
])
# Prerequisites of lib/vasnprintf.c.
AC_DEFUN([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_FUNCS(snprintf wcslen)
])
# Prerequisites of lib/asnprintf.c.
AC_DEFUN([gl_PREREQ_ASNPRINTF],
[
])
# vasprintf.m4 serial 1
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_VASPRINTF],
[
AC_REPLACE_FUNCS(vasprintf)
if test $ac_cv_func_vasprintf = no; then
AC_LIBOBJ(asprintf)
gl_PREREQ_VASPRINTF
gl_PREREQ_ASPRINTF
fi
])
# Prerequisites of lib/vasprintf.c.
AC_DEFUN([gl_PREREQ_VASPRINTF],
[
])
# Prerequisites of lib/asprintf.c.
AC_DEFUN([gl_PREREQ_ASPRINTF],
[
])
# visibility.m4 serial 1 (gettext-0.15)
dnl Copyright (C) 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Tests whether the compiler supports the command-line option
dnl -fvisibility=hidden and the function and variable attributes
dnl __attribute__((__visibility__("hidden"))) and
dnl __attribute__((__visibility__("default"))).
dnl Does *not* test for __visibility__("protected") - which has tricky
dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
dnl MacOS X.
dnl Does *not* test for __visibility__("internal") - which has processor
dnl dependent semantics.
dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
dnl "really only recommended for legacy code".
dnl Set the variable CFLAG_VISIBILITY.
dnl Defines and sets the variable HAVE_VISIBILITY.
AC_DEFUN([gl_VISIBILITY],
[
AC_REQUIRE([AC_PROG_CC])
CFLAG_VISIBILITY=
HAVE_VISIBILITY=0
if test -n "$GCC"; then
AC_MSG_CHECKING([for simple visibility declarations])
AC_CACHE_VAL(gl_cv_cc_visibility, [
gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
AC_TRY_COMPILE(
[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
extern __attribute__((__visibility__("default"))) int exportedvar;
extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
[],
gl_cv_cc_visibility=yes,
gl_cv_cc_visibility=no)
CFLAGS="$gl_save_CFLAGS"])
AC_MSG_RESULT([$gl_cv_cc_visibility])
if test $gl_cv_cc_visibility = yes; then
CFLAG_VISIBILITY="-fvisibility=hidden"
HAVE_VISIBILITY=1
fi
fi
AC_SUBST([CFLAG_VISIBILITY])
AC_SUBST([HAVE_VISIBILITY])
AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
[Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
])
# vsnprintf.m4 serial 2
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_VSNPRINTF],
[
MU_REPLACE_FUNCS(vsnprintf)
AC_CHECK_DECLS_ONCE(vsnprintf)
gl_PREREQ_VSNPRINTF
])
# Prerequisites of lib/vsnprintf.c.
AC_DEFUN([gl_PREREQ_VSNPRINTF], [:])
# wchar_t.m4 serial 1 (gettext-0.12)
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WCHAR_T],
[
AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
[AC_TRY_COMPILE([#include <stddef.h>
wchar_t foo = (wchar_t)'\0';], ,
gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
if test $gt_cv_c_wchar_t = yes; then
AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
fi
])
# wcwidth.m4 serial 5
dnl Copyright (C) 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_WCWIDTH],
[
dnl Persuade glibc <wchar.h> to declare wcwidth().
AC_REQUIRE([AC_GNU_SOURCE])
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_CHECK_HEADERS_ONCE([wchar.h wctype.h])
AC_CHECK_FUNCS_ONCE([iswprint wcwidth])
AC_CHECK_DECLS([wcwidth], [], [], [
/* AIX 3.2.5 declares wcwidth in <string.h>. */
#include <string.h>
#if HAVE_WCHAR_H
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
<wchar.h>. */
# include <stdio.h>
# include <time.h>
# include <wchar.h>
#endif
])])
# wint_t.m4 serial 1 (gettext-0.12)
dnl Copyright (C) 2003 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Test whether <wchar.h> has the 'wint_t' type.
dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WINT_T],
[
AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
[AC_TRY_COMPILE([#include <wchar.h>
wint_t foo = (wchar_t)'\0';], ,
gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
if test $gt_cv_c_wint_t = yes; then
AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
fi
])
# xalloc.m4 serial 13
dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_XALLOC],
[
AC_LIBOBJ([xmalloc])
gl_PREREQ_XALLOC
gl_PREREQ_XMALLOC
])
# Prerequisites of lib/xalloc.h.
AC_DEFUN([gl_PREREQ_XALLOC], [
:
])
# Prerequisites of lib/xmalloc.c.
AC_DEFUN([gl_PREREQ_XMALLOC], [
AC_REQUIRE([AC_C_INLINE])
:
])
# xsize.m4 serial 3
dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_XSIZE],
[
dnl Prerequisites of lib/xsize.h.
AC_REQUIRE([gl_SIZE_MAX])
AC_REQUIRE([AC_C_INLINE])
AC_CHECK_HEADERS(stdint.h)
])