From d931b85e44bb5f2aff68f1504ff1aeca76b8f56c Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Thu, 5 Oct 2017 02:00:41 +0100
Subject: [PATCH 08/30] runtime_library_dir_option: Use 1st word of CC as
 compiler

Previous, 'CC' got passed to os.path.basename, so any paths in it after
the executable name would get returned as the executable and it would
not get detected as gcc (or whatever it actually is).
---
 Lib/distutils/unixccompiler.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 3f05cf7f8c..84a421767d 100644
--- a/Lib/distutils/unixccompiler.py	2022-03-21 10:35:10.256408898 +0300
+++ b/Lib/distutils/unixccompiler.py	2022-03-21 10:35:24.148713509 +0300
@@ -234,7 +234,7 @@
         # this time, there's no way to determine this information from
         # the configuration data stored in the Python installation, so
         # we use this hack.
-        compiler = os.path.basename(sysconfig.get_config_var("CC"))
+        compiler = os.path.basename(sysconfig.get_config_var("CC").split()[0])
         if sys.platform[:6] == "darwin":
             # MacOSX's linker doesn't understand the -R flag at all
             return "-L" + dir
