From 2f9db7f73b24ba3c4a6b0699a331ec67ce1da677 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 18 Sep 2003 07:42:19 +0000 Subject: [PATCH] Fix test/SWIG.py to find the proper Python include directory in all cases. (Christoph Wiedemann) git-svn-id: http://scons.tigris.org/svn/scons/trunk@800 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 4 ++++ test/SWIG.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index fb22efb7..f692b742 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -82,6 +82,10 @@ RELEASE X.XX - XXX - Split the non-SCons-specific functionality from SConf.py to a new, re-usable Conftest.py module. + From Christoph Wiedemann: + + - Fix test/SWIG.py to find the Python include directory in all cases. + RELEASE 0.92 - Wed, 20 Aug 2003 03:45:28 -0500 diff --git a/test/SWIG.py b/test/SWIG.py index d36c77e8..2a0ee329 100644 --- a/test/SWIG.py +++ b/test/SWIG.py @@ -104,7 +104,7 @@ swig = test.where_is('swig') if swig: - version = string.join(string.split(sys.version, '.')[:2], '.') + version = sys.version[:3] # see also sys.prefix documentation test.write("wrapper.py", """import os @@ -116,7 +116,7 @@ os.system(string.join(sys.argv[1:], " ")) test.write('SConstruct', """ foo = Environment(SWIGFLAGS='-python', - CPPPATH='/usr/include/python%s/', + CPPPATH='%s/include/python%s/', SHCCFLAGS='', SHOBJSUFFIX='.o', SHLIBPREFIX='') @@ -124,7 +124,7 @@ swig = foo.Dictionary('SWIG') bar = foo.Copy(SWIG = r'%s wrapper.py ' + swig) foo.SharedLibrary(target = 'foo', source = ['foo.c', 'foo.i']) bar.SharedLibrary(target = 'bar', source = ['bar.c', 'bar.i']) -""" % (version, python)) +""" % (sys.prefix, version, python)) test.write("foo.c", """\ char * -- 2.26.2