From 10ce92221163378124e7814e477e8d04100dcc4b Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 1 Jan 2025 16:26:10 -0800 Subject: [PATCH] build: update configure.ac using autoupdate-2.69 from ubuntu20.04 This should solve the build failures seen in CodeQL CI testing about outdated autoconf issues. Signed-off-by: Robin H. Johnson --- configure.ac | 64 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 8117513..ebee8f5 100644 --- a/configure.ac +++ b/configure.ac @@ -13,9 +13,9 @@ dnl dnl dnl If adding rcX to version, be sure to separate with a '-' -AC_INIT(radvd, [2.20]) +AC_INIT([radvd],[2.20]) AC_CONFIG_SRCDIR(radvd.c) -AC_CANONICAL_SYSTEM +AC_CANONICAL_TARGET AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) @@ -64,12 +64,12 @@ AM_CONDITIONAL(HAVE_CHECK, test x"$with_check" = xyes) dnl Determine of netlink is available AC_MSG_CHECKING(netlink) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include -],[ +]], [[ int main(int argc, char * argv[]) { @@ -83,7 +83,7 @@ main(int argc, char * argv[]) return 0; } -],[ +]])],[ AC_DEFINE(HAVE_NETLINK, 1, [Linux netlink]) CONDITIONAL_SOURCES=netlink.${OBJEXT} AC_MSG_RESULT(yes) @@ -178,21 +178,43 @@ AC_HEADER_TIME dnl Checks for typedefs, structures, and compiler characteristics. AC_MSG_CHECKING(whether struct sockaddr_in6 has sin6_scope_id) -AC_TRY_COMPILE([#include -#include -#include ], [ -static struct sockaddr_in6 ac_sin6; -uint32_t ac_size = sizeof (ac_sin6.sin6_scope_id); -], [AC_MSG_RESULT(yes); AC_DEFINE([HAVE_SIN6_SCOPE_ID], -1, [whether struct sockaddr_in6 has sin6_scope_id])], -AC_MSG_RESULT(no)) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include + #include + #include + ]], [[ + static struct sockaddr_in6 ac_sin6; + uint32_t ac_size = sizeof (ac_sin6.sin6_scope_id); + ]])], + [ + AC_MSG_RESULT(yes); + AC_DEFINE( + [HAVE_SIN6_SCOPE_ID], + 1, + [whether struct sockaddr_in6 has sin6_scope_id] + ) + ], + [AC_MSG_RESULT(no)] +) AC_MSG_CHECKING(whether struct in6_addr has u6_addrXX and defines s6_addrXX) -AC_TRY_COMPILE([#include -#include ], [static struct in6_addr in6_u; -uint16_t u = in6_u.s6_addr16[0];], [AC_MSG_RESULT(yes); AC_DEFINE([HAVE_IN6_ADDR_S6_ADDR], -1, [whether struct in6_addr has u6_addrXX and defines s6_addrXX])], -AC_MSG_RESULT(no)) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + ]], [[ + static struct in6_addr in6_u; + uint16_t u = in6_u.s6_addr16[0]; + ]] + )], + [ + AC_MSG_RESULT(yes); + AC_DEFINE([HAVE_IN6_ADDR_S6_ADDR], 1, [whether struct in6_addr has u6_addrXX and defines s6_addrXX]) + ], + [AC_MSG_RESULT(no)] +) dnl Checks for library functions. AC_CHECK_FUNCS(getopt_long) @@ -247,12 +269,12 @@ AS_IF([test "x$with_systemdsystemunitdir" != "xno"], AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) AM_CONFIG_HEADER(config.h) -AC_OUTPUT( - Makefile \ +AC_CONFIG_FILES([Makefile \ radvd.service \ redhat/systemd/radvd.spec \ redhat/SysV/radvd.spec \ -) +]) +AC_OUTPUT cat << EOF