third_party: Build pypamtest with -Wno-error=declaration-after-statement
authorAndreas Schneider <asn@samba.org>
Thu, 9 Nov 2023 16:16:17 +0000 (17:16 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 20 Nov 2023 15:37:33 +0000 (15:37 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_autoconf.py
third_party/pam_wrapper/wscript

index 546b0daf932c7b0a57bd800ef74bc8ac286163b0..16f962ded6048aa600c6eff6bbb39f2d5acdec71 100644 (file)
@@ -820,6 +820,9 @@ int main(void) {
         if CHECK_CFLAGS(conf, ["-Wno-error=stringop-overflow"]):
             conf.define('HAVE_WNO_ERROR_STRINGOP_OVERFLOW', 1)
 
+        if CHECK_CFLAGS(conf, ["-Wno-error=declaration-after-statement"]):
+            conf.define('HAVE_WNO_ERROR_DECLARATION_AFTER_STATEMENT', 1)
+
         if not Options.options.disable_warnings_as_errors:
             conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Werror -Wno-error=deprecated-declarations', testflags=True)
             conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=tautological-compare', testflags=True)
index 28d003d9fab2ebb66c24d2ccf6033f1abf842f72..3ce89bbbc2797904c34cbaf676b92042ef3988cf 100644 (file)
@@ -105,8 +105,13 @@ def build(bld):
                           install=False,
                           realname='pam_set_items.so')
 
+        pypamtest_cflags = ''
+        if bld.CONFIG_SET('HAVE_WNO_ERROR_DECLARATION_AFTER_STATEMENT'):
+            pypamtest_cflags = '-Wno-error=declaration-after-statement'
+
         # Can be used to write pam tests in python
         bld.SAMBA_PYTHON('pypamtest',
                          source='python/pypamtest.c',
+                         cflags_end=pypamtest_cflags,
                          deps='libpamtest',
                          install=False)