modernise autotools
authorPaul <paul@claws-mail.org>
Wed, 18 May 2022 10:49:16 +0000 (11:49 +0100)
committerPaul <paul@claws-mail.org>
Wed, 18 May 2022 10:49:16 +0000 (11:49 +0100)
13 files changed:
configure.ac
m4/check-type.m4
m4/gnupg-check-typedef.m4
m4/gnupg.m4
m4/intmax.m4
m4/inttypes-pri.m4
m4/inttypes.m4
m4/inttypes_h.m4
m4/longdouble.m4
m4/signed.m4
m4/spamassassin.m4
m4/stdint_h.m4
m4/wchar_t.m4

index 291d6a939a1319d1c4509892f1a0138247172439..bbd87a2fcf34aee3d21b8f007c7c238dc55ab416 100644 (file)
@@ -443,16 +443,6 @@ AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_STRUCT_TM
 
-dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
-dnl may be defined only in wchar.h (this happens with gcc-2.96).
-dnl So we need to use this extended macro.
-CLAWS_CHECK_TYPE(wint_t, unsigned int,
-[
-#if HAVE_WCHAR_H
-#include <wchar.h>
-#endif
-], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
-
 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
 AC_CHECK_SIZEOF(unsigned short, 2)
 AC_CHECK_SIZEOF(unsigned int, 4)
index b5ac51d605a6a1f32f2195d04c031153de130bc0..7ea7c89e8a18cca52f98fe5981f0258be1e22cf3 100644 (file)
@@ -10,20 +10,19 @@ 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.
 AC_DEFUN([CLAWS_CHECK_TYPE],
-[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_MSG_CHECKING(for $1)
+[AC_MSG_CHECKING(for $1)
 AC_CACHE_VAL(claws_cv_type_$1,
-[AC_TRY_COMPILE([
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
 #endif
 $3
-][
+]], [[
 #undef $1
 int a = sizeof($1);
-], claws_cv_type_$1=yes, claws_cv_type_$1=no)])dnl
+]])],[claws_cv_type_$1=yes],[claws_cv_type_$1=no])])dnl
 AC_MSG_RESULT($claws_cv_type_$1)
 if test $claws_cv_type_$1 = no; then
   AC_DEFINE($1, $2, $4)
index bd7d6c4008e944f60e1ad3bce1362077465ce7de..7e41cf05d4199f10f862d26d3197cfe01a700f28 100644 (file)
@@ -8,11 +8,11 @@ dnl
 AC_DEFUN([GNUPG_CHECK_TYPEDEF],
   [ AC_MSG_CHECKING(for $1 typedef)
     AC_CACHE_VAL(gnupg_cv_typedef_$1,
-    [AC_TRY_COMPILE([#include <stdlib.h>
-    #include <sys/types.h>][
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+    #include <sys/types.h>]], [[
     #undef $1
     int a = sizeof($1);
-    ], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
+    ]])],[gnupg_cv_typedef_$1=yes],[gnupg_cv_typedef_$1=no ])])
     AC_MSG_RESULT($gnupg_cv_typedef_$1)
     if test "$gnupg_cv_typedef_$1" = yes; then
         AC_DEFINE($2, 1, $3)
index 5f1cffc24e48145d3779838972ebb058708249b9..0b04202774f2c243811844e1de05db48b88d9214 100644 (file)
@@ -17,7 +17,7 @@ dnl of the usual 2.
 AC_DEFUN([GNUPG_FUNC_MKDIR_TAKES_ONE_ARG],
 [AC_CHECK_HEADERS(sys/stat.h unistd.h direct.h)
 AC_CACHE_CHECK([if mkdir takes one argument], gnupg_cv_mkdir_takes_one_arg,
-[AC_TRY_COMPILE([
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
@@ -27,8 +27,7 @@ AC_CACHE_CHECK([if mkdir takes one argument], gnupg_cv_mkdir_takes_one_arg,
 #endif
 #ifdef HAVE_DIRECT_H
 # include <direct.h>
-#endif], [mkdir ("foo", 0);],
-        gnupg_cv_mkdir_takes_one_arg=no, gnupg_cv_mkdir_takes_one_arg=yes)])
+#endif]], [[mkdir ("foo", 0);]])],[gnupg_cv_mkdir_takes_one_arg=no],[gnupg_cv_mkdir_takes_one_arg=yes])])
 if test $gnupg_cv_mkdir_takes_one_arg = yes ; then
   AC_DEFINE(MKDIR_TAKES_ONE_ARG,1,
             [Defined if mkdir() does not take permission flags])
index d99c999fdbde8d3a143b3426ae5c70af08c6b580..5c5c8b5555a2236d0438ec6097d7f33ed31582a1 100644 (file)
@@ -13,7 +13,7 @@ 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,7 +22,7 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
 #if HAVE_INTTYPES_H_WITH_UINTMAX
 #include <inttypes.h>
 #endif
-], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
+]], [[intmax_t x = -1;]])],[gt_cv_c_intmax_t=yes],[gt_cv_c_intmax_t=no])])
   if test $gt_cv_c_intmax_t = yes; then
     AC_DEFINE(HAVE_INTMAX_T, 1,
       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
index 4d56a9ad30c9a1907f95b69c57bb8f83ebf3277a..268ceb8dd4b65aa3adeb53b144f58a70c1bd4930 100644 (file)
@@ -16,11 +16,11 @@ 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 779bcea059d29123ca9d541e4dd7749ba2497980..9987a5427d51d75fbc55580b616aa8403572d99e 100644 (file)
@@ -13,10 +13,8 @@ AC_DEFUN([gt_HEADER_INTTYPES_H],
 [
   AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
   [
-    AC_TRY_COMPILE(
-      [#include <sys/types.h>
-#include <inttypes.h>],
-      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <inttypes.h>]], [[]])],[gt_cv_header_inttypes_h=yes],[gt_cv_header_inttypes_h=no])
   ])
   if test $gt_cv_header_inttypes_h = yes; then
     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
index a5d075d96875a5e9f432467c3b84054efbf59379..33809d8b10b3024c1b92ee356faf64d606f96841 100644 (file)
@@ -12,12 +12,8 @@ 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;],
-    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;]])],[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 40cd7ce02df6d355145e3eea5c70e6ee9fc3096a..bf10d78762ca868ca3d121f3d93b7f050918b819 100644 (file)
@@ -14,13 +14,12 @@ AC_DEFUN([gt_TYPE_LONGDOUBLE],
     [if test "$GCC" = yes; then
        gt_cv_c_long_double=yes
      else
-       AC_TRY_COMPILE([
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
          /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
          long double foo = 0.0;
          /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
          int array [2*(sizeof(long double) >= sizeof(double)) - 1];
-         ], ,
-         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
+         ]], [[]])],[gt_cv_c_long_double=yes],[gt_cv_c_long_double=no])
      fi])
   if test $gt_cv_c_long_double = yes; then
     AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
index 048f593698ba151c8c47f25b90df5c87c54e8aa0..881247ebf16720b5233566ca4d82f63fd284a18b 100644 (file)
@@ -9,7 +9,7 @@ dnl From Bruno Haible.
 AC_DEFUN([bh_C_SIGNED],
 [
   AC_CACHE_CHECK([for signed], bh_cv_c_signed,
-   [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
+   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char x;]])],[bh_cv_c_signed=yes],[bh_cv_c_signed=no])])
   if test $bh_cv_c_signed = no; then
     AC_DEFINE(signed, ,
               [Define to empty if the C compiler doesn't support this keyword.])
index c70228ca663aa36bb6baa47c4a5e51b95a8322b4..ea4bacf701c8d8bb82c9715369dc104c4209f9b8 100644 (file)
@@ -12,12 +12,9 @@ AC_CHECK_HEADERS(time.h sysexits.h sys/socket.h netdb.h netinet/in.h)
 
 AC_CACHE_CHECK([for SHUT_RD],
        spamassassin_cv_has_shutrd, [
-                AC_TRY_COMPILE([#include <sys/types.h>
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 #include <stdio.h>
-#include <sys/socket.h>],
-                        [printf ("%d", SHUT_RD); return 0;],
-                                        [spamassassin_cv_has_shutrd=yes],
-                                        [spamassassin_cv_has_shutrd=no]),
+#include <sys/socket.h>]], [[printf ("%d", SHUT_RD); return 0;]])],[spamassassin_cv_has_shutrd=yes],[spamassassin_cv_has_shutrd=no]),
        ])
 if test $spamassassin_cv_has_shutrd = yes ; then
   AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
@@ -31,12 +28,9 @@ dnl ----------------------------------------------------------------------
 
 AC_CACHE_CHECK([for h_errno],
         spamassassin_cv_has_herrno, [
-                AC_TRY_COMPILE([#include <netdb.h>
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>
 #include <stdio.h>
-],
-                        [printf ("%d", h_errno); return 0;],
-                                        [spamassassin_cv_has_herrno=yes],
-                                        [spamassassin_cv_has_herrno=no]),
+]], [[printf ("%d", h_errno); return 0;]])],[spamassassin_cv_has_herrno=yes],[spamassassin_cv_has_herrno=no]),
         ])
 if test $spamassassin_cv_has_herrno = yes ; then
   AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
@@ -48,11 +42,8 @@ dnl ----------------------------------------------------------------------
 
 AC_CACHE_CHECK([for in_addr_t],
         spamassassin_cv_has_inaddrt, [
-                AC_TRY_COMPILE([#include <sys/types.h>
-#include <netinet/in.h>],
-                        [in_addr_t foo; return 0;],
-                                        [spamassassin_cv_has_inaddrt=yes],
-                                        [spamassassin_cv_has_inaddrt=no]),
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <netinet/in.h>]], [[in_addr_t foo; return 0;]])],[spamassassin_cv_has_inaddrt=yes],[spamassassin_cv_has_inaddrt=no]),
         ])
 if test $spamassassin_cv_has_inaddrt = no ; then
   AC_CHECK_TYPE(in_addr_t, unsigned long)
@@ -62,11 +53,8 @@ dnl ----------------------------------------------------------------------
 
 AC_CACHE_CHECK([for INADDR_NONE],
         spamassassin_cv_has_haveinaddrnone, [
-                AC_TRY_COMPILE([#include <sys/types.h>
-#include <netinet/in.h>],
-                        [in_addr_t foo = INADDR_NONE; return 0;],
-                                        [spamassassin_cv_has_haveinaddrnone=yes],
-                                        [spamassassin_cv_has_haveinaddrnone=no]),
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <netinet/in.h>]], [[in_addr_t foo = INADDR_NONE; return 0;]])],[spamassassin_cv_has_haveinaddrnone=yes],[spamassassin_cv_has_haveinaddrnone=no]),
         ])
 if test $spamassassin_cv_has_haveinaddrnone = yes ; then
   AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
@@ -76,13 +64,10 @@ dnl ----------------------------------------------------------------------
 
 AC_CACHE_CHECK([for EX__MAX],
         spamassassin_cv_has_haveexmax, [
-                AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYSEXITS_H
 #include <sysexits.h>
 #endif
-#include <errno.h>],
-                        [int foo = EX__MAX; return 0;],
-                                        [spamassassin_cv_has_haveexmax=yes],
-                                        [spamassassin_cv_has_haveexmax=no]),
+#include <errno.h>]], [[int foo = EX__MAX; return 0;]])],[spamassassin_cv_has_haveexmax=yes],[spamassassin_cv_has_haveexmax=no]),
         ])
 if test $spamassassin_cv_has_haveexmax = yes ; then
   AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
index 3355f35aa3ffef364fc812923db663ff1564292a..6e224c5a86a4f92312917726a85a89d032de8ec3 100644 (file)
@@ -12,12 +12,8 @@ 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;],
-    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;]])],[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 cde2129a97273cfbab4ad5adc811ec34dfd5d59e..b023c3e177dd064047b7e88e3e2542d5a8ee2615 100644 (file)
@@ -11,9 +11,8 @@ 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