]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Cleanup platform module
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 15 Aug 2023 22:04:51 +0000 (00:04 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:39 +0000 (13:28 +0100)
meson.build
meson/platform/meson.build

index 95d1bfcf8bf399b7361a8efe7bec0191a6e5b2b9..da6992f3ecd5a5d2225fdc554c5127134939a810 100644 (file)
@@ -33,12 +33,12 @@ subdir('meson' / 'compiler-setup')          # Common compiler setup
 subdir('meson' / 'summary')                 # Print a system/project summary
 subdir('meson' / 'sysconfdir')              # Sysconfdir
 subdir('meson' / 'libdir')                  # Libdir
+subdir('meson' / 'platform')                # Platform detection
 subdir('meson' / 'timet-size')              # Check the size of time_t
 subdir('meson' / 'timet-sign')              # Check the sign of time_t
 subdir('meson' / 'flex')                    # Find flex and create generator
 subdir('meson' / 'bison')                   # Find bison and create generator
 subdir('meson' / 'ragel')                   # Find ragel and create generator
-subdir('meson' / 'platform')                # Platform detection
 subdir('meson' / 'atomics')                 # Check atomics support
 subdir('meson' / 'pthread-headers')         # Check pthread headers
 subdir('meson' / 'pthread-setname')         # Pthread setname madness
@@ -174,6 +174,7 @@ subdir('ext')
 
 deps = [
   dep_pdns,
+  dep_platform,
   dep_atomic,
   dep_lua,
   dep_lua_records,
index a77d4e1848de187d83e32cd541ad3cf8576806db..6b224538bc3edc5db569e557474752800eeea1d1 100644 (file)
@@ -1,17 +1,15 @@
-# Platform detection
-# Inputs: deps conf system
-
 platforms = [
-  ['linux',   [['HAVE_LINUX',   'We are on Linux']], [], []],
-  ['darwin',  [['HAVE_DARWIN',  'We are on Darwin/MacOS']], [], ['__APPLE_USE_RFC_3542', '_XOPEN_SOURCE', '_DARWIN_C_SOURCE'], []],
-  ['openbsd', [['HAVE_OPENBSD', 'We are on OpenBSD']], [], []],
-  ['freebsd', [['HAVE_FREEBSD', 'We are on FreeBSD']], [], []],
-  ['sunos',   [['HAVE_SOLARIS', 'We are on Solaris/SunOS'],
+  ['linux',   [['HAVE_LINUX',   'On Linux']], [], []],
+  ['darwin',  [['HAVE_DARWIN',  'On Darwin/MacOS']], [], ['__APPLE_USE_RFC_3542', '_XOPEN_SOURCE', '_DARWIN_C_SOURCE'], []],
+  ['openbsd', [['HAVE_OPENBSD', 'On OpenBSD']], [], []],
+  ['freebsd', [['HAVE_FREEBSD', 'On FreeBSD']], [], []],
+  ['sunos',   [['HAVE_SOLARIS', 'On Solaris/SunOS'],
                ['NEED_POSIX_TYPEDEF', 'POSIX typedefs need to be defined'],
                ['NEED_INET_NTOP_PROTO', 'OS is so broken that it needs an additional prototype']],
    ['_REENTRANT'], ['posix4']],
 ]
 
+platform_deps = []
 foreach platform: platforms
   name = platform[0]
   defines = platform[1]
@@ -23,7 +21,7 @@ foreach platform: platforms
     foreach define: defines
       define_name = define[0]
       define_desc = define[1]
-      conf.set10(define_name, true, description: define_desc)
+      conf.set(define_name, true, description: define_desc)
       platform_defines += define[0]
     endforeach
 
@@ -32,11 +30,15 @@ foreach platform: platforms
     endforeach
 
     foreach lib: libs
-      deps += cxx.find_library(lib, required: true)
+      platform_deps += cxx.find_library(lib, required: true)
     endforeach
 
-    summary('Defines', ' '.join(platform_defines), section: 'System')
+    summary('Platform Defines', platform_defines, section: 'System')
 
     break
   endif
 endforeach
+
+dep_platform = declare_dependency(
+  dependencies: platform_deps,
+)