root/trunk/bindings/python/SConscript @ 650

Revision 650, 2.7 kB (checked in by artem, 3 years ago)

added Unicode support based on ICU

Line 
1#
2# This file is part of Mapnik (c++ mapping toolkit)
3#
4# Copyright (C) 2006 Artem Pavlenko, Jean-Francois Doyon
5#
6# Mapnik is free software; you can redistribute it and/or
7# modify it under the terms of the GNU Lesser General Public
8# License as published by the Free Software Foundation; either
9# version 2.1 of the License, or (at your option) any later version.
10#
11# This library is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14# Lesser General Public License for more details.
15#
16# You should have received a copy of the GNU Lesser General Public
17# License along with this library; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19#
20# $Id$
21
22import glob
23import re
24import os
25
26Import('env')
27
28prefix = env['PYTHON_PREFIX'] + '/' + env['LIBDIR_SCHEMA'] + '/python' + env['PYTHON_VERSION'] + '/site-packages/'
29install_prefix = env['DESTDIR'] + '/' + prefix
30
31thread_suffix = '-mt'
32
33if env['PLATFORM'] == 'FreeBSD':
34    thread_suffix = ''
35
36linkflags = ''
37libraries = ['mapnik','png','jpeg']
38if env['THREADING'] == 'multi':
39    libraries.append('boost_python%s%s' % (env['BOOST_APPEND'],thread_suffix))
40else :
41    libraries.append('boost_python%s' % env['BOOST_APPEND'])
42
43if env['PLATFORM'] == 'Darwin':
44    libraries.append('icuuc')
45    libraries.append('icudata')
46    if env['THREADING'] == 'multi':
47        libraries.append('boost_regex%s%s' % (env['BOOST_APPEND'],thread_suffix))
48    else :
49        libraries.append('boost_regex%s' % env['BOOST_APPEND'])
50   
51    if env['THREADING'] == 'multi':
52        libraries.append('boost_thread%s%s' % (env['BOOST_APPEND'],thread_suffix))
53
54    linkflags = '-F/ -framework Python'
55
56headers = [env['PYTHON_PREFIX'] + '/include/python' + env['PYTHON_VERSION']] + env['CPPPATH']
57
58_mapnik = env.LoadableModule('_mapnik', glob.glob('*.cpp'), LIBS=libraries, LDMODULEPREFIX='', LDMODULESUFFIX='.so', CPPPATH=headers,LINKFLAGS=linkflags)
59
60paths = """
61mapniklibpath = '%s'
62inputpluginspath = mapniklibpath + '/input'
63fontscollectionpath = mapniklibpath + '/fonts'
64"""
65
66exp =  r"%s{2,}" % os.sep
67mapnik_plugins_dir  = re.sub(exp,os.sep, env['PREFIX'] + '/'+env['LIBDIR_SCHEMA']+'/mapnik')
68file('mapnik/paths.py','w').write(paths % (mapnik_plugins_dir,))
69
70pymapnik = glob.glob('mapnik/*.py')
71env.Alias(target='install', source=env.Install(install_prefix+'/mapnik', pymapnik))
72pymapnik2 = glob.glob('mapnik/ogcserver/*.py')
73env.Alias(target='install', source=env.Install(install_prefix+'/mapnik/ogcserver', pymapnik2))
74pymapniklib = env.Install(install_prefix+'/mapnik',_mapnik)
75env.Alias(target="install",source=pymapniklib)
Note: See TracBrowser for help on using the browser.