Skip to content

Commit

Permalink
actually pass the environement
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Oct 28, 2016
1 parent b67c63d commit d98f1ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions _setuplibuv.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def prepare_windows_env(env):
# Try if `python` on PATH is the right one. If we would execute
# `python` directly the current executable might be used so we
# delegate this to cmd.
cmd = ['cmd.exe', '/C', 'python', '-c', 'import sys; '
cmd = ['cmd.exe', '/C', 'python', '-c', 'import sys; '
'v = str(sys.version_info[:2]); sys.stdout.write(v); '
'sys.stdout.flush()']
try:
Expand Down Expand Up @@ -118,15 +118,18 @@ def configure_libuv(_bext, _ext):
def build_libuv():
cflags = '-fPIC'
env = os.environ.copy()
env['CFLAGS'] = ' '.join(x for x in (cflags, env.get('CFLAGS', None), env.get('ARCHFLAGS', None)) if x)
env['CFLAGS'] = ' '.join(x for x in (cflags,
env.get('CFLAGS', None),
env.get('ARCHFLAGS', None))
if x)
# Since we're building a static library, if link-time-optimization is requested, it
# results in failure to properly create the library archive. This goes unnoticed on
# OS X until import time because of '-undefined dynamic_lookup'. On the raspberry
# pi, it causes the linker to crash
if '-flto' in env['CFLAGS']:
log.info("Removing LTO")
env['CFLAGS'] = env['CFLAGS'].replace('-flto', '')
log.info('Building libuv...')
log.info('Building libuv with cflags %s', env['CFLAGS'])
if WIN:
prepare_windows_env(env)
libuv_arch = {'32bit': 'x86', '64bit': 'x64'}[platform.architecture()[0]]
Expand Down
2 changes: 1 addition & 1 deletion _setuputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _system(cmd, cwd=None, env=None):


def system(cmd, cwd=None, env=None):
if _system(cmd, cwd=cwd, env=None):
if _system(cmd, cwd=cwd, env=env):
sys.exit(1)


Expand Down
2 changes: 1 addition & 1 deletion deps/libuv/vcbuild.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off
@rem @echo off

cd %~dp0

Expand Down

0 comments on commit d98f1ab

Please sign in to comment.