1
# intl.m4 serial 29 (gettext-0.19)
2
dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
1
# intl.m4 serial 17 (gettext-0.18)
2
dnl Copyright (C) 1995-2009 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
7
dnl This file can be used in projects which are not available under
7
dnl This file can can be used in projects which are not available under
8
8
dnl the GNU General Public License or the GNU Library General Public
9
9
dnl License but which still want to provide support for the GNU gettext
11
11
dnl Please note that the actual code of the GNU gettext library is covered
12
12
dnl by the GNU Library General Public License, and the rest of the GNU
13
dnl gettext package is covered by the GNU General Public License.
13
dnl gettext package package is covered by the GNU General Public License.
14
14
dnl They are *not* in the public domain.
17
17
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18
18
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
22
22
dnl Checks for all prerequisites of the intl subdirectory,
23
23
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
42
42
AC_REQUIRE([gl_XSIZE])dnl
43
43
AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
44
44
AC_REQUIRE([gt_INTL_MACOSX])dnl
45
AC_REQUIRE([gl_EXTERN_INLINE])dnl
46
AC_REQUIRE([gt_GL_ATTRIBUTE])dnl
48
46
dnl Support for automake's --enable-silent-rules.
49
47
case "$enable_silent_rules" in
57
55
[AC_DEFINE([ptrdiff_t], [long],
58
56
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
60
AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
58
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
61
59
AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
62
60
snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
64
62
dnl Use the _snprintf function only if it is declared (because on NetBSD it
65
63
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
66
AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
64
gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
65
gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
68
67
dnl Use the *_unlocked functions only if they are declared.
69
68
dnl (because some of them were defined without being declared in Solaris
70
69
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
71
70
dnl on Solaris 2.5.1 to run on Solaris 2.6).
72
AC_CHECK_DECLS([getc_unlocked], , , [#include <stdio.h>])
71
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
72
gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
74
74
case $gt_cv_func_printf_posix in
75
75
*yes) HAVE_POSIX_PRINTF=1 ;;
220
220
AC_REQUIRE([gt_INTTYPES_PRI])dnl
221
221
AC_REQUIRE([gl_LOCK])dnl
225
[[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }]],
224
[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
227
226
[AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
228
227
[Define to 1 if the compiler understands __builtin_expect.])])
232
231
stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
233
232
argz_stringify argz_next __fsetlocking])
235
dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have
236
dnl it nor the equivalent.
237
if test $ac_cv_func_uselocale = yes; then
238
AC_CHECK_FUNCS([getlocalename_l])
241
234
dnl Use the *_unlocked functions only if they are declared.
242
235
dnl (because some of them were defined without being declared in Solaris
243
236
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
244
237
dnl on Solaris 2.5.1 to run on Solaris 2.6).
245
AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
238
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
239
gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
240
gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
249
244
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
250
245
dnl because plural.y uses bison specific features. It requires at least
251
dnl bison-2.7 for %define api.pure.
246
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
252
248
dnl bison is only needed for the maintainer (who touches plural.y). But in
253
249
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
254
250
dnl the rule in general Makefile. Now, some people carelessly touch the
265
261
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
266
262
case $ac_prog_version in
267
263
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
264
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
269
265
changequote([,])dnl
270
266
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
271
267
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
280
dnl Copies _GL_UNUSED and _GL_ATTRIBUTE_PURE definitions from
281
dnl gnulib-common.m4 as a fallback, if the project isn't using Gnulib.
282
AC_DEFUN([gt_GL_ATTRIBUTE], [
283
m4_ifndef([gl_[]COMMON],
284
AH_VERBATIM([gt_gl_attribute],
285
[/* Define as a marker that can be attached to declarations that might not
286
be used. This helps to reduce warnings, such as from
287
GCC -Wunused-parameter. */
289
# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
290
# define _GL_UNUSED __attribute__ ((__unused__))
296
/* The __pure__ attribute was added in gcc 2.96. */
297
#ifndef _GL_ATTRIBUTE_PURE
298
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
299
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
301
# define _GL_ATTRIBUTE_PURE /* empty */
277
dnl gt_CHECK_DECL(FUNC, INCLUDES)
278
dnl Check whether a function is declared.
279
AC_DEFUN([gt_CHECK_DECL],
281
AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
282
[AC_TRY_COMPILE([$2], [
284
char *p = (char *) $1;
286
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
287
if test $ac_cv_have_decl_$1 = yes; then
292
AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
293
[Define to 1 if you have the declaration of `$1', and to 0 if you don't.])