Add an INTERNAL_LIBAGG build option that can be used to make mapnik

build against the system libagg instead of mapnik's copy.
This commit is contained in:
Tom Hughes 2008-07-29 18:35:27 +00:00
parent dd9435f50c
commit 6472af9289
2 changed files with 16 additions and 4 deletions

View file

@ -62,6 +62,7 @@ opts.Add(BoolOption('DEBUG', 'Compile a debug version of mapnik', 'False'))
opts.Add('DESTDIR', 'The root directory to install into. Useful mainly for binary package building', '/') opts.Add('DESTDIR', 'The root directory to install into. Useful mainly for binary package building', '/')
opts.Add(EnumOption('THREADING','Set threading support','multi', ['multi','single'])) opts.Add(EnumOption('THREADING','Set threading support','multi', ['multi','single']))
opts.Add(EnumOption('XMLPARSER','Set xml parser ','tinyxml', ['tinyxml','spirit','libxml2'])) opts.Add(EnumOption('XMLPARSER','Set xml parser ','tinyxml', ['tinyxml','spirit','libxml2']))
opts.Add(BoolOption('INTERNAL_LIBAGG', 'Use provided libagg', 'True'))
env = Environment(ENV=os.environ, options=opts) env = Environment(ENV=os.environ, options=opts)
@ -92,8 +93,8 @@ def uniq_add(env, key, val):
if not val in env[key]: env[key].append(val) if not val in env[key]: env[key].append(val)
# Libraries and headers dependency checks # Libraries and headers dependency checks
env['CPPPATH'] = ['#agg/include', '#tinyxml', '#include', '#'] env['CPPPATH'] = ['#tinyxml', '#include', '#']
env['LIBPATH'] = ['#agg', '#src'] env['LIBPATH'] = ['#src']
# Solaris & Sun Studio settings (the `SUNCC` flag will only be # Solaris & Sun Studio settings (the `SUNCC` flag will only be
# set if the `CXX` option begins with `CC`) # set if the `CXX` option begins with `CC`)
@ -116,6 +117,13 @@ if SUNCC:
if env['THREADING'] == 'multi': if env['THREADING'] == 'multi':
env['CXXFLAGS'] = ['-mt'] env['CXXFLAGS'] = ['-mt']
# Decide which libagg to use
if env['INTERNAL_LIBAGG']:
env.Prepend(CPPPATH = '#agg/include');
env.Prepend(LIBPATH = '#agg');
else:
env.ParseConfig('pkg-config --libs --cflags libagg')
# Adding the prerequisite library directories to the include path for # Adding the prerequisite library directories to the include path for
# compiling and the library path for linking, respectively. # compiling and the library path for linking, respectively.
for prereq in ('BOOST', 'PNG', 'JPEG', 'TIFF', 'PGSQL', 'PROJ', 'GDAL',): for prereq in ('BOOST', 'PNG', 'JPEG', 'TIFF', 'PGSQL', 'PROJ', 'GDAL',):
@ -197,6 +205,7 @@ bindings = [ binding.strip() for binding in Split(env['BINDINGS'])]
#### Build instructions & settings #### #### Build instructions & settings ####
# Build agg first, doesn't need anything special # Build agg first, doesn't need anything special
if env['INTERNAL_LIBAGG']:
SConscript('agg/SConscript') SConscript('agg/SConscript')
# Build the core library # Build the core library

View file

@ -30,7 +30,10 @@ ABI_VERSION=[0,5,0]
prefix = env['PREFIX'] prefix = env['PREFIX']
install_prefix = env['DESTDIR'] + '/' + prefix install_prefix = env['DESTDIR'] + '/' + prefix
libraries = ['agg'] + env['LIBS'] libraries = env['LIBS']
if env['INTERNAL_LIBAGG']:
libraries.insert(0, 'agg')
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('iconv') libraries.append('iconv')