From: Michael R. Crusoe <crusoe@debian.org>
Subject: respect LDFLAGS
Description: Pass LDFLAGS to the feature-detection link checks
 Split LDFLAGS into separate arguments with shlex. Passing the whole
 string as one argument breaks as soon as LDFLAGS has more than one
 flag (e.g. Ubuntu's "-Wl,-Bsymbolic-functions ... -Wl,-z,relro"): the
 linker rejects it, every check fails and the build stops with
 "Could not find the FFTW header 'fftw3.h'". It also passed None when
 LDFLAGS was unset.
Bug-Debian: https://bugs.debian.org/1150410
Forwarded: https://bugs.debian.org/1150410
Last-Update: 2026-10-09
Index: pyfftw-0.15.0/setup.py
===================================================================
--- pyfftw-0.15.0.orig/setup.py
+++ pyfftw-0.15.0/setup.py
@@ -47,6 +47,7 @@ from sysconfig import get_platform
 
 from contextlib import redirect_stderr, redirect_stdout
 import os
+import shlex
 import logging
 import platform
 import sys
@@ -172,7 +173,7 @@ class EnvironmentSniffer(object):
         self.objects = []
         self.libraries = []
         self.library_dirs = get_library_dirs()
-        self.linker_flags = []
+        self.linker_flags = shlex.split(os.environ.get("LDFLAGS", ""))
         self.compile_time_env = {}
 
         if self.compiler.compiler_type == 'msvc':
