aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-09-05 16:27:42 -0600
committerEric Blake <eblake@redhat.com>2012-09-06 10:08:47 -0600
commitccaf0beec84b3f55f5206a71e2f1b768cc58cdda (patch)
tree6d0ab687855e0560f5c83c10ee36aa51d3f20ab3 /configure.ac
parentbuild: avoid tabs that failed syntax-check (diff)
downloadlibvirt-ccaf0beec84b3f55f5206a71e2f1b768cc58cdda.tar.gz
libvirt-ccaf0beec84b3f55f5206a71e2f1b768cc58cdda.tar.bz2
libvirt-ccaf0beec84b3f55f5206a71e2f1b768cc58cdda.zip
build: improved handling of <execinfo.h>, BSD <net/if.h>
FreeBSD and OpenBSD have a <net/if.h> that is not self-contained; and mingw lacks the header altogether. But gnulib has just taken care of that for us, so we might as well simplify our code. In the process, I got a syntax-check failure if we don't also take the gnulib execinfo module. * .gnulib: Update to latest, for execinfo and net_if. * bootstrap.conf (gnulib_modules): Add execinfo and net_if modules. * configure.ac: Let gnulib check for headers. Simplify check for 'struct ifreq', while also including enough prereq headers. * src/internal.h (IF_NAMESIZE): Drop, now that gnulib guarantees it. * src/nwfilter/nwfilter_learnipaddr.h: Use correct header for IF_NAMESIZE. * src/util/virnetdev.c (includes): Assume <net/if.h> exists. * src/util/virnetdevbridge.c (includes): Likewise. * src/util/virnetdevtap.c (includes): Likewise. * src/util/logging.c (includes): Assume <execinfo.h> exists. (virLogStackTraceToFd): Handle gnulib's fallback implementation.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 7 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index cb91e7d72..47a72b9b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,8 +186,7 @@ LIBS=$old_libs
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/un.h \
sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
- sys/un.h sys/syscall.h netinet/tcp.h ifaddrs.h libtasn1.h \
- net/if.h execinfo.h])
+ sys/un.h sys/syscall.h netinet/tcp.h ifaddrs.h libtasn1.h])
dnl We need to decide at configure time if libvirt will use real atomic
dnl operations ("lock free") or emulated ones with a mutex.
@@ -245,20 +244,12 @@ AM_CONDITIONAL([WITH_ATOMIC_OPS_PTHREAD],[test "$atomic_ops" = "pthread"])
AC_MSG_RESULT([$atomic_ops])
-
-AC_MSG_CHECKING([for struct ifreq in net/if.h])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[
- #include <net/if.h>
- ]],
- [[
- struct ifreq ifr;
- ]])],[
- AC_DEFINE([HAVE_STRUCT_IFREQ],[],[Defined if struct ifreq existsin net/if.h])
- AC_MSG_RESULT([yes])
- ],[
- AC_MSG_RESULT([yes])
- ])
+AC_CHECK_TYPE([struct ifreq],
+ [AC_DEFINE([HAVE_STRUCT_IFREQ],[1],
+ [Defined if struct ifreq exists in net/if.h])],
+ [], [[#include <sys/socket.h>
+ #include <net/if.h>
+ ]])
dnl Our only use of libtasn1.h is in the testsuite, and can be skipped
dnl if the header is not present. Assume -ltasn1 is present if the