Skip to content

Commit 7af666c

Browse files
committed
Fixed a bug with Python headers on 64-bit Debian.
1 parent 38eb133 commit 7af666c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def make(name, target=None, **makevars):
454454
def require_header(header, lang, msg='', symbol=None, value=None):
455455
debug('require_header "%s"', header)
456456

457-
cmd = {'c': '{cc}', 'c++': '{cxx}'}[lang]
457+
cmd = {'c': os.environ['CC'], 'c++': os.environ['CXX']}[lang]
458458
cmd = fill_in(cmd).split()
459459
proc = subprocess.Popen(cmd + ['-fsyntax-only', '-x', lang, '-'],
460460
stdin=subprocess.PIPE,

toolchain-m68k

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ def build():
216216
else:
217217
CC, CXX = 'gcc', 'g++'
218218

219+
CC = find_executable(CC)
220+
CXX = find_executable(CXX)
221+
219222
"""
220223
On 64-bit architecture GNU Assembler crashes writing out an object, due to
221224
(probably) miscalculated structure sizes. There could be some other bugs
@@ -225,10 +228,9 @@ def build():
225228

226229
ARCH = '-m32' if platform.machine() == 'x86_64' else ''
227230

228-
environ['CC'] = ' '.join([find_executable(CC), ARCH])
229-
environ['CXX'] = ' '.join([find_executable(CXX), ARCH])
230-
231-
environ['PATH'] = ":".join([path.join('{target}', 'bin'),
231+
environ['CC'] = CC + ' ' + ARCH
232+
environ['CXX'] = CXX + ' ' + ARCH
233+
environ['PATH'] = ':'.join([path.join('{target}', 'bin'),
232234
path.join('{host}', 'bin'),
233235
environ['PATH']])
234236

@@ -248,12 +250,12 @@ def build():
248250
require_header('ncurses.h', 'c', 'libncurses-dev package missing')
249251

250252
py_ver = 'python%d.%d' % (sys.version_info.major, sys.version_info.minor)
253+
with env(CC=CC, CXX=CXX):
254+
require_header(path.join(py_ver, 'Python.h'), 'c',
255+
'python-dev package missing')
251256

252-
require_header(path.join(py_ver, 'Python.h'), 'c',
253-
'python-dev package missing')
254-
255-
unpack('python-lha', work_dir='{build}')
256-
python_setup('python-lha')
257+
unpack('python-lha', work_dir='{build}')
258+
python_setup('python-lha')
257259

258260
unpack('{m4}')
259261
configure('{m4}', '--prefix={host}')

0 commit comments

Comments
 (0)