waf: get rid of target aliases in wafsamba
authorAndrew Tridgell <tridge@samba.org>
Sat, 30 Oct 2010 03:33:06 +0000 (14:33 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sat, 30 Oct 2010 12:49:01 +0000 (23:49 +1100)
these aliases are no longer needed, and can cause a lot of confusion

buildtools/wafsamba/samba_deps.py
buildtools/wafsamba/wafsamba.py

index e11ea60f8e8f442d27391e66174cac89a3340bc2..0c9add2e06321fb86058e4403cc665be69d8a477 100644 (file)
@@ -19,16 +19,6 @@ def BREAK_CIRCULAR_LIBRARY_DEPENDENCIES(ctx):
     ctx.env.ALLOW_CIRCULAR_LIB_DEPENDENCIES = True
 
 
-def TARGET_ALIAS(bld, target, alias):
-    '''define an alias for a target name'''
-    cache = LOCAL_CACHE(bld, 'TARGET_ALIAS')
-    if alias in cache:
-        Logs.error("Target alias %s already set to %s : newalias %s" % (alias, cache[alias], target))
-        sys.exit(1)
-    cache[alias] = target
-Build.BuildContext.TARGET_ALIAS = TARGET_ALIAS
-
-
 @conf
 def SET_SYSLIB_DEPS(conf, target, deps):
     '''setup some implied dependencies for a SYSLIB'''
@@ -36,15 +26,6 @@ def SET_SYSLIB_DEPS(conf, target, deps):
     cache[target] = deps
 
 
-def EXPAND_ALIAS(bld, target):
-    '''expand a target name via an alias'''
-    aliases = LOCAL_CACHE(bld, 'TARGET_ALIAS')
-    if target in aliases:
-        return aliases[target]
-    return target
-Build.BuildContext.EXPAND_ALIAS = EXPAND_ALIAS
-
-
 def expand_subsystem_deps(bld):
     '''expand the reverse dependencies resulting from subsystem
        attributes of modules. This is walking over the complete list
@@ -52,12 +33,9 @@ def expand_subsystem_deps(bld):
        module<->subsystem dependencies'''
 
     subsystem_list = LOCAL_CACHE(bld, 'INIT_FUNCTIONS')
-    aliases    = LOCAL_CACHE(bld, 'TARGET_ALIAS')
     targets    = LOCAL_CACHE(bld, 'TARGET_TYPE')
 
     for subsystem_name in subsystem_list:
-        if subsystem_name in aliases:
-            subsystem_name = aliases[subsystem_name]
         bld.ASSERT(subsystem_name in targets, "Subsystem target %s not declared" % subsystem_name)
         type = targets[subsystem_name]
         if type == 'DISABLED' or type == 'EMPTY':
@@ -443,7 +421,6 @@ def build_direct_deps(bld, tgt_list):
         if getattr(t, 'samba_use_global_deps', False) and not t.sname in global_deps_exclude:
             deps.extend(global_deps)
         for d in deps:
-            d = EXPAND_ALIAS(bld, d)
             if d == t.sname: continue
             if not d in targets:
                 Logs.error("Unknown dependency '%s' in '%s'" % (d, t.sname))
@@ -947,7 +924,7 @@ savedeps_inputs  = ['samba_deps', 'samba_includes', 'local_include', 'local_incl
 savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes', 'ccflags', 'ldflags', 'samba_deps_extended']
 savedeps_outenv  = ['INC_PATHS']
 savedeps_envvars = ['NONSHARED_BINARIES', 'GLOBAL_DEPENDENCIES']
-savedeps_caches  = ['GLOBAL_DEPENDENCIES', 'TARGET_ALIAS', 'TARGET_TYPE', 'INIT_FUNCTIONS', 'SYSLIB_DEPS']
+savedeps_caches  = ['GLOBAL_DEPENDENCIES', 'TARGET_TYPE', 'INIT_FUNCTIONS', 'SYSLIB_DEPS']
 savedeps_files   = ['buildtools/wafsamba/samba_deps.py']
 
 def save_samba_deps(bld, tgt_list):
index e6d3ef0d5038377a5a170ec41423576661988e54..a9dfc4036cec7d5ca1c4a5640c7857f8697b6dc5 100644 (file)
@@ -324,12 +324,6 @@ def SAMBA_BINARY(bld, binname, source,
         samba_install  = install
         )
 
-    # setup the subsystem_name as an alias for the real
-    # binary name, so it can be found when expanding
-    # subsystem dependencies
-    if subsystem_name is not None:
-        bld.TARGET_ALIAS(subsystem_name, binname)
-
     if manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
         bld.MANPAGES(manpages)