SConstruct (5990:886da6fa6d4a) SConstruct (6003:8f374fd9a348)
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# Copyright (c) 2004-2005 The Regents of The University of Michigan
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are

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

156 if len(v1) > len(v2): return 1
157 return 0
158
159########################################################################
160#
161# Set up the base build environment.
162#
163########################################################################
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# Copyright (c) 2004-2005 The Regents of The University of Michigan
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are

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

156 if len(v1) > len(v2): return 1
157 return 0
158
159########################################################################
160#
161# Set up the base build environment.
162#
163########################################################################
164use_vars = set([ 'AS', 'AR', 'CC', 'CXX', 'HOME', 'PATH', 'RANLIB' ])
164use_vars = set([ 'AS', 'AR', 'CC', 'CXX', 'HOME', 'LD_LIBRARY_PATH', 'PATH',
165 'RANLIB' ])
165
166use_env = {}
167for key,val in os.environ.iteritems():
168 if key in use_vars or key.startswith("M5"):
169 use_env[key] = val
170
171env = Environment(ENV=use_env)
172env.root = Dir(".") # The current directory (where this file lives).

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

545py_version = 'python' + py_getvar('VERSION')
546
547py_general_include = sysconfig.get_python_inc()
548py_platform_include = sysconfig.get_python_inc(plat_specific=True)
549py_includes = [ py_general_include ]
550if py_platform_include != py_general_include:
551 py_includes.append(py_platform_include)
552
166
167use_env = {}
168for key,val in os.environ.iteritems():
169 if key in use_vars or key.startswith("M5"):
170 use_env[key] = val
171
172env = Environment(ENV=use_env)
173env.root = Dir(".") # The current directory (where this file lives).

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

546py_version = 'python' + py_getvar('VERSION')
547
548py_general_include = sysconfig.get_python_inc()
549py_platform_include = sysconfig.get_python_inc(plat_specific=True)
550py_includes = [ py_general_include ]
551if py_platform_include != py_general_include:
552 py_includes.append(py_platform_include)
553
553py_lib_path = []
554py_lib_path = [ py_getvar('LIBDIR') ]
554# add the prefix/lib/pythonX.Y/config dir, but only if there is no
555# shared library in prefix/lib/.
556if not py_getvar('Py_ENABLE_SHARED'):
557 py_lib_path.append('-L' + py_getvar('LIBPL'))
558
559py_libs = []
560for lib in py_getvar('LIBS').split() + py_getvar('SYSLIBS').split():
561 if lib not in py_libs:
562 py_libs.append(lib)
563py_libs.append('-l' + py_version)
564
565env.Append(CPPPATH=py_includes)
566env.Append(LIBPATH=py_lib_path)
555# add the prefix/lib/pythonX.Y/config dir, but only if there is no
556# shared library in prefix/lib/.
557if not py_getvar('Py_ENABLE_SHARED'):
558 py_lib_path.append('-L' + py_getvar('LIBPL'))
559
560py_libs = []
561for lib in py_getvar('LIBS').split() + py_getvar('SYSLIBS').split():
562 if lib not in py_libs:
563 py_libs.append(lib)
564py_libs.append('-l' + py_version)
565
566env.Append(CPPPATH=py_includes)
567env.Append(LIBPATH=py_lib_path)
567#env.Append(LIBS=py_libs)
568
569# verify that this stuff works
570if not conf.CheckHeader('Python.h', '<>'):
571 print "Error: can't find Python.h header in", py_includes
572 Exit(1)
573
574for lib in py_libs:
575 assert lib.startswith('-l')

--- 325 unchanged lines hidden ---
568
569# verify that this stuff works
570if not conf.CheckHeader('Python.h', '<>'):
571 print "Error: can't find Python.h header in", py_includes
572 Exit(1)
573
574for lib in py_libs:
575 assert lib.startswith('-l')

--- 325 unchanged lines hidden ---