Changeset cf858877 in mainline for tools/autotool.py


Ignore:
Timestamp:
2012-01-26T08:51:45Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ea75ceb
Parents:
5c5f522 (diff), 7174403 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autotool.py

    r5c5f522 rcf858877  
    184184        sys.stderr.write("ok\n")
    185185
     186def check_app_alternatives(alts, args, name, details):
     187        "Check whether an application can be executed (use several alternatives)"
     188       
     189        tried = []
     190        found = None
     191       
     192        for alt in alts:
     193                working = True
     194                cmdline = [alt] + args
     195                tried.append(" ".join(cmdline))
     196               
     197                try:
     198                        sys.stderr.write("Checking for %s ... " % alt)
     199                        subprocess.Popen(cmdline, stdout = subprocess.PIPE, stderr = subprocess.PIPE).wait()
     200                except:
     201                        sys.stderr.write("failed\n")
     202                        working = False
     203               
     204                if (working):
     205                        sys.stderr.write("ok\n")
     206                        found = alt
     207                        break
     208       
     209        if (found is None):
     210                print_error(["%s is missing." % name,
     211                             "",
     212                             "Please make sure that it is installed in your",
     213                             "system (%s)." % details,
     214                             "",
     215                             "The following alternatives were tried:"] + tried)
     216       
     217        return found
     218
    186219def check_gcc(path, prefix, common, details):
    187220        "Check for GCC"
     
    459492       
    460493        for key, value in common.items():
    461                 outmk.write('%s = %s\n' % (key, value))
     494                if (type(value) is list):
     495                        outmk.write('%s = %s\n' % (key, " ".join(value)))
     496                else:
     497                        outmk.write('%s = %s\n' % (key, value))
    462498       
    463499        outmk.close()
     
    624660                # Platform-specific utilities
    625661                if ((config['BARCH'] == "amd64") or (config['BARCH'] == "ia32") or (config['BARCH'] == "ppc32") or (config['BARCH'] == "sparc64")):
    626                         check_app(["mkisofs", "--version"], "ISO 9660 creation utility", "usually part of genisoimage")
     662                        common['GENISOIMAGE'] = check_app_alternatives(["mkisofs", "genisoimage"], ["--version"], "ISO 9660 creation utility", "usually part of genisoimage")
    627663               
    628664                probe = probe_compiler(common,
Note: See TracChangeset for help on using the changeset viewer.