def read_def_file(def_file):
    """Read variables defined in def file."""
    ret = {}
    f = open(def_file, 'r')
    for line_ in f:
        if line_.startswith("#"):
            continue
        line = line_.rstrip()
        if len(line) == 0:
            continue
        if "=" not in line:
            continue
        var_and_val = line.split("=")
        var = var_and_val[0]
        val = var_and_val[1].split()[0]
        ret[var] = val
    f.close()
    return ret