Skip to content

Commit

Permalink
build: Add an explicit declaration of the AWK variable to configure.ac
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ctruta committed Feb 20, 2024
1 parent d165a20 commit 29e31f6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
22 changes: 13 additions & 9 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ CCAS
CCASFLAGS
CPP
LT_SYS_LIBRARY_PATH
AWK
PNG_COPTS'


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down
17 changes: 10 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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]]]],
Expand Down

0 comments on commit 29e31f6

Please sign in to comment.