diff --git a/Misc/NEWS.d/next/Build/2026-05-24-12-30-00.gh-issue-150311.Xk9m3P.rst b/Misc/NEWS.d/next/Build/2026-05-24-12-30-00.gh-issue-150311.Xk9m3P.rst new file mode 100644 index 000000000000000..a9a37d4b628a417 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-05-24-12-30-00.gh-issue-150311.Xk9m3P.rst @@ -0,0 +1,4 @@ +Fix three minor issues in ``configure.ac`` for the Cygwin port: use +consistent uppercase ``CYGWIN`` for ``ac_sys_system``, correct the static +library extension from ``.dll.a`` to ``.a`` when shared is disabled, and use +``$(CC)``/``$(CXX)`` instead of hardcoded ``gcc``/``g++``. diff --git a/configure b/configure index 00e3ca25c86e8f9..c8ffd79d2521930 100755 --- a/configure +++ b/configure @@ -4151,7 +4151,7 @@ then ac_sys_system=Linux ;; *-*-cygwin*) - ac_sys_system=Cygwin + ac_sys_system=CYGWIN ;; *-apple-ios*) ac_sys_system=iOS @@ -7842,7 +7842,7 @@ else # shared is disabled case $ac_sys_system in CYGWIN*) BLDLIBRARY='$(LIBRARY)' - LDLIBRARY='libpython$(LDVERSION).dll.a' + LDLIBRARY='libpython$(LDVERSION).a' ;; esac fi @@ -14226,8 +14226,8 @@ then : fi;; CYGWIN*) - LDSHARED="gcc -shared -Wl,--enable-auto-image-base" - LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; + LDSHARED="$(CC) -shared -Wl,--enable-auto-image-base" + LDCXXSHARED="$(CXX) -shared -Wl,--enable-auto-image-base";; *) LDSHARED="ld";; esac fi diff --git a/configure.ac b/configure.ac index bb2a7eee9a116e3..a5da598d0852b11 100644 --- a/configure.ac +++ b/configure.ac @@ -334,7 +334,7 @@ then ac_sys_system=Linux ;; *-*-cygwin*) - ac_sys_system=Cygwin + ac_sys_system=CYGWIN ;; *-apple-ios*) ac_sys_system=iOS @@ -1650,7 +1650,7 @@ else # shared is disabled case $ac_sys_system in CYGWIN*) BLDLIBRARY='$(LIBRARY)' - LDLIBRARY='libpython$(LDVERSION).dll.a' + LDLIBRARY='libpython$(LDVERSION).a' ;; esac fi @@ -3694,8 +3694,8 @@ then dnl not implemented yet ]);; CYGWIN*) - LDSHARED="gcc -shared -Wl,--enable-auto-image-base" - LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; + LDSHARED="$(CC) -shared -Wl,--enable-auto-image-base" + LDCXXSHARED="$(CXX) -shared -Wl,--enable-auto-image-base";; *) LDSHARED="ld";; esac fi