diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-02-07 20:05:01 -0500 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-02-08 18:52:18 -0500 |
commit | fefc3d59b58e7952dac5a2e2182b659205029968 (patch) | |
tree | 0550073354393e46cad051195c4f60a6062bc755 | |
parent | 90dbe68b93020b3b8588753394e0e4014fa2b819 (diff) |
Preserve the extension of shared libraries as well
-rwxr-xr-x | emcc | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -239,7 +239,8 @@ if EMMAKEN_CFLAGS: CC_ADDITIONAL_ARGS += EMMAKEN_CFLAGS.split(' ') # ---------------- Utilities --------------- SOURCE_SUFFIXES = ('.c', '.cpp', '.cxx', '.cc') -BITCODE_SUFFIXES = ('.bc', '.o', '.dylib', '.so', '.dll') +BITCODE_SUFFIXES = ('.bc', '.o') +SHAREDLIB_SUFFIXES = ('.dylib', '.so', '.dll') ASSEMBLY_SUFFIXES = ('.ll',) def unsuffixed(name): @@ -377,7 +378,7 @@ try: for i in range(len(newargs)): # find input files XXX this a simple heuristic. we should really analyze based on a full understanding of gcc params, # right now we just assume that what is left contains no more |-x OPT| things arg = newargs[i] - if arg.endswith(SOURCE_SUFFIXES + BITCODE_SUFFIXES + ASSEMBLY_SUFFIXES) or shared.Building.is_ar(arg): # we already removed -o <target>, so all these should be inputs + if arg.endswith(SOURCE_SUFFIXES + BITCODE_SUFFIXES + SHAREDLIB_SUFFIXES + ASSEMBLY_SUFFIXES) or shared.Building.is_ar(arg): # we already removed -o <target>, so all these should be inputs newargs[i] = '' if os.path.exists(arg): if arg.endswith(SOURCE_SUFFIXES): @@ -445,8 +446,8 @@ try: temp_file = in_temp(unsuffixed_basename(input_file) + '.o') shutil.copyfile(input_file, temp_file) temp_files.append(temp_file) - elif shared.Building.is_ar(input_file): - if DEBUG: print >> sys.stderr, 'emcc: copying ar file: ', input_file + elif input_file.endswith(SHAREDLIB_SUFFIXES) or shared.Building.is_ar(input_file): + if DEBUG: print >> sys.stderr, 'emcc: copying library file: ', input_file temp_file = in_temp(os.path.basename(input_file)) shutil.copyfile(input_file, temp_file) temp_files.append(temp_file) |