]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: fix environ search
authorRosen Penev <rosenp@gmail.com>
Sat, 30 Apr 2022 01:16:17 +0000 (18:16 -0700)
committerRosen Penev <rosenp@gmail.com>
Sat, 30 Apr 2022 01:16:17 +0000 (18:16 -0700)
musl has it defined in unistd.h and hidden behind _GNU_SOURCE.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
meson.build

index 2edeb8c962fbaab8223672a6a2bd090e4789a0ad..c800570758751f21157759e515c54a8beea17a93 100644 (file)
@@ -383,7 +383,7 @@ conf.set10('HAVE_DECL_CPU_ALLOC', have)
 have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
 
-have = cc.has_header_symbol('stdlib.h', 'environ')
+have = cc.has_header_symbol('unistd.h', 'environ', prefix : '#define _GNU_SOURCE')
 conf.set10('HAVE_ENVIRON_DECL', have)
 
 have = cc.has_header_symbol('signal.h', 'sighandler_t')