]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: test if libbsd is really usable
authorVincent Bernat <vincent@bernat.im>
Sat, 13 Aug 2016 22:21:00 +0000 (00:21 +0200)
committerVincent Bernat <vincent@bernat.im>
Sat, 13 Aug 2016 22:21:00 +0000 (00:21 +0200)
It is possible for libbsd to not be usable due to the use of
"-isystem". See for example:
 http://autobuild.buildroot.net/results/c8a/c8a6001f437701ecc75f6c9252935645bda8a8c8/lldpd-0.9.4/config.log

In this case, just don't use it.

configure.ac

index 47b1ea2193f769e1836cd28087983666ea1cbcb7..c7eef8db07296987d6000524fb87fb69a5f4aca1 100644 (file)
@@ -174,7 +174,10 @@ PKG_CHECK_MODULES([libbsd], [libbsd-overlay], [
   CFLAGS="$CFLAGS $libbsd_CFLAGS"
   LIBS="$LIBS $libbsd_LIBS"
   AC_MSG_CHECKING([if libbsd can be linked correctly])
-  AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
+  AC_TRY_LINK([
+@%:@include <sys/time.h>
+@%:@include <sys/types.h>
+],[],
     [
       AC_MSG_RESULT(yes)
       LLDP_CFLAGS="$LLDP_CFLAGS $libbsd_CFLAGS"