import os import sys env = Environment() # Find the path for Python.h and then share it to other SConscripts later on # Where to find the Python.h if sys.platform == 'win32': #Windows python_include = os.path.join(sys.exec_prefix, 'include') # Windows installs need to be told the lib path and the python library name # else it won't work right. python_libdir = os.path.join(sys.exec_prefix, 'libs') try: env['LIBPATH'] = env['LIBPATH'] + [python_libdir] except KeyError: env['LIBPATH'] = [python_libdir] python_libname = 'python%d%d' % (sys.version_info[0], sys.version_info[1]) try: env['LIBS'] = env['LIBS'] + [python_libname] except KeyError: env['LIBS'] = [python_libname] else: python_include = os.path.join(os.path.join(sys.exec_prefix, 'include'), 'python' + sys.version[:3]) # Check existence of Python.h headerfile = python_include + os.sep + 'Python.h' try: open(headerfile, 'r') except: raise """Did not find Python header file %s. Make sure files for Python C-extensions are installed. In debian linux, for example, you need to install a package called something like python2.3-dev""" %headerfile try: env['CPPPATH'] = env['CPPPATH'] + [python_include] except KeyError: env['CPPPATH'] = [python_include] Export('env') # Build the inundation modules SConscript(['inundation/SConscript'])