diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-10-18 17:44:00 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-10-18 17:44:00 +0200 |
commit | 7bbc25b0916b8eca88bfe11f799fe0612f231392 (patch) | |
tree | 2872c186b7148ef63a86751ee863aecdfc8101b1 /m4 | |
parent | e3f0d7e7f1bad57faad649e59c416ebab755e690 (diff) | |
download | gnunet-gtk-7bbc25b0916b8eca88bfe11f799fe0612f231392.tar.gz gnunet-gtk-7bbc25b0916b8eca88bfe11f799fe0612f231392.zip |
use modernized bootstrap script
Diffstat (limited to 'm4')
-rw-r--r-- | m4/codeset.m4 | 26 | ||||
-rw-r--r-- | m4/glibc2.m4 | 21 | ||||
-rw-r--r-- | m4/glibc21.m4 | 36 | ||||
-rw-r--r-- | m4/intdiv0.m4 | 63 | ||||
-rw-r--r-- | m4/intldir.m4 | 6 | ||||
-rw-r--r-- | m4/intmax.m4 | 32 | ||||
-rw-r--r-- | m4/inttypes-pri.m4 | 36 | ||||
-rw-r--r-- | m4/inttypes_h.m4 | 35 | ||||
-rw-r--r-- | m4/lcmessage.m4 | 29 | ||||
-rw-r--r-- | m4/lock.m4 | 323 | ||||
-rw-r--r-- | m4/longlong.m4 | 124 | ||||
-rw-r--r-- | m4/printf-posix.m4 | 34 | ||||
-rw-r--r-- | m4/size_max.m4 | 102 | ||||
-rw-r--r-- | m4/stdint_h.m4 | 33 | ||||
-rw-r--r-- | m4/uintmax_t.m4 | 30 | ||||
-rw-r--r-- | m4/visibility.m4 | 49 | ||||
-rw-r--r-- | m4/wchar_t.m4 | 26 | ||||
-rw-r--r-- | m4/wint_t.m4 | 34 | ||||
-rw-r--r-- | m4/xsize.m4 | 14 |
19 files changed, 480 insertions, 573 deletions
diff --git a/m4/codeset.m4 b/m4/codeset.m4 index 59535ebc..d7de8d67 100644 --- a/m4/codeset.m4 +++ b/m4/codeset.m4 | |||
@@ -1,23 +1,23 @@ | |||
1 | # codeset.m4 serial AM1 (gettext-0.10.40) | 1 | # codeset.m4 serial 5 (gettext-0.18.2) |
2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2000-2002, 2006, 2008-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | 8 | ||
11 | AC_DEFUN([AM_LANGINFO_CODESET], | 9 | AC_DEFUN([AM_LANGINFO_CODESET], |
12 | [ | 10 | [ |
13 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, | 11 | AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], |
14 | [AC_TRY_LINK([#include <langinfo.h>], | 12 | [AC_LINK_IFELSE( |
15 | [char* cs = nl_langinfo(CODESET);], | 13 | [AC_LANG_PROGRAM( |
16 | am_cv_langinfo_codeset=yes, | 14 | [[#include <langinfo.h>]], |
17 | am_cv_langinfo_codeset=no) | 15 | [[char* cs = nl_langinfo(CODESET); return !cs;]])], |
16 | [am_cv_langinfo_codeset=yes], | ||
17 | [am_cv_langinfo_codeset=no]) | ||
18 | ]) | 18 | ]) |
19 | if test $am_cv_langinfo_codeset = yes; then | 19 | if test $am_cv_langinfo_codeset = yes; then |
20 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, | 20 | AC_DEFINE([HAVE_LANGINFO_CODESET], [1], |
21 | [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) | 21 | [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) |
22 | fi | 22 | fi |
23 | ]) | 23 | ]) |
diff --git a/m4/glibc2.m4 b/m4/glibc2.m4 index e8f5bfe6..71dd8a12 100644 --- a/m4/glibc2.m4 +++ b/m4/glibc2.m4 | |||
@@ -1,5 +1,6 @@ | |||
1 | # glibc2.m4 serial 1 | 1 | # glibc2.m4 serial 3 |
2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 Free Software Foundation, |
3 | dnl Inc. | ||
3 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
@@ -9,22 +10,22 @@ dnl with or without modifications, as long as this notice is preserved. | |||
9 | 10 | ||
10 | AC_DEFUN([gt_GLIBC2], | 11 | AC_DEFUN([gt_GLIBC2], |
11 | [ | 12 | [ |
12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, | 13 | AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer], |
13 | ac_cv_gnu_library_2, | 14 | [ac_cv_gnu_library_2], |
14 | [AC_EGREP_CPP([Lucky GNU user], | 15 | [AC_EGREP_CPP([Lucky GNU user], |
15 | [ | 16 | [ |
16 | #include <features.h> | 17 | #include <features.h> |
17 | #ifdef __GNU_LIBRARY__ | 18 | #ifdef __GNU_LIBRARY__ |
18 | #if (__GLIBC__ >= 2) | 19 | #if (__GLIBC__ >= 2) && !defined __UCLIBC__ |
19 | Lucky GNU user | 20 | Lucky GNU user |
20 | #endif | 21 | #endif |
21 | #endif | 22 | #endif |
22 | ], | 23 | ], |
23 | ac_cv_gnu_library_2=yes, | 24 | [ac_cv_gnu_library_2=yes], |
24 | ac_cv_gnu_library_2=no) | 25 | [ac_cv_gnu_library_2=no]) |
25 | ] | 26 | ] |
26 | ) | 27 | ) |
27 | AC_SUBST(GLIBC2) | 28 | AC_SUBST([GLIBC2]) |
28 | GLIBC2="$ac_cv_gnu_library_2" | 29 | GLIBC2="$ac_cv_gnu_library_2" |
29 | ] | 30 | ] |
30 | ) | 31 | ) |
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4 index 9c9f3db3..ab58b712 100644 --- a/m4/glibc21.m4 +++ b/m4/glibc21.m4 | |||
@@ -1,32 +1,34 @@ | |||
1 | # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) | 1 | # glibc21.m4 serial 5 |
2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 Free Software Foundation, |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl Inc. |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl This file is free software; the Free Software Foundation |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl gives unlimited permission to copy and/or distribute it, |
6 | dnl that contains a configuration script generated by Autoconf, under | 6 | dnl with or without modifications, as long as this notice is preserved. |
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 7 | ||
9 | # Test for the GNU C Library, version 2.1 or newer. | 8 | # Test for the GNU C Library, version 2.1 or newer, or uClibc. |
10 | # From Bruno Haible. | 9 | # From Bruno Haible. |
11 | 10 | ||
12 | AC_DEFUN([jm_GLIBC21], | 11 | AC_DEFUN([gl_GLIBC21], |
13 | [ | 12 | [ |
14 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, | 13 | AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc], |
15 | ac_cv_gnu_library_2_1, | 14 | [ac_cv_gnu_library_2_1], |
16 | [AC_EGREP_CPP([Lucky GNU user], | 15 | [AC_EGREP_CPP([Lucky], |
17 | [ | 16 | [ |
18 | #include <features.h> | 17 | #include <features.h> |
19 | #ifdef __GNU_LIBRARY__ | 18 | #ifdef __GNU_LIBRARY__ |
20 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) | 19 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) |
21 | Lucky GNU user | 20 | Lucky GNU user |
22 | #endif | 21 | #endif |
23 | #endif | 22 | #endif |
24 | ], | 23 | #ifdef __UCLIBC__ |
25 | ac_cv_gnu_library_2_1=yes, | 24 | Lucky user |
26 | ac_cv_gnu_library_2_1=no) | 25 | #endif |
26 | ], | ||
27 | [ac_cv_gnu_library_2_1=yes], | ||
28 | [ac_cv_gnu_library_2_1=no]) | ||
27 | ] | 29 | ] |
28 | ) | 30 | ) |
29 | AC_SUBST(GLIBC21) | 31 | AC_SUBST([GLIBC21]) |
30 | GLIBC21="$ac_cv_gnu_library_2_1" | 32 | GLIBC21="$ac_cv_gnu_library_2_1" |
31 | ] | 33 | ] |
32 | ) | 34 | ) |
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4 index 55dddcf1..afa9acb8 100644 --- a/m4/intdiv0.m4 +++ b/m4/intdiv0.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # intdiv0.m4 serial 1 (gettext-0.11.3) | 1 | # intdiv0.m4 serial 6 (gettext-0.18.2) |
2 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2002, 2007-2008, 2010-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | 8 | ||
@@ -16,16 +14,28 @@ AC_DEFUN([gt_INTDIV0], | |||
16 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], | 14 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], |
17 | gt_cv_int_divbyzero_sigfpe, | 15 | gt_cv_int_divbyzero_sigfpe, |
18 | [ | 16 | [ |
19 | AC_TRY_RUN([ | 17 | gt_cv_int_divbyzero_sigfpe= |
18 | changequote(,)dnl | ||
19 | case "$host_os" in | ||
20 | macos* | darwin[6-9]* | darwin[1-9][0-9]*) | ||
21 | # On Mac OS X 10.2 or newer, just assume the same as when cross- | ||
22 | # compiling. If we were to perform the real test, 1 Crash Report | ||
23 | # dialog window would pop up. | ||
24 | case "$host_cpu" in | ||
25 | i[34567]86 | x86_64) | ||
26 | gt_cv_int_divbyzero_sigfpe="guessing yes" ;; | ||
27 | esac | ||
28 | ;; | ||
29 | esac | ||
30 | changequote([,])dnl | ||
31 | if test -z "$gt_cv_int_divbyzero_sigfpe"; then | ||
32 | AC_RUN_IFELSE( | ||
33 | [AC_LANG_SOURCE([[ | ||
20 | #include <stdlib.h> | 34 | #include <stdlib.h> |
21 | #include <signal.h> | 35 | #include <signal.h> |
22 | 36 | ||
23 | static void | 37 | static void |
24 | #ifdef __cplusplus | ||
25 | sigfpe_handler (int sig) | 38 | sigfpe_handler (int sig) |
26 | #else | ||
27 | sigfpe_handler (sig) int sig; | ||
28 | #endif | ||
29 | { | 39 | { |
30 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ | 40 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ |
31 | exit (sig != SIGFPE); | 41 | exit (sig != SIGFPE); |
@@ -50,23 +60,28 @@ int main () | |||
50 | 60 | ||
51 | z = x / y; | 61 | z = x / y; |
52 | nan = y / y; | 62 | nan = y / y; |
53 | exit (1); | 63 | exit (2); |
54 | } | 64 | } |
55 | ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, | 65 | ]])], |
56 | [ | 66 | [gt_cv_int_divbyzero_sigfpe=yes], |
57 | # Guess based on the CPU. | 67 | [gt_cv_int_divbyzero_sigfpe=no], |
58 | case "$host_cpu" in | 68 | [ |
59 | alpha* | i[34567]86 | m68k | s390*) | 69 | # Guess based on the CPU. |
60 | gt_cv_int_divbyzero_sigfpe="guessing yes";; | 70 | changequote(,)dnl |
61 | *) | 71 | case "$host_cpu" in |
62 | gt_cv_int_divbyzero_sigfpe="guessing no";; | 72 | alpha* | i[34567]86 | x86_64 | m68k | s390*) |
63 | esac | 73 | gt_cv_int_divbyzero_sigfpe="guessing yes";; |
64 | ]) | 74 | *) |
75 | gt_cv_int_divbyzero_sigfpe="guessing no";; | ||
76 | esac | ||
77 | changequote([,])dnl | ||
78 | ]) | ||
79 | fi | ||
65 | ]) | 80 | ]) |
66 | case "$gt_cv_int_divbyzero_sigfpe" in | 81 | case "$gt_cv_int_divbyzero_sigfpe" in |
67 | *yes) value=1;; | 82 | *yes) value=1;; |
68 | *) value=0;; | 83 | *) value=0;; |
69 | esac | 84 | esac |
70 | AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, | 85 | AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value], |
71 | [Define if integer division by zero raises signal SIGFPE.]) | 86 | [Define if integer division by zero raises signal SIGFPE.]) |
72 | ]) | 87 | ]) |
diff --git a/m4/intldir.m4 b/m4/intldir.m4 index 7a28843f..73b672a5 100644 --- a/m4/intldir.m4 +++ b/m4/intldir.m4 | |||
@@ -1,5 +1,5 @@ | |||
1 | # intldir.m4 serial 1 (gettext-0.16) | 1 | # intldir.m4 serial 2 (gettext-0.18) |
2 | dnl Copyright (C) 2006 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
@@ -13,7 +13,7 @@ dnl by the GNU Library General Public License, and the rest of the GNU | |||
13 | dnl gettext package package is covered by the GNU General Public License. | 13 | dnl gettext package package is covered by the GNU General Public License. |
14 | dnl They are *not* in the public domain. | 14 | dnl They are *not* in the public domain. |
15 | 15 | ||
16 | AC_PREREQ(2.52) | 16 | AC_PREREQ([2.52]) |
17 | 17 | ||
18 | dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. | 18 | dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. |
19 | AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], []) | 19 | AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], []) |
diff --git a/m4/intmax.m4 b/m4/intmax.m4 index dfb08ccc..f70ceeea 100644 --- a/m4/intmax.m4 +++ b/m4/intmax.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # intmax.m4 serial 1 (gettext-0.12) | 1 | # intmax.m4 serial 6 (gettext-0.18.2) |
2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2002-2005, 2008-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | dnl Test whether the system has the 'intmax_t' type, but don't attempt to | 8 | dnl Test whether the system has the 'intmax_t' type, but don't attempt to |
@@ -12,11 +10,13 @@ dnl find a replacement if it is lacking. | |||
12 | 10 | ||
13 | AC_DEFUN([gt_TYPE_INTMAX_T], | 11 | AC_DEFUN([gt_TYPE_INTMAX_T], |
14 | [ | 12 | [ |
15 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) | 13 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) |
16 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) | 14 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) |
17 | AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, | 15 | AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], |
18 | [AC_TRY_COMPILE([ | 16 | [AC_COMPILE_IFELSE( |
19 | #include <stddef.h> | 17 | [AC_LANG_PROGRAM( |
18 | [[ | ||
19 | #include <stddef.h> | ||
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #if HAVE_STDINT_H_WITH_UINTMAX | 21 | #if HAVE_STDINT_H_WITH_UINTMAX |
22 | #include <stdint.h> | 22 | #include <stdint.h> |
@@ -24,9 +24,13 @@ AC_DEFUN([gt_TYPE_INTMAX_T], | |||
24 | #if HAVE_INTTYPES_H_WITH_UINTMAX | 24 | #if HAVE_INTTYPES_H_WITH_UINTMAX |
25 | #include <inttypes.h> | 25 | #include <inttypes.h> |
26 | #endif | 26 | #endif |
27 | ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) | 27 | ]], |
28 | [[intmax_t x = -1; | ||
29 | return !x;]])], | ||
30 | [gt_cv_c_intmax_t=yes], | ||
31 | [gt_cv_c_intmax_t=no])]) | ||
28 | if test $gt_cv_c_intmax_t = yes; then | 32 | if test $gt_cv_c_intmax_t = yes; then |
29 | AC_DEFINE(HAVE_INTMAX_T, 1, | 33 | AC_DEFINE([HAVE_INTMAX_T], [1], |
30 | [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) | 34 | [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) |
31 | fi | 35 | fi |
32 | ]) | 36 | ]) |
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 index fd007c31..00251e1d 100644 --- a/m4/inttypes-pri.m4 +++ b/m4/inttypes-pri.m4 | |||
@@ -1,32 +1,42 @@ | |||
1 | # inttypes-pri.m4 serial 1 (gettext-0.11.4) | 1 | # inttypes-pri.m4 serial 7 (gettext-0.18.2) |
2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1997-2002, 2006, 2008-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | 8 | ||
9 | AC_PREREQ([2.53]) | ||
10 | |||
11 | # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* | 11 | # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* |
12 | # macros to non-string values. This is the case on AIX 4.3.3. | 12 | # macros to non-string values. This is the case on AIX 4.3.3. |
13 | 13 | ||
14 | AC_DEFUN([gt_INTTYPES_PRI], | 14 | AC_DEFUN([gt_INTTYPES_PRI], |
15 | [ | 15 | [ |
16 | AC_REQUIRE([gt_HEADER_INTTYPES_H]) | 16 | AC_CHECK_HEADERS([inttypes.h]) |
17 | if test $gt_cv_header_inttypes_h = yes; then | 17 | if test $ac_cv_header_inttypes_h = yes; then |
18 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], | 18 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], |
19 | gt_cv_inttypes_pri_broken, | 19 | [gt_cv_inttypes_pri_broken], |
20 | [ | 20 | [ |
21 | AC_TRY_COMPILE([#include <inttypes.h> | 21 | AC_COMPILE_IFELSE( |
22 | [AC_LANG_PROGRAM( | ||
23 | [[ | ||
24 | #include <inttypes.h> | ||
22 | #ifdef PRId32 | 25 | #ifdef PRId32 |
23 | char *p = PRId32; | 26 | char *p = PRId32; |
24 | #endif | 27 | #endif |
25 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) | 28 | ]], |
29 | [[]])], | ||
30 | [gt_cv_inttypes_pri_broken=no], | ||
31 | [gt_cv_inttypes_pri_broken=yes]) | ||
26 | ]) | 32 | ]) |
27 | fi | 33 | fi |
28 | if test "$gt_cv_inttypes_pri_broken" = yes; then | 34 | if test "$gt_cv_inttypes_pri_broken" = yes; then |
29 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, | 35 | AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], |
30 | [Define if <inttypes.h> exists and defines unusable PRI* macros.]) | 36 | [Define if <inttypes.h> exists and defines unusable PRI* macros.]) |
37 | PRI_MACROS_BROKEN=1 | ||
38 | else | ||
39 | PRI_MACROS_BROKEN=0 | ||
31 | fi | 40 | fi |
41 | AC_SUBST([PRI_MACROS_BROKEN]) | ||
32 | ]) | 42 | ]) |
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 index f342eba3..87be9cfb 100644 --- a/m4/inttypes_h.m4 +++ b/m4/inttypes_h.m4 | |||
@@ -1,27 +1,28 @@ | |||
1 | # inttypes_h.m4 serial 5 (gettext-0.12) | 1 | # inttypes_h.m4 serial 10 |
2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1997-2004, 2006, 2008-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Paul Eggert. | 7 | dnl From Paul Eggert. |
10 | 8 | ||
11 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists, | 9 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists, |
12 | # doesn't clash with <sys/types.h>, and declares uintmax_t. | 10 | # doesn't clash with <sys/types.h>, and declares uintmax_t. |
13 | 11 | ||
14 | AC_DEFUN([jm_AC_HEADER_INTTYPES_H], | 12 | AC_DEFUN([gl_AC_HEADER_INTTYPES_H], |
15 | [ | 13 | [ |
16 | AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, | 14 | AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], |
17 | [AC_TRY_COMPILE( | 15 | [AC_COMPILE_IFELSE( |
18 | [#include <sys/types.h> | 16 | [AC_LANG_PROGRAM( |
19 | #include <inttypes.h>], | 17 | [[ |
20 | [uintmax_t i = (uintmax_t) -1;], | 18 | #include <sys/types.h> |
21 | jm_ac_cv_header_inttypes_h=yes, | 19 | #include <inttypes.h> |
22 | jm_ac_cv_header_inttypes_h=no)]) | 20 | ]], |
23 | if test $jm_ac_cv_header_inttypes_h = yes; then | 21 | [[uintmax_t i = (uintmax_t) -1; return !i;]])], |
24 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, | 22 | [gl_cv_header_inttypes_h=yes], |
23 | [gl_cv_header_inttypes_h=no])]) | ||
24 | if test $gl_cv_header_inttypes_h = yes; then | ||
25 | AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], | ||
25 | [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, | 26 | [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, |
26 | and declares uintmax_t. ]) | 27 | and declares uintmax_t. ]) |
27 | fi | 28 | fi |
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4 index ffd4008b..7470ec59 100644 --- a/m4/lcmessage.m4 +++ b/m4/lcmessage.m4 | |||
@@ -1,10 +1,9 @@ | |||
1 | # lcmessage.m4 serial 3 (gettext-0.11.3) | 1 | # lcmessage.m4 serial 7 (gettext-0.18.2) |
2 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014 Free Software Foundation, |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl Inc. |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl This file is free software; the Free Software Foundation |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl gives unlimited permission to copy and/or distribute it, |
6 | dnl that contains a configuration script generated by Autoconf, under | 6 | dnl with or without modifications, as long as this notice is preserved. |
7 | dnl the same distribution terms as the rest of that program. | ||
8 | dnl | 7 | dnl |
9 | dnl This file can can be used in projects which are not available under | 8 | dnl This file can can be used in projects which are not available under |
10 | dnl the GNU General Public License or the GNU Library General Public | 9 | dnl the GNU General Public License or the GNU Library General Public |
@@ -20,13 +19,17 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1995. | |||
20 | 19 | ||
21 | # Check whether LC_MESSAGES is available in <locale.h>. | 20 | # Check whether LC_MESSAGES is available in <locale.h>. |
22 | 21 | ||
23 | AC_DEFUN([AM_LC_MESSAGES], | 22 | AC_DEFUN([gt_LC_MESSAGES], |
24 | [ | 23 | [ |
25 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | 24 | AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES], |
26 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | 25 | [AC_LINK_IFELSE( |
27 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | 26 | [AC_LANG_PROGRAM( |
28 | if test $am_cv_val_LC_MESSAGES = yes; then | 27 | [[#include <locale.h>]], |
29 | AC_DEFINE(HAVE_LC_MESSAGES, 1, | 28 | [[return LC_MESSAGES]])], |
29 | [gt_cv_val_LC_MESSAGES=yes], | ||
30 | [gt_cv_val_LC_MESSAGES=no])]) | ||
31 | if test $gt_cv_val_LC_MESSAGES = yes; then | ||
32 | AC_DEFINE([HAVE_LC_MESSAGES], [1], | ||
30 | [Define if your <locale.h> file defines LC_MESSAGES.]) | 33 | [Define if your <locale.h> file defines LC_MESSAGES.]) |
31 | fi | 34 | fi |
32 | ]) | 35 | ]) |
@@ -1,311 +1,42 @@ | |||
1 | # lock.m4 serial 6 (gettext-0.16) | 1 | # lock.m4 serial 13 (gettext-0.18.2) |
2 | dnl Copyright (C) 2005-2006 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2005-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | 6 | ||
7 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
8 | 8 | ||
9 | dnl Tests for a multithreading library to be used. | 9 | AC_DEFUN([gl_LOCK], |
10 | dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS, | ||
11 | dnl USE_PTH_THREADS, USE_WIN32_THREADS | ||
12 | dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use | ||
13 | dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with | ||
14 | dnl libtool). | ||
15 | dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for | ||
16 | dnl programs that really need multithread functionality. The difference | ||
17 | dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak | ||
18 | dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread". | ||
19 | dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for | ||
20 | dnl multithread-safe programs. | ||
21 | |||
22 | AC_DEFUN([gl_LOCK_EARLY], | ||
23 | [ | ||
24 | AC_REQUIRE([gl_LOCK_EARLY_BODY]) | ||
25 | ]) | ||
26 | |||
27 | dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once. | ||
28 | |||
29 | AC_DEFUN([gl_LOCK_EARLY_BODY], | ||
30 | [ | ||
31 | dnl Ordering constraints: This macro modifies CPPFLAGS in a way that | ||
32 | dnl influences the result of the autoconf tests that test for *_unlocked | ||
33 | dnl declarations, on AIX 5 at least. Therefore it must come early. | ||
34 | AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl | ||
35 | AC_BEFORE([$0], [gl_ARGP])dnl | ||
36 | |||
37 | AC_REQUIRE([AC_CANONICAL_HOST]) | ||
38 | AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems | ||
39 | dnl Check for multithreading. | ||
40 | AC_ARG_ENABLE(threads, | ||
41 | AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) | ||
42 | AC_HELP_STRING([--disable-threads], [build without multithread safety]), | ||
43 | [gl_use_threads=$enableval], | ||
44 | [case "$host_os" in | ||
45 | dnl Disable multithreading by default on OSF/1, because it interferes | ||
46 | dnl with fork()/exec(): When msgexec is linked with -lpthread, its child | ||
47 | dnl process gets an endless segmentation fault inside execvp(). | ||
48 | osf*) gl_use_threads=no ;; | ||
49 | *) gl_use_threads=yes ;; | ||
50 | esac | ||
51 | ]) | ||
52 | if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then | ||
53 | # For using <pthread.h>: | ||
54 | case "$host_os" in | ||
55 | osf*) | ||
56 | # On OSF/1, the compiler needs the flag -D_REENTRANT so that it | ||
57 | # groks <pthread.h>. cc also understands the flag -pthread, but | ||
58 | # we don't use it because 1. gcc-2.95 doesn't understand -pthread, | ||
59 | # 2. putting a flag into CPPFLAGS that has an effect on the linker | ||
60 | # causes the AC_TRY_LINK test below to succeed unexpectedly, | ||
61 | # leading to wrong values of LIBTHREAD and LTLIBTHREAD. | ||
62 | CPPFLAGS="$CPPFLAGS -D_REENTRANT" | ||
63 | ;; | ||
64 | esac | ||
65 | # Some systems optimize for single-threaded programs by default, and | ||
66 | # need special flags to disable these optimizations. For example, the | ||
67 | # definition of 'errno' in <errno.h>. | ||
68 | case "$host_os" in | ||
69 | aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; | ||
70 | solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; | ||
71 | esac | ||
72 | fi | ||
73 | ]) | ||
74 | |||
75 | dnl The guts of gl_LOCK. Needs to be expanded only once. | ||
76 | |||
77 | AC_DEFUN([gl_LOCK_BODY], | ||
78 | [ | 10 | [ |
79 | AC_REQUIRE([gl_LOCK_EARLY_BODY]) | 11 | AC_REQUIRE([gl_THREADLIB]) |
80 | gl_threads_api=none | 12 | if test "$gl_threads_api" = posix; then |
81 | LIBTHREAD= | 13 | # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the |
82 | LTLIBTHREAD= | 14 | # pthread_rwlock_* functions. |
83 | LIBMULTITHREAD= | 15 | AC_CHECK_TYPE([pthread_rwlock_t], |
84 | LTLIBMULTITHREAD= | 16 | [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1], |
85 | if test "$gl_use_threads" != no; then | 17 | [Define if the POSIX multithreading library has read/write locks.])], |
86 | dnl Check whether the compiler and linker support weak declarations. | 18 | [], |
87 | AC_MSG_CHECKING([whether imported symbols can be declared weak]) | 19 | [#include <pthread.h>]) |
88 | gl_have_weak=no | 20 | # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. |
89 | AC_TRY_LINK([extern void xyzzy (); | 21 | AC_COMPILE_IFELSE([ |
90 | #pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes]) | 22 | AC_LANG_PROGRAM( |
91 | AC_MSG_RESULT([$gl_have_weak]) | 23 | [[#include <pthread.h>]], |
92 | if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then | 24 | [[ |
93 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | 25 | #if __FreeBSD__ == 4 |
94 | # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY. | ||
95 | AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no) | ||
96 | if test "$gl_have_pthread_h" = yes; then | ||
97 | # Other possible tests: | ||
98 | # -lpthreads (FSU threads, PCthreads) | ||
99 | # -lgthreads | ||
100 | gl_have_pthread= | ||
101 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | ||
102 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | ||
103 | # the second one only in libpthread, and lock.c needs it. | ||
104 | AC_TRY_LINK([#include <pthread.h>], | ||
105 | [pthread_mutex_lock((pthread_mutex_t*)0); | ||
106 | pthread_mutexattr_init((pthread_mutexattr_t*)0);], | ||
107 | [gl_have_pthread=yes]) | ||
108 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, | ||
109 | # since it is defined as a macro on OSF/1.) | ||
110 | if test -n "$gl_have_pthread"; then | ||
111 | # The program links fine without libpthread. But it may actually | ||
112 | # need to link with libpthread in order to create multiple threads. | ||
113 | AC_CHECK_LIB(pthread, pthread_kill, | ||
114 | [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread | ||
115 | # On Solaris and HP-UX, most pthread functions exist also in libc. | ||
116 | # Therefore pthread_in_use() needs to actually try to create a | ||
117 | # thread: pthread_create from libc will fail, whereas | ||
118 | # pthread_create will actually create a thread. | ||
119 | case "$host_os" in | ||
120 | solaris* | hpux*) | ||
121 | AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1, | ||
122 | [Define if the pthread_in_use() detection is hard.]) | ||
123 | esac | ||
124 | ]) | ||
125 | else | ||
126 | # Some library is needed. Try libpthread and libc_r. | ||
127 | AC_CHECK_LIB(pthread, pthread_kill, | ||
128 | [gl_have_pthread=yes | ||
129 | LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread | ||
130 | LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread]) | ||
131 | if test -z "$gl_have_pthread"; then | ||
132 | # For FreeBSD 4. | ||
133 | AC_CHECK_LIB(c_r, pthread_kill, | ||
134 | [gl_have_pthread=yes | ||
135 | LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r | ||
136 | LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r]) | ||
137 | fi | ||
138 | fi | ||
139 | if test -n "$gl_have_pthread"; then | ||
140 | gl_threads_api=posix | ||
141 | AC_DEFINE([USE_POSIX_THREADS], 1, | ||
142 | [Define if the POSIX multithreading library can be used.]) | ||
143 | if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then | ||
144 | if test $gl_have_weak = yes; then | ||
145 | AC_DEFINE([USE_POSIX_THREADS_WEAK], 1, | ||
146 | [Define if references to the POSIX multithreading library should be made weak.]) | ||
147 | LIBTHREAD= | ||
148 | LTLIBTHREAD= | ||
149 | fi | ||
150 | fi | ||
151 | # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the | ||
152 | # pthread_rwlock_* functions. | ||
153 | AC_CHECK_TYPE([pthread_rwlock_t], | ||
154 | [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1, | ||
155 | [Define if the POSIX multithreading library has read/write locks.])], | ||
156 | [], | ||
157 | [#include <pthread.h>]) | ||
158 | # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. | ||
159 | AC_TRY_COMPILE([#include <pthread.h>], | ||
160 | [#if __FreeBSD__ == 4 | ||
161 | error "No, in FreeBSD 4.0 recursive mutexes actually don't work." | 26 | error "No, in FreeBSD 4.0 recursive mutexes actually don't work." |
27 | #elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ | ||
28 | && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) | ||
29 | error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." | ||
162 | #else | 30 | #else |
163 | int x = (int)PTHREAD_MUTEX_RECURSIVE; | 31 | int x = (int)PTHREAD_MUTEX_RECURSIVE; |
164 | return !x; | 32 | return !x; |
165 | #endif], | 33 | #endif |
166 | [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, | 34 | ]])], |
167 | [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])]) | 35 | [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], |
168 | fi | 36 | [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])]) |
169 | fi | ||
170 | fi | ||
171 | if test -z "$gl_have_pthread"; then | ||
172 | if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then | ||
173 | gl_have_solaristhread= | ||
174 | gl_save_LIBS="$LIBS" | ||
175 | LIBS="$LIBS -lthread" | ||
176 | AC_TRY_LINK([#include <thread.h> | ||
177 | #include <synch.h>], | ||
178 | [thr_self();], | ||
179 | [gl_have_solaristhread=yes]) | ||
180 | LIBS="$gl_save_LIBS" | ||
181 | if test -n "$gl_have_solaristhread"; then | ||
182 | gl_threads_api=solaris | ||
183 | LIBTHREAD=-lthread | ||
184 | LTLIBTHREAD=-lthread | ||
185 | LIBMULTITHREAD="$LIBTHREAD" | ||
186 | LTLIBMULTITHREAD="$LTLIBTHREAD" | ||
187 | AC_DEFINE([USE_SOLARIS_THREADS], 1, | ||
188 | [Define if the old Solaris multithreading library can be used.]) | ||
189 | if test $gl_have_weak = yes; then | ||
190 | AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1, | ||
191 | [Define if references to the old Solaris multithreading library should be made weak.]) | ||
192 | LIBTHREAD= | ||
193 | LTLIBTHREAD= | ||
194 | fi | ||
195 | fi | ||
196 | fi | ||
197 | fi | ||
198 | if test "$gl_use_threads" = pth; then | ||
199 | gl_save_CPPFLAGS="$CPPFLAGS" | ||
200 | AC_LIB_LINKFLAGS(pth) | ||
201 | gl_have_pth= | ||
202 | gl_save_LIBS="$LIBS" | ||
203 | LIBS="$LIBS -lpth" | ||
204 | AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes) | ||
205 | LIBS="$gl_save_LIBS" | ||
206 | if test -n "$gl_have_pth"; then | ||
207 | gl_threads_api=pth | ||
208 | LIBTHREAD="$LIBPTH" | ||
209 | LTLIBTHREAD="$LTLIBPTH" | ||
210 | LIBMULTITHREAD="$LIBTHREAD" | ||
211 | LTLIBMULTITHREAD="$LTLIBTHREAD" | ||
212 | AC_DEFINE([USE_PTH_THREADS], 1, | ||
213 | [Define if the GNU Pth multithreading library can be used.]) | ||
214 | if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then | ||
215 | if test $gl_have_weak = yes; then | ||
216 | AC_DEFINE([USE_PTH_THREADS_WEAK], 1, | ||
217 | [Define if references to the GNU Pth multithreading library should be made weak.]) | ||
218 | LIBTHREAD= | ||
219 | LTLIBTHREAD= | ||
220 | fi | ||
221 | fi | ||
222 | else | ||
223 | CPPFLAGS="$gl_save_CPPFLAGS" | ||
224 | fi | ||
225 | fi | ||
226 | if test -z "$gl_have_pthread"; then | ||
227 | if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then | ||
228 | if { case "$host_os" in | ||
229 | mingw*) true;; | ||
230 | *) false;; | ||
231 | esac | ||
232 | }; then | ||
233 | gl_threads_api=win32 | ||
234 | AC_DEFINE([USE_WIN32_THREADS], 1, | ||
235 | [Define if the Win32 multithreading API can be used.]) | ||
236 | fi | ||
237 | fi | ||
238 | fi | ||
239 | fi | 37 | fi |
240 | AC_MSG_CHECKING([for multithread API to use]) | ||
241 | AC_MSG_RESULT([$gl_threads_api]) | ||
242 | AC_SUBST(LIBTHREAD) | ||
243 | AC_SUBST(LTLIBTHREAD) | ||
244 | AC_SUBST(LIBMULTITHREAD) | ||
245 | AC_SUBST(LTLIBMULTITHREAD) | ||
246 | ]) | ||
247 | |||
248 | AC_DEFUN([gl_LOCK], | ||
249 | [ | ||
250 | AC_REQUIRE([gl_LOCK_EARLY]) | ||
251 | AC_REQUIRE([gl_LOCK_BODY]) | ||
252 | gl_PREREQ_LOCK | 38 | gl_PREREQ_LOCK |
253 | ]) | 39 | ]) |
254 | 40 | ||
255 | # Prerequisites of lib/lock.c. | 41 | # Prerequisites of lib/glthread/lock.c. |
256 | AC_DEFUN([gl_PREREQ_LOCK], [ | 42 | AC_DEFUN([gl_PREREQ_LOCK], [:]) |
257 | AC_REQUIRE([AC_C_INLINE]) | ||
258 | ]) | ||
259 | |||
260 | dnl Survey of platforms: | ||
261 | dnl | ||
262 | dnl Platform Available Compiler Supports test-lock | ||
263 | dnl flavours option weak result | ||
264 | dnl --------------- --------- --------- -------- --------- | ||
265 | dnl Linux 2.4/glibc posix -lpthread Y OK | ||
266 | dnl | ||
267 | dnl GNU Hurd/glibc posix | ||
268 | dnl | ||
269 | dnl FreeBSD 5.3 posix -lc_r Y | ||
270 | dnl posix -lkse ? Y | ||
271 | dnl posix -lpthread ? Y | ||
272 | dnl posix -lthr Y | ||
273 | dnl | ||
274 | dnl FreeBSD 5.2 posix -lc_r Y | ||
275 | dnl posix -lkse Y | ||
276 | dnl posix -lthr Y | ||
277 | dnl | ||
278 | dnl FreeBSD 4.0,4.10 posix -lc_r Y OK | ||
279 | dnl | ||
280 | dnl NetBSD 1.6 -- | ||
281 | dnl | ||
282 | dnl OpenBSD 3.4 posix -lpthread Y OK | ||
283 | dnl | ||
284 | dnl MacOS X 10.[123] posix -lpthread Y OK | ||
285 | dnl | ||
286 | dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK | ||
287 | dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK | ||
288 | dnl | ||
289 | dnl HP-UX 11 posix -lpthread N (cc) OK | ||
290 | dnl Y (gcc) | ||
291 | dnl | ||
292 | dnl IRIX 6.5 posix -lpthread Y 0.5 | ||
293 | dnl | ||
294 | dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK | ||
295 | dnl | ||
296 | dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK | ||
297 | dnl -lpthread (gcc) Y | ||
298 | dnl | ||
299 | dnl Cygwin posix -lpthread Y OK | ||
300 | dnl | ||
301 | dnl Any of the above pth -lpth 0.0 | ||
302 | dnl | ||
303 | dnl Mingw win32 N OK | ||
304 | dnl | ||
305 | dnl BeOS 5 -- | ||
306 | dnl | ||
307 | dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is | ||
308 | dnl turned off: | ||
309 | dnl OK if all three tests terminate OK, | ||
310 | dnl 0.5 if the first test terminates OK but the second one loops endlessly, | ||
311 | dnl 0.0 if the first test already loops endlessly. | ||
diff --git a/m4/longlong.m4 b/m4/longlong.m4 index d7d7350b..eefb37c4 100644 --- a/m4/longlong.m4 +++ b/m4/longlong.m4 | |||
@@ -1,25 +1,113 @@ | |||
1 | # longlong.m4 serial 4 | 1 | # longlong.m4 serial 17 |
2 | dnl Copyright (C) 1999-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1999-2007, 2009-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Paul Eggert. | 7 | dnl From Paul Eggert. |
10 | 8 | ||
11 | # Define HAVE_LONG_LONG if 'long long' works. | 9 | # Define HAVE_LONG_LONG_INT if 'long long int' works. |
10 | # This fixes a bug in Autoconf 2.61, and can be faster | ||
11 | # than what's in Autoconf 2.62 through 2.68. | ||
12 | 12 | ||
13 | AC_DEFUN([jm_AC_TYPE_LONG_LONG], | 13 | # Note: If the type 'long long int' exists but is only 32 bits large |
14 | # (as on some very old compilers), HAVE_LONG_LONG_INT will not be | ||
15 | # defined. In this case you can treat 'long long int' like 'long int'. | ||
16 | |||
17 | AC_DEFUN([AC_TYPE_LONG_LONG_INT], | ||
18 | [ | ||
19 | AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) | ||
20 | AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], | ||
21 | [ac_cv_type_long_long_int=yes | ||
22 | if test "x${ac_cv_prog_cc_c99-no}" = xno; then | ||
23 | ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int | ||
24 | if test $ac_cv_type_long_long_int = yes; then | ||
25 | dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. | ||
26 | dnl If cross compiling, assume the bug is not important, since | ||
27 | dnl nobody cross compiles for this platform as far as we know. | ||
28 | AC_RUN_IFELSE( | ||
29 | [AC_LANG_PROGRAM( | ||
30 | [[@%:@include <limits.h> | ||
31 | @%:@ifndef LLONG_MAX | ||
32 | @%:@ define HALF \ | ||
33 | (1LL << (sizeof (long long int) * CHAR_BIT - 2)) | ||
34 | @%:@ define LLONG_MAX (HALF - 1 + HALF) | ||
35 | @%:@endif]], | ||
36 | [[long long int n = 1; | ||
37 | int i; | ||
38 | for (i = 0; ; i++) | ||
39 | { | ||
40 | long long int m = n << i; | ||
41 | if (m >> i != n) | ||
42 | return 1; | ||
43 | if (LLONG_MAX / 2 < m) | ||
44 | break; | ||
45 | } | ||
46 | return 0;]])], | ||
47 | [], | ||
48 | [ac_cv_type_long_long_int=no], | ||
49 | [:]) | ||
50 | fi | ||
51 | fi]) | ||
52 | if test $ac_cv_type_long_long_int = yes; then | ||
53 | AC_DEFINE([HAVE_LONG_LONG_INT], [1], | ||
54 | [Define to 1 if the system has the type 'long long int'.]) | ||
55 | fi | ||
56 | ]) | ||
57 | |||
58 | # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. | ||
59 | # This fixes a bug in Autoconf 2.61, and can be faster | ||
60 | # than what's in Autoconf 2.62 through 2.68. | ||
61 | |||
62 | # Note: If the type 'unsigned long long int' exists but is only 32 bits | ||
63 | # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT | ||
64 | # will not be defined. In this case you can treat 'unsigned long long int' | ||
65 | # like 'unsigned long int'. | ||
66 | |||
67 | AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], | ||
14 | [ | 68 | [ |
15 | AC_CACHE_CHECK([for long long], ac_cv_type_long_long, | 69 | AC_CACHE_CHECK([for unsigned long long int], |
16 | [AC_TRY_LINK([long long ll = 1LL; int i = 63;], | 70 | [ac_cv_type_unsigned_long_long_int], |
17 | [long long llmax = (long long) -1; | 71 | [ac_cv_type_unsigned_long_long_int=yes |
18 | return ll << i | ll >> i | llmax / ll | llmax % ll;], | 72 | if test "x${ac_cv_prog_cc_c99-no}" = xno; then |
19 | ac_cv_type_long_long=yes, | 73 | AC_LINK_IFELSE( |
20 | ac_cv_type_long_long=no)]) | 74 | [_AC_TYPE_LONG_LONG_SNIPPET], |
21 | if test $ac_cv_type_long_long = yes; then | 75 | [], |
22 | AC_DEFINE(HAVE_LONG_LONG, 1, | 76 | [ac_cv_type_unsigned_long_long_int=no]) |
23 | [Define if you have the 'long long' type.]) | 77 | fi]) |
78 | if test $ac_cv_type_unsigned_long_long_int = yes; then | ||
79 | AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], | ||
80 | [Define to 1 if the system has the type 'unsigned long long int'.]) | ||
24 | fi | 81 | fi |
25 | ]) | 82 | ]) |
83 | |||
84 | # Expands to a C program that can be used to test for simultaneous support | ||
85 | # of 'long long' and 'unsigned long long'. We don't want to say that | ||
86 | # 'long long' is available if 'unsigned long long' is not, or vice versa, | ||
87 | # because too many programs rely on the symmetry between signed and unsigned | ||
88 | # integer types (excluding 'bool'). | ||
89 | AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], | ||
90 | [ | ||
91 | AC_LANG_PROGRAM( | ||
92 | [[/* For now, do not test the preprocessor; as of 2007 there are too many | ||
93 | implementations with broken preprocessors. Perhaps this can | ||
94 | be revisited in 2012. In the meantime, code should not expect | ||
95 | #if to work with literals wider than 32 bits. */ | ||
96 | /* Test literals. */ | ||
97 | long long int ll = 9223372036854775807ll; | ||
98 | long long int nll = -9223372036854775807LL; | ||
99 | unsigned long long int ull = 18446744073709551615ULL; | ||
100 | /* Test constant expressions. */ | ||
101 | typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) | ||
102 | ? 1 : -1)]; | ||
103 | typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 | ||
104 | ? 1 : -1)]; | ||
105 | int i = 63;]], | ||
106 | [[/* Test availability of runtime routines for shift and division. */ | ||
107 | long long int llmax = 9223372036854775807ll; | ||
108 | unsigned long long int ullmax = 18446744073709551615ull; | ||
109 | return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | ||
110 | | (llmax / ll) | (llmax % ll) | ||
111 | | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | ||
112 | | (ullmax / ull) | (ullmax % ull));]]) | ||
113 | ]) | ||
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4 index 186ba6a6..3be95c13 100644 --- a/m4/printf-posix.m4 +++ b/m4/printf-posix.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # printf-posix.m4 serial 2 (gettext-0.13.1) | 1 | # printf-posix.m4 serial 6 (gettext-0.18.2) |
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2003, 2007, 2009-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | dnl Test whether the printf() function supports POSIX/XSI format strings with | 8 | dnl Test whether the printf() function supports POSIX/XSI format strings with |
@@ -16,7 +14,8 @@ AC_DEFUN([gt_PRINTF_POSIX], | |||
16 | AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], | 14 | AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], |
17 | gt_cv_func_printf_posix, | 15 | gt_cv_func_printf_posix, |
18 | [ | 16 | [ |
19 | AC_TRY_RUN([ | 17 | AC_RUN_IFELSE( |
18 | [AC_LANG_SOURCE([[ | ||
20 | #include <stdio.h> | 19 | #include <stdio.h> |
21 | #include <string.h> | 20 | #include <string.h> |
22 | /* The string "%2$d %1$d", with dollar characters protected from the shell's | 21 | /* The string "%2$d %1$d", with dollar characters protected from the shell's |
@@ -27,19 +26,22 @@ int main () | |||
27 | { | 26 | { |
28 | sprintf (buf, format, 33, 55); | 27 | sprintf (buf, format, 33, 55); |
29 | return (strcmp (buf, "55 33") != 0); | 28 | return (strcmp (buf, "55 33") != 0); |
30 | }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, | 29 | }]])], |
31 | [ | 30 | [gt_cv_func_printf_posix=yes], |
32 | AC_EGREP_CPP(notposix, [ | 31 | [gt_cv_func_printf_posix=no], |
33 | #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ | 32 | [ |
33 | AC_EGREP_CPP([notposix], [ | ||
34 | #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ | ||
34 | notposix | 35 | notposix |
35 | #endif | 36 | #endif |
36 | ], gt_cv_func_printf_posix="guessing no", | 37 | ], |
37 | gt_cv_func_printf_posix="guessing yes") | 38 | [gt_cv_func_printf_posix="guessing no"], |
38 | ]) | 39 | [gt_cv_func_printf_posix="guessing yes"]) |
40 | ]) | ||
39 | ]) | 41 | ]) |
40 | case $gt_cv_func_printf_posix in | 42 | case $gt_cv_func_printf_posix in |
41 | *yes) | 43 | *yes) |
42 | AC_DEFINE(HAVE_POSIX_PRINTF, 1, | 44 | AC_DEFINE([HAVE_POSIX_PRINTF], [1], |
43 | [Define if your printf() function supports format strings with positions.]) | 45 | [Define if your printf() function supports format strings with positions.]) |
44 | ;; | 46 | ;; |
45 | esac | 47 | esac |
diff --git a/m4/size_max.m4 b/m4/size_max.m4 index 5762fc33..7e192d5e 100644 --- a/m4/size_max.m4 +++ b/m4/size_max.m4 | |||
@@ -1,20 +1,18 @@ | |||
1 | # size_max.m4 serial 2 | 1 | # size_max.m4 serial 10 |
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2003, 2005-2006, 2008-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | 8 | ||
11 | AC_DEFUN([gl_SIZE_MAX], | 9 | AC_DEFUN([gl_SIZE_MAX], |
12 | [ | 10 | [ |
13 | AC_CHECK_HEADERS(stdint.h) | 11 | AC_CHECK_HEADERS([stdint.h]) |
14 | dnl First test whether the system already has SIZE_MAX. | 12 | dnl First test whether the system already has SIZE_MAX. |
15 | AC_MSG_CHECKING([for SIZE_MAX]) | 13 | AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [ |
16 | result= | 14 | gl_cv_size_max= |
17 | AC_EGREP_CPP([Found it], [ | 15 | AC_EGREP_CPP([Found it], [ |
18 | #include <limits.h> | 16 | #include <limits.h> |
19 | #if HAVE_STDINT_H | 17 | #if HAVE_STDINT_H |
20 | #include <stdint.h> | 18 | #include <stdint.h> |
@@ -22,40 +20,60 @@ AC_DEFUN([gl_SIZE_MAX], | |||
22 | #ifdef SIZE_MAX | 20 | #ifdef SIZE_MAX |
23 | Found it | 21 | Found it |
24 | #endif | 22 | #endif |
25 | ], result=yes) | 23 | ], [gl_cv_size_max=yes]) |
26 | if test -z "$result"; then | 24 | if test -z "$gl_cv_size_max"; then |
27 | dnl Define it ourselves. Here we assume that the type 'size_t' is not wider | 25 | dnl Define it ourselves. Here we assume that the type 'size_t' is not wider |
28 | dnl than the type 'unsigned long'. | 26 | dnl than the type 'unsigned long'. Try hard to find a definition that can |
29 | dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', | 27 | dnl be used in a preprocessor #if, i.e. doesn't contain a cast. |
30 | dnl which is guaranteed to work from LONG_MIN to LONG_MAX. | 28 | AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], |
31 | _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, | 29 | [#include <stddef.h> |
32 | [#include <stddef.h>], result=?) | 30 | #include <limits.h>], [size_t_bits_minus_1=]) |
33 | _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, | 31 | AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], |
34 | [#include <stddef.h>], result=?) | 32 | [#include <stddef.h>], [fits_in_uint=]) |
35 | _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, | 33 | if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then |
36 | [#include <stddef.h>], result=?) | 34 | if test $fits_in_uint = 1; then |
37 | if test "$fits_in_uint" = 1; then | 35 | dnl Even though SIZE_MAX fits in an unsigned int, it must be of type |
38 | dnl Even though SIZE_MAX fits in an unsigned int, it must be of type | 36 | dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. |
39 | dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. | 37 | AC_COMPILE_IFELSE( |
40 | AC_TRY_COMPILE([#include <stddef.h> | 38 | [AC_LANG_PROGRAM( |
41 | extern size_t foo; | 39 | [[#include <stddef.h> |
42 | extern unsigned long foo; | 40 | extern size_t foo; |
43 | ], [], fits_in_uint=0) | 41 | extern unsigned long foo; |
44 | fi | 42 | ]], |
45 | if test -z "$result"; then | 43 | [[]])], |
46 | if test "$fits_in_uint" = 1; then | 44 | [fits_in_uint=0]) |
47 | result="$res_hi$res_lo"U | 45 | fi |
46 | dnl We cannot use 'expr' to simplify this expression, because 'expr' | ||
47 | dnl works only with 'long' integers in the host environment, while we | ||
48 | dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. | ||
49 | if test $fits_in_uint = 1; then | ||
50 | gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" | ||
51 | else | ||
52 | gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" | ||
53 | fi | ||
48 | else | 54 | else |
49 | result="$res_hi$res_lo"UL | 55 | dnl Shouldn't happen, but who knows... |
56 | gl_cv_size_max='((size_t)~(size_t)0)' | ||
50 | fi | 57 | fi |
51 | else | ||
52 | dnl Shouldn't happen, but who knows... | ||
53 | result='~(size_t)0' | ||
54 | fi | 58 | fi |
55 | fi | 59 | ]) |
56 | AC_MSG_RESULT([$result]) | 60 | if test "$gl_cv_size_max" != yes; then |
57 | if test "$result" != yes; then | 61 | AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], |
58 | AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], | ||
59 | [Define as the maximum value of type 'size_t', if the system doesn't define it.]) | 62 | [Define as the maximum value of type 'size_t', if the system doesn't define it.]) |
60 | fi | 63 | fi |
64 | dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after | ||
65 | dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with | ||
66 | dnl #define by AC_DEFINE_UNQUOTED. | ||
67 | AH_VERBATIM([SIZE_MAX], | ||
68 | [/* Define as the maximum value of type 'size_t', if the system doesn't define | ||
69 | it. */ | ||
70 | #ifndef SIZE_MAX | ||
71 | # undef SIZE_MAX | ||
72 | #endif]) | ||
73 | ]) | ||
74 | |||
75 | dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. | ||
76 | dnl Remove this when we can assume autoconf >= 2.61. | ||
77 | m4_ifdef([AC_COMPUTE_INT], [], [ | ||
78 | AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) | ||
61 | ]) | 79 | ]) |
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 index 32ba7ae7..7fc2ce9a 100644 --- a/m4/stdint_h.m4 +++ b/m4/stdint_h.m4 | |||
@@ -1,27 +1,26 @@ | |||
1 | # stdint_h.m4 serial 3 (gettext-0.12) | 1 | # stdint_h.m4 serial 9 |
2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1997-2004, 2006, 2008-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Paul Eggert. | 7 | dnl From Paul Eggert. |
10 | 8 | ||
11 | # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists, | 9 | # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists, |
12 | # doesn't clash with <sys/types.h>, and declares uintmax_t. | 10 | # doesn't clash with <sys/types.h>, and declares uintmax_t. |
13 | 11 | ||
14 | AC_DEFUN([jm_AC_HEADER_STDINT_H], | 12 | AC_DEFUN([gl_AC_HEADER_STDINT_H], |
15 | [ | 13 | [ |
16 | AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, | 14 | AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], |
17 | [AC_TRY_COMPILE( | 15 | [AC_COMPILE_IFELSE( |
18 | [#include <sys/types.h> | 16 | [AC_LANG_PROGRAM( |
19 | #include <stdint.h>], | 17 | [[#include <sys/types.h> |
20 | [uintmax_t i = (uintmax_t) -1;], | 18 | #include <stdint.h>]], |
21 | jm_ac_cv_header_stdint_h=yes, | 19 | [[uintmax_t i = (uintmax_t) -1; return !i;]])], |
22 | jm_ac_cv_header_stdint_h=no)]) | 20 | [gl_cv_header_stdint_h=yes], |
23 | if test $jm_ac_cv_header_stdint_h = yes; then | 21 | [gl_cv_header_stdint_h=no])]) |
24 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, | 22 | if test $gl_cv_header_stdint_h = yes; then |
23 | AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], | ||
25 | [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, | 24 | [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, |
26 | and declares uintmax_t. ]) | 25 | and declares uintmax_t. ]) |
27 | fi | 26 | fi |
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4 index b5f28d44..0a94f17f 100644 --- a/m4/uintmax_t.m4 +++ b/m4/uintmax_t.m4 | |||
@@ -1,32 +1,30 @@ | |||
1 | # uintmax_t.m4 serial 7 (gettext-0.12) | 1 | # uintmax_t.m4 serial 12 |
2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1997-2004, 2007-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Paul Eggert. | 7 | dnl From Paul Eggert. |
10 | 8 | ||
11 | AC_PREREQ(2.13) | 9 | AC_PREREQ([2.13]) |
12 | 10 | ||
13 | # Define uintmax_t to 'unsigned long' or 'unsigned long long' | 11 | # Define uintmax_t to 'unsigned long' or 'unsigned long long' |
14 | # if it is not already defined in <stdint.h> or <inttypes.h>. | 12 | # if it is not already defined in <stdint.h> or <inttypes.h>. |
15 | 13 | ||
16 | AC_DEFUN([jm_AC_TYPE_UINTMAX_T], | 14 | AC_DEFUN([gl_AC_TYPE_UINTMAX_T], |
17 | [ | 15 | [ |
18 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) | 16 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) |
19 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) | 17 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) |
20 | if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then | 18 | if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then |
21 | AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) | 19 | AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) |
22 | test $ac_cv_type_unsigned_long_long = yes \ | 20 | test $ac_cv_type_unsigned_long_long_int = yes \ |
23 | && ac_type='unsigned long long' \ | 21 | && ac_type='unsigned long long' \ |
24 | || ac_type='unsigned long' | 22 | || ac_type='unsigned long' |
25 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, | 23 | AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type], |
26 | [Define to unsigned long or unsigned long long | 24 | [Define to unsigned long or unsigned long long |
27 | if <stdint.h> and <inttypes.h> don't define.]) | 25 | if <stdint.h> and <inttypes.h> don't define.]) |
28 | else | 26 | else |
29 | AC_DEFINE(HAVE_UINTMAX_T, 1, | 27 | AC_DEFINE([HAVE_UINTMAX_T], [1], |
30 | [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.]) | 28 | [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.]) |
31 | fi | 29 | fi |
32 | ]) | 30 | ]) |
diff --git a/m4/visibility.m4 b/m4/visibility.m4 index 2ff6330a..552e3977 100644 --- a/m4/visibility.m4 +++ b/m4/visibility.m4 | |||
@@ -1,5 +1,5 @@ | |||
1 | # visibility.m4 serial 1 (gettext-0.15) | 1 | # visibility.m4 serial 5 (gettext-0.18.2) |
2 | dnl Copyright (C) 2005 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
@@ -12,7 +12,7 @@ dnl __attribute__((__visibility__("hidden"))) and | |||
12 | dnl __attribute__((__visibility__("default"))). | 12 | dnl __attribute__((__visibility__("default"))). |
13 | dnl Does *not* test for __visibility__("protected") - which has tricky | 13 | dnl Does *not* test for __visibility__("protected") - which has tricky |
14 | dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on | 14 | dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on |
15 | dnl MacOS X. | 15 | dnl Mac OS X. |
16 | dnl Does *not* test for __visibility__("internal") - which has processor | 16 | dnl Does *not* test for __visibility__("internal") - which has processor |
17 | dnl dependent semantics. | 17 | dnl dependent semantics. |
18 | dnl Does *not* test for #pragma GCC visibility push(hidden) - which is | 18 | dnl Does *not* test for #pragma GCC visibility push(hidden) - which is |
@@ -26,18 +26,43 @@ AC_DEFUN([gl_VISIBILITY], | |||
26 | CFLAG_VISIBILITY= | 26 | CFLAG_VISIBILITY= |
27 | HAVE_VISIBILITY=0 | 27 | HAVE_VISIBILITY=0 |
28 | if test -n "$GCC"; then | 28 | if test -n "$GCC"; then |
29 | dnl First, check whether -Werror can be added to the command line, or | ||
30 | dnl whether it leads to an error because of some other option that the | ||
31 | dnl user has put into $CC $CFLAGS $CPPFLAGS. | ||
32 | AC_MSG_CHECKING([whether the -Werror option is usable]) | ||
33 | AC_CACHE_VAL([gl_cv_cc_vis_werror], [ | ||
34 | gl_save_CFLAGS="$CFLAGS" | ||
35 | CFLAGS="$CFLAGS -Werror" | ||
36 | AC_COMPILE_IFELSE( | ||
37 | [AC_LANG_PROGRAM([[]], [[]])], | ||
38 | [gl_cv_cc_vis_werror=yes], | ||
39 | [gl_cv_cc_vis_werror=no]) | ||
40 | CFLAGS="$gl_save_CFLAGS"]) | ||
41 | AC_MSG_RESULT([$gl_cv_cc_vis_werror]) | ||
42 | dnl Now check whether visibility declarations are supported. | ||
29 | AC_MSG_CHECKING([for simple visibility declarations]) | 43 | AC_MSG_CHECKING([for simple visibility declarations]) |
30 | AC_CACHE_VAL(gl_cv_cc_visibility, [ | 44 | AC_CACHE_VAL([gl_cv_cc_visibility], [ |
31 | gl_save_CFLAGS="$CFLAGS" | 45 | gl_save_CFLAGS="$CFLAGS" |
32 | CFLAGS="$CFLAGS -fvisibility=hidden" | 46 | CFLAGS="$CFLAGS -fvisibility=hidden" |
33 | AC_TRY_COMPILE( | 47 | dnl We use the option -Werror and a function dummyfunc, because on some |
34 | [extern __attribute__((__visibility__("hidden"))) int hiddenvar; | 48 | dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning |
35 | extern __attribute__((__visibility__("default"))) int exportedvar; | 49 | dnl "visibility attribute not supported in this configuration; ignored" |
36 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); | 50 | dnl at the first function definition in every compilation unit, and we |
37 | extern __attribute__((__visibility__("default"))) int exportedfunc (void);], | 51 | dnl don't want to use the option in this case. |
38 | [], | 52 | if test $gl_cv_cc_vis_werror = yes; then |
39 | gl_cv_cc_visibility=yes, | 53 | CFLAGS="$CFLAGS -Werror" |
40 | gl_cv_cc_visibility=no) | 54 | fi |
55 | AC_COMPILE_IFELSE( | ||
56 | [AC_LANG_PROGRAM( | ||
57 | [[extern __attribute__((__visibility__("hidden"))) int hiddenvar; | ||
58 | extern __attribute__((__visibility__("default"))) int exportedvar; | ||
59 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); | ||
60 | extern __attribute__((__visibility__("default"))) int exportedfunc (void); | ||
61 | void dummyfunc (void) {} | ||
62 | ]], | ||
63 | [[]])], | ||
64 | [gl_cv_cc_visibility=yes], | ||
65 | [gl_cv_cc_visibility=no]) | ||
41 | CFLAGS="$gl_save_CFLAGS"]) | 66 | CFLAGS="$gl_save_CFLAGS"]) |
42 | AC_MSG_RESULT([$gl_cv_cc_visibility]) | 67 | AC_MSG_RESULT([$gl_cv_cc_visibility]) |
43 | if test $gl_cv_cc_visibility = yes; then | 68 | if test $gl_cv_cc_visibility = yes; then |
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 index d8fd1ec5..839a04c1 100644 --- a/m4/wchar_t.m4 +++ b/m4/wchar_t.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # wchar_t.m4 serial 1 (gettext-0.12) | 1 | # wchar_t.m4 serial 4 (gettext-0.18.2) |
2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2002-2003, 2008-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | dnl Test whether <stddef.h> has the 'wchar_t' type. | 8 | dnl Test whether <stddef.h> has the 'wchar_t' type. |
@@ -12,11 +10,15 @@ dnl Prerequisite: AC_PROG_CC | |||
12 | 10 | ||
13 | AC_DEFUN([gt_TYPE_WCHAR_T], | 11 | AC_DEFUN([gt_TYPE_WCHAR_T], |
14 | [ | 12 | [ |
15 | AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, | 13 | AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], |
16 | [AC_TRY_COMPILE([#include <stddef.h> | 14 | [AC_COMPILE_IFELSE( |
17 | wchar_t foo = (wchar_t)'\0';], , | 15 | [AC_LANG_PROGRAM( |
18 | gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) | 16 | [[#include <stddef.h> |
17 | wchar_t foo = (wchar_t)'\0';]], | ||
18 | [[]])], | ||
19 | [gt_cv_c_wchar_t=yes], | ||
20 | [gt_cv_c_wchar_t=no])]) | ||
19 | if test $gt_cv_c_wchar_t = yes; then | 21 | if test $gt_cv_c_wchar_t = yes; then |
20 | AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) | 22 | AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) |
21 | fi | 23 | fi |
22 | ]) | 24 | ]) |
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 index 3d8d2159..9b07b070 100644 --- a/m4/wint_t.m4 +++ b/m4/wint_t.m4 | |||
@@ -1,10 +1,8 @@ | |||
1 | # wint_t.m4 serial 1 (gettext-0.12) | 1 | # wint_t.m4 serial 5 (gettext-0.18.2) |
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | dnl From Bruno Haible. | 7 | dnl From Bruno Haible. |
10 | dnl Test whether <wchar.h> has the 'wint_t' type. | 8 | dnl Test whether <wchar.h> has the 'wint_t' type. |
@@ -12,11 +10,23 @@ dnl Prerequisite: AC_PROG_CC | |||
12 | 10 | ||
13 | AC_DEFUN([gt_TYPE_WINT_T], | 11 | AC_DEFUN([gt_TYPE_WINT_T], |
14 | [ | 12 | [ |
15 | AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, | 13 | AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], |
16 | [AC_TRY_COMPILE([#include <wchar.h> | 14 | [AC_COMPILE_IFELSE( |
17 | wint_t foo = (wchar_t)'\0';], , | 15 | [AC_LANG_PROGRAM( |
18 | gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) | 16 | [[ |
17 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | ||
18 | <wchar.h>. | ||
19 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included | ||
20 | before <wchar.h>. */ | ||
21 | #include <stddef.h> | ||
22 | #include <stdio.h> | ||
23 | #include <time.h> | ||
24 | #include <wchar.h> | ||
25 | wint_t foo = (wchar_t)'\0';]], | ||
26 | [[]])], | ||
27 | [gt_cv_c_wint_t=yes], | ||
28 | [gt_cv_c_wint_t=no])]) | ||
19 | if test $gt_cv_c_wint_t = yes; then | 29 | if test $gt_cv_c_wint_t = yes; then |
20 | AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) | 30 | AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) |
21 | fi | 31 | fi |
22 | ]) | 32 | ]) |
diff --git a/m4/xsize.m4 b/m4/xsize.m4 index 9b7cf9b4..3af23ec7 100644 --- a/m4/xsize.m4 +++ b/m4/xsize.m4 | |||
@@ -1,14 +1,12 @@ | |||
1 | # xsize.m4 serial 2 | 1 | # xsize.m4 serial 5 |
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2003-2004, 2008-2014 Free Software Foundation, Inc. |
3 | dnl This file is free software, distributed under the terms of the GNU | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl General Public License. As a special exception to the GNU General | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl Public License, this file may be distributed as part of a program | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | 6 | ||
9 | AC_DEFUN([gl_XSIZE], | 7 | AC_DEFUN([gl_XSIZE], |
10 | [ | 8 | [ |
11 | dnl Prerequisites of lib/xsize.h. | 9 | dnl Prerequisites of lib/xsize.h. |
12 | AC_REQUIRE([gl_SIZE_MAX]) | 10 | AC_REQUIRE([gl_SIZE_MAX]) |
13 | AC_CHECK_HEADERS(stdint.h) | 11 | AC_CHECK_HEADERS([stdint.h]) |
14 | ]) | 12 | ]) |