https://lists.gnu.org/archive/html/bug-recutils/2024-10/msg00002.html From f2df87685e11e59429d5866f6cd21f357308abb2 Mon Sep 17 00:00:00 2001 Message-ID: In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org> References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org> From: Sam James Date: Sun, 6 Oct 2024 05:20:51 +0100 Subject: [PATCH 07/10] configure.ac: modernise Modernise configure.ac by using more careful [] quoting as well as AS_IF and AC_MSG_WARN. See beb6d826338fb854b5c73458a1d52662b04c171c in autoconf.git. 2024-10-06 Sam James * configure.ac: Quote. Use AS_IF and AC_MSG_WARN. Drop deprecated AC_PROG_CC_C99 and unnecessary AM_PROG_CC_C_O. --- configure.ac | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index d6ffb01..a190f5e 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AC_INIT([GNU recutils], [1.9], [bug-recutils@gnu.org]) dnl Must come before AM_INIT_AUTOMAKE AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([subdir-objects]) -AC_CONFIG_HEADERS(src/config.h) +AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_MACRO_DIR([m4]) dnl Autobuild @@ -33,8 +33,6 @@ AC_PROG_CC gl_EARLY LT_INIT -AC_PROG_CC_C99 -AM_PROG_CC_C_O dnl Both lex and yacc are required to generate the lexer/parser source dnl files. @@ -59,18 +57,18 @@ gl_INIT # However, this means invoking executables, which we generally cannot do # when cross-compiling, so we test to avoid that (the variable # "cross_compiling" is set by AC_PROG_CC). -if test $cross_compiling = no; then - AM_MISSING_PROG(HELP2MAN, help2man) -else +AS_IF([test "x$cross_compiling" = "xno"], [ + AM_MISSING_PROG([HELP2MAN], [help2man]) +], [ HELP2MAN=: -fi +]) dnl Seach for headers AC_CHECK_HEADERS([malloc.h string.h]) dnl Search for data types -AC_CHECK_TYPE(size_t, unsigned) -AC_CHECK_TYPE(off_t, long) +AC_CHECK_TYPE([size_t], [unsigned]) +AC_CHECK_TYPE([off_t], [long]) dnl Search for functions AC_FUNC_FSEEKO @@ -191,12 +189,12 @@ AC_ARG_WITH([bash-headers], [location of the bash header files (default is /usr/include/bash)]), [BASH_HEADERS=$withval],) -if test -f ${BASH_HEADERS}/config.h; then +AS_IF([test -f ${BASH_HEADERS}/config.h], [ AC_SUBST([BASH_HEADERS]) bash_headers_available=yes -else +], [ bash_headers_available=no -fi +]) AC_ARG_ENABLE([bash-builtins], AS_HELP_STRING([--enable-bash-builtins], @@ -245,8 +243,8 @@ AC_OUTPUT dnl Report warnings -if test "x$bash_headers_available" = "xno" || test "x$bash_builtins_enabled" = "xno"; then - echo "warning: not building the recutils bash builtins." -fi +AS_IF([test "x$bash_headers_available" = "xno" || test "x$bash_builtins_enabled" = "xno"], [ + AC_MSG_WARN([Not building the recutils bash builtins]) +], []) dnl End of configure.ac -- 2.46.2