From 77bac48b37643ebc475c75c6c016924b6144dc66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Wed, 17 Jul 2013 20:02:17 +0200 Subject: [PATCH] Check for link_addr more thoroughly Some versions of kFreeBSD (like 9.0) declare link_addr in a header but lack an implementation. This makes ./configure pass but breaks compilation later with a undefined reference to `link_addr' Althought that's a bug in the OS header we can detect it easily by also trying to link. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715320 --- configure.ac | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index b5af0d35c..5d5c8deb7 100644 --- a/configure.ac +++ b/configure.ac @@ -2391,13 +2391,19 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_newname, [#include #include ]) + # Check for BSD approach for setting MAC addr -AC_CHECK_DECLS([link_addr], - [], [], - [#include - #include - #include - ]) +AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ + #include + #include + #include + ]], + [[ + link_addr(NULL, NULL)]])], + [AC_DEFINE([HAVE_DECL_LINK_ADDR], + [1], + [whether link_addr is available])]) # Check for BSD approach for bridge management AC_CHECK_DECLS([BRDGSFD, BRDGADD, BRDGDEL], -- 2.39.5