From 4af5e6293c5e9b353266839f99dab450fa2a63c7 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 16 Nov 2022 19:24:42 -0700 Subject: [PATCH] Update macros from autoconf-archive. --- configure | 40 +++++++++++++++++----------------- m4/ax_append_flag.m4 | 33 ++++++---------------------- m4/ax_check_compile_flag.m4 | 43 +++++++++++-------------------------- m4/ax_func_snprintf.m4 | 5 +++-- m4/ax_prog_cc_for_build.m4 | 12 +++++------ 5 files changed, 47 insertions(+), 86 deletions(-) diff --git a/configure b/configure index 097a9fdf7..dffcdf8c4 100755 --- a/configure +++ b/configure @@ -7551,10 +7551,10 @@ ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_F ac_compiler_gnu=$ac_cv_build_c_compiler_gnu -was_set_ac_cv_c_compiler_gnu=${ac_cv_c_compiler_gnu+y} -if test ${was_set_ac_cv_c_compiler_gnu} +was_set_c_compiler_gnu=${ac_cv_c_compiler_gnu+y} +if test ${was_set_c_compiler_gnu} then : - saved_ac_cv_c_compiler_gnu=$ac_cv_c_compiler_gnu + saved_c_compiler_gnu=$ac_cv_c_compiler_gnu { ac_cv_c_compiler_gnu=; unset ac_cv_c_compiler_gnu;} fi @@ -8312,9 +8312,9 @@ ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_F ac_compiler_gnu=$ac_cv_build_c_compiler_gnu -if test ${was_set_ac_cv_c_compiler_gnu} +if test ${was_set_c_compiler_gnu} then : - ac_cv_c_compiler_gnu=saved_ac_cv_c_compiler_gnu + ac_cv_c_compiler_gnu=$saved_c_compiler_gnu fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31437,7 +31437,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___static_libgcc" >&5 printf "%s\n" "$ax_cv_check_cflags___static_libgcc" >&6; } -if test x"$ax_cv_check_cflags___static_libgcc" = xyes +if test "x$ax_cv_check_cflags___static_libgcc" = xyes then : if test ${LT_LDFLAGS+y} @@ -31672,7 +31672,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fvisibility_hidden" >&5 printf "%s\n" "$ax_cv_check_cflags___fvisibility_hidden" >&6; } -if test x"$ax_cv_check_cflags___fvisibility_hidden" = xyes +if test "x$ax_cv_check_cflags___fvisibility_hidden" = xyes then : printf "%s\n" "#define HAVE_DSO_VISIBILITY 1" >>confdefs.h @@ -31722,7 +31722,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Bhidden_def" >&5 printf "%s\n" "$ax_cv_check_cflags___Bhidden_def" >&6; } -if test x"$ax_cv_check_cflags___Bhidden_def" = xyes +if test "x$ax_cv_check_cflags___Bhidden_def" = xyes then : # HP-UX cc may not allow __declspec(dllexport) to be @@ -31809,7 +31809,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___xldscope_hidden" >&5 printf "%s\n" "$ax_cv_check_cflags___xldscope_hidden" >&6; } -if test x"$ax_cv_check_cflags___xldscope_hidden" = xyes +if test "x$ax_cv_check_cflags___xldscope_hidden" = xyes then : printf "%s\n" "#define HAVE_DSO_VISIBILITY 1" >>confdefs.h @@ -32011,7 +32011,7 @@ fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } -if test x"`eval 'as_val=${'$as_CACHEVAR'};printf "%s\n" "$as_val"'`" = xyes +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : @@ -32149,7 +32149,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_omit_frame_pointer" >&5 printf "%s\n" "$ax_cv_check_cflags___fno_omit_frame_pointer" >&6; } -if test x"$ax_cv_check_cflags___fno_omit_frame_pointer" = xyes +if test "x$ax_cv_check_cflags___fno_omit_frame_pointer" = xyes then : @@ -32250,7 +32250,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fsanitize_fuzzer_no_link" >&5 printf "%s\n" "$ax_cv_check_cflags___fsanitize_fuzzer_no_link" >&6; } -if test x"$ax_cv_check_cflags___fsanitize_fuzzer_no_link" = xyes +if test "x$ax_cv_check_cflags___fsanitize_fuzzer_no_link" = xyes then : @@ -32391,7 +32391,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_omit_frame_pointer" >&5 printf "%s\n" "$ax_cv_check_cflags___fno_omit_frame_pointer" >&6; } -if test x"$ax_cv_check_cflags___fno_omit_frame_pointer" = xyes +if test "x$ax_cv_check_cflags___fno_omit_frame_pointer" = xyes then : @@ -32528,7 +32528,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_pie" >&5 printf "%s\n" "$ax_cv_check_cflags___fno_pie" >&6; } -if test x"$ax_cv_check_cflags___fno_pie" = xyes +if test "x$ax_cv_check_cflags___fno_pie" = xyes then : _CFLAGS="$CFLAGS" @@ -32619,7 +32619,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fPIE" >&5 printf "%s\n" "$ax_cv_check_cflags___fPIE" >&6; } -if test x"$ax_cv_check_cflags___fPIE" = xyes +if test "x$ax_cv_check_cflags___fPIE" = xyes then : _CFLAGS="$CFLAGS" @@ -33056,7 +33056,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fcf_protection" >&5 printf "%s\n" "$ax_cv_check_cflags___fcf_protection" >&6; } -if test x"$ax_cv_check_cflags___fcf_protection" = xyes +if test "x$ax_cv_check_cflags___fcf_protection" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -fcf-protection" >&5 @@ -33473,7 +33473,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wshadow" >&5 printf "%s\n" "$ax_cv_check_cflags___Wshadow" >&6; } -if test x"$ax_cv_check_cflags___Wshadow" = xyes +if test "x$ax_cv_check_cflags___Wshadow" = xyes then : CFLAGS="$CFLAGS -Wshadow" else case e in #( @@ -33514,7 +33514,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wvla" >&5 printf "%s\n" "$ax_cv_check_cflags___Wvla" >&6; } -if test x"$ax_cv_check_cflags___Wvla" = xyes +if test "x$ax_cv_check_cflags___Wvla" = xyes then : CFLAGS="$CFLAGS -Wvla" else case e in #( @@ -33555,7 +33555,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Walloca" >&5 printf "%s\n" "$ax_cv_check_cflags___Walloca" >&6; } -if test x"$ax_cv_check_cflags___Walloca" = xyes +if test "x$ax_cv_check_cflags___Walloca" = xyes then : CFLAGS="$CFLAGS -Walloca" else case e in #( @@ -33596,7 +33596,7 @@ esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wtrampolines" >&5 printf "%s\n" "$ax_cv_check_cflags___Wtrampolines" >&6; } -if test x"$ax_cv_check_cflags___Wtrampolines" = xyes +if test "x$ax_cv_check_cflags___Wtrampolines" = xyes then : CFLAGS="$CFLAGS -Wtrampolines" else case e in #( diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4 index 08f2e07ec..dd6d8b614 100644 --- a/m4/ax_append_flag.m4 +++ b/m4/ax_append_flag.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html +# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS @@ -23,33 +23,12 @@ # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 6 +#serial 8 AC_DEFUN([AX_APPEND_FLAG], [dnl diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 index c3a8d695a..bd753b34d 100644 --- a/m4/ax_check_compile_flag.m4 +++ b/m4/ax_check_compile_flag.m4 @@ -1,10 +1,10 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # @@ -19,6 +19,8 @@ # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # @@ -27,45 +29,24 @@ # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 2 +#serial 6 AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], +AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl diff --git a/m4/ax_func_snprintf.m4 b/m4/ax_func_snprintf.m4 index c060d6e9f..dfaa03dd3 100644 --- a/m4/ax_func_snprintf.m4 +++ b/m4/ax_func_snprintf.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_func_snprintf.html +# https://www.gnu.org/software/autoconf-archive/ax_func_snprintf.html # =========================================================================== # # SYNOPSIS @@ -24,8 +24,9 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 5 +#serial 7 +AU_ALIAS([AC_FUNC_SNPRINTF], [AX_FUNC_SNPRINTF]) AC_DEFUN([AX_FUNC_SNPRINTF], [AC_CHECK_FUNCS(snprintf vsnprintf) AC_MSG_CHECKING(for working snprintf) diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4 index 28fb18b90..33eaa389f 100644 --- a/m4/ax_prog_cc_for_build.m4 +++ b/m4/ax_prog_cc_for_build.m4 @@ -32,7 +32,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 20 +#serial 21 AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl @@ -89,16 +89,16 @@ AC_LANG_PUSH([C]) dnl The pushdef([ac_cv_c_compiler_gnu], ...) currently does not cover dnl the use of this variable in _AC_LANG_COMPILER_GNU called by dnl AC_PROG_CC. Unset this cache variable temporarily as a workaround. -was_set_ac_cv_c_compiler_gnu=${[ac_cv_c_compiler_gnu]+y} -AS_IF([test ${was_set_ac_cv_c_compiler_gnu}], - [saved_ac_cv_c_compiler_gnu=$[ac_cv_c_compiler_gnu] +was_set_c_compiler_gnu=${[ac_cv_c_compiler_gnu]+y} +AS_IF([test ${was_set_c_compiler_gnu}], + [saved_c_compiler_gnu=$[ac_cv_c_compiler_gnu] AS_UNSET([[ac_cv_c_compiler_gnu]])]) AC_PROG_CC dnl Restore ac_cv_c_compiler_gnu -AS_IF([test ${was_set_ac_cv_c_compiler_gnu}], - [[ac_cv_c_compiler_gnu]=saved_ac_cv_c_compiler_gnu]) +AS_IF([test ${was_set_c_compiler_gnu}], + [[ac_cv_c_compiler_gnu]=$[saved_c_compiler_gnu]]) _AC_COMPILER_EXEEXT _AC_COMPILER_OBJEXT