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, 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.
1
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
3
# Copyright (C) 1996-2013 Free Software 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.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15
# codeset.m4 serial 5 (gettext-0.18.2)
16
dnl Copyright (C) 2000-2002, 2006, 2008-2013 Free Software Foundation, Inc.
17
dnl This file is free software; the Free Software Foundation
18
dnl gives unlimited permission to copy and/or distribute it,
19
dnl with or without modifications, as long as this notice is preserved.
9
21
dnl From Bruno Haible.
11
23
AC_DEFUN([AM_LANGINFO_CODESET],
13
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
14
[AC_TRY_LINK([#include <langinfo.h>],
15
[char* cs = nl_langinfo(CODESET);],
16
am_cv_langinfo_codeset=yes,
17
am_cv_langinfo_codeset=no)
25
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
28
[[#include <langinfo.h>]],
29
[[char* cs = nl_langinfo(CODESET); return !cs;]])],
30
[am_cv_langinfo_codeset=yes],
31
[am_cv_langinfo_codeset=no])
19
33
if test $am_cv_langinfo_codeset = yes; then
20
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
34
AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
21
35
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
24
# gettext.m4 serial 28 (gettext-0.13)
25
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
26
dnl This file is free software, distributed under the terms of the GNU
27
dnl General Public License. As a special exception to the GNU General
28
dnl Public License, this file may be distributed as part of a program
29
dnl that contains a configuration script generated by Autoconf, under
30
dnl the same distribution terms as the rest of that program.
39
dnl 'extern inline' a la ISO C99.
41
dnl Copyright 2012-2013 Free Software Foundation, Inc.
42
dnl This file is free software; the Free Software Foundation
43
dnl gives unlimited permission to copy and/or distribute it,
44
dnl with or without modifications, as long as this notice is preserved.
46
AC_DEFUN([gl_EXTERN_INLINE],
48
AH_VERBATIM([extern_inline],
49
[/* Please see the Gnulib manual for how to use these macros.
51
Suppress extern inline with HP-UX cc, as it appears to be broken; see
52
<http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
54
Suppress extern inline with Sun C in standards-conformance mode, as it
55
mishandles inline functions that call each other. E.g., for 'inline void f
56
(void) { } inline void g (void) { f (); }', c99 incorrectly complains
57
'reference to static identifier "f" in extern inline function'.
58
This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
60
Suppress the use of extern inline on Apple's platforms, as Libc at least
61
through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
62
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
63
Perhaps Apple will fix this some day. */
65
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
66
: (199901L <= __STDC_VERSION__ \
68
&& !(defined __SUNPRO_C && __STDC__))) \
69
&& !defined __APPLE__)
70
# define _GL_INLINE inline
71
# define _GL_EXTERN_INLINE extern inline
72
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
73
&& !defined __APPLE__)
74
# if __GNUC_GNU_INLINE__
75
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
76
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
78
# define _GL_INLINE extern inline
80
# define _GL_EXTERN_INLINE extern
82
# define _GL_INLINE static _GL_UNUSED
83
# define _GL_EXTERN_INLINE static _GL_UNUSED
86
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
87
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
88
# define _GL_INLINE_HEADER_CONST_PRAGMA
90
# define _GL_INLINE_HEADER_CONST_PRAGMA \
91
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
93
/* Suppress GCC's bogus "no previous prototype for 'FOO'"
94
and "no previous declaration for 'FOO'" diagnostics,
95
when FOO is an inline function in the header; see
96
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */
97
# define _GL_INLINE_HEADER_BEGIN \
98
_Pragma ("GCC diagnostic push") \
99
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
100
_Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
101
_GL_INLINE_HEADER_CONST_PRAGMA
102
# define _GL_INLINE_HEADER_END \
103
_Pragma ("GCC diagnostic pop")
105
# define _GL_INLINE_HEADER_BEGIN
106
# define _GL_INLINE_HEADER_END
110
# fcntl-o.m4 serial 4
111
dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
112
dnl This file is free software; the Free Software Foundation
113
dnl gives unlimited permission to copy and/or distribute it,
114
dnl with or without modifications, as long as this notice is preserved.
116
dnl Written by Paul Eggert.
118
# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
119
# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
120
# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
121
AC_DEFUN([gl_FCNTL_O_FLAGS],
123
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
124
dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
126
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
127
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
128
[AC_REQUIRE([AC_GNU_SOURCE])])
130
AC_CHECK_HEADERS_ONCE([unistd.h])
131
AC_CHECK_FUNCS_ONCE([symlink])
132
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
135
[[#include <sys/types.h>
136
#include <sys/stat.h>
139
#else /* on Windows with MSVC */
142
# defined sleep(n) _sleep ((n) * 1000)
151
static int const constants[] =
153
O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
154
O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
158
int result = !constants;
161
static char const sym[] = "conftest.sym";
162
if (symlink ("/dev/null", sym) != 0)
166
int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
173
if (unlink (sym) != 0 || symlink (".", sym) != 0)
177
int fd = open (sym, O_RDONLY | O_NOFOLLOW);
188
static char const file[] = "confdefs.h";
189
int fd = open (file, O_RDONLY | O_NOATIME);
195
if (fstat (fd, &st0) != 0)
201
if (read (fd, &c, 1) != 1)
210
if (stat (file, &st1) != 0)
213
if (st0.st_atime != st1.st_atime)
221
[gl_cv_header_working_fcntl_h=yes],
223
4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
224
64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
225
68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
226
*) gl_cv_header_working_fcntl_h='no';;
228
[gl_cv_header_working_fcntl_h=cross-compiling])])
230
case $gl_cv_header_working_fcntl_h in #(
231
*O_NOATIME* | no | cross-compiling) ac_val=0;; #(
234
AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
235
[Define to 1 if O_NOATIME works.])
237
case $gl_cv_header_working_fcntl_h in #(
238
*O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
241
AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
242
[Define to 1 if O_NOFOLLOW works.])
245
# gettext.m4 serial 66 (gettext-0.18.2)
246
dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
247
dnl This file is free software; the Free Software Foundation
248
dnl gives unlimited permission to copy and/or distribute it,
249
dnl with or without modifications, as long as this notice is preserved.
32
251
dnl This file can can be used in projects which are not available under
33
252
dnl the GNU General Public License or the GNU Library General Public
333
594
dnl For backward compatibility. Some Makefiles may be using this.
334
595
DATADIRNAME=share
335
AC_SUBST(DATADIRNAME)
596
AC_SUBST([DATADIRNAME])
337
598
dnl For backward compatibility. Some Makefiles may be using this.
600
AC_SUBST([INSTOBJEXT])
341
602
dnl For backward compatibility. Some Makefiles may be using this.
345
606
dnl For backward compatibility. Some Makefiles may be using this.
346
608
if test "$USE_INCLUDED_LIBINTL" = yes; then
347
609
INTLOBJS="\$(GETTOBJS)"
351
613
dnl Enable libtool support if the surrounding package wishes it.
352
614
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
353
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
615
AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
356
618
dnl For backward compatibility. Some Makefiles may be using this.
357
619
INTLLIBS="$LIBINTL"
360
622
dnl Make all documented variables known to autoconf.
367
dnl Checks for all prerequisites of the intl subdirectory,
368
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
369
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
370
AC_DEFUN([AM_INTL_SUBDIR],
372
AC_REQUIRE([AC_PROG_INSTALL])dnl
373
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
374
AC_REQUIRE([AC_PROG_CC])dnl
375
AC_REQUIRE([AC_CANONICAL_HOST])dnl
376
AC_REQUIRE([AC_PROG_RANLIB])dnl
377
AC_REQUIRE([AC_ISC_POSIX])dnl
378
AC_REQUIRE([AC_HEADER_STDC])dnl
379
AC_REQUIRE([AC_C_CONST])dnl
380
AC_REQUIRE([bh_C_SIGNED])dnl
381
AC_REQUIRE([AC_C_INLINE])dnl
382
AC_REQUIRE([AC_TYPE_OFF_T])dnl
383
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
384
AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
385
AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
386
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
387
AC_REQUIRE([gt_TYPE_WINT_T])dnl
388
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
389
AC_REQUIRE([jm_AC_HEADER_STDINT_H])
390
AC_REQUIRE([gt_TYPE_INTMAX_T])
391
AC_REQUIRE([gt_PRINTF_POSIX])
392
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
393
AC_REQUIRE([AC_FUNC_MMAP])dnl
394
AC_REQUIRE([jm_GLIBC21])dnl
395
AC_REQUIRE([gt_INTDIV0])dnl
396
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
397
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
398
AC_REQUIRE([gt_INTTYPES_PRI])dnl
399
AC_REQUIRE([gl_XSIZE])dnl
401
AC_CHECK_TYPE([ptrdiff_t], ,
402
[AC_DEFINE([ptrdiff_t], [long],
403
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
405
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
406
stdlib.h string.h unistd.h sys/param.h])
407
AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
408
mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
409
strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
412
dnl Use the _snprintf function only if it is declared (because on NetBSD it
413
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
414
gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
415
gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
417
dnl Use the *_unlocked functions only if they are declared.
418
dnl (because some of them were defined without being declared in Solaris
419
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
420
dnl on Solaris 2.5.1 to run on Solaris 2.6).
421
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
422
gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
423
gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
424
gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
426
case $gt_cv_func_printf_posix in
427
*yes) HAVE_POSIX_PRINTF=1 ;;
428
*) HAVE_POSIX_PRINTF=0 ;;
430
AC_SUBST([HAVE_POSIX_PRINTF])
431
if test "$ac_cv_func_asprintf" = yes; then
436
AC_SUBST([HAVE_ASPRINTF])
437
if test "$ac_cv_func_snprintf" = yes; then
442
AC_SUBST([HAVE_SNPRINTF])
443
if test "$ac_cv_func_wprintf" = yes; then
448
AC_SUBST([HAVE_WPRINTF])
452
if test $ac_cv_header_locale_h = yes; then
456
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
457
dnl because plural.y uses bison specific features. It requires at least
458
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
460
dnl bison is only needed for the maintainer (who touches plural.y). But in
461
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
462
dnl the rule in general Makefile. Now, some people carelessly touch the
463
dnl files or have a broken "make" program, hence the plural.c rule will
464
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
465
dnl present or too old.
466
AC_CHECK_PROGS([INTLBISON], [bison])
467
if test -z "$INTLBISON"; then
470
dnl Found it, now check the version.
471
AC_MSG_CHECKING([version of bison])
472
changequote(<<,>>)dnl
473
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
474
case $ac_prog_version in
475
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
476
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
478
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
479
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
481
AC_MSG_RESULT([$ac_prog_version])
483
if test $ac_verc_fail = yes; then
489
dnl gt_CHECK_DECL(FUNC, INCLUDES)
490
dnl Check whether a function is declared.
491
AC_DEFUN([gt_CHECK_DECL],
493
AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
494
[AC_TRY_COMPILE([$2], [
496
char *p = (char *) $1;
498
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
499
if test $ac_cv_have_decl_$1 = yes; then
504
AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
505
[Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
624
AC_SUBST([LTLIBINTL])
629
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
630
m4_define([gt_NEEDS_INIT],
632
m4_divert_text([DEFAULTS], [gt_needs=])
633
m4_define([gt_NEEDS_INIT], [])
637
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
638
AC_DEFUN([AM_GNU_GETTEXT_NEED],
640
m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
509
644
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
510
645
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
511
# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
512
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
513
dnl This file is free software, distributed under the terms of the GNU
514
dnl General Public License. As a special exception to the GNU General
515
dnl Public License, this file may be distributed as part of a program
516
dnl that contains a configuration script generated by Autoconf, under
517
dnl the same distribution terms as the rest of that program.
519
# Test for the GNU C Library, version 2.1 or newer.
648
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
650
dnl This file is free software; the Free Software Foundation
651
dnl gives unlimited permission to copy and/or distribute it,
652
dnl with or without modifications, as long as this notice is preserved.
654
# Test for the GNU C Library, version 2.0 or newer.
520
655
# From Bruno Haible.
522
AC_DEFUN([jm_GLIBC21],
657
AC_DEFUN([gt_GLIBC2],
524
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
525
ac_cv_gnu_library_2_1,
659
AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
660
[ac_cv_gnu_library_2],
526
661
[AC_EGREP_CPP([Lucky GNU user],
663
#include <features.h>
664
#ifdef __GNU_LIBRARY__
665
#if (__GLIBC__ >= 2) && !defined __UCLIBC__
670
[ac_cv_gnu_library_2=yes],
671
[ac_cv_gnu_library_2=no])
675
GLIBC2="$ac_cv_gnu_library_2"
679
# glibc21.m4 serial 5
680
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
682
dnl This file is free software; the Free Software Foundation
683
dnl gives unlimited permission to copy and/or distribute it,
684
dnl with or without modifications, as long as this notice is preserved.
686
# Test for the GNU C Library, version 2.1 or newer, or uClibc.
689
AC_DEFUN([gl_GLIBC21],
691
AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
692
[ac_cv_gnu_library_2_1],
693
[AC_EGREP_CPP([Lucky],
528
695
#include <features.h>
529
696
#ifdef __GNU_LIBRARY__
530
697
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
535
ac_cv_gnu_library_2_1=yes,
536
ac_cv_gnu_library_2_1=no)
705
[ac_cv_gnu_library_2_1=yes],
706
[ac_cv_gnu_library_2_1=no])
540
710
GLIBC21="$ac_cv_gnu_library_2_1"
543
# iconv.m4 serial AM4 (gettext-0.11.3)
544
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
545
dnl This file is free software, distributed under the terms of the GNU
546
dnl General Public License. As a special exception to the GNU General
547
dnl Public License, this file may be distributed as part of a program
548
dnl that contains a configuration script generated by Autoconf, under
549
dnl the same distribution terms as the rest of that program.
714
# iconv.m4 serial 18 (gettext-0.18.2)
715
dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc.
716
dnl This file is free software; the Free Software Foundation
717
dnl gives unlimited permission to copy and/or distribute it,
718
dnl with or without modifications, as long as this notice is preserved.
551
720
dnl From Bruno Haible.
573
743
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
574
744
dnl because if the user has installed libiconv and not disabled its use
575
745
dnl via --without-libiconv-prefix, he wants to use it. The first
576
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
746
dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
577
747
am_save_CPPFLAGS="$CPPFLAGS"
578
748
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
580
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
750
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
581
751
am_cv_func_iconv="no, consider installing GNU libiconv"
582
752
am_cv_lib_iconv=no
583
AC_TRY_LINK([#include <stdlib.h>
585
[iconv_t cd = iconv_open("","");
586
iconv(cd,NULL,NULL,NULL,NULL);
588
am_cv_func_iconv=yes)
759
[[iconv_t cd = iconv_open("","");
760
iconv(cd,NULL,NULL,NULL,NULL);
761
iconv_close(cd);]])],
762
[am_cv_func_iconv=yes])
589
763
if test "$am_cv_func_iconv" != yes; then
590
764
am_save_LIBS="$LIBS"
591
765
LIBS="$LIBS $LIBICONV"
592
AC_TRY_LINK([#include <stdlib.h>
594
[iconv_t cd = iconv_open("","");
595
iconv(cd,NULL,NULL,NULL,NULL);
598
am_cv_func_iconv=yes)
772
[[iconv_t cd = iconv_open("","");
773
iconv(cd,NULL,NULL,NULL,NULL);
774
iconv_close(cd);]])],
775
[am_cv_lib_iconv=yes]
776
[am_cv_func_iconv=yes])
599
777
LIBS="$am_save_LIBS"
602
780
if test "$am_cv_func_iconv" = yes; then
603
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
781
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
782
dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
785
if test $am_cv_lib_iconv = yes; then
786
LIBS="$LIBS $LIBICONV"
795
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
798
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
799
if (cd_utf8_to_88591 != (iconv_t)(-1))
801
static const char input[] = "\342\202\254"; /* EURO SIGN */
803
const char *inptr = input;
804
size_t inbytesleft = strlen (input);
806
size_t outbytesleft = sizeof (buf);
807
size_t res = iconv (cd_utf8_to_88591,
808
(char **) &inptr, &inbytesleft,
809
&outptr, &outbytesleft);
812
iconv_close (cd_utf8_to_88591);
815
/* Test against Solaris 10 bug: Failures are not distinguishable from
816
successful returns. */
818
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
819
if (cd_ascii_to_88591 != (iconv_t)(-1))
821
static const char input[] = "\263";
823
const char *inptr = input;
824
size_t inbytesleft = strlen (input);
826
size_t outbytesleft = sizeof (buf);
827
size_t res = iconv (cd_ascii_to_88591,
828
(char **) &inptr, &inbytesleft,
829
&outptr, &outbytesleft);
832
iconv_close (cd_ascii_to_88591);
835
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
837
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
838
if (cd_88591_to_utf8 != (iconv_t)(-1))
840
static const char input[] = "\304";
841
static char buf[2] = { (char)0xDE, (char)0xAD };
842
const char *inptr = input;
843
size_t inbytesleft = 1;
845
size_t outbytesleft = 1;
846
size_t res = iconv (cd_88591_to_utf8,
847
(char **) &inptr, &inbytesleft,
848
&outptr, &outbytesleft);
849
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
851
iconv_close (cd_88591_to_utf8);
854
#if 0 /* This bug could be worked around by the caller. */
855
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
857
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
858
if (cd_88591_to_utf8 != (iconv_t)(-1))
860
static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
862
const char *inptr = input;
863
size_t inbytesleft = strlen (input);
865
size_t outbytesleft = sizeof (buf);
866
size_t res = iconv (cd_88591_to_utf8,
867
(char **) &inptr, &inbytesleft,
868
&outptr, &outbytesleft);
871
iconv_close (cd_88591_to_utf8);
875
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
877
if (/* Try standardized names. */
878
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
879
/* Try IRIX, OSF/1 names. */
880
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
882
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
883
/* Try HP-UX names. */
884
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
888
[am_cv_func_iconv_works=yes],
889
[am_cv_func_iconv_works=no],
893
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
894
*) am_cv_func_iconv_works="guessing yes" ;;
900
case "$am_cv_func_iconv_works" in
901
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
902
*) am_func_iconv=yes ;;
905
am_func_iconv=no am_cv_lib_iconv=no
907
if test "$am_func_iconv" = yes; then
908
AC_DEFINE([HAVE_ICONV], [1],
909
[Define if you have the iconv() function and it works.])
605
911
if test "$am_cv_lib_iconv" = yes; then
606
912
AC_MSG_CHECKING([how to link with libiconv])
700
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
702
# Guess based on the CPU.
704
alpha* | i[34567]86 | m68k | s390*)
705
gt_cv_int_divbyzero_sigfpe="guessing yes";;
707
gt_cv_int_divbyzero_sigfpe="guessing no";;
1048
[gt_cv_int_divbyzero_sigfpe=yes],
1049
[gt_cv_int_divbyzero_sigfpe=no],
1051
# Guess based on the CPU.
1054
alpha* | i[34567]86 | x86_64 | m68k | s390*)
1055
gt_cv_int_divbyzero_sigfpe="guessing yes";;
1057
gt_cv_int_divbyzero_sigfpe="guessing no";;
711
1063
case "$gt_cv_int_divbyzero_sigfpe" in
715
AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
1067
AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
716
1068
[Define if integer division by zero raises signal SIGFPE.])
718
# intmax.m4 serial 1 (gettext-0.12)
719
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
720
dnl This file is free software, distributed under the terms of the GNU
721
dnl General Public License. As a special exception to the GNU General
722
dnl Public License, this file may be distributed as part of a program
723
dnl that contains a configuration script generated by Autoconf, under
724
dnl the same distribution terms as the rest of that program.
1071
# intl.m4 serial 25 (gettext-0.18.3)
1072
dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
1073
dnl This file is free software; the Free Software Foundation
1074
dnl gives unlimited permission to copy and/or distribute it,
1075
dnl with or without modifications, as long as this notice is preserved.
1077
dnl This file can can be used in projects which are not available under
1078
dnl the GNU General Public License or the GNU Library General Public
1079
dnl License but which still want to provide support for the GNU gettext
1081
dnl Please note that the actual code of the GNU gettext library is covered
1082
dnl by the GNU Library General Public License, and the rest of the GNU
1083
dnl gettext package package is covered by the GNU General Public License.
1084
dnl They are *not* in the public domain.
1087
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1088
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
1092
dnl Checks for all prerequisites of the intl subdirectory,
1093
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1094
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1095
AC_DEFUN([AM_INTL_SUBDIR],
1097
AC_REQUIRE([AC_PROG_INSTALL])dnl
1098
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1099
AC_REQUIRE([AC_PROG_CC])dnl
1100
AC_REQUIRE([AC_CANONICAL_HOST])dnl
1101
AC_REQUIRE([gt_GLIBC2])dnl
1102
AC_REQUIRE([AC_PROG_RANLIB])dnl
1103
AC_REQUIRE([gl_VISIBILITY])dnl
1104
AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
1105
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
1106
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
1107
AC_REQUIRE([gt_TYPE_WINT_T])dnl
1108
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1109
AC_REQUIRE([gt_TYPE_INTMAX_T])
1110
AC_REQUIRE([gt_PRINTF_POSIX])
1111
AC_REQUIRE([gl_GLIBC21])dnl
1112
AC_REQUIRE([gl_XSIZE])dnl
1113
AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
1114
AC_REQUIRE([gt_INTL_MACOSX])dnl
1115
AC_REQUIRE([gl_EXTERN_INLINE])dnl
1117
dnl Support for automake's --enable-silent-rules.
1118
case "$enable_silent_rules" in
1119
yes) INTL_DEFAULT_VERBOSITY=0;;
1120
no) INTL_DEFAULT_VERBOSITY=1;;
1121
*) INTL_DEFAULT_VERBOSITY=1;;
1123
AC_SUBST([INTL_DEFAULT_VERBOSITY])
1125
AC_CHECK_TYPE([ptrdiff_t], ,
1126
[AC_DEFINE([ptrdiff_t], [long],
1127
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
1129
AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
1130
AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
1131
snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
1133
dnl Use the _snprintf function only if it is declared (because on NetBSD it
1134
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
1135
AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
1137
dnl Use the *_unlocked functions only if they are declared.
1138
dnl (because some of them were defined without being declared in Solaris
1139
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1140
dnl on Solaris 2.5.1 to run on Solaris 2.6).
1141
AC_CHECK_DECLS([getc_unlocked], , , [#include <stdio.h>])
1143
case $gt_cv_func_printf_posix in
1144
*yes) HAVE_POSIX_PRINTF=1 ;;
1145
*) HAVE_POSIX_PRINTF=0 ;;
1147
AC_SUBST([HAVE_POSIX_PRINTF])
1148
if test "$ac_cv_func_asprintf" = yes; then
1153
AC_SUBST([HAVE_ASPRINTF])
1154
if test "$ac_cv_func_snprintf" = yes; then
1159
AC_SUBST([HAVE_SNPRINTF])
1160
if test "$ac_cv_func_newlocale" = yes; then
1165
AC_SUBST([HAVE_NEWLOCALE])
1166
if test "$ac_cv_func_wprintf" = yes; then
1171
AC_SUBST([HAVE_WPRINTF])
1176
dnl Compilation on mingw and Cygwin needs special Makefile rules, because
1177
dnl 1. when we install a shared library, we must arrange to export
1178
dnl auxiliary pointer variables for every exported variable,
1179
dnl 2. when we install a shared library and a static library simultaneously,
1180
dnl the include file specifies __declspec(dllimport) and therefore we
1181
dnl must arrange to define the auxiliary pointer variables for the
1182
dnl exported variables _also_ in the static library.
1183
if test "$enable_shared" = yes; then
1185
mingw* | cygwin*) is_woe32dll=yes ;;
1186
*) is_woe32dll=no ;;
1191
WOE32DLL=$is_woe32dll
1192
AC_SUBST([WOE32DLL])
1194
dnl On mingw and Cygwin, we can activate special Makefile rules which add
1195
dnl version information to the shared libraries and executables.
1197
mingw* | cygwin*) is_woe32=yes ;;
1202
if test $WOE32 = yes; then
1203
dnl Check for a program that compiles Windows resource files.
1204
AC_CHECK_TOOL([WINDRES], [windres])
1207
dnl Determine whether when creating a library, "-lc" should be passed to
1208
dnl libtool or not. On many platforms, it is required for the libtool option
1209
dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
1210
dnl in the *.la files - makes it impossible to create multithreaded programs,
1211
dnl because libtool also reorders the -lc to come before the -pthread, and
1212
dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
1219
dnl Rename some macros and functions used for locking.
1221
#define __libc_lock_t gl_lock_t
1222
#define __libc_lock_define gl_lock_define
1223
#define __libc_lock_define_initialized gl_lock_define_initialized
1224
#define __libc_lock_init gl_lock_init
1225
#define __libc_lock_lock gl_lock_lock
1226
#define __libc_lock_unlock gl_lock_unlock
1227
#define __libc_lock_recursive_t gl_recursive_lock_t
1228
#define __libc_lock_define_recursive gl_recursive_lock_define
1229
#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
1230
#define __libc_lock_init_recursive gl_recursive_lock_init
1231
#define __libc_lock_lock_recursive gl_recursive_lock_lock
1232
#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
1233
#define glthread_in_use libintl_thread_in_use
1234
#define glthread_lock_init_func libintl_lock_init_func
1235
#define glthread_lock_lock_func libintl_lock_lock_func
1236
#define glthread_lock_unlock_func libintl_lock_unlock_func
1237
#define glthread_lock_destroy_func libintl_lock_destroy_func
1238
#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
1239
#define glthread_rwlock_init_func libintl_rwlock_init_func
1240
#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
1241
#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
1242
#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
1243
#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
1244
#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
1245
#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
1246
#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
1247
#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
1248
#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
1249
#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
1250
#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
1251
#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
1252
#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
1253
#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
1254
#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
1255
#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
1256
#define glthread_once_func libintl_once_func
1257
#define glthread_once_singlethreaded libintl_once_singlethreaded
1258
#define glthread_once_multithreaded libintl_once_multithreaded
1263
dnl Checks for the core files of the intl subdirectory:
1270
dnl hash-string.h hash-string.c
1272
dnl libgnuintl.h.in (except the *printf stuff)
1277
dnl plural-exp.h plural-exp.c
1279
dnl Used by libglocale.
1280
AC_DEFUN([gt_INTL_SUBDIR_CORE],
1282
AC_REQUIRE([AC_C_INLINE])dnl
1283
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1284
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1285
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1286
AC_REQUIRE([AC_FUNC_MMAP])dnl
1287
AC_REQUIRE([gt_INTDIV0])dnl
1288
AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
1289
AC_REQUIRE([gt_INTTYPES_PRI])dnl
1290
AC_REQUIRE([gl_LOCK])dnl
1294
[[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }]],
1296
[AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
1297
[Define to 1 if the compiler understands __builtin_expect.])])
1299
AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
1300
AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
1301
stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
1302
argz_stringify argz_next __fsetlocking])
1304
dnl Use the *_unlocked functions only if they are declared.
1305
dnl (because some of them were defined without being declared in Solaris
1306
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1307
dnl on Solaris 2.5.1 to run on Solaris 2.6).
1308
AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
1312
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1313
dnl because plural.y uses bison specific features. It requires at least
1314
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1316
dnl bison is only needed for the maintainer (who touches plural.y). But in
1317
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1318
dnl the rule in general Makefile. Now, some people carelessly touch the
1319
dnl files or have a broken "make" program, hence the plural.c rule will
1320
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1321
dnl present or too old.
1322
AC_CHECK_PROGS([INTLBISON], [bison])
1323
if test -z "$INTLBISON"; then
1326
dnl Found it, now check the version.
1327
AC_MSG_CHECKING([version of bison])
1328
changequote(<<,>>)dnl
1329
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1330
case $ac_prog_version in
1331
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1332
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1334
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1335
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1337
AC_MSG_RESULT([$ac_prog_version])
1339
if test $ac_verc_fail = yes; then
1344
# intlmacosx.m4 serial 5 (gettext-0.18.2)
1345
dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
1346
dnl This file is free software; the Free Software Foundation
1347
dnl gives unlimited permission to copy and/or distribute it,
1348
dnl with or without modifications, as long as this notice is preserved.
1350
dnl This file can can be used in projects which are not available under
1351
dnl the GNU General Public License or the GNU Library General Public
1352
dnl License but which still want to provide support for the GNU gettext
1354
dnl Please note that the actual code of the GNU gettext library is covered
1355
dnl by the GNU Library General Public License, and the rest of the GNU
1356
dnl gettext package package is covered by the GNU General Public License.
1357
dnl They are *not* in the public domain.
1359
dnl Checks for special options needed on Mac OS X.
1360
dnl Defines INTL_MACOSX_LIBS.
1361
AC_DEFUN([gt_INTL_MACOSX],
1363
dnl Check for API introduced in Mac OS X 10.2.
1364
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1365
[gt_cv_func_CFPreferencesCopyAppValue],
1366
[gt_save_LIBS="$LIBS"
1367
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1370
[[#include <CoreFoundation/CFPreferences.h>]],
1371
[[CFPreferencesCopyAppValue(NULL, NULL)]])],
1372
[gt_cv_func_CFPreferencesCopyAppValue=yes],
1373
[gt_cv_func_CFPreferencesCopyAppValue=no])
1374
LIBS="$gt_save_LIBS"])
1375
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1376
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
1377
[Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1379
dnl Check for API introduced in Mac OS X 10.3.
1380
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
1381
[gt_save_LIBS="$LIBS"
1382
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1385
[[#include <CoreFoundation/CFLocale.h>]],
1386
[[CFLocaleCopyCurrent();]])],
1387
[gt_cv_func_CFLocaleCopyCurrent=yes],
1388
[gt_cv_func_CFLocaleCopyCurrent=no])
1389
LIBS="$gt_save_LIBS"])
1390
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1391
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
1392
[Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
1395
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1396
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1398
AC_SUBST([INTL_MACOSX_LIBS])
1401
# intmax.m4 serial 6 (gettext-0.18.2)
1402
dnl Copyright (C) 2002-2005, 2008-2013 Free Software Foundation, Inc.
1403
dnl This file is free software; the Free Software Foundation
1404
dnl gives unlimited permission to copy and/or distribute it,
1405
dnl with or without modifications, as long as this notice is preserved.
726
1407
dnl From Bruno Haible.
727
1408
dnl Test whether the system has the 'intmax_t' type, but don't attempt to
741
1424
#if HAVE_INTTYPES_H_WITH_UINTMAX
742
1425
#include <inttypes.h>
744
], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
1430
[gt_cv_c_intmax_t=yes],
1431
[gt_cv_c_intmax_t=no])])
745
1432
if test $gt_cv_c_intmax_t = yes; then
746
AC_DEFINE(HAVE_INTMAX_T, 1,
1433
AC_DEFINE([HAVE_INTMAX_T], [1],
747
1434
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
750
# inttypes.m4 serial 1 (gettext-0.11.4)
751
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
752
dnl This file is free software, distributed under the terms of the GNU
753
dnl General Public License. As a special exception to the GNU General
754
dnl Public License, this file may be distributed as part of a program
755
dnl that contains a configuration script generated by Autoconf, under
756
dnl the same distribution terms as the rest of that program.
758
dnl From Paul Eggert.
760
# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
763
AC_DEFUN([gt_HEADER_INTTYPES_H],
765
AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
768
[#include <sys/types.h>
769
#include <inttypes.h>],
770
[], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
772
if test $gt_cv_header_inttypes_h = yes; then
773
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
774
[Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
777
# inttypes_h.m4 serial 5 (gettext-0.12)
778
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
779
dnl This file is free software, distributed under the terms of the GNU
780
dnl General Public License. As a special exception to the GNU General
781
dnl Public License, this file may be distributed as part of a program
782
dnl that contains a configuration script generated by Autoconf, under
783
dnl the same distribution terms as the rest of that program.
785
dnl From Paul Eggert.
787
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
788
# doesn't clash with <sys/types.h>, and declares uintmax_t.
790
AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
792
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
794
[#include <sys/types.h>
795
#include <inttypes.h>],
796
[uintmax_t i = (uintmax_t) -1;],
797
jm_ac_cv_header_inttypes_h=yes,
798
jm_ac_cv_header_inttypes_h=no)])
799
if test $jm_ac_cv_header_inttypes_h = yes; then
800
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
801
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
802
and declares uintmax_t. ])
805
# inttypes-pri.m4 serial 1 (gettext-0.11.4)
806
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
807
dnl This file is free software, distributed under the terms of the GNU
808
dnl General Public License. As a special exception to the GNU General
809
dnl Public License, this file may be distributed as part of a program
810
dnl that contains a configuration script generated by Autoconf, under
811
dnl the same distribution terms as the rest of that program.
1438
# inttypes-pri.m4 serial 7 (gettext-0.18.2)
1439
dnl Copyright (C) 1997-2002, 2006, 2008-2013 Free Software Foundation, Inc.
1440
dnl This file is free software; the Free Software Foundation
1441
dnl gives unlimited permission to copy and/or distribute it,
1442
dnl with or without modifications, as long as this notice is preserved.
813
1444
dnl From Bruno Haible.
815
1448
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
816
1449
# macros to non-string values. This is the case on AIX 4.3.3.
818
1451
AC_DEFUN([gt_INTTYPES_PRI],
820
AC_REQUIRE([gt_HEADER_INTTYPES_H])
821
if test $gt_cv_header_inttypes_h = yes; then
1453
AC_CHECK_HEADERS([inttypes.h])
1454
if test $ac_cv_header_inttypes_h = yes; then
822
1455
AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
823
gt_cv_inttypes_pri_broken,
1456
[gt_cv_inttypes_pri_broken],
825
AC_TRY_COMPILE([#include <inttypes.h>
1461
#include <inttypes.h>
827
1463
char *p = PRId32;
829
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
1467
[gt_cv_inttypes_pri_broken=no],
1468
[gt_cv_inttypes_pri_broken=yes])
832
1471
if test "$gt_cv_inttypes_pri_broken" = yes; then
833
AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
1472
AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
834
1473
[Define if <inttypes.h> exists and defines unusable PRI* macros.])
837
# isc-posix.m4 serial 2 (gettext-0.11.2)
838
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
839
dnl This file is free software, distributed under the terms of the GNU
840
dnl General Public License. As a special exception to the GNU General
841
dnl Public License, this file may be distributed as part of a program
842
dnl that contains a configuration script generated by Autoconf, under
843
dnl the same distribution terms as the rest of that program.
845
# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
847
# This test replaces the one in autoconf.
848
# Currently this macro should have the same name as the autoconf macro
849
# because gettext's gettext.m4 (distributed in the automake package)
850
# still uses it. Otherwise, the use in gettext.m4 makes autoheader
851
# give these diagnostics:
852
# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
853
# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
855
undefine([AC_ISC_POSIX])
857
AC_DEFUN([AC_ISC_POSIX],
859
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
860
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
863
# lcmessage.m4 serial 3 (gettext-0.11.3)
864
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
865
dnl This file is free software, distributed under the terms of the GNU
866
dnl General Public License. As a special exception to the GNU General
867
dnl Public License, this file may be distributed as part of a program
868
dnl that contains a configuration script generated by Autoconf, under
869
dnl the same distribution terms as the rest of that program.
1478
AC_SUBST([PRI_MACROS_BROKEN])
1481
# inttypes_h.m4 serial 10
1482
dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
1483
dnl This file is free software; the Free Software Foundation
1484
dnl gives unlimited permission to copy and/or distribute it,
1485
dnl with or without modifications, as long as this notice is preserved.
1487
dnl From Paul Eggert.
1489
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1490
# doesn't clash with <sys/types.h>, and declares uintmax_t.
1492
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
1494
AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
1498
#include <sys/types.h>
1499
#include <inttypes.h>
1501
[[uintmax_t i = (uintmax_t) -1; return !i;]])],
1502
[gl_cv_header_inttypes_h=yes],
1503
[gl_cv_header_inttypes_h=no])])
1504
if test $gl_cv_header_inttypes_h = yes; then
1505
AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
1506
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1507
and declares uintmax_t. ])
1511
# lcmessage.m4 serial 7 (gettext-0.18.2)
1512
dnl Copyright (C) 1995-2002, 2004-2005, 2008-2013 Free Software Foundation,
1514
dnl This file is free software; the Free Software Foundation
1515
dnl gives unlimited permission to copy and/or distribute it,
1516
dnl with or without modifications, as long as this notice is preserved.
871
1518
dnl This file can can be used in projects which are not available under
872
1519
dnl the GNU General Public License or the GNU Library General Public
974
1630
AC_MSG_CHECKING([for non-GNU ld])
976
AC_CACHE_VAL(acl_cv_path_LD,
1632
AC_CACHE_VAL([acl_cv_path_LD],
977
1633
[if test -z "$LD"; then
978
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1634
acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
979
1635
for ac_dir in $PATH; do
980
1637
test -z "$ac_dir" && ac_dir=.
981
1638
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
982
1639
acl_cv_path_LD="$ac_dir/$ac_prog"
983
1640
# Check to see if the program is GNU ld. I'd rather use --version,
984
# but apparently some GNU ld's only accept -v.
1641
# but apparently some variants of GNU ld only accept -v.
985
1642
# Break only if it was the GNU/non-GNU ld that we prefer.
986
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1643
case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
987
1644
*GNU* | *'with BFD'*)
988
test "$with_gnu_ld" != no && break ;;
1645
test "$with_gnu_ld" != no && break
990
test "$with_gnu_ld" != yes && break ;;
1648
test "$with_gnu_ld" != yes && break
996
1655
acl_cv_path_LD="$LD" # Let the user override the test with a path.
998
1657
LD="$acl_cv_path_LD"
999
1658
if test -n "$LD"; then
1659
AC_MSG_RESULT([$LD])
1004
1663
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1005
1664
AC_LIB_PROG_LD_GNU
1007
# lib-link.m4 serial 4 (gettext-0.12)
1008
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1009
dnl This file is free software, distributed under the terms of the GNU
1010
dnl General Public License. As a special exception to the GNU General
1011
dnl Public License, this file may be distributed as part of a program
1012
dnl that contains a configuration script generated by Autoconf, under
1013
dnl the same distribution terms as the rest of that program.
1667
# lib-link.m4 serial 26 (gettext-0.18.2)
1668
dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
1669
dnl This file is free software; the Free Software Foundation
1670
dnl gives unlimited permission to copy and/or distribute it,
1671
dnl with or without modifications, as long as this notice is preserved.
1015
1673
dnl From Bruno Haible.
1017
1677
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1018
1678
dnl the libraries corresponding to explicit and implicit dependencies.
1019
1679
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1020
1680
dnl augments the CPPFLAGS variable.
1681
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1682
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1021
1683
AC_DEFUN([AC_LIB_LINKFLAGS],
1023
1685
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1024
1686
AC_REQUIRE([AC_LIB_RPATH])
1025
define([Name],[translit([$1],[./-], [___])])
1026
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1027
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1687
pushdef([Name],[m4_translit([$1],[./+-], [____])])
1688
pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1689
[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1028
1690
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1029
1691
AC_LIB_LINKFLAGS_BODY([$1], [$2])
1030
1692
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1031
1693
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1032
1694
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1695
ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
1034
1697
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1035
1698
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1036
1699
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1700
LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
1037
1701
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1038
1702
AC_SUBST([LIB]NAME)
1039
1703
AC_SUBST([LTLIB]NAME)
1704
AC_SUBST([LIB]NAME[_PREFIX])
1040
1705
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1041
1706
dnl results of this search when this library appears as a dependency.
1042
1707
HAVE_LIB[]NAME=yes
1047
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1712
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
1048
1713
dnl searches for libname and the libraries corresponding to explicit and
1049
1714
dnl implicit dependencies, together with the specified include files and
1050
dnl the ability to compile and link the specified testcode. If found, it
1051
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1052
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1715
dnl the ability to compile and link the specified testcode. The missing-message
1716
dnl defaults to 'no' and may contain additional hints for the user.
1717
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
1718
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1053
1719
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1054
1720
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1721
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1722
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1055
1723
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1057
1725
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1058
1726
AC_REQUIRE([AC_LIB_RPATH])
1059
define([Name],[translit([$1],[./-], [___])])
1060
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1061
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1727
pushdef([Name],[m4_translit([$1],[./+-], [____])])
1728
pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1729
[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1063
1731
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1064
1732
dnl accordingly.
1710
2596
exec_prefix="$acl_save_exec_prefix"
1711
2597
prefix="$acl_save_prefix"
1713
# longdouble.m4 serial 1 (gettext-0.12)
1714
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
1715
dnl This file is free software, distributed under the terms of the GNU
1716
dnl General Public License. As a special exception to the GNU General
1717
dnl Public License, this file may be distributed as part of a program
1718
dnl that contains a configuration script generated by Autoconf, under
1719
dnl the same distribution terms as the rest of that program.
2600
dnl AC_LIB_PREPARE_MULTILIB creates
2601
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
2602
dnl "lib" or "lib64" or "lib/64",
2603
dnl - a variable acl_libdirstem2, as a secondary possible value for
2604
dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
2606
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
2608
dnl There is no formal standard regarding lib and lib64.
2609
dnl On glibc systems, the current practice is that on a system supporting
2610
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2611
dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
2612
dnl the compiler's default mode by looking at the compiler's library search
2613
dnl path. If at least one of its elements ends in /lib64 or points to a
2614
dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
2615
dnl Otherwise we use the default, namely "lib".
2616
dnl On Solaris systems, the current practice is that on a system supporting
2617
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2618
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
2619
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
2620
AC_REQUIRE([AC_CANONICAL_HOST])
2625
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
2626
dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
2627
dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
2628
dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
2629
dnl symlink is missing, so we set acl_libdirstem2 too.
2630
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
2631
[AC_EGREP_CPP([sixtyfour bits], [
2635
], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
2637
if test $gl_cv_solaris_64bit = yes; then
2638
acl_libdirstem=lib/64
2640
sparc*) acl_libdirstem2=lib/sparcv9 ;;
2641
i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
2646
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
2647
if test -n "$searchpath"; then
2648
acl_save_IFS="${IFS= }"; IFS=":"
2649
for searchdir in $searchpath; do
2650
if test -d "$searchdir"; then
2651
case "$searchdir" in
2652
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
2654
# Better ignore directories of this form. They are misleading.
2656
*) searchdir=`cd "$searchdir" && pwd`
2657
case "$searchdir" in
2658
*/lib64 ) acl_libdirstem=lib64 ;;
2667
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
2670
# lock.m4 serial 13 (gettext-0.18.2)
2671
dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
2672
dnl This file is free software; the Free Software Foundation
2673
dnl gives unlimited permission to copy and/or distribute it,
2674
dnl with or without modifications, as long as this notice is preserved.
1721
2676
dnl From Bruno Haible.
1722
dnl Test whether the compiler supports the 'long double' type.
1723
dnl Prerequisite: AC_PROG_CC
1725
AC_DEFUN([gt_TYPE_LONGDOUBLE],
1727
AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
1728
[if test "$GCC" = yes; then
1729
gt_cv_c_long_double=yes
1732
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
1733
long double foo = 0.0;
1734
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
1735
int array [2*(sizeof(long double) >= sizeof(double)) - 1];
1737
gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
2680
AC_REQUIRE([gl_THREADLIB])
2681
if test "$gl_threads_api" = posix; then
2682
# OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
2683
# pthread_rwlock_* functions.
2684
AC_CHECK_TYPE([pthread_rwlock_t],
2685
[AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
2686
[Define if the POSIX multithreading library has read/write locks.])],
2688
[#include <pthread.h>])
2689
# glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
2692
[[#include <pthread.h>]],
2694
#if __FreeBSD__ == 4
2695
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
2696
#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
2697
&& __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
2698
error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
2700
int x = (int)PTHREAD_MUTEX_RECURSIVE;
2704
[AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
2705
[Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
2710
# Prerequisites of lib/glthread/lock.c.
2711
AC_DEFUN([gl_PREREQ_LOCK], [:])
2713
# longlong.m4 serial 17
2714
dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc.
2715
dnl This file is free software; the Free Software Foundation
2716
dnl gives unlimited permission to copy and/or distribute it,
2717
dnl with or without modifications, as long as this notice is preserved.
2719
dnl From Paul Eggert.
2721
# Define HAVE_LONG_LONG_INT if 'long long int' works.
2722
# This fixes a bug in Autoconf 2.61, and can be faster
2723
# than what's in Autoconf 2.62 through 2.68.
2725
# Note: If the type 'long long int' exists but is only 32 bits large
2726
# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
2727
# defined. In this case you can treat 'long long int' like 'long int'.
2729
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
2731
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
2732
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
2733
[ac_cv_type_long_long_int=yes
2734
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
2735
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
2736
if test $ac_cv_type_long_long_int = yes; then
2737
dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
2738
dnl If cross compiling, assume the bug is not important, since
2739
dnl nobody cross compiles for this platform as far as we know.
2742
[[@%:@include <limits.h>
2743
@%:@ifndef LLONG_MAX
2745
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
2746
@%:@ define LLONG_MAX (HALF - 1 + HALF)
2748
[[long long int n = 1;
2752
long long int m = n << i;
2755
if (LLONG_MAX / 2 < m)
2760
[ac_cv_type_long_long_int=no],
2764
if test $ac_cv_type_long_long_int = yes; then
2765
AC_DEFINE([HAVE_LONG_LONG_INT], [1],
2766
[Define to 1 if the system has the type 'long long int'.])
2770
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
2771
# This fixes a bug in Autoconf 2.61, and can be faster
2772
# than what's in Autoconf 2.62 through 2.68.
2774
# Note: If the type 'unsigned long long int' exists but is only 32 bits
2775
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
2776
# will not be defined. In this case you can treat 'unsigned long long int'
2777
# like 'unsigned long int'.
2779
AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
2781
AC_CACHE_CHECK([for unsigned long long int],
2782
[ac_cv_type_unsigned_long_long_int],
2783
[ac_cv_type_unsigned_long_long_int=yes
2784
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
2786
[_AC_TYPE_LONG_LONG_SNIPPET],
2788
[ac_cv_type_unsigned_long_long_int=no])
1739
if test $gt_cv_c_long_double = yes; then
1740
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
2790
if test $ac_cv_type_unsigned_long_long_int = yes; then
2791
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
2792
[Define to 1 if the system has the type 'unsigned long long int'.])
1743
# longlong.m4 serial 4
1744
dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
1745
dnl This file is free software, distributed under the terms of the GNU
1746
dnl General Public License. As a special exception to the GNU General
1747
dnl Public License, this file may be distributed as part of a program
1748
dnl that contains a configuration script generated by Autoconf, under
1749
dnl the same distribution terms as the rest of that program.
1751
dnl From Paul Eggert.
1753
# Define HAVE_LONG_LONG if 'long long' works.
1755
AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2796
# Expands to a C program that can be used to test for simultaneous support
2797
# of 'long long' and 'unsigned long long'. We don't want to say that
2798
# 'long long' is available if 'unsigned long long' is not, or vice versa,
2799
# because too many programs rely on the symmetry between signed and unsigned
2800
# integer types (excluding 'bool').
2801
AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
1757
AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
1758
[AC_TRY_LINK([long long ll = 1LL; int i = 63;],
1759
[long long llmax = (long long) -1;
1760
return ll << i | ll >> i | llmax / ll | llmax % ll;],
1761
ac_cv_type_long_long=yes,
1762
ac_cv_type_long_long=no)])
1763
if test $ac_cv_type_long_long = yes; then
1764
AC_DEFINE(HAVE_LONG_LONG, 1,
1765
[Define if you have the 'long long' type.])
2804
[[/* For now, do not test the preprocessor; as of 2007 there are too many
2805
implementations with broken preprocessors. Perhaps this can
2806
be revisited in 2012. In the meantime, code should not expect
2807
#if to work with literals wider than 32 bits. */
2808
/* Test literals. */
2809
long long int ll = 9223372036854775807ll;
2810
long long int nll = -9223372036854775807LL;
2811
unsigned long long int ull = 18446744073709551615ULL;
2812
/* Test constant expressions. */
2813
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
2815
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
2818
[[/* Test availability of runtime routines for shift and division. */
2819
long long int llmax = 9223372036854775807ll;
2820
unsigned long long int ullmax = 18446744073709551615ull;
2821
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
2822
| (llmax / ll) | (llmax % ll)
2823
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
2824
| (ullmax / ull) | (ullmax % ull));]])
1768
# nls.m4 serial 1 (gettext-0.12)
1769
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1770
dnl This file is free software, distributed under the terms of the GNU
1771
dnl General Public License. As a special exception to the GNU General
1772
dnl Public License, this file may be distributed as part of a program
1773
dnl that contains a configuration script generated by Autoconf, under
1774
dnl the same distribution terms as the rest of that program.
2827
# nls.m4 serial 5 (gettext-0.18)
2828
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
2830
dnl This file is free software; the Free Software Foundation
2831
dnl gives unlimited permission to copy and/or distribute it,
2832
dnl with or without modifications, as long as this notice is preserved.
1776
2834
dnl This file can can be used in projects which are not available under
1777
2835
dnl the GNU General Public License or the GNU Library General Public
1786
2844
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1787
2845
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1789
2849
AC_DEFUN([AM_NLS],
1791
2851
AC_MSG_CHECKING([whether NLS is requested])
1792
2852
dnl Default is enabled NLS
2853
AC_ARG_ENABLE([nls],
1794
2854
[ --disable-nls do not use Native Language Support],
1795
2855
USE_NLS=$enableval, USE_NLS=yes)
1796
AC_MSG_RESULT($USE_NLS)
1800
AC_DEFUN([AM_MKINSTALLDIRS],
1802
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1803
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1804
dnl Try to locate it.
1806
if test -n "$ac_aux_dir"; then
1807
case "$ac_aux_dir" in
1808
/*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1809
*) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1812
if test -z "$MKINSTALLDIRS"; then
1813
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1815
AC_SUBST(MKINSTALLDIRS)
1817
# po.m4 serial 3 (gettext-0.14)
1818
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1819
dnl This file is free software, distributed under the terms of the GNU
1820
dnl General Public License. As a special exception to the GNU General
1821
dnl Public License, this file may be distributed as part of a program
1822
dnl that contains a configuration script generated by Autoconf, under
1823
dnl the same distribution terms as the rest of that program.
2856
AC_MSG_RESULT([$USE_NLS])
2860
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2861
# serial 1 (pkg-config-0.24)
2863
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2865
# This program is free software; you can redistribute it and/or modify
2866
# it under the terms of the GNU General Public License as published by
2867
# the Free Software Foundation; either version 2 of the License, or
2868
# (at your option) any later version.
2870
# This program is distributed in the hope that it will be useful, but
2871
# WITHOUT ANY WARRANTY; without even the implied warranty of
2872
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2873
# General Public License for more details.
2875
# You should have received a copy of the GNU General Public License
2876
# along with this program; if not, write to the Free Software
2877
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2879
# As a special exception to the GNU General Public License, if you
2880
# distribute this file as part of a program that contains a
2881
# configuration script generated by Autoconf, you may include it under
2882
# the same distribution terms that you use for the rest of that program.
2884
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2885
# ----------------------------------
2886
AC_DEFUN([PKG_PROG_PKG_CONFIG],
2887
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2888
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
2889
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
2890
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
2891
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
2892
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
2894
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2895
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2897
if test -n "$PKG_CONFIG"; then
2898
_pkg_min_version=m4_default([$1], [0.9.0])
2899
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2900
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2901
AC_MSG_RESULT([yes])
2907
])# PKG_PROG_PKG_CONFIG
2909
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2911
# Check to see whether a particular set of modules exists. Similar
2912
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2914
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2915
# only at the first occurence in configure.ac, so if the first place
2916
# it's called might be skipped (such as if it is within an "if", you
2917
# have to call PKG_CHECK_EXISTS manually
2918
# --------------------------------------------------------------
2919
AC_DEFUN([PKG_CHECK_EXISTS],
2920
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2921
if test -n "$PKG_CONFIG" && \
2922
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2923
m4_default([$2], [:])
2924
m4_ifvaln([$3], [else
2928
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2929
# ---------------------------------------------
2930
m4_define([_PKG_CONFIG],
2931
[if test -n "$$1"; then
2933
elif test -n "$PKG_CONFIG"; then
2934
PKG_CHECK_EXISTS([$3],
2935
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
2936
test "x$?" != "x0" && pkg_failed=yes ],
2943
# _PKG_SHORT_ERRORS_SUPPORTED
2944
# -----------------------------
2945
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2946
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2947
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2948
_pkg_short_errors_supported=yes
2950
_pkg_short_errors_supported=no
2952
])# _PKG_SHORT_ERRORS_SUPPORTED
2955
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2956
# [ACTION-IF-NOT-FOUND])
2959
# Note that if there is a possibility the first call to
2960
# PKG_CHECK_MODULES might not happen, you should be sure to include an
2961
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2964
# --------------------------------------------------------------
2965
AC_DEFUN([PKG_CHECK_MODULES],
2966
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2967
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2968
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2971
AC_MSG_CHECKING([for $1])
2973
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2974
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2976
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2977
and $1[]_LIBS to avoid the need to call pkg-config.
2978
See the pkg-config man page for more details.])
2980
if test $pkg_failed = yes; then
2982
_PKG_SHORT_ERRORS_SUPPORTED
2983
if test $_pkg_short_errors_supported = yes; then
2984
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
2986
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
2988
# Put the nasty error message in config.log where it belongs
2989
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2991
m4_default([$4], [AC_MSG_ERROR(
2992
[Package requirements ($2) were not met:
2996
Consider adjusting the PKG_CONFIG_PATH environment variable if you
2997
installed software in a non-standard prefix.
3001
elif test $pkg_failed = untried; then
3003
m4_default([$4], [AC_MSG_FAILURE(
3004
[The pkg-config script could not be found or is too old. Make sure it
3005
is in your PATH or set the PKG_CONFIG environment variable to the full
3010
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
3013
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
3014
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
3015
AC_MSG_RESULT([yes])
3018
])# PKG_CHECK_MODULES
3021
# PKG_INSTALLDIR(DIRECTORY)
3022
# -------------------------
3023
# Substitutes the variable pkgconfigdir as the location where a module
3024
# should install pkg-config .pc files. By default the directory is
3025
# $libdir/pkgconfig, but the default can be changed by passing
3026
# DIRECTORY. The user can override through the --with-pkgconfigdir
3028
AC_DEFUN([PKG_INSTALLDIR],
3029
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
3030
m4_pushdef([pkg_description],
3031
[pkg-config installation directory @<:@]pkg_default[@:>@])
3032
AC_ARG_WITH([pkgconfigdir],
3033
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
3034
[with_pkgconfigdir=]pkg_default)
3035
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
3036
m4_popdef([pkg_default])
3037
m4_popdef([pkg_description])
3038
]) dnl PKG_INSTALLDIR
3041
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
3042
# -------------------------
3043
# Substitutes the variable noarch_pkgconfigdir as the location where a
3044
# module should install arch-independent pkg-config .pc files. By
3045
# default the directory is $datadir/pkgconfig, but the default can be
3046
# changed by passing DIRECTORY. The user can override through the
3047
# --with-noarch-pkgconfigdir parameter.
3048
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
3049
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
3050
m4_pushdef([pkg_description],
3051
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
3052
AC_ARG_WITH([noarch-pkgconfigdir],
3053
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
3054
[with_noarch_pkgconfigdir=]pkg_default)
3055
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
3056
m4_popdef([pkg_default])
3057
m4_popdef([pkg_description])
3058
]) dnl PKG_NOARCH_INSTALLDIR
3061
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
3062
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3063
# -------------------------------------------
3064
# Retrieves the value of the pkg-config variable for the given module.
3065
AC_DEFUN([PKG_CHECK_VAR],
3066
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3067
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
3069
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
3070
AS_VAR_COPY([$1], [pkg_cv_][$1])
3072
AS_VAR_IF([$1], [""], [$5], [$4])dnl
3075
# po.m4 serial 21 (gettext-0.18.3)
3076
dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
3077
dnl This file is free software; the Free Software Foundation
3078
dnl gives unlimited permission to copy and/or distribute it,
3079
dnl with or without modifications, as long as this notice is preserved.
1825
3081
dnl This file can can be used in projects which are not available under
1826
3082
dnl the GNU General Public License or the GNU Library General Public
2420
3689
#ifdef SIZE_MAX
2424
if test -z "$result"; then
2425
dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
2426
dnl than the type 'unsigned long'.
2427
dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
2428
dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
2429
_AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
2430
[#include <stddef.h>], result=?)
2431
_AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
2432
[#include <stddef.h>], result=?)
2433
_AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
2434
[#include <stddef.h>], result=?)
2435
if test "$fits_in_uint" = 1; then
2436
dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
2437
dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
2438
AC_TRY_COMPILE([#include <stddef.h>
2440
extern unsigned long foo;
2441
], [], fits_in_uint=0)
2443
if test -z "$result"; then
2444
if test "$fits_in_uint" = 1; then
2445
result="$res_hi$res_lo"U
3692
], [gl_cv_size_max=yes])
3693
if test -z "$gl_cv_size_max"; then
3694
dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
3695
dnl than the type 'unsigned long'. Try hard to find a definition that can
3696
dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
3697
AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
3698
[#include <stddef.h>
3699
#include <limits.h>], [size_t_bits_minus_1=])
3700
AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
3701
[#include <stddef.h>], [fits_in_uint=])
3702
if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
3703
if test $fits_in_uint = 1; then
3704
dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
3705
dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
3708
[[#include <stddef.h>
3710
extern unsigned long foo;
3715
dnl We cannot use 'expr' to simplify this expression, because 'expr'
3716
dnl works only with 'long' integers in the host environment, while we
3717
dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
3718
if test $fits_in_uint = 1; then
3719
gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
3721
gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
2447
result="$res_hi$res_lo"UL
3724
dnl Shouldn't happen, but who knows...
3725
gl_cv_size_max='((size_t)~(size_t)0)'
2450
dnl Shouldn't happen, but who knows...
2454
AC_MSG_RESULT([$result])
2455
if test "$result" != yes; then
2456
AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
3729
if test "$gl_cv_size_max" != yes; then
3730
AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
2457
3731
[Define as the maximum value of type 'size_t', if the system doesn't define it.])
2460
# stdint_h.m4 serial 3 (gettext-0.12)
2461
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2462
dnl This file is free software, distributed under the terms of the GNU
2463
dnl General Public License. As a special exception to the GNU General
2464
dnl Public License, this file may be distributed as part of a program
2465
dnl that contains a configuration script generated by Autoconf, under
2466
dnl the same distribution terms as the rest of that program.
3733
dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
3734
dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
3735
dnl #define by AC_DEFINE_UNQUOTED.
3736
AH_VERBATIM([SIZE_MAX],
3737
[/* Define as the maximum value of type 'size_t', if the system doesn't define
3744
dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
3745
dnl Remove this when we can assume autoconf >= 2.61.
3746
m4_ifdef([AC_COMPUTE_INT], [], [
3747
AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
3750
# stdint_h.m4 serial 9
3751
dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
3752
dnl This file is free software; the Free Software Foundation
3753
dnl gives unlimited permission to copy and/or distribute it,
3754
dnl with or without modifications, as long as this notice is preserved.
2468
3756
dnl From Paul Eggert.
2470
3758
# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2471
3759
# doesn't clash with <sys/types.h>, and declares uintmax_t.
2473
AC_DEFUN([jm_AC_HEADER_STDINT_H],
3761
AC_DEFUN([gl_AC_HEADER_STDINT_H],
2475
AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2477
[#include <sys/types.h>
2478
#include <stdint.h>],
2479
[uintmax_t i = (uintmax_t) -1;],
2480
jm_ac_cv_header_stdint_h=yes,
2481
jm_ac_cv_header_stdint_h=no)])
2482
if test $jm_ac_cv_header_stdint_h = yes; then
2483
AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
3763
AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
3766
[[#include <sys/types.h>
3767
#include <stdint.h>]],
3768
[[uintmax_t i = (uintmax_t) -1; return !i;]])],
3769
[gl_cv_header_stdint_h=yes],
3770
[gl_cv_header_stdint_h=no])])
3771
if test $gl_cv_header_stdint_h = yes; then
3772
AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
2484
3773
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2485
3774
and declares uintmax_t. ])
2488
# uintmax_t.m4 serial 7 (gettext-0.12)
2489
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2490
dnl This file is free software, distributed under the terms of the GNU
2491
dnl General Public License. As a special exception to the GNU General
2492
dnl Public License, this file may be distributed as part of a program
2493
dnl that contains a configuration script generated by Autoconf, under
2494
dnl the same distribution terms as the rest of that program.
3778
# threadlib.m4 serial 10 (gettext-0.18.2)
3779
dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
3780
dnl This file is free software; the Free Software Foundation
3781
dnl gives unlimited permission to copy and/or distribute it,
3782
dnl with or without modifications, as long as this notice is preserved.
3784
dnl From Bruno Haible.
3788
dnl Tests for a multithreading library to be used.
3789
dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
3790
dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
3791
dnl default is 'no', otherwise it is system dependent. In both cases, the user
3792
dnl can change the choice through the options --enable-threads=choice or
3793
dnl --disable-threads.
3794
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
3795
dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
3796
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
3797
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
3799
dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
3800
dnl programs that really need multithread functionality. The difference
3801
dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
3802
dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
3803
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
3804
dnl multithread-safe programs.
3806
AC_DEFUN([gl_THREADLIB_EARLY],
3808
AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
3811
dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
3813
AC_DEFUN([gl_THREADLIB_EARLY_BODY],
3815
dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
3816
dnl influences the result of the autoconf tests that test for *_unlocked
3817
dnl declarations, on AIX 5 at least. Therefore it must come early.
3818
AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
3819
AC_BEFORE([$0], [gl_ARGP])dnl
3821
AC_REQUIRE([AC_CANONICAL_HOST])
3822
dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
3823
dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
3825
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
3826
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
3827
[AC_REQUIRE([AC_GNU_SOURCE])])
3828
dnl Check for multithreading.
3829
m4_ifdef([gl_THREADLIB_DEFAULT_NO],
3830
[m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
3831
[m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
3832
AC_ARG_ENABLE([threads],
3833
AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
3834
AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
3835
[gl_use_threads=$enableval],
3836
[if test -n "$gl_use_threads_default"; then
3837
gl_use_threads="$gl_use_threads_default"
3841
dnl Disable multithreading by default on OSF/1, because it interferes
3842
dnl with fork()/exec(): When msgexec is linked with -lpthread, its
3843
dnl child process gets an endless segmentation fault inside execvp().
3844
dnl Disable multithreading by default on Cygwin 1.5.x, because it has
3845
dnl bugs that lead to endless loops or crashes. See
3846
dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
3847
osf*) gl_use_threads=no ;;
3850
1.[0-5].*) gl_use_threads=no ;;
3851
*) gl_use_threads=yes ;;
3854
*) gl_use_threads=yes ;;
3859
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
3860
# For using <pthread.h>:
3863
# On OSF/1, the compiler needs the flag -D_REENTRANT so that it
3864
# groks <pthread.h>. cc also understands the flag -pthread, but
3865
# we don't use it because 1. gcc-2.95 doesn't understand -pthread,
3866
# 2. putting a flag into CPPFLAGS that has an effect on the linker
3867
# causes the AC_LINK_IFELSE test below to succeed unexpectedly,
3868
# leading to wrong values of LIBTHREAD and LTLIBTHREAD.
3869
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3872
# Some systems optimize for single-threaded programs by default, and
3873
# need special flags to disable these optimizations. For example, the
3874
# definition of 'errno' in <errno.h>.
3876
aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
3877
solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
3882
dnl The guts of gl_THREADLIB. Needs to be expanded only once.
3884
AC_DEFUN([gl_THREADLIB_BODY],
3886
AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
3892
if test "$gl_use_threads" != no; then
3893
dnl Check whether the compiler and linker support weak declarations.
3894
AC_CACHE_CHECK([whether imported symbols can be declared weak],
3897
dnl First, test whether the compiler accepts it syntactically.
3900
[[extern void xyzzy ();
3901
#pragma weak xyzzy]],
3903
[gl_cv_have_weak=maybe])
3904
if test $gl_cv_have_weak = maybe; then
3905
dnl Second, test whether it actually works. On Cygwin 1.7.2, with
3906
dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
3913
return (fputs == NULL);
3915
[gl_cv_have_weak=yes],
3916
[gl_cv_have_weak=no],
3917
[dnl When cross-compiling, assume that only ELF platforms support
3919
AC_EGREP_CPP([Extensible Linking Format],
3921
Extensible Linking Format
3924
[gl_cv_have_weak="guessing yes"],
3925
[gl_cv_have_weak="guessing no"])
3929
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
3930
# On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
3931
# it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
3932
AC_CHECK_HEADER([pthread.h],
3933
[gl_have_pthread_h=yes], [gl_have_pthread_h=no])
3934
if test "$gl_have_pthread_h" = yes; then
3935
# Other possible tests:
3936
# -lpthreads (FSU threads, PCthreads)
3939
# Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
3940
# in libc. IRIX 6.5 has the first one in both libc and libpthread, but
3941
# the second one only in libpthread, and lock.c needs it.
3944
[[#include <pthread.h>]],
3945
[[pthread_mutex_lock((pthread_mutex_t*)0);
3946
pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
3947
[gl_have_pthread=yes])
3948
# Test for libpthread by looking for pthread_kill. (Not pthread_self,
3949
# since it is defined as a macro on OSF/1.)
3950
if test -n "$gl_have_pthread"; then
3951
# The program links fine without libpthread. But it may actually
3952
# need to link with libpthread in order to create multiple threads.
3953
AC_CHECK_LIB([pthread], [pthread_kill],
3954
[LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
3955
# On Solaris and HP-UX, most pthread functions exist also in libc.
3956
# Therefore pthread_in_use() needs to actually try to create a
3957
# thread: pthread_create from libc will fail, whereas
3958
# pthread_create will actually create a thread.
3961
AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
3962
[Define if the pthread_in_use() detection is hard.])
3966
# Some library is needed. Try libpthread and libc_r.
3967
AC_CHECK_LIB([pthread], [pthread_kill],
3968
[gl_have_pthread=yes
3969
LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
3970
LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
3971
if test -z "$gl_have_pthread"; then
3973
AC_CHECK_LIB([c_r], [pthread_kill],
3974
[gl_have_pthread=yes
3975
LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
3976
LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
3979
if test -n "$gl_have_pthread"; then
3980
gl_threads_api=posix
3981
AC_DEFINE([USE_POSIX_THREADS], [1],
3982
[Define if the POSIX multithreading library can be used.])
3983
if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
3984
if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
3985
AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
3986
[Define if references to the POSIX multithreading library should be made weak.])
3994
if test -z "$gl_have_pthread"; then
3995
if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
3996
gl_have_solaristhread=
3997
gl_save_LIBS="$LIBS"
3998
LIBS="$LIBS -lthread"
4006
[gl_have_solaristhread=yes])
4007
LIBS="$gl_save_LIBS"
4008
if test -n "$gl_have_solaristhread"; then
4009
gl_threads_api=solaris
4011
LTLIBTHREAD=-lthread
4012
LIBMULTITHREAD="$LIBTHREAD"
4013
LTLIBMULTITHREAD="$LTLIBTHREAD"
4014
AC_DEFINE([USE_SOLARIS_THREADS], [1],
4015
[Define if the old Solaris multithreading library can be used.])
4016
if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
4017
AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
4018
[Define if references to the old Solaris multithreading library should be made weak.])
4025
if test "$gl_use_threads" = pth; then
4026
gl_save_CPPFLAGS="$CPPFLAGS"
4027
AC_LIB_LINKFLAGS([pth])
4029
gl_save_LIBS="$LIBS"
4030
LIBS="$LIBS $LIBPTH"
4032
[AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
4034
LIBS="$gl_save_LIBS"
4035
if test -n "$gl_have_pth"; then
4038
LTLIBTHREAD="$LTLIBPTH"
4039
LIBMULTITHREAD="$LIBTHREAD"
4040
LTLIBMULTITHREAD="$LTLIBTHREAD"
4041
AC_DEFINE([USE_PTH_THREADS], [1],
4042
[Define if the GNU Pth multithreading library can be used.])
4043
if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
4044
if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
4045
AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
4046
[Define if references to the GNU Pth multithreading library should be made weak.])
4052
CPPFLAGS="$gl_save_CPPFLAGS"
4055
if test -z "$gl_have_pthread"; then
4056
case "$gl_use_threads" in
4057
yes | windows | win32) # The 'win32' is for backward compatibility.
4058
if { case "$host_os" in
4063
gl_threads_api=windows
4064
AC_DEFINE([USE_WINDOWS_THREADS], [1],
4065
[Define if the native Windows multithreading API can be used.])
4071
AC_MSG_CHECKING([for multithread API to use])
4072
AC_MSG_RESULT([$gl_threads_api])
4073
AC_SUBST([LIBTHREAD])
4074
AC_SUBST([LTLIBTHREAD])
4075
AC_SUBST([LIBMULTITHREAD])
4076
AC_SUBST([LTLIBMULTITHREAD])
4079
AC_DEFUN([gl_THREADLIB],
4081
AC_REQUIRE([gl_THREADLIB_EARLY])
4082
AC_REQUIRE([gl_THREADLIB_BODY])
4086
dnl gl_DISABLE_THREADS
4087
dnl ------------------
4088
dnl Sets the gl_THREADLIB default so that threads are not used by default.
4089
dnl The user can still override it at installation time, by using the
4090
dnl configure option '--enable-threads'.
4092
AC_DEFUN([gl_DISABLE_THREADS], [
4093
m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
4097
dnl Survey of platforms:
4099
dnl Platform Available Compiler Supports test-lock
4100
dnl flavours option weak result
4101
dnl --------------- --------- --------- -------- ---------
4102
dnl Linux 2.4/glibc posix -lpthread Y OK
4104
dnl GNU Hurd/glibc posix
4106
dnl FreeBSD 5.3 posix -lc_r Y
4108
dnl posix -lpthread ? Y
4111
dnl FreeBSD 5.2 posix -lc_r Y
4115
dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
4119
dnl OpenBSD 3.4 posix -lpthread Y OK
4121
dnl Mac OS X 10.[123] posix -lpthread Y OK
4123
dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
4124
dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
4126
dnl HP-UX 11 posix -lpthread N (cc) OK
4129
dnl IRIX 6.5 posix -lpthread Y 0.5
4131
dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
4133
dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
4134
dnl -lpthread (gcc) Y
4136
dnl Cygwin posix -lpthread Y OK
4138
dnl Any of the above pth -lpth 0.0
4140
dnl Mingw windows N OK
4144
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
4146
dnl OK if all three tests terminate OK,
4147
dnl 0.5 if the first test terminates OK but the second one loops endlessly,
4148
dnl 0.0 if the first test already loops endlessly.
4150
# uintmax_t.m4 serial 12
4151
dnl Copyright (C) 1997-2004, 2007-2013 Free Software Foundation, Inc.
4152
dnl This file is free software; the Free Software Foundation
4153
dnl gives unlimited permission to copy and/or distribute it,
4154
dnl with or without modifications, as long as this notice is preserved.
2496
4156
dnl From Paul Eggert.
2500
4160
# Define uintmax_t to 'unsigned long' or 'unsigned long long'
2501
4161
# if it is not already defined in <stdint.h> or <inttypes.h>.
2503
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
4163
AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
2505
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2506
AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2507
if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2508
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2509
test $ac_cv_type_unsigned_long_long = yes \
4165
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
4166
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
4167
if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
4168
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
4169
test $ac_cv_type_unsigned_long_long_int = yes \
2510
4170
&& ac_type='unsigned long long' \
2511
4171
|| ac_type='unsigned long'
2512
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
4172
AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
2513
4173
[Define to unsigned long or unsigned long long
2514
4174
if <stdint.h> and <inttypes.h> don't define.])
2516
AC_DEFINE(HAVE_UINTMAX_T, 1,
4176
AC_DEFINE([HAVE_UINTMAX_T], [1],
2517
4177
[Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2520
# ulonglong.m4 serial 3
2521
dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2522
dnl This file is free software, distributed under the terms of the GNU
2523
dnl General Public License. As a special exception to the GNU General
2524
dnl Public License, this file may be distributed as part of a program
2525
dnl that contains a configuration script generated by Autoconf, under
2526
dnl the same distribution terms as the rest of that program.
2528
dnl From Paul Eggert.
2530
# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2532
AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
4181
# visibility.m4 serial 5 (gettext-0.18.2)
4182
dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
4183
dnl This file is free software; the Free Software Foundation
4184
dnl gives unlimited permission to copy and/or distribute it,
4185
dnl with or without modifications, as long as this notice is preserved.
4187
dnl From Bruno Haible.
4189
dnl Tests whether the compiler supports the command-line option
4190
dnl -fvisibility=hidden and the function and variable attributes
4191
dnl __attribute__((__visibility__("hidden"))) and
4192
dnl __attribute__((__visibility__("default"))).
4193
dnl Does *not* test for __visibility__("protected") - which has tricky
4194
dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
4196
dnl Does *not* test for __visibility__("internal") - which has processor
4197
dnl dependent semantics.
4198
dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
4199
dnl "really only recommended for legacy code".
4200
dnl Set the variable CFLAG_VISIBILITY.
4201
dnl Defines and sets the variable HAVE_VISIBILITY.
4203
AC_DEFUN([gl_VISIBILITY],
2534
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2535
[AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
2536
[unsigned long long ullmax = (unsigned long long) -1;
2537
return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2538
ac_cv_type_unsigned_long_long=yes,
2539
ac_cv_type_unsigned_long_long=no)])
2540
if test $ac_cv_type_unsigned_long_long = yes; then
2541
AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2542
[Define if you have the 'unsigned long long' type.])
4205
AC_REQUIRE([AC_PROG_CC])
4208
if test -n "$GCC"; then
4209
dnl First, check whether -Werror can be added to the command line, or
4210
dnl whether it leads to an error because of some other option that the
4211
dnl user has put into $CC $CFLAGS $CPPFLAGS.
4212
AC_MSG_CHECKING([whether the -Werror option is usable])
4213
AC_CACHE_VAL([gl_cv_cc_vis_werror], [
4214
gl_save_CFLAGS="$CFLAGS"
4215
CFLAGS="$CFLAGS -Werror"
4217
[AC_LANG_PROGRAM([[]], [[]])],
4218
[gl_cv_cc_vis_werror=yes],
4219
[gl_cv_cc_vis_werror=no])
4220
CFLAGS="$gl_save_CFLAGS"])
4221
AC_MSG_RESULT([$gl_cv_cc_vis_werror])
4222
dnl Now check whether visibility declarations are supported.
4223
AC_MSG_CHECKING([for simple visibility declarations])
4224
AC_CACHE_VAL([gl_cv_cc_visibility], [
4225
gl_save_CFLAGS="$CFLAGS"
4226
CFLAGS="$CFLAGS -fvisibility=hidden"
4227
dnl We use the option -Werror and a function dummyfunc, because on some
4228
dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
4229
dnl "visibility attribute not supported in this configuration; ignored"
4230
dnl at the first function definition in every compilation unit, and we
4231
dnl don't want to use the option in this case.
4232
if test $gl_cv_cc_vis_werror = yes; then
4233
CFLAGS="$CFLAGS -Werror"
4237
[[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
4238
extern __attribute__((__visibility__("default"))) int exportedvar;
4239
extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
4240
extern __attribute__((__visibility__("default"))) int exportedfunc (void);
4241
void dummyfunc (void) {}
4244
[gl_cv_cc_visibility=yes],
4245
[gl_cv_cc_visibility=no])
4246
CFLAGS="$gl_save_CFLAGS"])
4247
AC_MSG_RESULT([$gl_cv_cc_visibility])
4248
if test $gl_cv_cc_visibility = yes; then
4249
CFLAG_VISIBILITY="-fvisibility=hidden"
4253
AC_SUBST([CFLAG_VISIBILITY])
4254
AC_SUBST([HAVE_VISIBILITY])
4255
AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
4256
[Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
2545
# wchar_t.m4 serial 1 (gettext-0.12)
2546
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2547
dnl This file is free software, distributed under the terms of the GNU
2548
dnl General Public License. As a special exception to the GNU General
2549
dnl Public License, this file may be distributed as part of a program
2550
dnl that contains a configuration script generated by Autoconf, under
2551
dnl the same distribution terms as the rest of that program.
4259
# wchar_t.m4 serial 4 (gettext-0.18.2)
4260
dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc.
4261
dnl This file is free software; the Free Software Foundation
4262
dnl gives unlimited permission to copy and/or distribute it,
4263
dnl with or without modifications, as long as this notice is preserved.
2553
4265
dnl From Bruno Haible.
2554
4266
dnl Test whether <stddef.h> has the 'wchar_t' type.
2579
4294
AC_DEFUN([gt_TYPE_WINT_T],
2581
AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
2582
[AC_TRY_COMPILE([#include <wchar.h>
2583
wint_t foo = (wchar_t)'\0';], ,
2584
gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
4296
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
4300
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
4302
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
4303
before <wchar.h>. */
4308
wint_t foo = (wchar_t)'\0';]],
4310
[gt_cv_c_wint_t=yes],
4311
[gt_cv_c_wint_t=no])])
2585
4312
if test $gt_cv_c_wint_t = yes; then
2586
AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
4313
AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
2590
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2591
dnl This file is free software, distributed under the terms of the GNU
2592
dnl General Public License. As a special exception to the GNU General
2593
dnl Public License, this file may be distributed as part of a program
2594
dnl that contains a configuration script generated by Autoconf, under
2595
dnl the same distribution terms as the rest of that program.
4318
dnl Copyright (C) 2003-2004, 2008-2013 Free Software Foundation, Inc.
4319
dnl This file is free software; the Free Software Foundation
4320
dnl gives unlimited permission to copy and/or distribute it,
4321
dnl with or without modifications, as long as this notice is preserved.
2597
4323
AC_DEFUN([gl_XSIZE],
2599
4325
dnl Prerequisites of lib/xsize.h.
2600
4326
AC_REQUIRE([gl_SIZE_MAX])
2601
AC_CHECK_HEADERS(stdint.h)
2604
# from http://autoconf-archive.cryp.to/ax_tls.html
2606
# This was licensed under the GPL with the following exception:
2608
# As a special exception, the respective Autoconf Macro's copyright
2609
# owner gives unlimited permission to copy, distribute and modify the
2610
# configure scripts that are the output of Autoconf when processing
2611
# the Macro. You need not follow the terms of the GNU General Public
2612
# License when using or distributing such scripts, even though
2613
# portions of the text of the Macro appear in them. The GNU General
2614
# Public License (GPL) does govern all other use of the material that
2615
# constitutes the Autoconf Macro.
2617
# This special exception to the GPL applies to versions of the
2618
# Autoconf Macro released by the Autoconf Macro Archive. When you make
2619
# and distribute a modified version of the Autoconf Macro, you may
2620
# extend this special exception to the GPL to apply to your modified
2623
AC_DEFUN([AX_TLS], [
2624
AC_MSG_CHECKING(for thread local storage (TLS) class)
2625
AC_CACHE_VAL(ac_cv_tls, [
2626
ax_tls_keywords="__thread __declspec(thread) none"
2627
for ax_tls_keyword in $ax_tls_keywords; do
2628
case $ax_tls_keyword in
2629
none) ac_cv_tls=none ; break ;;
2632
[#include <stdlib.h>
2635
static ] $ax_tls_keyword [ int bar;
2639
[ac_cv_tls=$ax_tls_keyword ; break],
2646
if test "$ac_cv_tls" != "none"; then
2647
dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
2648
AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
2650
AC_MSG_RESULT($ac_cv_tls)
2653
# Excerpted from pkg.m4 - Macros to locate and utilise pkg-config
2655
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2657
# This program is free software; you can redistribute it and/or modify
2658
# it under the terms of the GNU General Public License as published by
2659
# the Free Software Foundation; either version 2 of the License, or
2660
# (at your option) any later version.
2662
# This program is distributed in the hope that it will be useful, but
2663
# WITHOUT ANY WARRANTY; without even the implied warranty of
2664
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2665
# General Public License for more details.
2667
# You should have received a copy of the GNU General Public License
2668
# along with this program; if not, write to the Free Software
2669
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2671
# As a special exception to the GNU General Public License, if you
2672
# distribute this file as part of a program that contains a
2673
# configuration script generated by Autoconf, you may include it under
2674
# the same distribution terms that you use for the rest of that program.
2676
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2677
# ----------------------------------
2678
AC_DEFUN([PKG_PROG_PKG_CONFIG],
2679
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2680
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2681
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2682
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2683
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2685
if test -n "$PKG_CONFIG"; then
2686
_pkg_min_version=m4_default([$1], [0.9.0])
2687
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2688
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2689
AC_MSG_RESULT([yes])
2696
])# PKG_PROG_PKG_CONFIG
2697
# ===========================================================================
2698
# http://www.nongnu.org/autoconf-archive/check_gnu_make.html
2699
# ===========================================================================
2707
# This macro searches for a GNU version of make. If a match is found, the
2708
# makefile variable `ifGNUmake' is set to the empty string, otherwise it
2709
# is set to "#". This is useful for including a special features in a
2710
# Makefile, which cannot be handled by other versions of make. The
2711
# variable _cv_gnu_make_command is set to the command to invoke GNU make
2712
# if it exists, the empty string otherwise.
2714
# Here is an example of its use:
2716
# Makefile.in might contain:
2718
# # A failsafe way of putting a dependency rule into a makefile
2720
# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
2722
# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
2723
# @ifGNUmake@ include $(DEPEND)
2726
# Then configure.in would normally contain:
2729
# AC_OUTPUT(Makefile)
2731
# Then perhaps to cause gnu make to override any other make, we could do
2732
# something like this (note that GNU make always looks for GNUmakefile
2735
# if ! test x$_cv_gnu_make_command = x ; then
2736
# mv Makefile GNUmakefile
2737
# echo .DEFAULT: > Makefile ;
2738
# echo \ $_cv_gnu_make_command \$@ >> Makefile;
2741
# Then, if any (well almost any) other make is called, and GNU make also
2742
# exists, then the other make wraps the GNU make.
2746
# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
2748
# Copying and distribution of this file, with or without modification, are
2749
# permitted in any medium without royalty provided the copyright notice
2750
# and this notice are preserved.
2752
# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
2755
[CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
2756
_cv_gnu_make_command='' ;
2757
dnl Search all the common names for GNU make
2758
for a in "$MAKE" make gmake gnumake ; do
2759
if test -z "$a" ; then continue ; fi ;
2760
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
2761
_cv_gnu_make_command=$a ;
2766
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
2767
if test "x$_cv_gnu_make_command" != "x" ; then
2773
AC_MSG_RESULT("Not found");
2776
AC_SUBST(ifNotGNUmake)
4327
AC_CHECK_HEADERS([stdint.h])
4330
m4_include([acinclude.m4])