Example #1
0
def _check_fortran_runtime_flags(conf):
    if not conf.env.has_key(FC_VERBOSE_FLAG):
        raise ValueError("""\
You need to call check_fortran_verbose_flag before getting runtime
flags (or to define the %s variable)""" % FC_VERBOSE_FLAG)
    code = """\
       program main
       end
"""

    conf.start_message("Checking for fortran runtime flags")

    old = copy.deepcopy(conf.env["F77_LINKFLAGS"])
    try:
        conf.env["F77_LINKFLAGS"].append(conf.env["FC_VERBOSE_FLAG"])
        ret = conf.builders["fortran"].try_program("check_fc", code)
        if ret:
            stdout = conf.get_stdout(conf.last_task)
            flags = parse_flink(stdout)
            conf.end_message("%r" % " ".join(flags))
            conf.env[FC_RUNTIME_LDFLAGS] = flags
            return True
        else:
            conf.end_message("failed !")
            return False
    finally:
        conf.env["F77_LINKFLAGS"] = old
    return False
def _check_fortran_runtime_flags(conf):
    if not FC_VERBOSE_FLAG in conf.env:
        raise ValueError("""\
You need to call check_fortran_verbose_flag before getting runtime
flags (or to define the %s variable)""" % FC_VERBOSE_FLAG)
    code = """\
       program main
       end
"""

    conf.start_message("Checking for fortran runtime flags")

    old = copy.deepcopy(conf.env["F77_LINKFLAGS"])
    try:
        conf.env["F77_LINKFLAGS"].append(conf.env["FC_VERBOSE_FLAG"])
        ret = conf.builders["fortran"].try_program("check_fc", code)
        if ret:
            stdout = conf.get_stdout(conf.last_task)
            flags = parse_flink(stdout)
            conf.end_message("%r" % " ".join(flags))
            conf.env[FC_RUNTIME_LDFLAGS] = flags
            return True
        else:
            conf.end_message("failed !")
            return False
    finally:
        conf.env["F77_LINKFLAGS"] = old
    return False