Skip to content

Commit 4825225

Browse files
committed
Drop from _sysconfig
1 parent f53f599 commit 4825225

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cpython-unix/build-cpython.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,10 +627,14 @@ def replace_in_all(search, replace):
627627
replace_in_file(MAKEFILE, search, replace)
628628
replace_in_file(SYSCONFIGDATA, search, replace)
629629
630-
# Replace the XCode path with a generic value.
630+
# Remove the Xcode path from the compiler flags.
631+
#
632+
# CPython itself will drop this from `sysconfig.get_config_var("CFLAGS")` and
633+
# similar calls, but _not_ if `CFLAGS` is set in the environment (regardless of
634+
# the `CFLAGS` value). It will almost always be wrong, so we drop it unconditionally.
631635
xcode_path = os.getenv("APPLE_SDK_PATH")
632636
if xcode_path:
633-
replace_in_all(xcode_path, "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk")
637+
replace_in_all("-isysroot %s" % xcode_path, "")
634638
635639
# -fdebug-default-version is Clang only. Strip so compiling works on GCC.
636640
replace_in_all("-fdebug-default-version=4", "")

0 commit comments

Comments
 (0)