meson: add members check

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-06-30 14:17:11 +02:00
parent f46965b5f5
commit ce9b4462f7
2 changed files with 19 additions and 9 deletions

View 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

View 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('.')