From b42197ceb9ac8a0cd95b53092b30c4f51c0c0057 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sun, 14 May 2023 07:00:04 -0400 Subject: [PATCH 1/2] Port code from CygwinCCompiler to UnixCCompiler https://github.com/python-pillow/Pillow/issues/7158#issuecomment-1546746716 suggests that Cygwin uses UnixCCompiler rather than CygwinCCompiler by default, so UnixCCompiler would need to know how to find shared libraries, import libraries, and static libraries on Cygwin. --- distutils/unixccompiler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distutils/unixccompiler.py b/distutils/unixccompiler.py index 6ca2332a..b1139cfb 100644 --- a/distutils/unixccompiler.py +++ b/distutils/unixccompiler.py @@ -141,6 +141,10 @@ class UnixCCompiler(CCompiler): xcode_stub_lib_format = dylib_lib_format if sys.platform == "cygwin": exe_extension = ".exe" + shared_lib_extension = ".dll.a" + dylib_lib_extension = ".dll" + static_lib_format = shared_lib_format = "lib%s%s" + dylib_lib_format = "cyg%s%s" def preprocess( self, From afc54f822b52df1499d3379c2d05f96bd86433a8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 28 Jun 2024 11:55:50 -0400 Subject: [PATCH 2/2] Remove unnecessary override to the same value. Co-authored-by: DWesl <22566757+DWesl@users.noreply.github.com> --- distutils/unixccompiler.py | 1 - 1 file changed, 1 deletion(-) diff --git a/distutils/unixccompiler.py b/distutils/unixccompiler.py index e547d489..7e68596b 100644 --- a/distutils/unixccompiler.py +++ b/distutils/unixccompiler.py @@ -146,7 +146,6 @@ class UnixCCompiler(CCompiler): exe_extension = ".exe" shared_lib_extension = ".dll.a" dylib_lib_extension = ".dll" - static_lib_format = shared_lib_format = "lib%s%s" dylib_lib_format = "cyg%s%s" def preprocess(