SConstruct (10135:7bbd1a21e566) SConstruct (10158:24a198a46ff0)
1# -*- mode:python -*-
2
3# Copyright (c) 2013 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

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

867
868# Find Python include and library directories for embedding the
869# interpreter. We rely on python-config to resolve the appropriate
870# includes and linker flags. ParseConfig does not seem to understand
871# the more exotic linker flags such as -Xlinker and -export-dynamic so
872# we add them explicitly below. If you want to link in an alternate
873# version of python, see above for instructions on how to invoke
874# scons with the appropriate PATH set.
1# -*- mode:python -*-
2
3# Copyright (c) 2013 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

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

867
868# Find Python include and library directories for embedding the
869# interpreter. We rely on python-config to resolve the appropriate
870# includes and linker flags. ParseConfig does not seem to understand
871# the more exotic linker flags such as -Xlinker and -export-dynamic so
872# we add them explicitly below. If you want to link in an alternate
873# version of python, see above for instructions on how to invoke
874# scons with the appropriate PATH set.
875py_includes = readCommand(['python-config', '--includes'],
875#
876# First we check if python2-config exists, else we use python-config
877python_config = readCommand(['which', 'python2-config'], exception='').strip()
878if not os.path.exists(python_config):
879 python_config = readCommand(['which', 'python-config'], exception='')
880py_includes = readCommand([python_config, '--includes'],
876 exception='').split()
877# Strip the -I from the include folders before adding them to the
878# CPPPATH
879main.Append(CPPPATH=map(lambda inc: inc[2:], py_includes))
880
881# Read the linker flags and split them into libraries and other link
882# flags. The libraries are added later through the call the CheckLib.
881 exception='').split()
882# Strip the -I from the include folders before adding them to the
883# CPPPATH
884main.Append(CPPPATH=map(lambda inc: inc[2:], py_includes))
885
886# Read the linker flags and split them into libraries and other link
887# flags. The libraries are added later through the call the CheckLib.
883py_ld_flags = readCommand(['python-config', '--ldflags'], exception='').split()
888py_ld_flags = readCommand([python_config, '--ldflags'], exception='').split()
884py_libs = []
885for lib in py_ld_flags:
886 if not lib.startswith('-l'):
887 main.Append(LINKFLAGS=[lib])
888 else:
889 lib = lib[2:]
890 if lib not in py_libs:
891 py_libs.append(lib)

--- 427 unchanged lines hidden ---
889py_libs = []
890for lib in py_ld_flags:
891 if not lib.startswith('-l'):
892 main.Append(LINKFLAGS=[lib])
893 else:
894 lib = lib[2:]
895 if lib not in py_libs:
896 py_libs.append(lib)

--- 427 unchanged lines hidden ---