From 9721826e1e37cdad1d9f5be2fdc308dc163bde0c Mon Sep 17 00:00:00 2001
From: Matt Clarke <matt.clarke@stfc.ac.uk>
Date: Fri, 9 Nov 2007 16:07:48 +0000
Subject: [PATCH] This sconstruct works on windows for building the Kernel
 including the Boostpython stuff. Refs #36.

---
 Code/Mantid/Kernel/SConstruct.win | 86 +++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 Code/Mantid/Kernel/SConstruct.win

diff --git a/Code/Mantid/Kernel/SConstruct.win b/Code/Mantid/Kernel/SConstruct.win
new file mode 100644
index 00000000000..33df91a6902
--- /dev/null
+++ b/Code/Mantid/Kernel/SConstruct.win
@@ -0,0 +1,86 @@
+#For MantidKernel
+
+import os
+import platform
+import sys
+
+from socket import gethostname
+
+currPath = os.getcwd() + '/'
+
+cppPaths = ['../../Third_Party/include']
+
+dirpath=os.listdir('.')
+for item in dirpath:
+	if (item=="inc" or item=="auxinc"):
+		cppPaths.append(item)
+
+
+#get libraries and the library directories
+libDirList = ['lib']
+libList = []
+
+cflags=''
+
+if os.name == 'nt':
+	# assume this is nt
+	libDirList.append('../../Third_Party/lib/win32/')
+	libDir = '../../Third_Party/lib/win32/'
+	cflags = ['-W3','/EHsc', '/MDd', '/ZI', '/TP', '/DWIN32', '/D_DEBUG', '/D_WINDOWS', '/DPOCO_DLL', '/DWINVER=0x0500']
+	
+	cppPaths.append('C:\Python25\include')
+	libDirList.append('C:\Python25\libs')
+	
+	for file in os.listdir(libDir):
+		if file.endswith('.dll'):
+			libList.append(file.replace('.dll',''))
+		else:
+			if file.endswith('.lib'):
+				if file.startswith('lib'):
+					libList.append(file.replace('.lib',''))
+	
+else:
+	#so this must be posix
+	#libDirList.append('/usr/lib/gcc/i386-redhat-linux/3.4.6/')
+	#libDirList.append('/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/')
+	cflags = ['-Wall', '-fPIC']
+	cppPaths.append('/usr/include/python' + sys.version[0:3])
+	
+	#libDir =''
+	
+	if platform.architecture()[0].startswith('64bit'):
+		libDirList.append('../../Third_Party/lib/linux64/')
+		libDir = '../../Third_Party/lib/linux64/'
+		
+	else:
+		libDirList.append('../../Third_Party/lib/linux32/')
+		libDir = '../../Third_Party/lib/linux32/'
+	
+	for file in os.listdir(libDir):
+		if file.endswith('.so'):
+			if (not file.endswith('d.so')):
+				libList.append(file.replace('.so','')[3:])
+			else:
+				if file.endswith('.a'):
+					libList.append(file.replace('.a','').replace('lib','',1))
+		
+normPath = []
+
+for dir in libDirList:
+	normPath.append(os.path.abspath(dir))
+	
+#GET LIST OF CPPS
+codeFolder = 'src'
+listCpps = []
+
+files = os.listdir(codeFolder)
+for file in files:
+	if file.endswith('.cpp'):
+		listCpps.append(codeFolder + '/' +  file)
+			
+# set header include paths
+env = Environment(CPPPATH=cppPaths)
+env.Append( CCFLAGS = cflags)
+
+#BUILD CODE
+env.SharedLibrary('lib/MantidKernel', listCpps, LIBS=libList, LIBPATH=normPath)
-- 
GitLab