source: SConstruct @ 3339

Last change on this file since 3339 was 3328, checked in by jack, 19 years ago

Fixed a missing . in SConstruct

File size: 1.5 KB
Line 
1import os
2import sys
3
4# Read in build options
5opts = Options('build_options.py')
6opts.Add('GCCFLAGS', 'Flags passed to GCC')
7opts.Add('MSVCFLAGS', 'Flags passed to the MSVC compiler')
8
9env = Environment(options = opts)
10
11if env['CC'] == 'gcc':
12    env.Append(CCFLAGS=['${GCCFLAGS}'])
13elif env['CC'] == 'cl':
14    env.Append(CCFLAGS=['${MSVCFLAGS}'])
15
16Help(opts.GenerateHelpText(env))
17
18# Find the path for Python.h and then share it to other SConscripts later on
19# Where to find the Python.h
20if sys.platform == 'win32':
21    # Prefer MinGW over MSVC
22    env.Prepend(TOOLS=['mingw'])
23
24    python_include = os.path.join(sys.exec_prefix, 'include')
25    # Windows installs need to be told the lib path and the python library name
26    # else it won't work right.
27    python_libdir = os.path.join(sys.exec_prefix, 'libs')
28    env.Append(LIBPATH=[python_libdir])
29    python_libname = 'python%d%d' % (sys.version_info[0:2])
30    env.Append(LIBS=[python_libname])
31else:
32    python_include = os.path.join(os.path.join(sys.exec_prefix, 'include'),
33                                  'python' + sys.version[:3])
34   
35# Check existence of Python.h
36headerfile = python_include + os.sep + 'Python.h'
37try:
38    open(headerfile, 'r')
39except:
40    raise """Did not find Python header file %s.
41    Make sure files for Python C-extensions are installed.
42    In debian linux, for example, you need to install a
43    package called something like python2.3-dev""" %headerfile
44
45env.Append(CPPPATH=[python_include])
46
47Export('env')
48
49SConscript(['inundation/SConscript'])
Note: See TracBrowser for help on using the repository browser.