From: Guido Günther Date: Wed, 17 Jul 2013 18:02:17 +0000 (+0200) Subject: Check for link_addr more thoroughly X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=77bac48b37643ebc475c75c6c016924b6144dc66;p=libvirt.git 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 --- diff --git a/configure.ac b/configure.ac index b5af0d35c2..5d5c8deb7b 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],