From f1cdf64cd5fa4271403286271ead511989ce15a1 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 13 Mar 2013 16:24:59 +0000 Subject: One 'arch' to rule them all Define a specific set of 4 architectures that Morph supports, and only expose that value to morphologies. Since GNU triplets are very common we also expose a GNU triplet. Other morphologies should work out their configuration based on MORPH_ARCH. This commit also removes the morphlib.util.arch() function, which detected the machine Morph is running on via 'uname -m'. Morph's architecture names do not necessarily map to the output of 'uname -m' so we should not rely on it anywhere. --- morphlib/util.py | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'morphlib/util.py') diff --git a/morphlib/util.py b/morphlib/util.py index c3a7ac9f..c77ac8d3 100644 --- a/morphlib/util.py +++ b/morphlib/util.py @@ -38,21 +38,6 @@ except NotImplementedError: # pragma: no cover import os -def arch(): - '''Return the CPU architecture of the current host.''' - return os.uname()[4] - - -def target(runcmd): # pragma: no cover - '''Returns the machine triplet of the current host''' - try: - target = runcmd(['cc', '-dumpmachine']).strip() - except cliapp.AppException as e: - raise morphlib.Error( - 'Failed to execute host compiler \'cc\': %s' % e) - return target - - def indent(string, spaces=4): '''Return ``string`` indented by ``spaces`` spaces. -- cgit v1.2.1