build: run autoupdate

AC_TRY_COMPILE is deprecated too.  Also configure.ac isn't executable.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2021-04-21 12:33:47 +02:00
parent 19083e4f75
commit 1b636c0ad4
2 changed files with 76 additions and 43 deletions

109
configure.ac Executable file → Normal file
View File

@ -5,7 +5,7 @@
## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
##
AC_PREREQ([2.60])
AC_PREREQ([2.69])
AC_INIT([frr], [7.7-dev], [https://github.com/frrouting/frr/issues])
PACKAGE_URL="https://frrouting.org/"
@ -1520,24 +1520,22 @@ FRR_INCLUDES
#endif
])dnl
AC_MSG_CHECKING([for BSD struct ip_mreq hack])
AC_TRY_COMPILE([#include <sys/param.h>],
[#if (defined(__FreeBSD__) && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__DragonFly__) || defined(__sun)
return (0);
#else
#error No support for BSD struct ip_mreq hack detected
#endif],[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_BSD_STRUCT_IP_MREQ_HACK], [1], [Can pass ifindex in struct ip_mreq])],
AC_MSG_RESULT([no]))
AC_MSG_CHECKING([for RFC3678 protocol-independed API])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <netinet/in.h>
], [struct group_req gr; int sock; setsockopt(sock, IPPROTO_IP, MCAST_JOIN_GROUP, (void*)&gr, sizeof(gr));
], [AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_RFC3678], [1], [Have RFC3678 protocol-independed API])],
AC_MSG_RESULT([no]))
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <netinet/in.h>
]], [[
struct group_req gr;
int sock;
setsockopt(sock, IPPROTO_IP, MCAST_JOIN_GROUP, (void*)&gr, sizeof(gr));
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_RFC3678], [1], [Have RFC3678 protocol-independed API])
],[
AC_MSG_RESULT(no)
])
dnl ---------------------------------------------------------------
dnl figure out how to check link-state
@ -2134,12 +2132,16 @@ dnl -----------------------
dnl checking for IP_PKTINFO
dnl -----------------------
AC_MSG_CHECKING([for IP_PKTINFO])
AC_TRY_COMPILE([#include <netdb.h>], [
int opt = IP_PKTINFO;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netdb.h>
]], [[
int opt = IP_PKTINFO;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_PKTINFO], [1], [Have IP_PKTINFO])
], [
],[
AC_MSG_RESULT([no])
])
@ -2147,12 +2149,16 @@ dnl ---------------------------
dnl checking for IP_RECVDSTADDR
dnl ---------------------------
AC_MSG_CHECKING([for IP_RECVDSTADDR])
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_RECVDSTADDR;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_RECVDSTADDR;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_RECVDSTADDR], [1], [Have IP_RECVDSTADDR])
], [
],[
AC_MSG_RESULT([no])
])
@ -2160,12 +2166,16 @@ dnl ----------------------
dnl checking for IP_RECVIF
dnl ----------------------
AC_MSG_CHECKING([for IP_RECVIF])
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_RECVIF;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_RECVIF;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_RECVIF], [1], [Have IP_RECVIF])
], [
],[
AC_MSG_RESULT([no])
])
@ -2173,12 +2183,16 @@ dnl ----------------------
dnl checking for SO_BINDANY
dnl ----------------------
AC_MSG_CHECKING([for SO_BINDANY])
AC_TRY_COMPILE([#include <sys/socket.h>], [
int opt = SO_BINDANY;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <sys/socket.h>
]], [[
int opt = SO_BINDANY;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_SO_BINDANY], [1], [Have SO_BINDANY])
], [
],[
AC_MSG_RESULT([no])
])
@ -2186,12 +2200,16 @@ dnl ----------------------
dnl checking for IP_FREEBIND
dnl ----------------------
AC_MSG_CHECKING([for IP_FREEBIND])
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_FREEBIND;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_FREEBIND;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_FREEBIND], [1], [Have IP_FREEBIND])
], [
],[
AC_MSG_RESULT([no])
])
@ -2293,12 +2311,17 @@ dnl capabilities checks
dnl -------------------
if test "$enable_capabilities" != "no"; then
AC_MSG_CHECKING([whether prctl PR_SET_KEEPCAPS is available])
AC_TRY_COMPILE([#include <sys/prctl.h>], [prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
[AC_MSG_RESULT([yes])
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <sys/prctl.h>
]], [[
prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
]])
],[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PR_SET_KEEPCAPS], [1], [prctl])
frr_ac_keepcaps="yes"],
AC_MSG_RESULT([no])
)
frr_ac_keepcaps="yes"
],[AC_MSG_RESULT(no)
])
if test "$frr_ac_keepcaps" = "yes"; then
AC_CHECK_HEADERS([sys/capability.h])
fi

View File

@ -25,6 +25,16 @@
#include "sockunion.h"
#include "lib_errors.h"
#if (defined(__FreeBSD__) \
&& ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) \
|| (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) \
|| (defined(__NetBSD__) && defined(__NetBSD_Version__) \
&& __NetBSD_Version__ >= 106010000) \
|| defined(__OpenBSD__) || defined(__APPLE__) \
|| defined(__DragonFly__) || defined(__sun)
#define HAVE_BSD_STRUCT_IP_MREQ_HACK
#endif
void setsockopt_so_recvbuf(int sock, int size)
{
int orig_req = size;