From: Vincent Bernat Date: Tue, 21 Sep 2021 06:48:53 +0000 (+0200) Subject: build: update to autoconf 2.71 X-Git-Tag: 1.0.13~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc6cf97858eaf0b1492d5c224cefd6c60540cfaf;p=thirdparty%2Flldpd.git build: update to autoconf 2.71 This removes warning about deprecated stuff. Notably AC_PROG_CC now does what AC_PROG_CC_C99 did. --- diff --git a/configure.ac b/configure.ac index d101deef..c855234c 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ ### Base configuration # Configure autoconf -AC_PREREQ([2.69]) +AC_PREREQ([2.71]) AC_INIT([lldpd], [m4_esyscmd_s([./get-version])], @@ -14,7 +14,7 @@ AC_INIT([lldpd], [https://lldpd.github.io/]) AC_CONFIG_SRCDIR([src/log.c]) -AC_CONFIG_HEADER([config.h]) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile src/Makefile src/compat/Makefile @@ -44,7 +44,6 @@ gl_LD_VERSION_SCRIPT # Checks for programs. AC_PROG_CC -AC_PROG_CC_C99 if test x"$ac_cv_prog_cc_c99" = x"no"; then AC_MSG_FAILURE([*** C99 support is mandatory]) fi diff --git a/m4/alignof.m4 b/m4/alignof.m4 index f45caae7..a90475dd 100644 --- a/m4/alignof.m4 +++ b/m4/alignof.m4 @@ -3,10 +3,9 @@ # AC_DEFUN([lldp_CHECK_ALIGNOF],[ AC_CACHE_CHECK([whether compiler understands __alignof__], lldp_cv_check_alignof, [ - AC_TRY_COMPILE([], - [ return __alignof__(long); ], - [ lldp_cv_check_alignof="yes" ], - [ lldp_cv_check_alignof="no" ]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return __alignof__(long); ]])], + [ lldp_cv_check_alignof="yes" ], + [ lldp_cv_check_alignof="no" ]) ]) if test x"$lldp_cv_check_alignof" = x"yes"; then AC_DEFINE([HAVE_ALIGNOF], [1], [Define if __alignof__ operator is available]) diff --git a/m4/ax_cflags_gcc_option.m4 b/m4/ax_cflags_gcc_option.m4 index 54c9f6e3..ae0d6da7 100644 --- a/m4/ax_cflags_gcc_option.m4 +++ b/m4/ax_cflags_gcc_option.m4 @@ -81,15 +81,16 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl AC_CACHE_CHECK([FLAGS for gcc m4_ifval($1,$1,-option)], VAR,[AS_VAR_SET([VAR],["no, unknown"]) AC_LANG_SAVE - AC_LANG_C + AC_LANG([C]) ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS $[]m4_ifval($2,$2,) "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_TRY_COMPILE([],[return 0;], - [AS_VAR_SET([VAR],[`echo $ac_arg | sed -e 's,.*% *,,'`]) ; break]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])], + [AS_VAR_SET([VAR],[`echo $ac_arg | sed -e 's,.*% *,,'`]) ; break], + []) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE diff --git a/m4/ax_ld_check_flag.m4 b/m4/ax_ld_check_flag.m4 index 2da32410..6a7d503b 100644 --- a/m4/ax_ld_check_flag.m4 +++ b/m4/ax_ld_check_flag.m4 @@ -50,7 +50,7 @@ #serial 6 AC_DEFUN([AX_LDFLAGS_OPTION],[ - AC_PREREQ([2.61]) + AC_PREREQ([2.71]) AC_REQUIRE([AC_PROG_SED]) flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'` @@ -59,7 +59,7 @@ AC_DEFUN([AX_LDFLAGS_OPTION],[ [ax_cv_ld_check_flag_$flag],[ AC_LANG_SAVE - AC_LANG_C + AC_LANG([C]) save_LDFLAGS="$LDFLAGS" LDFLAGS="-Werror $LDFLAGS $[]m4_ifval($2,$2,) $1"