From 4bf558bda40b0ead78841e11d5fed61c7cf022d9 Mon Sep 17 00:00:00 2001 From: Michael Karcher Date: Wed, 12 Jun 2024 22:37:03 +0200 Subject: [PATCH] Use gcc-specific _compile method for triplet-gcc as well On debian bookworm, distutils invokes gcc as x86_64-linux-gnu-gcc, so allow command line elements ending in "-gcc" as well as command line elements being exactly "gcc". --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8036363..58a5d2c 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,8 @@ def c_compile(obj, src, ext, cc_args, extra_postargs, pp_opts): cc_args = cc_args + ['-std=c99'] if src.endswith('.c') else cc_args return _compile(obj, src, ext, cc_args, extra_postargs, pp_opts) - if c.compiler_type == 'unix' and 'gcc' in c.compiler: + if c.compiler_type == 'unix' and \ + any(item == 'gcc' or item.endswith("-gcc") for item in c.compiler): c._compile = c_compile elif self.compiler.compiler_type == "msvc":