root/tags/release-0.2.1a/SConstruct

Revision 58, 3.0 kB (checked in by pavlenko, 4 years ago)

1.added copyright notice to SConstruct/SConscript files
2.fixed include/libs in datasources
3.revived shapeindex utility (+ boost::program_options)

Line 
1#  This file is part of Mapnik (c++ mapping toolkit)
2#  Copyright (C) 2005 Artem Pavlenko
3#
4#  Mapnik is free software; you can redistribute it and/or
5#  modify it under the terms of the GNU General Public License
6#  as published by the Free Software Foundation; either version 2
7#  of the License, or any later version.
8#
9#  This program is distributed in the hope that it will be useful,
10#  but WITHOUT ANY WARRANTY; without even the implied warranty of
11#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12#  GNU General Public License for more details.
13#
14#  You should have received a copy of the GNU General Public License
15#  along with this program; if not, write to the Free Software
16#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17#
18# $Id$
19
20import os
21
22#edit 'settings.py' to match your system settings
23opts = Options('settings.py')
24
25opts.Add('PREFIX', 'Set the install "prefix"', '/opt/mapnik')
26opts.Add(PathOption('BOOST_ROOT','boost source root directory','/opt/boost'))
27opts.Add(PathOption('AGG_ROOT','agg source root directory','/opt/agg23'))
28opts.Add(PathOption('FREETYPE2_ROOT','freetype2 root directory','/opt/freetype2'))
29opts.Add(PathOption('PYTHON_ROOT','python root directory','/opt/python'))
30opts.Add('PYTHON_VERSION','python version','2.4')
31opts.Add(ListOption('DATASOURCES','list of available datasources','postgis',['postgis','shape']))
32opts.Add('POSTGRESQL_ROOT','path to postgresql prefix','/usr/local')
33   
34platform = ARGUMENTS.get("OS",Platform())
35
36build_dir = 'build'
37build_prefix = build_dir+'/'+str(platform)
38
39cxx = 'g++'
40
41env = Environment(CXX=cxx,ENV=os.environ, options=opts)
42
43cxx_debug='-Wall -ftemplate-depth-100 -O0 -fno-inline -g -pthread -DDEBUG'
44cxx_release='-Wall -ftemplate-depth-100 -O2 -finline-functions -Wno-inline -pthread -DNDEBUG'
45
46release_env = env.Copy(CXXFLAGS = cxx_release)
47debug_env = env.Copy(CXXFLAGS = cxx_debug)
48
49if ARGUMENTS.get('debug',0):
50    env.Append(CXXFLAGS = cxx_debug)
51    build_prefix+='/debug'
52else:
53    env.Append(CXXFLAGS = cxx_release)
54    build_prefix+='/release'
55
56Help(opts.GenerateHelpText(env))
57
58conf = Configure(env)
59
60if not conf.CheckLibWithHeader('ltdl','ltdl.h','C'):
61    print 'Could not find libltdl/headers , exiting!'
62    Exit(1)
63
64if not conf.CheckLib('z'):
65    print 'Could not find libz , exiting!'
66    Exit(1)
67
68if not conf.CheckLibWithHeader('png','png.h','C'):
69    print 'Could not find libpng/headers, exiting!'
70    Exit(1)
71
72if not conf.CheckLib('jpeg'):
73    print 'Could not find jpeg lib, exiting!'
74    Exit(1)
75   
76env  = conf.Finish()
77
78Export('env')
79
80#build boost libs (filesystem, regex, python)
81env.SConscript('boost/SConscript')
82
83#build agg lib
84env.SConscript('agg/SConscript')
85
86#main lib
87SConscript('src/SConscript')
88
89#python ext
90SConscript('python/SConscript')
91
92#shapeindex
93SConscript('util/shapeindex/SConscript')
94
95#datasources
96for datasource in Split(env['DATASOURCES']):
97    env.BuildDir('build/datasources/'+datasource,'src/datasources/'+datasource,duplicate=0)
98    SConscript('datasources/'+datasource+'/SConscript')
99
100
Note: See TracBrowser for help on using the browser.