summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2017-03-23 19:15:44 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2017-05-03 15:10:55 +0100
commit4e9403df7f503f62ee51135e33ade9c12c78a286 (patch)
tree5bafee4502f1d0f06b7430bdad85e2fbb979130f /meson.build
parentf12c011e43154063888da68cac3755a46245e965 (diff)
downloadgtk+-4e9403df7f503f62ee51135e33ade9c12c78a286.tar.gz
meson: simplify header checks
Remove workaround for gcc bug (Meson does that now), and construct the right config.h defines for the headers on the fly instead of listing them in the build file, which is more error prone.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build50
1 files changed, 22 insertions, 28 deletions
diff --git a/meson.build b/meson.build
index db4950a20e..6e221df865 100644
--- a/meson.build
+++ b/meson.build
@@ -90,41 +90,35 @@ cdata.set('GTK_MINOR_VERSION', gtk_minor_version)
cdata.set('GTK_MICRO_VERSION', gtk_micro_version)
cdata.set('GTK_BINARY_AGE', gtk_binary_age)
cdata.set('GTK_INTERFACE_AGE', gtk_interface_age)
+
check_headers = [
- ['HAVE_CRT_EXTERNS_H', 'crt/externs.h'],
- ['HAVE_DLFCN_H', 'dlfcn.h'],
- ['HAVE_FTW_H', 'ftw.h'],
- ['HAVE_INTTYPES_H', 'inttypes.h'],
- ['HAVE_LOCALE_H', 'locale.h'],
- ['HAVE_MEMORY_H', 'memory.h'],
- ['HAVE_STDINT_H', 'stdint.h'],
- ['HAVE_STDLIB_H', 'stdlib.h'],
- ['HAVE_STRINGS_H', 'strings.h'],
- ['HAVE_STRING_H', 'string.h'],
- ['HAVE_SYS_MMAN_H', 'sys/mman.h'],
- ['HAVE_SYS_PARAM_H', 'sys/param.h'],
- ['HAVE_SYS_STAT_H', 'sys/stat.h'],
- ['HAVE_SYS_SYSINFO_H', 'sys/sysinfo.h'],
- ['HAVE_SYS_SYSTEMINFO_H', 'sys/systeminfo.h'],
- ['HAVE_SYS_TIME_H', 'sys/time.h'],
- ['HAVE_SYS_TYPES_H', 'sys/types.h'],
- ['HAVE_UNISTD_H', 'unistd.h'],
- #['HAVE_LINUX_MEMFD_H', 'linux/memfd.h'], # FIXME: doesn't work, see below
+ 'crt/externs.h',
+ 'dlfcn.h',
+ 'ftw.h',
+ 'inttypes.h',
+ 'linux/memfd.h',
+ 'locale.h',
+ 'memory.h',
+ 'stdint.h',
+ 'stdlib.h',
+ 'strings.h',
+ 'string.h',
+ 'sys/mman.h',
+ 'sys/param.h',
+ 'sys/stat.h',
+ 'sys/sysinfo.h',
+ 'sys/systeminfo.h',
+ 'sys/time.h',
+ 'sys/types.h',
+ 'unistd.h',
]
foreach h : check_headers
- if cc.has_header(h.get(1))
- cdata.set(h.get(0), 1)
+ if cc.has_header(h)
+ cdata.set('HAVE_' + h.underscorify().to_upper(), 1)
endif
endforeach
-# FIXME: cc.has_header('linux/memfd.h') doesn't work with meson 0.39 and gcc
-# https://github.com/mesonbuild/meson/issues/1458
-# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005
-if cc.has_header_symbol('linux/memfd.h', 'MFD_CLOEXEC')
- cdata.set('HAVE_LINUX_MEMFD_H', 1)
-endif
-
# Maths functions might be implemented in libm
libm = cc.find_library('m', required : false)