Mike Frysinger | 51f0d52 | 2015-11-21 00:11:17 +0000 | [diff] [blame] | 1 | This fixes the problem that when CC is set, the LDSHAREd is not |
| 2 | set accordingly on linux. |
| 3 | Upstream bug filed at https://bugs.python.org/issue24935 |
| 4 | |
| 5 | --- a/Lib/distutils/sysconfig.py |
| 6 | +++ b/Lib/distutils/sysconfig.py |
| 7 | @@ -180,10 +180,10 @@ |
| 8 | |
| 9 | if 'CC' in os.environ: |
| 10 | newcc = os.environ['CC'] |
| 11 | - if (sys.platform == 'darwin' |
| 12 | + if ((sys.platform == 'darwin' or sys.platform.startswith('linux')) |
| 13 | and 'LDSHARED' not in os.environ |
| 14 | and ldshared.startswith(cc)): |
| 15 | - # On OS X, if CC is overridden, use that as the default |
| 16 | + # On OS X and linux, if CC is overridden, use that as the default |
| 17 | # command for LDSHARED as well |
| 18 | ldshared = newcc + ldshared[len(cc):] |
| 19 | cc = newcc |