Fix test/SWIG.py to find the proper Python include directory in all cases. (Christop...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 18 Sep 2003 07:42:19 +0000 (07:42 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 18 Sep 2003 07:42:19 +0000 (07:42 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@800 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
test/SWIG.py

index fb22efb713ee310c072b99e104c7e1be7699221c..f692b7422f2f8c4b7ff01d3ac96af64a75e49060 100644 (file)
@@ -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
index d36c77e8e49d6c8e37bbf62d7063df6edf671fb8..2a0ee329db0a97f26a38683fceae5cab86d33d7a 100644 (file)
@@ -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 *