source: SConstruct @ 3275

Last change on this file since 3275 was 3259, checked in by jack, 19 years ago

Preliminary SCons support for Win32.

File size: 1.5 KB
Line 
1import os
2import sys
3
4env = Environment()
5
6# Find the path for Python.h and then share it to other SConscripts later on
7# Where to find the Python.h
8if sys.platform == 'win32':  #Windows
9    python_include = os.path.join(sys.exec_prefix, 'include')
10    # Windows installs need to be told the lib path and the python library name
11    # else it won't work right.
12    python_libdir = os.path.join(sys.exec_prefix, 'libs')
13    try:
14        env['LIBPATH'] = env['LIBPATH'] + [python_libdir]
15    except KeyError:
16        env['LIBPATH'] = [python_libdir]
17    python_libname = 'python%d%d' % (sys.version_info[0], sys.version_info[1])
18    try:
19        env['LIBS'] = env['LIBS'] + [python_libname]
20    except KeyError:
21        env['LIBS'] = [python_libname]
22else:
23    python_include = os.path.join(os.path.join(sys.exec_prefix, 'include'),
24                                  'python' + sys.version[:3])
25   
26# Check existence of Python.h
27headerfile = python_include + os.sep + 'Python.h'
28try:
29    open(headerfile, 'r')
30except:
31    raise """Did not find Python header file %s.
32    Make sure files for Python C-extensions are installed.
33    In debian linux, for example, you need to install a
34    package called something like python2.3-dev""" %headerfile
35
36try:
37    env['CPPPATH'] = env['CPPPATH'] + [python_include]
38except KeyError:
39    env['CPPPATH'] = [python_include]
40
41Export('env')
42
43# Build the inundation modules
44SConscript(['inundation/SConscript'])
Note: See TracBrowser for help on using the repository browser.