[libvirt PATCH 029/351] meson: add members check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 configure.ac |  9 ---------
 meson.build  | 19 +++++++++++++++++++
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 69067091f09..a426ba2a355 100644
--- a/configure.ac
+++ b/configure.ac
@@ -429,15 +429,6 @@ then
 fi
 AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])
 
-# Check for Linux vs. BSD ifreq members
-AC_CHECK_MEMBERS([struct ifreq.ifr_newname,
-                  struct ifreq.ifr_ifindex,
-                  struct ifreq.ifr_index,
-                  struct ifreq.ifr_hwaddr],
-                 [], [],
-                 [#include <sys/socket.h>
-                  #include <net/if.h>
-                 ])
 
 # Check for BSD kvm (kernel memory interface)
 if test $with_freebsd = yes; then
diff --git a/meson.build b/meson.build
index aa492c9549a..d474745f31e 100644
--- a/meson.build
+++ b/meson.build
@@ -835,6 +835,25 @@ if host_machine.system() == 'windows'
 endif
 
 
+# check various members
+
+members = [
+  # Check for Linux vs. BSD ifreq members
+  [ 'struct ifreq', 'ifr_newname', '#include <sys/socket.h>\n#include <net/if.h>' ],
+  [ 'struct ifreq', 'ifr_ifindex', '#include <sys/socket.h>\n#include <net/if.h>' ],
+  [ 'struct ifreq', 'ifr_index', '#include <sys/socket.h>\n#include <net/if.h>' ],
+  [ 'struct ifreq', 'ifr_hwaddr', '#include <sys/socket.h>\n#include <net/if.h>' ],
+]
+
+foreach member : members
+  if cc.has_member(member[0], member[1], prefix: member[2])
+    type = member[0].underscorify().to_upper()
+    member = member[1].underscorify().to_upper()
+    conf.set('HAVE_@0@_@1@'.format(type, member), 1)
+  endif
+endforeach
+
+
 # define top include directory
 
 top_inc_dir = include_directories('.')
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux