SConstruct (13421:79af503161d7) SConstruct (13541:a23fca6305e1)
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015-2017 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 78 unchanged lines hidden (view full) ---

87import shutil
88import subprocess
89import sys
90
91from os import mkdir, environ
92from os.path import abspath, basename, dirname, expanduser, normpath
93from os.path import exists, isdir, isfile
94from os.path import join as joinpath, split as splitpath
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015-2017 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 78 unchanged lines hidden (view full) ---

87import shutil
88import subprocess
89import sys
90
91from os import mkdir, environ
92from os.path import abspath, basename, dirname, expanduser, normpath
93from os.path import exists, isdir, isfile
94from os.path import join as joinpath, split as splitpath
95from re import match
95
96# SCons includes
97import SCons
98import SCons.Node
99
100from m5.util import compareVersions, readCommand
101
102help_texts = {

--- 602 unchanged lines hidden (view full) ---

705 # First we check if python2-config exists, else we use python-config
706 python_config = readCommand(['which', 'python2-config'],
707 exception='').strip()
708 if not os.path.exists(python_config):
709 python_config = readCommand(['which', 'python-config'],
710 exception='').strip()
711 py_includes = readCommand([python_config, '--includes'],
712 exception='').split()
96
97# SCons includes
98import SCons
99import SCons.Node
100
101from m5.util import compareVersions, readCommand
102
103help_texts = {

--- 602 unchanged lines hidden (view full) ---

706 # First we check if python2-config exists, else we use python-config
707 python_config = readCommand(['which', 'python2-config'],
708 exception='').strip()
709 if not os.path.exists(python_config):
710 python_config = readCommand(['which', 'python-config'],
711 exception='').strip()
712 py_includes = readCommand([python_config, '--includes'],
713 exception='').split()
714 py_includes = filter(lambda s: match(r'.*\/include\/.*',s), py_includes)
713 # Strip the -I from the include folders before adding them to the
714 # CPPPATH
715 # Strip the -I from the include folders before adding them to the
716 # CPPPATH
715 main.Append(CPPPATH=map(lambda inc: inc[2:], py_includes))
717 py_includes = map(lambda s: s[2:] if s.startswith('-I') else s, py_includes)
718 main.Append(CPPPATH=py_includes)
716
717 # Read the linker flags and split them into libraries and other link
718 # flags. The libraries are added later through the call the CheckLib.
719 py_ld_flags = readCommand([python_config, '--ldflags'],
720 exception='').split()
721 py_libs = []
722 for lib in py_ld_flags:
723 if not lib.startswith('-l'):

--- 532 unchanged lines hidden ---
719
720 # Read the linker flags and split them into libraries and other link
721 # flags. The libraries are added later through the call the CheckLib.
722 py_ld_flags = readCommand([python_config, '--ldflags'],
723 exception='').split()
724 py_libs = []
725 for lib in py_ld_flags:
726 if not lib.startswith('-l'):

--- 532 unchanged lines hidden ---