]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Modernize AC_TRY_COMPILE invocations.
authorBruno Haible <bruno@clisp.org>
Mon, 19 Jul 2010 00:38:04 +0000 (02:38 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 30 Aug 2010 20:58:34 +0000 (22:58 +0200)
12 files changed:
gettext-runtime/m4/ChangeLog
gettext-runtime/m4/iconv.m4
gettext-runtime/m4/intl.m4
gettext-runtime/m4/intmax.m4
gettext-runtime/m4/inttypes-pri.m4
gettext-runtime/m4/inttypes_h.m4
gettext-runtime/m4/lock.m4
gettext-runtime/m4/size_max.m4
gettext-runtime/m4/stdint_h.m4
gettext-runtime/m4/visibility.m4
gettext-runtime/m4/wchar_t.m4
gettext-runtime/m4/wint_t.m4

index 3a5c0cb8a2bd85b7595d0037dde5b4cf8092d827..c3baad2899484d7fcfc69f45316330f5abc3d489 100644 (file)
@@ -1,3 +1,19 @@
+2010-07-18  Bruno Haible  <bruno@clisp.org>
+
+       Modernize AC_TRY_COMPILE invocations.
+       * iconv.m4 (gl_iconv_AC_DEFUN): Use AC_COMPILE_IFELSE instead of
+       AC_TRY_COMPILE.
+       * intl.m4 (gt_CHECK_DECL): Likewise.
+       * intmax.m4 (gt_TYPE_INTMAX_T): Likewise.
+       * inttypes-pri.m4 (gt_INTTYPES_PRI): Likewise.
+       * inttypes_h.m4 (gl_AC_HEADER_INTTYPES_H): Likewise.
+       * lock.m4 (gl_LOCK): Likewise.
+       * size_max.m4 (gl_SIZE_MAX): Likewise.
+       * stdint_h.m4 (gl_AC_HEADER_STDINT_H): Likewise.
+       * visibility.m4 (gl_VISIBILITY): Likewise.
+       * wchar_t.m4 (gt_TYPE_WCHAR_T): Likewise.
+       * wint_t.m4 (gt_TYPE_WINT_T): Likewise.
+
 2010-07-01  Christian Weisgerber  <naddy@mips.inka.de>  (tiny change)
 
        Use AC_GNU_SOURCE as a fallback for AC_USE_SYSTEM_EXTENSIONS.
index e2041b9b49fb70bcb08cd65699529d9b0c3374a4..1ec4f82c429434bab5e5705635cc315f41670f6e 100644 (file)
@@ -1,4 +1,4 @@
-# iconv.m4 serial 11 (gettext-0.18.1)
+# iconv.m4 serial 12 (gettext-0.18.2)
 dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -191,7 +191,9 @@ gl_iconv_AC_DEFUN([AM_ICONV],
   if test "$am_cv_func_iconv" = yes; then
     AC_MSG_CHECKING([for iconv declaration])
     AC_CACHE_VAL([am_cv_proto_iconv], [
-      AC_TRY_COMPILE([
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
 #include <stdlib.h>
 #include <iconv.h>
 extern
@@ -203,7 +205,10 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
 #else
 size_t iconv();
 #endif
-], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
+           ]],
+           [[]])],
+        [am_cv_proto_iconv_arg1=""],
+        [am_cv_proto_iconv_arg1="const"])
       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
     AC_MSG_RESULT([
index 584f257bd0e25689de1474395aaa2cfd2f7f88c7..134981c8907b06b2f333460ff80228cb80c0760e 100644 (file)
@@ -1,4 +1,4 @@
-# intl.m4 serial 18 (gettext-0.18.2)
+# intl.m4 serial 19 (gettext-0.18.2)
 dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ dnl Authors:
 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2009.
 
-AC_PREREQ([2.52])
+AC_PREREQ([2.53])
 
 dnl Checks for all prerequisites of the intl subdirectory,
 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
@@ -279,11 +279,16 @@ dnl Check whether a function is declared.
 AC_DEFUN([gt_CHECK_DECL],
 [
   AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
-    [AC_TRY_COMPILE([$2], [
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[$2]],
+          [[
 #ifndef $1
   char *p = (char *) $1;
 #endif
-], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
+          ]])],
+       [ac_cv_have_decl_$1=yes],
+       [ac_cv_have_decl_$1=no])])
   if test $ac_cv_have_decl_$1 = yes; then
     gt_value=1
   else
index 74aaaf5ed66314043e447a5675327a9dda4b0d0a..2c0f2afe59f53c5b3edc11197fc028db1d44be70 100644 (file)
@@ -1,4 +1,4 @@
-# intmax.m4 serial 5 (gettext-0.18)
+# intmax.m4 serial 6 (gettext-0.18.2)
 dnl Copyright (C) 2002-2005, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,9 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
   AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
   AC_REQUIRE([gl_AC_HEADER_STDINT_H])
   AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
-    [AC_TRY_COMPILE([
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
 #include <stddef.h>
 #include <stdlib.h>
 #if HAVE_STDINT_H_WITH_UINTMAX
@@ -22,8 +24,9 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
 #if HAVE_INTTYPES_H_WITH_UINTMAX
 #include <inttypes.h>
 #endif
-],     [intmax_t x = -1;
-        return !x;],
+          ]],
+          [[intmax_t x = -1;
+            return !x;]])],
        [gt_cv_c_intmax_t=yes],
        [gt_cv_c_intmax_t=no])])
   if test $gt_cv_c_intmax_t = yes; then
index 718a4f4e19f4e0ae45cd9be70a1aef0df4df307e..ee96bcd9780bc62b88dbb6c34897938a6fb43524 100644 (file)
@@ -1,4 +1,4 @@
-# inttypes-pri.m4 serial 6 (gettext-0.18)
+# inttypes-pri.m4 serial 7 (gettext-0.18.2)
 dnl Copyright (C) 1997-2002, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
-AC_PREREQ([2.52])
+AC_PREREQ([2.53])
 
 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
 # macros to non-string values.  This is the case on AIX 4.3.3.
@@ -18,11 +18,17 @@ AC_DEFUN([gt_INTTYPES_PRI],
     AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
       [gt_cv_inttypes_pri_broken],
       [
-        AC_TRY_COMPILE([#include <inttypes.h>
+        AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
+#include <inttypes.h>
 #ifdef PRId32
 char *p = PRId32;
 #endif
-], [], [gt_cv_inttypes_pri_broken=no], [gt_cv_inttypes_pri_broken=yes])
+             ]],
+             [[]])],
+          [gt_cv_inttypes_pri_broken=no],
+          [gt_cv_inttypes_pri_broken=yes])
       ])
   fi
   if test "$gt_cv_inttypes_pri_broken" = yes; then
index 782d77ed8b1e0629d7b5ac2938db0ef6010e61d6..9d8f926926e55b4a89dff55f8f7b38a465d1e678 100644 (file)
@@ -1,4 +1,4 @@
-# inttypes_h.m4 serial 9
+# inttypes_h.m4 serial 10
 dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,12 +12,15 @@ dnl From Paul Eggert.
 AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
 [
   AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <inttypes.h>],
-    [uintmax_t i = (uintmax_t) -1; return !i;],
-    [gl_cv_header_inttypes_h=yes],
-    [gl_cv_header_inttypes_h=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
+#include <sys/types.h>
+#include <inttypes.h>
+          ]],
+          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+       [gl_cv_header_inttypes_h=yes],
+       [gl_cv_header_inttypes_h=no])])
   if test $gl_cv_header_inttypes_h = yes; then
     AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
       [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
index 9da8465ebfb47c04d1385753df55e56f61c92871..f71c66459ebfd5a93c19f37c1a2d818a2084f334 100644 (file)
@@ -1,4 +1,4 @@
-# lock.m4 serial 10 (gettext-0.18)
+# lock.m4 serial 11 (gettext-0.18.2)
 dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,13 +18,17 @@ AC_DEFUN([gl_LOCK],
       [],
       [#include <pthread.h>])
     # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
-    AC_TRY_COMPILE([#include <pthread.h>],
-      [#if __FreeBSD__ == 4
+    AC_COMPILE_IFELSE([
+      AC_LANG_PROGRAM(
+        [[#include <pthread.h>]],
+        [[
+#if __FreeBSD__ == 4
 error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
 #else
 int x = (int)PTHREAD_MUTEX_RECURSIVE;
 return !x;
-#endif],
+#endif
+        ]])],
       [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
          [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
   fi
index ce992db1f18336a0775f3bd98bdd12cdb7e4e70f..f3b1a9dfb2074f1cb667ef70f15c3c32456541ef 100644 (file)
@@ -1,4 +1,4 @@
-# size_max.m4 serial 9
+# size_max.m4 serial 10
 dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -34,10 +34,14 @@ Found it
         if test $fits_in_uint = 1; then
           dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
           dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
-          AC_TRY_COMPILE([#include <stddef.h>
-            extern size_t foo;
-            extern unsigned long foo;
-            ], [], [fits_in_uint=0])
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[#include <stddef.h>
+                 extern size_t foo;
+                 extern unsigned long foo;
+               ]],
+               [[]])],
+            [fits_in_uint=0])
         fi
         dnl We cannot use 'expr' to simplify this expression, because 'expr'
         dnl works only with 'long' integers in the host environment, while we
index b8e3c6cc711f17ab409131b9411ea51fe23d8d01..670c0cc2bff9c1edbab5da3ebb53bc9ee90749f8 100644 (file)
@@ -1,4 +1,4 @@
-# stdint_h.m4 serial 8
+# stdint_h.m4 serial 9
 dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,12 +12,13 @@ dnl From Paul Eggert.
 AC_DEFUN([gl_AC_HEADER_STDINT_H],
 [
   AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <stdint.h>],
-    [uintmax_t i = (uintmax_t) -1; return !i;],
-    [gl_cv_header_stdint_h=yes],
-    [gl_cv_header_stdint_h=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <sys/types.h>
+            #include <stdint.h>]],
+          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+       [gl_cv_header_stdint_h=yes],
+       [gl_cv_header_stdint_h=no])])
   if test $gl_cv_header_stdint_h = yes; then
     AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
       [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
index 077c4765ec2252f796d90b8848ef199860b7789d..19cd8f3d3ed4d2d5d8249339388276f046d2a24e 100644 (file)
@@ -1,5 +1,5 @@
-# visibility.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc.
+# visibility.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2005, 20082010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -33,7 +33,8 @@ AC_DEFUN([gl_VISIBILITY],
     AC_CACHE_VAL([gl_cv_cc_vis_werror], [
       gl_save_CFLAGS="$CFLAGS"
       CFLAGS="$CFLAGS -Werror"
-      AC_TRY_COMPILE([], [],
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[]], [[]])],
         [gl_cv_cc_vis_werror=yes],
         [gl_cv_cc_vis_werror=no])
       CFLAGS="$gl_save_CFLAGS"])
@@ -51,13 +52,15 @@ AC_DEFUN([gl_VISIBILITY],
       if test $gl_cv_cc_vis_werror = yes; then
         CFLAGS="$CFLAGS -Werror"
       fi
-      AC_TRY_COMPILE(
-        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
-         extern __attribute__((__visibility__("default"))) int exportedvar;
-         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
-         extern __attribute__((__visibility__("default"))) int exportedfunc (void);
-         void dummyfunc (void) {}],
-        [],
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+             extern __attribute__((__visibility__("default"))) int exportedvar;
+             extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+             extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+             void dummyfunc (void) {}
+           ]],
+           [[]])],
         [gl_cv_cc_visibility=yes],
         [gl_cv_cc_visibility=no])
       CFLAGS="$gl_save_CFLAGS"])
index ed804e664ba7933d42051ff3f240e82f9d787998..a133e6ad5868f04247375563e72273e8e43512ab 100644 (file)
@@ -1,4 +1,4 @@
-# wchar_t.m4 serial 3 (gettext-0.18)
+# wchar_t.m4 serial 4 (gettext-0.18.2)
 dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,9 +11,13 @@ dnl Prerequisite: AC_PROG_CC
 AC_DEFUN([gt_TYPE_WCHAR_T],
 [
   AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
-    [AC_TRY_COMPILE([#include <stddef.h>
-       wchar_t foo = (wchar_t)'\0';], ,
-       [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stddef.h>
+            wchar_t foo = (wchar_t)'\0';]],
+          [[]])],
+       [gt_cv_c_wchar_t=yes],
+       [gt_cv_c_wchar_t=no])])
   if test $gt_cv_c_wchar_t = yes; then
     AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
   fi
index a6c7d15cb50a60c46df73caef95f0fd1a0034809..58ef865565f09db7ccc09ddeaf69568d03755b0d 100644 (file)
@@ -1,4 +1,4 @@
-# wint_t.m4 serial 4 (gettext-0.18)
+# wint_t.m4 serial 5 (gettext-0.18.2)
 dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,9 @@ dnl Prerequisite: AC_PROG_CC
 AC_DEFUN([gt_TYPE_WINT_T],
 [
   AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
-    [AC_TRY_COMPILE([
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
@@ -20,8 +22,10 @@ AC_DEFUN([gt_TYPE_WINT_T],
 #include <stdio.h>
 #include <time.h>
 #include <wchar.h>
-       wint_t foo = (wchar_t)'\0';], ,
-       [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])])
+            wint_t foo = (wchar_t)'\0';]],
+          [[]])],
+       [gt_cv_c_wint_t=yes],
+       [gt_cv_c_wint_t=no])])
   if test $gt_cv_c_wint_t = yes; then
     AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
   fi