Example #1
0
def _applyInsideSource(env):
    # If ARCH is present and the NIDAS library source directories are
    # present, then build up the library nodes from the built targets.
    if not env.has_key('ARCH'):
        return False
    arch = env['ARCH']  # empty string for native builds

    if not os.path.exists(env.Dir('#/nidas/dynld').get_abspath()):
        return False

    libsyms = ['LIBNIDAS_UTIL','LIBNIDAS','LIBNIDAS_DYNLD']
    libmap = dict(zip(libsyms, libsyms))
    libpath = []
    for k in libmap.keys():
        if global_exports.has_key(k+arch):
            lib = global_exports[k+arch]
            libmap[k] = lib
            env[k] = lib
            libpath.append(lib.Dir(''))

    # Inside the  source tree, the build dir  paths have to come  first, to take
    # precedence over any  other library paths (ie OTHER_PREFIX)  added by other
    # tools or for third-party libraries.
    env.Prepend(LIBPATH = libpath)
    env.Tool("xercesc")
    env.Tool('xmlrpc')

    # Set LD_LIBRARY_PATH to the locally built libraries, for builders like
    # tests which want to run the nidas apps.  Also include nc_server_rpc,
    # in case it is not on the system path but NIDAS was built against it.
    ldlibdirs = [ l.Dir('').abspath for l in env.File(libmap.values()) ]
    env['ENV']['LD_LIBRARY_PATH'] = ":".join(ldlibdirs + ['/opt/nc_server/lib'])
    return True
Example #2
0
def _loadToolFile(env, name):
    # See if there's a file named "tool_<tool>.py" somewhere under the
    # top directory.  If we find one, load it as a SConscript which 
    # should define and export the tool.
    tool = None
    matchList = _findToolFile(env, name)
    # If we got a match, load it
    if (len(matchList) > 0):
        # If we got more than one match, complain...
        if (len(matchList) > 1):
            print("Warning: multiple tool files for " + name + ": " + 
                  str(matchList) + ", using the first one")
        # Load the first match
        toolScript = matchList[0]
        env.LogDebug("Loading %s to get tool %s..." % (toolScript, name))
        env.SConscript(toolScript)
        # After loading the script, make sure the tool appeared 
        # in the global exports list.
        if global_exports.has_key(name):
            tool = global_exports[name]
        else:
            raise SCons.Errors.StopError, "Tool error: " + \
                toolScript + " does not export symbol '" + name + "'"
    return tool
Example #3
0
toolname = 'qtt_colorbar'
from SCons.Script.SConscript import global_exports
if not global_exports.has_key(toolname):
    import SCons.Defaults
    SCons.Defaults.DefaultEnvironment().SConscript('#/ColorBar/tool_qtt_colorbar.py')

def generate(env):
    global_exports[toolname](env)
        
def exists(env):
    return True
Example #4
0
toolname = 'qtt_scopeplot'
from SCons.Script.SConscript import global_exports
if not global_exports.has_key(toolname):
    import SCons.Defaults
    SCons.Defaults.DefaultEnvironment().SConscript(
        '#/ScopePlot/tool_qtt_scopeplot.py')


def generate(env):
    global_exports[toolname](env)


def exists(env):
    return True