configure.ac: Lightly modernize.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 10 Mar 2024 16:46:38 +0000 (16:46 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 10 Mar 2024 17:17:17 +0000 (17:17 +0000)
  * Use `@%:@' for hashes.
  * Delete unnecessary toothpicks in `AC_DEFINE'.
  * Replace `AC_TRY_...' with `AC_..._IFELSE'.
  * Use `LT_INIT' instead of `AM_PROG_LIBTOOL'.

configure.ac

index 4e8f489..88d2ec5 100644 (file)
@@ -37,7 +37,7 @@ mdw_SILENT_RULES
 
 AC_PROG_CC
 AX_CFLAGS_WARN_ALL
-AM_PROG_LIBTOOL
+LT_INIT
 mdw_LIBTOOL_VERSION_INFO
 case $host_os in
   cygwin* | mingw* | pw32* | os2* | darwin* | cegcc*)
@@ -152,7 +152,7 @@ m4_define([catacomb_DEFINE_CPU_OR_ABI],
        ;;m4_define([catacomb_seen_$3/$$2], [t])])])
   catacomb_CPU_FAMILIES([_def])
   nil) ;;
-  *) AC_MSG_ERROR([BUG: unexpected $1 \`$$1']) ;;
+  *) AC_MSG_ERROR([BUG: unexpected $1 `$$1']) ;;
 esac])
 
 dnl Now that's out the way, we can explain what we're doing.
@@ -161,9 +161,9 @@ AC_MSG_CHECKING([CPU family and ABI])
 dnl Figure out the target CPU family and ABI.
 catacomb_CPU_FAMILIES([catacomb_CLEAR_FLAGS])
 catacomb_DEFINE_CPU_OR_ABI([CPUFAM], [2], [cpu],
-  [CPUFAM_], [Define if target CPU is \`$][2\'.])
+  [CPUFAM_], [Define if target CPU is `$][2'.])
 catacomb_DEFINE_CPU_OR_ABI([ABI], [3], [abi],
-  [ABI_], [Define if target ABI is \`$][3\'.])
+  [ABI_], [Define if target ABI is `$][3'.])
 
 dnl Establish Automake conditions for things.
 catacomb_CPU_FAMILIES([catacomb_CLEAR_FLAGS])
@@ -262,7 +262,7 @@ AC_CHECK_TYPE([socklen_t], [],
   [AC_DEFINE([socklen_t], [int],
      [Define to `int' if <sys/socket.h> does not define])],
   [AC_INCLUDES_DEFAULT
-#include <sys/socket.h>
+@%:@include <sys/socket.h>
 ])
 
 dnl The maths library.
@@ -277,10 +277,11 @@ AC_CACHE_CHECK(
   [library needed for syslog], [mdw_cv_syslog_lib],
   [mdw_ORIG_LIBS=$LIBS LIBS=
    for i in 0 1; do
-     AC_TRY_LINK([#include <syslog.h>],
-                [openlog("test", LOG_PID, LOG_DAEMON);
-                 syslog(LOG_ERR, "this is a test");],
-                [ok=t], [ok=nil])
+     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+        [[@%:@include <syslog.h>]],
+        [[openlog("test", LOG_PID, LOG_DAEMON);
+          syslog(LOG_ERR, "this is a test");]])],
+       [ok=t], [ok=nil])
      case $i,$ok in
        *,t) mdw_cv_syslog_lib=${LIBS:-none}; break ;;
        0,nil) LIBS="-llog" ;;
@@ -332,7 +333,7 @@ limits="" limits_sep=""
 AC_DEFUN([catacomb_COMPILE_TIME_CONSTANT],
   [case "$2" in
      =*)
-       $1="$2"; $1=${$1#=}
+       $1="$2"; $1=${$1@%:@=}
        ;;
      *)
        AC_CACHE_CHECK([compile-time value of $2], [mdw_cv_constant_$3],
@@ -342,11 +343,11 @@ AC_DEFUN([catacomb_COMPILE_TIME_CONSTANT],
    esac])
 AC_DEFUN([catacomb_LIMIT],
 [catacomb_COMPILE_TIME_CONSTANT([lo], [$2], [$1_min],
-[#include <limits.h>
-#include <stddef.h>])
+[@%:@include <limits.h>
+@%:@include <stddef.h>])
  catacomb_COMPILE_TIME_CONSTANT([hi], [$3], [$1_max],
-[#include <limits.h>
-#include <stddef.h>])
+[@%:@include <limits.h>
+@%:@include <stddef.h>])
  limits="$limits$limits_sep('$1', $lo, $hi)" limits_sep=", "])
 catacomb_LIMIT([SCHAR],                [SCHAR_MIN],    [SCHAR_MAX])
 catacomb_LIMIT([CHAR],         [CHAR_MIN],     [CHAR_MAX])
@@ -370,9 +371,9 @@ AC_SUBST([limits])
 dnl Figure out other aspects of the implementation's arithmetic.
 AC_CACHE_CHECK([whether negative numbers use two's complement],
        [catacomb_cv_neg_twoc],
-[AC_TRY_COMPILE(
-[#include <limits.h>],
-[int check[2*!!(-INT_MAX == INT_MIN + 1) - 1];],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[@%:@include <limits.h>]],
+[[int check[2*!!(-INT_MAX == INT_MIN + 1) - 1];]])],
 [catacomb_cv_neg_twoc=yes],
 [catacomb_cv_neg_twoc=no])])
 case $catacomb_cv_neg_twoc in
@@ -390,18 +391,18 @@ AC_SEARCH_LIBS([clock_gettime], [rt])
 CATACOMB_LIBS=$LIBS LIBS=$mdw_ORIG_LIBS
 if test "$ac_cv_search_clock_gettime" != no; then
   AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
-           [Define if you have the \`clock_gettime' function.])
+           [Define if you have the `clock_gettime' function.])
 fi
 AC_CHECK_FUNCS([getentropy])
 AC_CACHE_CHECK([whether the freewheel noise generator will work],
        [catacomb_cv_freewheel],
-[AC_TRY_LINK(
-[#include <setjmp.h>
-#include <sys/time.h>],
-[struct itimerval itv = { { 0, 0 }, { 0, 5000 } };
+[AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[@%:@include <setjmp.h>
+@%:@include <sys/time.h>]],
+[[struct itimerval itv = { { 0, 0 }, { 0, 5000 } };
 jmp_buf j;
 setitimer(ITIMER_REAL, &itv, 0);
-sigsetjmp(j, 1);],
+sigsetjmp(j, 1);]])],
 [catacomb_cv_freewheel=yes],
 [catacomb_cv_freewheel=no])])
 case $catacomb_cv_freewheel in
@@ -458,7 +459,7 @@ AC_ARG_ENABLE([mpw],
 dnl--------------------------------------------------------------------------
 dnl Produce output.
 
-AC_CONFIG_HEADER([config/config.h])
+AC_CONFIG_HEADERS([config/config.h])
 
 AC_CONFIG_FILES(
   [Makefile]