aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-09-14 22:18:32 +0100
committerEric Engestrom <[email protected]>2019-10-08 16:26:50 +0100
commit6f26eae077af2b4e1f51e9a9524617937afc8e36 (patch)
treeab6122d2d527f438702ee79552ab7c7f3f18695d
parent02b3aa3cf302eff3e8247a1767331657b8cefb29 (diff)
meson: fix sys/mkdev.h detection on Solaris
On Solaris, sys/sysmacros.h has long-deprecated copies of major() & minor() but not makedev(). sys/mkdev.h has all three and is the preferred choice. Let's make sure we check for all 3 major(), minor() and makedev(). Reported-by: Alan Coopersmith <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Alan Coopersmith <[email protected]> Tested-by: Alan Coopersmith <[email protected]>
-rw-r--r--meson.build9
1 files changed, 7 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 8f30a94ed8d..20c40f1d221 100644
--- a/meson.build
+++ b/meson.build
@@ -1052,9 +1052,14 @@ elif host_machine.cpu_family().startswith('ppc64') and host_machine.endian() ==
endif
# Check for standard headers and functions
-if cc.has_header_symbol('sys/sysmacros.h', 'major')
+if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
+ cc.has_header_symbol('sys/sysmacros.h', 'minor') and
+ cc.has_header_symbol('sys/sysmacros.h', 'makedev'))
pre_args += '-DMAJOR_IN_SYSMACROS'
-elif cc.has_header_symbol('sys/mkdev.h', 'major')
+endif
+if (cc.has_header_symbol('sys/mkdev.h', 'major') and
+ cc.has_header_symbol('sys/mkdev.h', 'minor') and
+ cc.has_header_symbol('sys/mkdev.h', 'makedev'))
pre_args += '-DMAJOR_IN_MKDEV'
endif