summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch
blob: ef087ffc06b8726d75ca0ff3c5523d8baf2af7f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 9b5182d4781bcd6fb37a4030faf325965fde3e93 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Thu, 28 Nov 2024 20:32:17 +0100
Subject: [PATCH] meson: correct check for existence of two preprocessor
 defines

sizeof is meant for *types*, and in case of cross compiling
the test program produced by it has incorrect syntax
  __NR_keyctl something;
and will always fail to compile.

* meson.build: Use cc.get_define() instead of cc.sizeof() to check for
preprocessor symbols.

Co-authored-by: Dmitry V. Levin <ldv@strace.io>
Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/pull/861]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index f6a7dafe9..307fed0aa 100644
--- a/meson.build
+++ b/meson.build
@@ -198,12 +198,12 @@ foreach ident: check_functions
   endif
 endforeach
 
-enable_pam_keyinit = cc.sizeof('__NR_keyctl', prefix: '#include <sys/syscall.h>') > 0
+enable_pam_keyinit = cc.get_define('__NR_keyctl', prefix: '#include <sys/syscall.h>') != ''
 
 if get_option('mailspool') != ''
   cdata.set_quoted('PAM_PATH_MAILDIR', get_option('mailspool'))
 else
-  have = cc.sizeof('_PATH_MAILDIR', prefix: '#include <paths.h>') > 0
+  have = cc.get_define('_PATH_MAILDIR', prefix: '#include <paths.h>') != ''
   cdata.set('PAM_PATH_MAILDIR', have ? '_PATH_MAILDIR' : '"/var/spool/mail"')
 endif