scons: only attach uninstall actions if actually uninstalling - #311

This commit is contained in:
Dane Springmeyer 2010-07-18 21:26:50 +00:00
parent a4872eb522
commit 51a791eb77
2 changed files with 20 additions and 16 deletions

View file

@ -63,21 +63,22 @@ def call(cmd, silent=False):
# http://www.scons.org/wiki/InstallTargets # http://www.scons.org/wiki/InstallTargets
def create_uninstall_target(env, path, is_glob=False): def create_uninstall_target(env, path, is_glob=False):
if is_glob: if 'uninstall' in COMMAND_LINE_TARGETS:
all_files = Glob(path,strings=True) if is_glob:
for filei in all_files: all_files = Glob(path,strings=True)
env.Command( "uninstall-"+filei, filei, for filei in all_files:
[ env.Command( "uninstall-"+filei, filei,
Delete("$SOURCE"), [
]) Delete("$SOURCE"),
env.Alias("uninstall", "uninstall-"+filei) ])
else: env.Alias("uninstall", "uninstall-"+filei)
if os.path.exists(path): else:
env.Command( "uninstall-"+path, path, if os.path.exists(path):
[ env.Command( "uninstall-"+path, path,
Delete("$SOURCE"), [
]) Delete("$SOURCE"),
env.Alias("uninstall", "uninstall-"+path) ])
env.Alias("uninstall", "uninstall-"+path)
def shortest_name(libs): def shortest_name(libs):
name = '-'*200 name = '-'*200
@ -337,6 +338,7 @@ pickle_store = [# Scons internal variables
# Mapnik's SConstruct build variables # Mapnik's SConstruct build variables
'PLUGINS', 'PLUGINS',
'ABI_VERSION', 'ABI_VERSION',
'MAPNIK_VERSION_STRING',
'PLATFORM', 'PLATFORM',
'BOOST_ABI', 'BOOST_ABI',
'BOOST_APPEND', 'BOOST_APPEND',
@ -1001,6 +1003,7 @@ if not preconfigured:
env['ABI_VERSION'] = abi_fallback env['ABI_VERSION'] = abi_fallback
else: else:
env['ABI_VERSION'] = abi env['ABI_VERSION'] = abi
env['MAPNIK_VERSION_STRING'] = '.'.join(['%d' % i for i in env['ABI_VERSION']])
# Common C++ flags. # Common C++ flags.

View file

@ -72,7 +72,8 @@ if env['PLATFORM'] == 'Darwin':
else: else:
lib_path = mapnik_libname lib_path = mapnik_libname
linkflags = '-Wl,-install_name,%s' % lib_path linkflags = '-Wl,-install_name,%s' % lib_path
linkflags += ' -current_version 0.8.0 -compatibility_version 0.8.0' _d = {'version':env['MAPNIK_VERSION_STRING']}
linkflags += ' -current_version %(version)s -compatibility_version %(version)s' % _d
elif env['PLATFORM'] == 'SunOS' and env['CXX'].startswith('CC'): elif env['PLATFORM'] == 'SunOS' and env['CXX'].startswith('CC'):
linkflags = '-R. -h %s' % mapnik_libname linkflags = '-R. -h %s' % mapnik_libname
else: # Linux and others else: # Linux and others