Ejemplo n.º 1
0
def _handle_py_bin(env, f, output_dir):
    opath=scp.get_output_path(env, f, output_dir)
    ipath=scp.get_input_path(env, f)
    top_line=open(ipath, "r").readline()
    if not top_line.startswith("#!"):
        raise RuntimeError("No magic number found. First line should be #!/usr/bin/python: "+ f.path)
    if opath!=ipath:
        ret=sci.install_in_build(env, ipath, opath)
    else:
        ret=f
    return ret[0]
Ejemplo n.º 2
0
def _handle_cpp_bin(env, f, output_dir):
    # strip suffix
    oname= scp.get_output_path(env, f, output_dir)[:-4]
    #print "binary", f.abspath, oname
    ret=env.Program(source=f, target=oname)
    return ret[0]