]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add members check
authorPavel Hrdina <phrdina@redhat.com>
Tue, 30 Jun 2020 12:17:11 +0000 (14:17 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:26:59 +0000 (09:26 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
meson.build

index 598e44a36751a8886a240e01a958f0779d8bedac..020d78442c97f3943c8309c0f3dc07d13cd364f1 100644 (file)
@@ -427,15 +427,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
index 18f85ab514d94e1d0306bcb2a94376dbc25d89f2..990faa5d4631cd0c2daa6a1284376e50890e16c9 100644 (file)
@@ -848,6 +848,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('.')