OSDN Git Service

xf86drm: generalize the device subsystem type parsing code
[android-x86/external-libdrm.git] / meson.build
index 319f978..ddcb884 100644 (file)
@@ -52,9 +52,10 @@ intel_atomics = false
 lib_atomics = false
 
 dep_atomic_ops = dependency('atomic_ops', required : false)
-if cc.compiles('''
+if cc.links('''
     int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); }
     int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); }
+    int main() { }
     ''',
     name : 'Intel Atomics')
   intel_atomics = true
@@ -186,7 +187,7 @@ dep_m = cc.find_library('m', required : false)
 # FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
 # includes when checking for headers.
 foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
-  config.set('HAVE_' + header.underscorify().to_upper(),
+  config.set10('HAVE_' + header.underscorify().to_upper(),
     cc.compiles('#include <sys/types.h>\n#include <@0@>'.format(header), name : '@0@ works'.format(header)))
 endforeach
 if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
@@ -284,7 +285,7 @@ config_file = configure_file(
   configuration : config,
   output : 'config.h',
 )
-add_project_arguments('-include', 'config.h', language : 'c')
+add_project_arguments('-include', '@0@'.format(config_file), language : 'c')
 
 inc_root = include_directories('.')
 inc_drm = include_directories('include/drm')
@@ -304,6 +305,16 @@ libdrm = shared_library(
   install : true,
 )
 
+test(
+  'core-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm,
+    '--symbols-file', files('core-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
+)
+
 ext_libdrm = declare_dependency(
   link_with : libdrm,
   include_directories : [inc_root, inc_drm],
@@ -334,9 +345,6 @@ pkg.generate(
   description : 'Userspace interface to kernel DRM services',
 )
 
-env_test = environment()
-env_test.set('NM', find_program('nm').path())
-
 if with_libkms
   subdir('libkms')
 endif