Changeset 3327 for SConstruct


Ignore:
Timestamp:
Jul 13, 2006, 1:51:34 PM (18 years ago)
Author:
jack
Message:

Improved Build Process under Windows:

MinGW tools should be favoured over MSVC tools.
CFLAGS variable in build_options.py split into MSVCFLAGS and GCCFLAGS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SConstruct

    r3283 r3327  
    44# Read in build options
    55opts = Options('build_options.py')
    6 opts.Add('CFLAGS', 'Flags passed to the C Compiler')
     6opts.Add('GCCFLAGS', 'Flags passed to GCC')
     7opts.Add('MSVCFLAGS', 'Flags passed to the MSVC compiler')
    78
    8 env = Environment(options = opts, CCFLAGS=['${CFLAGS}'])
     9env = Environment(options = opts)
     10
     11if env['CC'] == 'gcc':
     12    env.Append(CCFLAGS=['${GCCFLAGS}'])
     13elif env['CC'] == 'cl':
     14    env.Append(CCFLAGS=['${MSVCFLAGS}'])
    915
    1016Help(opts.GenerateHelpText(env))
     
    1420if sys.platform == 'win32':
    1521    # Prefer MinGW over MSVC
    16     env['TOOLS'] = 'mingw'
     22    envPrepend(TOOLS=['mingw'])
    1723
    1824    python_include = os.path.join(sys.exec_prefix, 'include')
     
    2026    # else it won't work right.
    2127    python_libdir = os.path.join(sys.exec_prefix, 'libs')
    22     try:
    23         env['LIBPATH'] += [python_libdir]
    24     except KeyError:
    25         env['LIBPATH'] = [python_libdir]
    26     python_libname = 'python%d%d' % (sys.version_info[0], sys.version_info[1])
    27     try:
    28         env['LIBS'] += [python_libname]
    29     except KeyError:
    30         env['LIBS'] = [python_libname]
     28    env.Append(LIBPATH=[python_libdir])
     29    python_libname = 'python%d%d' % (sys.version_info[0:2])
     30    env.Append(LIBS=[python_libname])
    3131else:
    3232    python_include = os.path.join(os.path.join(sys.exec_prefix, 'include'),
     
    4343    package called something like python2.3-dev""" %headerfile
    4444
    45 try:
    46     env['CPPPATH'] += [python_include]
    47 except KeyError:
    48     env['CPPPATH'] = [python_include]
     45env.Append(CPPPATH=[python_include])
    4946
    5047Export('env')
Note: See TracChangeset for help on using the changeset viewer.