Example #1
0
 def run_flex(target, source, env):
     start_dir = os.getcwd()
     os.chdir(var_dir)
     res = scons.Execute('flex  ' + src_file, chdir=var_dir)
     if res != 0:
         scons.Exit(1)
     os.chdir(start_dir)
Example #2
0
 def run_lemon(target, source, env):
     """The targets, source, and environment are passed by scons but we
     can ignore them as we don't need them."""
     # Copy the .y file into the variant dir
     shutil.copy(src_path, var_dir)
     ret = scons.Execute('lemon ' + var_path)
     if ret != 0:
         scons.Exit(1)
     # now rename the .c file to a .cc file
     shutil.move(generated_c_path, desired_cc_path)
Example #3
0
def setDylibInternalPath(target, source, env):
    # Copy the library file
    srcName = str(source[0])
    tgtName = str(target[0])
    Script.Execute(Script.Copy(tgtName, srcName))
    # Then run install_name_tool
    cmd = "install_name_tool "
    cmd += "-id " + os.path.abspath(tgtName) + " "
    cmd += tgtName
    os.system(cmd)