backport for #257, and r1984

This commit is contained in:
Dane Springmeyer 2010-07-14 01:02:01 +00:00
parent 28f0106126
commit f187cb7a12
2 changed files with 18 additions and 4 deletions

View file

@ -322,6 +322,7 @@ pickle_store = [# Scons internal variables
'PYTHON_SYS_PREFIX',
'COLOR_PRINT',
'HAS_BOOST_SYSTEM',
'SVN_REVISION'
]
# Add all other user configurable options to pickle pickle_store
@ -981,8 +982,7 @@ if not preconfigured:
if not svn_version == 'exported':
pattern = r'(\d+)(.*)'
try:
rev = re.match(pattern,svn_version).groups()[0]
common_cxx_flags += '-DSVN_REVISION=%s ' % rev
env['SVN_REVISION'] = re.match(pattern,svn_version).groups()[0]
except: pass
# Mac OSX (Darwin) special settings
@ -1073,7 +1073,13 @@ if not preconfigured:
env['PYTHON_INSTALL_LOCATION'] = env['DESTDIR'] + '/' + env['PYTHON_SITE_PACKAGES']
majver, minver = env['PYTHON_VERSION'].split('.')
# TODO - this needs to be moved up...
env.AppendUnique(CPPPATH = env['PYTHON_INCLUDES'])
if not conf.CheckHeader(header='Python.h',language='C'):
color_print(1,'Could not find required header files for the Python language (version %s)' % env['PYTHON_VERSION'])
env['MISSING_DEPS'].append('python %s development headers' % env['PYTHON_VERSION'])
if (int(majver), int(minver)) < (2, 2):
color_print(1,"Python version 2.2 or greater required")
Exit(1)

View file

@ -133,8 +133,16 @@ ogcserver_files = glob.glob('mapnik/ogcserver/*.py')
ogcserver_module = env.Install(env['PYTHON_INSTALL_LOCATION'] + '/mapnik/ogcserver', ogcserver_files)
env.Alias(target='install', source=ogcserver_module)
# install the shared object beside the module directory
sources = glob.glob('*.cpp')
if env.get('SVN_REVISION'):
sources.remove('mapnik_python.cpp')
env2 = env.Clone();
env2.Append(CCFLAGS='-DSVN_REVISION=%s' % env['SVN_REVISION'])
sources.insert(0,env2.Object('mapnik_python.cpp'))
# install the shared object beside the module directory
_mapnik = env.LoadableModule('mapnik/_mapnik', glob.glob('*.cpp'), LIBS=libraries, LDMODULEPREFIX='', LDMODULESUFFIX='.so', CPPPATH=headers,LINKFLAGS=linkflags)
_mapnik = env.LoadableModule('mapnik/_mapnik', sources, LIBS=libraries, LDMODULEPREFIX='', LDMODULESUFFIX='.so', CPPPATH=headers,LINKFLAGS=linkflags)
pymapniklib = env.Install(env['PYTHON_INSTALL_LOCATION'] + '/mapnik',_mapnik)
env.Alias(target='install',source=pymapniklib)