aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-06-16 18:12:02 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-06-16 18:12:02 -0700
commit045eaebb7211eff633df80b5d44126ffbc260772 (patch)
tree2e1c5fb78eecea1b7c4deb6cef80979296a7c635
parent8a24a2e36b6e485a87f6f6c787a7d54484012b6b (diff)
move suffix tools to shared
-rwxr-xr-xemcc11
-rw-r--r--tools/shared.py9
2 files changed, 10 insertions, 10 deletions
diff --git a/emcc b/emcc
index 92d52e15..7b1f9f98 100755
--- a/emcc
+++ b/emcc
@@ -77,7 +77,7 @@ emcc can be influenced by a few environment variables:
import os, sys, shutil, tempfile, subprocess, shlex
from subprocess import PIPE, STDOUT
from tools import shared
-from tools.shared import Compression, execute
+from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename
# Mapping of emcc opt levels to llvm opt levels. We use llvm opt level 3 in emcc opt
# levels 2 and 3 (emcc 3 is unsafe opts, so unsuitable for the only level to get
@@ -335,15 +335,6 @@ STATICLIB_SUFFIXES = ('.a',)
ASSEMBLY_SUFFIXES = ('.ll',)
LIB_PREFIXES = ('', 'lib')
-def suffix(name):
- return name.split('.')[-1]
-
-def unsuffixed(name):
- return '.'.join(name.split('.')[:-1])
-
-def unsuffixed_basename(name):
- return os.path.basename(unsuffixed(name))
-
seen_names = {}
def unsuffixed_uniquename(name):
ret = unsuffixed_basename(name)
diff --git a/tools/shared.py b/tools/shared.py
index f76aa7f2..f431318b 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -959,3 +959,12 @@ def execute(cmd, *args, **kw):
print >> sys.stderr, 'Invoking Process failed: <<< ' + cmd + ' >>>'
raise
+def suffix(name):
+ return name.split('.')[-1]
+
+def unsuffixed(name):
+ return '.'.join(name.split('.')[:-1])
+
+def unsuffixed_basename(name):
+ return os.path.basename(unsuffixed(name))
+