From b90c845b4f17af5a81f38c435e3eb512cd07125b Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 12 Dec 2022 19:44:40 +0100 Subject: [PATCH] Port meson build script to C99 Related to: --- p11-kit-meson-c99.patch | 35 +++++++++++++++++++++++++++++++++++ p11-kit.spec | 1 + 2 files changed, 36 insertions(+) create mode 100644 p11-kit-meson-c99.patch diff --git a/p11-kit-meson-c99.patch b/p11-kit-meson-c99.patch new file mode 100644 index 0000000..6df78fa --- /dev/null +++ b/p11-kit-meson-c99.patch @@ -0,0 +1,35 @@ +Port meson build script to C99. The _Thread_local check used +an implicit int. Future compilers are likely to reject missing +int types by default. + +Patch configure.ac as well, although it is not used by the current +Fedora build. + +Submitted upstream: + +diff --git a/configure.ac b/configure.ac +index be3af55093874750..fc719c78c99c2ac3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -148,7 +148,7 @@ if test "$os_unix" = "yes"; then + [ac_cv_tls_keyword= + for keyword in _Thread_local __thread; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], +- [[static ]$keyword[ foo;]])], ++ [[static ]$keyword[ int foo;]])], + [ac_cv_tls_keyword=$keyword]) + done]) + if test -n "$ac_cv_tls_keyword"; then +diff --git a/meson.build b/meson.build +index 64bb3429aef1bb79..aaa3c1f50b5b943f 100644 +--- a/meson.build ++++ b/meson.build +@@ -200,7 +200,7 @@ if host_system != 'windows' + tls_test_code_template = ''' + #include + int main (void) { +-static @0@ foo; ++static @0@ int foo; + return 0; + } + ''' diff --git a/p11-kit.spec b/p11-kit.spec index 3002354..da38079 100644 --- a/p11-kit.spec +++ b/p11-kit.spec @@ -11,6 +11,7 @@ Source1: https://github.com/p11-glue/p11-kit/releases/download/%{version} Source2: gpgkey-462225C3B46F34879FC8496CD605848ED7E69871.gpg Source3: trust-extract-compat Source4: p11-kit-client.service +Patch0: p11-kit-meson-c99.patch BuildRequires: gcc BuildRequires: libtasn1-devel >= 2.3