summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2017-03-23 19:36:59 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2017-05-03 15:10:55 +0100
commit361e5d0b7473ad08de901b6b62f3b1cfbd9e98be (patch)
tree68b42423e468a845f712c2e9ac300fc121a04856 /meson.build
parent4e9403df7f503f62ee51135e33ade9c12c78a286 (diff)
downloadgtk+-361e5d0b7473ad08de901b6b62f3b1cfbd9e98be.tar.gz
meson: simplify function checks
Because we can. We don't need to specify the right header anymore to check for functions.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build46
1 files changed, 24 insertions, 22 deletions
diff --git a/meson.build b/meson.build
index 6e221df865..9afb89bef0 100644
--- a/meson.build
+++ b/meson.build
@@ -122,14 +122,8 @@ endforeach
# Maths functions might be implemented in libm
libm = cc.find_library('m', required : false)
-check_functions = [
# check token HAVE_BIND_TEXTDOMAIN_CODESET
# check token HAVE_CUPS_API_1_6
- ['HAVE_DCGETTEXT', 'dcgettext', '#include<libintl.h>'],
- ['HAVE_DECL_ISINF', 'isinf', '#include<math.h>', libm],
- ['HAVE_DECL_ISNAN', 'isnan', '#include<math.h>', libm],
- ['HAVE_GETPAGESIZE', 'getpagesize', '#include<unistd.h>'],
- ['HAVE_GETRESUID', 'getresuid', '#define _GNU_SOURCE\n#include<unistd.h>'],
# check token HAVE_GETTEXT
# check token HAVE_GIO_UNIX
# check token HAVE_GNU_FTW
@@ -138,19 +132,6 @@ check_functions = [
# check token HAVE_IPRINTDIALOGCALLBACK
# check token HAVE_LC_MESSAGES
# check token HAVE_LOCALTIME_R
- ['HAVE_LSTAT', 'lstat', '#include<sys/stat.h>'],
- ['HAVE_MMAP', 'mmap', '#include<sys/mman.h>'],
- ['HAVE_NEARBYINT', 'nearbyint', '#include<math.h>', libm],
- ['HAVE_POSIX_FALLOCATE', 'posix_fallocate', '#include<fcntl.h>'],
- ['HAVE__LOCK_FILE', '_lock_file', '#include<stdio.h>'],
- ['HAVE_FLOCKFILE', 'flockfile', '#include<stdio.h>'],
- ['HAVE_MKSTEMP', 'mkstemp', '#include<stdlib.h>'],
- ['HAVE_MALLINFO', 'mallinfo', '#include<malloc.h>'],
- ['HAVE_ROUND', 'round', '#include<math.h>', libm],
- ['HAVE_RINT', 'rint', '#include<math.h>', libm],
- ['HAVE_LOG2', 'log2', '#include<math.h>', libm],
- ['HAVE_EXP2', 'exp2', '#include<math.h>', libm],
- ['HAVE_SINCOS', 'sincos', '#define _GNU_SOURCE\n#include<math.h>', libm],
# check token HAVE_SOCKADDR_UN_SUN_LEN
# check token HAVE_SOLARIS_XINERAMA
# check token HAVE_XFREE_XINERAMA
@@ -160,14 +141,35 @@ check_functions = [
# check token HAVE__NL_PAPER_WIDTH
# check token HAVE__NL_TIME_FIRST_WEEKDAY
# check token HAVE__NSGETENVIRON
+
+check_functions = [
+ 'dcgettext',
+ 'getpagesize',
+ 'getresuid',
+ 'lstat',
+ 'mmap',
+ 'nearbyint',
+ 'posix_fallocate',
+ '_lock_file',
+ 'flockfile',
+ 'mkstemp',
+ 'mallinfo',
+ 'round',
+ 'rint',
+ 'log2',
+ 'exp2',
+ 'sincos',
]
-foreach f : check_functions
- if cc.has_function(f.get(1), prefix : f.get(2), dependencies : f.get(3, []))
- cdata.set(f.get(0), 1)
+foreach func : check_functions
+ if cc.has_function(func, dependencies : libm)
+ cdata.set('HAVE_' + func.underscorify().to_upper(), 1)
endif
endforeach
+cdata.set('HAVE_DECL_ISINF', cc.has_header_symbol('math.h', 'isinf'))
+cdata.set('HAVE_DECL_ISNAN', cc.has_header_symbol('math.h', 'isnan'))
+
# Disable deprecation checks for all libraries we depend on on stable branches.
# This is so newer versions of those libraries don't cause more warnings with
# a stable GTK version.