[gupnp] build: Simplify header checks



commit 11d71fe6e6775c55e30bf4336136a8e0aeb172f3
Author: Jens Georg <mail jensge org>
Date:   Thu Nov 29 12:38:23 2018 +0100

    build: Simplify header checks

 meson.build | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/meson.build b/meson.build
index 66774c2..fccf8a8 100644
--- a/meson.build
+++ b/meson.build
@@ -4,24 +4,14 @@ pkg = import('pkgconfig')
 
 cc = meson.get_compiler('c')
 
+netlink_available = cc.has_header('linux/rtnetlink.h')
+ifaddrs_available = cc.has_header('ifaddrs.h')
+
 conf = configuration_data()
 conf.set_quoted('VERSION', meson.project_version())
-
-netlink_test = '''#include <sys/socket.h>
-#include <linux/rtnetlink.h>
-'''
-netlink_available = cc.compiles(netlink_test, name : 'linux/rtnetlink.h availability')
 conf.set('HAVE_NETLINK', netlink_available)
-
-ifaddrs_test = '#include <ifaddrs.h>'
-ifaddrs_available = cc.compiles(ifaddrs_test, name : 'ifaddrs.h availability')
 conf.set('HAVE_IFADDRS_H', ifaddrs_available)
-
-wireless_test ='''#include <sys/socket.h>
-#include <linux/wireless.h>
-'''
-conf.set('HAVE_LINUX_WIRELESS_H',
-         cc.compiles(wireless_test, name : 'linux/wireless.h availability'))
+conf.set('HAVE_LINUX_WIRELESS_H', cc.has_header('linux/wireless.h'))
 
 config_h = configure_file(output : 'config.h', configuration : conf)
 add_global_arguments('-DHAVE_CONFIG_H=1', language : 'c')


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