Commit dfe13614 dfe136143306b3b190bb69473432ad10e1d03a0e by Sergey Poznyakoff

Remove

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