Rewrite how we set environment. (Simpler way to write the same thing)

This commit is contained in:
Matthieu Gautier 2017-02-22 14:20:48 +01:00
parent f2c841df6d
commit 6d69f056a4
1 changed files with 8 additions and 12 deletions

View File

@ -287,10 +287,8 @@ class BuildEnv:
bin_dirs += tlc.get_bin_dir() bin_dirs += tlc.get_bin_dir()
pkgconfig_path = pj(self.install_dir, self.libprefix, 'pkgconfig') pkgconfig_path = pj(self.install_dir, self.libprefix, 'pkgconfig')
env['PKG_CONFIG_PATH'] = (env['PKG_CONFIG_PATH'] + ':' + pkgconfig_path env['PKG_CONFIG_PATH'] = ':'.join([env['PKG_CONFIG_PATH'], pkgconfig_path])
if env['PKG_CONFIG_PATH']
else pkgconfig_path
)
# Add ccache path # Add ccache path
for p in ('/usr/lib/ccache', '/usr/lib64/ccache'): for p in ('/usr/lib/ccache', '/usr/lib64/ccache'):
if os.path.isdir(p): if os.path.isdir(p):
@ -302,14 +300,12 @@ class BuildEnv:
[pj(self.install_dir, 'bin')] + [pj(self.install_dir, 'bin')] +
ccache_path + ccache_path +
[env['PATH']]) [env['PATH']])
ld_library_path = ':'.join([
env['LD_LIBRARY_PATH'] = ':'.join([env['LD_LIBRARY_PATH'],
pj(self.install_dir, 'lib'), pj(self.install_dir, 'lib'),
pj(self.install_dir, 'lib64') pj(self.install_dir, 'lib64')
]) ])
env['LD_LIBRARY_PATH'] = (env['LD_LIBRARY_PATH'] + ':' + ld_library_path
if env['LD_LIBRARY_PATH']
else ld_library_path
)
env['CPPFLAGS'] = " ".join(['-I'+pj(self.install_dir, 'include'), env['CPPFLAGS']]) env['CPPFLAGS'] = " ".join(['-I'+pj(self.install_dir, 'include'), env['CPPFLAGS']])
env['LDFLAGS'] = " ".join(['-L'+pj(self.install_dir, 'lib'), env['LDFLAGS']]) env['LDFLAGS'] = " ".join(['-L'+pj(self.install_dir, 'lib'), env['LDFLAGS']])
return env return env