Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bbd3437

Browse files
committed
Issue #14292: Ensure that the OS X installer build configures the CXX
environment variable to a value comparable to what it sets for CC for the benefit of C++ extension modules. (Patch by Ronald Oussoren)
1 parent 6fc81d7 commit bbd3437

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

Mac/BuildScript/build-installer.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ def getFullVersion():
149149
DEPTARGET = '10.3'
150150

151151
target_cc_map = {
152-
'10.3': 'gcc-4.0',
153-
'10.4': 'gcc-4.0',
154-
'10.5': 'gcc-4.2',
155-
'10.6': 'gcc-4.2',
156-
'10.7': 'clang',
157-
'10.8': 'clang',
152+
'10.3': ('gcc-4.0', 'g++-4.0'),
153+
'10.4': ('gcc-4.0', 'g++-4.0'),
154+
'10.5': ('gcc-4.2', 'g++-4.2'),
155+
'10.6': ('gcc-4.2', 'g++-4.2'),
156+
'10.7': ('clang', 'clang++'),
157+
'10.8': ('clang', 'clang++'),
158158
}
159159

160-
CC = target_cc_map[DEPTARGET]
160+
CC, CXX = target_cc_map[DEPTARGET]
161161

162162
PYTHON_3 = getVersionTuple() >= (3, 0)
163163

@@ -264,8 +264,8 @@ def library_recipes():
264264
url="http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz",
265265
checksum='00b516f4704d4a7cb50a1d97e6e8e15b',
266266
configure=None,
267-
install='make install CC=%s PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
268-
CC,
267+
install='make install CC=%s CXX=%s, PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
268+
CC, CXX,
269269
shellQuote(os.path.join(WORKDIR, 'libraries')),
270270
' -arch '.join(ARCHLIST),
271271
SDKPATH,
@@ -276,8 +276,8 @@ def library_recipes():
276276
url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz",
277277
checksum='debc62758716a169df9f62e6ab2bc634',
278278
configure=None,
279-
install='make install CC=%s prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
280-
CC,
279+
install='make install CC=%s CXX=%s, prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
280+
CC, CXX,
281281
shellQuote(os.path.join(WORKDIR, 'libraries')),
282282
' -arch '.join(ARCHLIST),
283283
SDKPATH,
@@ -550,7 +550,7 @@ def parseOptions(args=None):
550550
Parse arguments and update global settings.
551551
"""
552552
global WORKDIR, DEPSRC, SDKPATH, SRCDIR, DEPTARGET
553-
global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC
553+
global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC, CXX
554554

555555
if args is None:
556556
args = sys.argv[1:]
@@ -608,7 +608,7 @@ def parseOptions(args=None):
608608
SDKPATH=os.path.abspath(SDKPATH)
609609
DEPSRC=os.path.abspath(DEPSRC)
610610

611-
CC=target_cc_map[DEPTARGET]
611+
CC, CXX=target_cc_map[DEPTARGET]
612612

613613
print("Settings:")
614614
print(" * Source directory:", SRCDIR)
@@ -618,6 +618,7 @@ def parseOptions(args=None):
618618
print(" * Deployment target:", DEPTARGET)
619619
print(" * Universal architectures:", ARCHLIST)
620620
print(" * C compiler:", CC)
621+
print(" * C++ compiler:", CXX)
621622
print("")
622623

623624

@@ -1288,6 +1289,7 @@ def main():
12881289

12891290
os.environ['MACOSX_DEPLOYMENT_TARGET'] = DEPTARGET
12901291
os.environ['CC'] = CC
1292+
os.environ['CXX'] = CXX
12911293

12921294
if os.path.exists(WORKDIR):
12931295
shutil.rmtree(WORKDIR)

0 commit comments

Comments
 (0)