From f857d65cdd6b5a021efb8a1946ba31599bbea714 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 10 Dec 2022 13:39:25 +0100 Subject: [PATCH] Add %_configure_use_runstatedir to disable --runstatedir --- buildflags.md | 10 ++++++++++ macros | 5 ++++- redhat-rpm-config.spec | 5 ++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/buildflags.md b/buildflags.md index cb5d2d9..73e0c5c 100644 --- a/buildflags.md +++ b/buildflags.md @@ -124,6 +124,16 @@ are set as well during libtool-. This can be switched off using: Further patching happens in LTO mode, see below. +### Other autotools compatibility settings + +During `%configure`, `--runstatedir` is automatically passed to the +`configure` script if support for this option is detected. This +detection can fail if the package has multiple `configure` scripts +that invoke each other, and only some of them support `--runstatedir`. +To disable passing `--runstatedir`, use: + + %undefine _configure_use_runstatedir + ### Disabling Link-Time Optimization By default, builds use link-time optimization. In this build mode, diff --git a/macros b/macros index 59c3c0c..ebab63b 100644 --- a/macros +++ b/macros @@ -154,6 +154,9 @@ print(result) # way to turn it back off. # %_configure_disable_silent_rules 1 +# Pass --runstatedir to configure. +%_configure_use_runstatedir 1 + # This fixes various easy resolved configure tests that are compromised by LTO. # # We use this within the standard %configure macro, but also make it available @@ -217,7 +220,7 @@ print(result) --libdir=%{_libdir} \\\ --libexecdir=%{_libexecdir} \\\ --localstatedir=%{_localstatedir} \\\ - $(grep -q "runstatedir=DIR" %{_configure} && echo '--runstatedir=%{_runstatedir}') \\\ + %{?_configure_use_runstatedir:$(grep -q "runstatedir=DIR" %{_configure} && echo '--runstatedir=%{_runstatedir}')} \\\ --sharedstatedir=%{_sharedstatedir} \\\ --mandir=%{_mandir} \\\ --infodir=%{_infodir} diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 389371c..1820c9b 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -4,7 +4,7 @@ # 2) When making changes, increment the version (in baserelease) by 1. # rpmdev-bumpspec and other tools update the macro below, which is used # in Version: to get the desired effect. -%global baserelease 234 +%global baserelease 235 Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config @@ -221,6 +221,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %doc buildflags.md %changelog +* Sat Dec 10 2022 Florian Weimer - 235-1 +- Add %%_configure_use_runstatedir to disable --runstatedir configure option + * Fri Nov 4 2022 Tom Stellard - 234-1 - Remove unsupported arches from rpmrc