From 29e31f622fd8880ad372994effdcf39ea1c606c9 Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Tue, 20 Feb 2024 15:10:12 +0200 Subject: [PATCH] build: Add an explicit declaration of the AWK variable to configure.ac Declare AWK explicitly via the AC_ARG_VAR directive, in order to make it "precious", and to include it in the list of influential variables at the end of the configure help text. Rephrase a few comments and config traces. Finally, regenerate the configure script. --- configure | 22 +++++++++++++--------- configure.ac | 17 ++++++++++------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 7f3a0f8bc3..c2e08e7da1 100755 --- a/configure +++ b/configure @@ -867,6 +867,7 @@ CCAS CCASFLAGS CPP LT_SYS_LIBRARY_PATH +AWK PNG_COPTS' @@ -1613,7 +1614,8 @@ Some influential environment variables: CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. - PNG_COPTS additional flags for the C compiler, use this for options that + AWK AWK language processor + PNG_COPTS additional flags for the C compiler, to be used for options that would cause configure itself to fail Use these variables to override the choices made by 'configure' or to help @@ -3389,7 +3391,7 @@ PNGLIB_RELEASE=43 ac_config_headers="$ac_config_headers config.h" -# Checks for programs. +# Check for basic programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -13659,20 +13661,22 @@ CC=$lt_save_CC -# Some awks crash when confronted with pnglibconf.dfa, do a test run now -# to make sure this doesn't happen -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that AWK works" >&5 -printf %s "checking that AWK works... " >&6; } + + +# Some awk implementations crash when confronted with pnglibconf.dfa. +# Run a test now, to make sure this doesn't happen. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if awk ($AWK) works" >&5 +printf %s "checking if awk ($AWK) works... " >&6; } if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\ ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ ${srcdir}/pngusr.dfa 1>&2 then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -printf "%s\n" "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error 1 "failed +as_fn_error 1 "no See 'config.log' for more details" "$LINENO" 5; } fi diff --git a/configure.ac b/configure.ac index b9162e8d2b..137339ebd1 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,7 @@ dnl End of version number stuff AC_CONFIG_SRCDIR([pngget.c]) AC_CONFIG_HEADERS([config.h]) -# Checks for programs. +# Check for basic programs. AC_LANG([C]) AC_PROG_CC AM_PROG_AS @@ -72,16 +72,19 @@ dnl compatible later version may be used LT_INIT([win32-dll]) LT_PREREQ([2.4.2]) -# Some awks crash when confronted with pnglibconf.dfa, do a test run now -# to make sure this doesn't happen -AC_MSG_CHECKING([that AWK works]) +dnl Declare the AWK variable. +AC_ARG_VAR(AWK, [AWK language processor]) + +# Some awk implementations crash when confronted with pnglibconf.dfa. +# Run a test now, to make sure this doesn't happen. +AC_MSG_CHECKING([if awk ($AWK) works]) if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\ ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ ${srcdir}/pngusr.dfa 1>&2 then - AC_MSG_RESULT([ok]) + AC_MSG_RESULT([yes]) else - AC_MSG_FAILURE([failed], 1) + AC_MSG_FAILURE([no], 1) fi # This is a remnant of the old cc -E validation, where it may have been @@ -111,7 +114,7 @@ AM_CONDITIONAL([ENABLE_TOOLS], # (it checks the compiler with a program that generates a warning). # Add the following option to deal with this: AC_ARG_VAR(PNG_COPTS, - [additional flags for the C compiler, use this for options that would] + [additional flags for the C compiler, to be used for options that would] [cause configure itself to fail]) AC_ARG_ENABLE(werror, AS_HELP_STRING([[[--enable-werror[=OPT]]]],