From 79abcb428ce2794c1224a41118490a158c548001 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 18 May 2022 11:49:16 +0100 Subject: [PATCH] modernise autotools --- configure.ac | 10 ---------- m4/check-type.m4 | 9 ++++----- m4/gnupg-check-typedef.m4 | 6 +++--- m4/gnupg.m4 | 5 ++--- m4/intmax.m4 | 4 ++-- m4/inttypes-pri.m4 | 4 ++-- m4/inttypes.m4 | 6 ++---- m4/inttypes_h.m4 | 8 ++------ m4/longdouble.m4 | 5 ++--- m4/signed.m4 | 2 +- m4/spamassassin.m4 | 35 ++++++++++------------------------- m4/stdint_h.m4 | 8 ++------ m4/wchar_t.m4 | 5 ++--- 13 files changed, 34 insertions(+), 73 deletions(-) diff --git a/configure.ac b/configure.ac index 291d6a939..bbd87a2fc 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -#endif -], Define to `unsigned int' if or 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) diff --git a/m4/check-type.m4 b/m4/check-type.m4 index b5ac51d60..7ea7c89e8 100644 --- a/m4/check-type.m4 +++ b/m4/check-type.m4 @@ -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 #if STDC_HEADERS #include #include #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) diff --git a/m4/gnupg-check-typedef.m4 b/m4/gnupg-check-typedef.m4 index bd7d6c400..7e41cf05d 100644 --- a/m4/gnupg-check-typedef.m4 +++ b/m4/gnupg-check-typedef.m4 @@ -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 - #include ], [ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include ]], [[ #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) diff --git a/m4/gnupg.m4 b/m4/gnupg.m4 index 5f1cffc24..0b0420277 100644 --- a/m4/gnupg.m4 +++ b/m4/gnupg.m4 @@ -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 #ifdef HAVE_SYS_STAT_H # include @@ -27,8 +27,7 @@ AC_CACHE_CHECK([if mkdir takes one argument], gnupg_cv_mkdir_takes_one_arg, #endif #ifdef HAVE_DIRECT_H # include -#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]) diff --git a/m4/intmax.m4 b/m4/intmax.m4 index d99c999fd..5c5c8b555 100644 --- a/m4/intmax.m4 +++ b/m4/intmax.m4 @@ -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 #include #if HAVE_STDINT_H_WITH_UINTMAX @@ -22,7 +22,7 @@ AC_DEFUN([gt_TYPE_INTMAX_T], #if HAVE_INTTYPES_H_WITH_UINTMAX #include #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 or .]) diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 index 4d56a9ad3..268ceb8dd 100644 --- a/m4/inttypes-pri.m4 +++ b/m4/inttypes-pri.m4 @@ -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 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #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 diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index 779bcea05..9987a5427 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -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 -#include ], - [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], [[]])],[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, diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 index a5d075d96..33809d8b1 100644 --- a/m4/inttypes_h.m4 +++ b/m4/inttypes_h.m4 @@ -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 -#include ], - [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 +#include ]], [[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 exists, doesn't clash with , diff --git a/m4/longdouble.m4 b/m4/longdouble.m4 index 40cd7ce02..bf10d7876 100644 --- a/m4/longdouble.m4 +++ b/m4/longdouble.m4 @@ -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.]) diff --git a/m4/signed.m4 b/m4/signed.m4 index 048f59369..881247ebf 100644 --- a/m4/signed.m4 +++ b/m4/signed.m4 @@ -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.]) diff --git a/m4/spamassassin.m4 b/m4/spamassassin.m4 index c70228ca6..ea4bacf70 100644 --- a/m4/spamassassin.m4 +++ b/m4/spamassassin.m4 @@ -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 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include -#include ], - [printf ("%d", SHUT_RD); return 0;], - [spamassassin_cv_has_shutrd=yes], - [spamassassin_cv_has_shutrd=no]), +#include ]], [[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 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include -], - [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 -#include ], - [in_addr_t foo; return 0;], - [spamassassin_cv_has_inaddrt=yes], - [spamassassin_cv_has_inaddrt=no]), + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], [[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 -#include ], - [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 +#include ]], [[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 #endif -#include ], - [int foo = EX__MAX; return 0;], - [spamassassin_cv_has_haveexmax=yes], - [spamassassin_cv_has_haveexmax=no]), +#include ]], [[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) diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 index 3355f35aa..6e224c5a8 100644 --- a/m4/stdint_h.m4 +++ b/m4/stdint_h.m4 @@ -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 -#include ], - [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 +#include ]], [[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 exists, doesn't clash with , diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 index cde2129a9..b023c3e17 100644 --- a/m4/wchar_t.m4 +++ b/m4/wchar_t.m4 @@ -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 - 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 + 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 -- 2.11.4.GIT