OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 | 6 |
7 env = Environment() | 7 env = Environment() |
8 for key in Split('CC CXX AR RANLIB LD NM'): | 8 for key in Split('CC CXX AR RANLIB LD NM'): |
9 value = os.environ.get(key) | 9 value = os.environ.get(key) |
10 if value != None: | 10 if value != None: |
11 env[key] = value | 11 env[key] = value |
12 for key in Split('CFLAGS CCFLAGS CPPPATH LIBPATH'): | 12 for key in Split('CFLAGS CCFLAGS CPPPATH LIBPATH'): |
13 value = os.environ.get(key) | 13 value = os.environ.get(key) |
14 if value != None: | 14 if value != None: |
15 env[key] = Split(value) | 15 env[key] = Split(value) |
16 if not env.get('CCFLAGS'): | 16 if not env.get('CCFLAGS'): |
17 env.Append(CCFLAGS=Split('-I.. -Wall -Werror -O3')) | 17 env.Append(CCFLAGS=Split('-I.. -Wall -Werror -O3')) |
18 | 18 |
19 # Fix issue with scons not passing pkg-config vars through the environment. | 19 # Fix issue with scons not passing some vars through the environment. |
20 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH'): | 20 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH SYSROOT'): |
21 if os.environ.has_key(key): | 21 if os.environ.has_key(key): |
22 env['ENV'][key] = os.environ[key] | 22 env['ENV'][key] = os.environ[key] |
23 | 23 |
24 env.Append(CPPPATH=['..']) | 24 env.Append(CPPPATH=['..']) |
25 env.Append(LIBS=Split('base chromeos rt Xtst')) | 25 env.Append(LIBS=Split('base chromeos rt Xtst')) |
26 env.ParseConfig('pkg-config --cflags --libs libpcrecpp x11') | 26 env.ParseConfig('pkg-config --cflags --libs libpcrecpp x11') |
27 env.Program('autox', Split('autox.cc script_runner.cc')) | 27 env.Program('autox', Split('autox.cc script_runner.cc')) |
OLD | NEW |