summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/unixccompiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/unixccompiler.py')
-rw-r--r--Lib/distutils/unixccompiler.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 25a042d..87ce921 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -63,7 +63,7 @@ def _darwin_compiler_fixup(compiler_so, cc_args):
stripArch = '-arch' in cc_args
stripSysroot = '-isysroot' in cc_args
- if stripArch:
+ if stripArch or 'ARCHFLAGS' in os.environ:
while True:
try:
index = compiler_so.index('-arch')
@@ -72,6 +72,12 @@ def _darwin_compiler_fixup(compiler_so, cc_args):
except ValueError:
break
+ if 'ARCHFLAGS' in os.environ and not stripArch:
+ # User specified different -arch flags in the environ,
+ # see also distutils.sysconfig
+ compiler_so = compiler_so + ' ' + os.environ['ARCHFLAGS']
+
+
if stripSysroot:
try:
index = compiler_so.index('-isysroot')