From 0edc04e8b16bfdcdb546159bcc757cd983ed654c Mon Sep 17 00:00:00 2001 From: Mikel Olasagasti Uranga Date: Tue, 30 Sep 2025 00:33:57 +0200 Subject: [PATCH] Fix(configure): Correctly persist SPF include and library paths The previous logic for detecting libspf2 temporarily modified the CFLAGS and LDFLAGS shell variables. While this was sufficient for the internal AC_SEARCH_LIBS check to pass, these modifications were not propagated into the final generated Makefiles. This caused build failures in strict environments (e.g., Fedora/EPEL rpmbuild) where CFLAGS is pre-populated with distribution-wide policies. The script's changes were lost, leading to compiler errors like "spf.h: No such file or directory" during the `make` stage. This commit fixes the issue by appending the SPF include and library paths to the standard `CPPFLAGS` and `LDFLAGS` variables, respectively. Signed-off-by: Mikel Olasagasti Uranga --- configure.ac | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 692dbe4..15f4aac 100644 --- a/configure.ac +++ b/configure.ac @@ -334,11 +334,8 @@ then then AC_DEFINE(HAVE_SPF2_H, 1, [Define to 1 if you have libspf2's `spf.h']) - spf2_include="-I $SPF2_INCLUDE" - saved_CFLAGS="$CFLAGS" - saved_LDFLAGS="$LDFLAGS" - CFLAGS="$spf2_include $saved_CFLAGS" - LDFLAGS="$saved_LDFLAGS -L${SPF2_LIB}" + CPPFLAGS="$CPPFLAGS -I${SPF2_INCLUDE}" + LDFLAGS="$LDFLAGS -L${SPF2_LIB}" fi AC_SEARCH_LIBS(SPF_record_new, spf2) AC_SEARCH_LIBS(SPF_server_new, spf2)