|
|
|
@ -486,6 +486,12 @@ class Compiler(): |
|
|
|
|
def get_link_debugfile_args(self, rel_obj): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
|
def get_std_shared_lib_link_args(self): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
|
def get_std_shared_module_link_args(self): |
|
|
|
|
return self.get_std_shared_lib_link_args() |
|
|
|
|
|
|
|
|
|
class CCompiler(Compiler): |
|
|
|
|
def __init__(self, exelist, version, is_cross, exe_wrapper=None): |
|
|
|
|
# If a child ObjC or CPP class has already set it, don't set it ourselves |
|
|
|
@ -1178,9 +1184,6 @@ class MonoCompiler(Compiler): |
|
|
|
|
def get_include_args(self, path): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
|
def get_std_shared_lib_link_args(self): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
|
def get_pic_args(self): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
@ -1267,9 +1270,6 @@ class JavaCompiler(Compiler): |
|
|
|
|
def get_include_args(self, path): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
|
def get_std_shared_lib_link_args(self): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
|
def get_pic_args(self): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
@ -1962,7 +1962,7 @@ CLANG_OSX = 1 |
|
|
|
|
CLANG_WIN = 2 |
|
|
|
|
# Possibly clang-cl? |
|
|
|
|
|
|
|
|
|
def get_gcc_soname_args(gcc_type, prefix, shlib_name, suffix, path, soversion): |
|
|
|
|
def get_gcc_soname_args(gcc_type, prefix, shlib_name, suffix, path, soversion, is_shared_module): |
|
|
|
|
if soversion is None: |
|
|
|
|
sostr = '' |
|
|
|
|
else: |
|
|
|
@ -1972,6 +1972,8 @@ def get_gcc_soname_args(gcc_type, prefix, shlib_name, suffix, path, soversion): |
|
|
|
|
return ['-Wl,-soname,%s%s.%s%s' % (prefix, shlib_name, suffix, sostr)] |
|
|
|
|
return ['-Wl,-soname,%s%s' % (shlib_name, sostr)] |
|
|
|
|
elif gcc_type == GCC_OSX: |
|
|
|
|
if is_shared_module: |
|
|
|
|
return [] |
|
|
|
|
return ['-install_name', os.path.join(path, 'lib' + shlib_name + '.dylib')] |
|
|
|
|
else: |
|
|
|
|
raise RuntimeError('Not implemented yet.') |
|
|
|
@ -2007,7 +2009,7 @@ class GnuCompiler: |
|
|
|
|
|
|
|
|
|
def get_define(self, define): |
|
|
|
|
if define in self.defines: |
|
|
|
|
return defines[define] |
|
|
|
|
return self.defines[define] |
|
|
|
|
|
|
|
|
|
def get_pic_args(self): |
|
|
|
|
if self.gcc_type in (GCC_MINGW, GCC_OSX): |
|
|
|
@ -2029,8 +2031,13 @@ class GnuCompiler: |
|
|
|
|
def split_shlib_to_parts(self, fname): |
|
|
|
|
return (os.path.split(fname)[0], fname) |
|
|
|
|
|
|
|
|
|
def get_soname_args(self, prefix, shlib_name, suffix, path, soversion): |
|
|
|
|
return get_gcc_soname_args(self.gcc_type, prefix, shlib_name, suffix, path, soversion) |
|
|
|
|
def get_soname_args(self, prefix, shlib_name, suffix, path, soversion, is_shared_module): |
|
|
|
|
return get_gcc_soname_args(self.gcc_type, prefix, shlib_name, suffix, path, soversion, is_shared_module) |
|
|
|
|
|
|
|
|
|
def get_std_shared_lib_link_args(self): |
|
|
|
|
if self.gcc_type == GCC_OSX: |
|
|
|
|
return ['-bundle'] |
|
|
|
|
return ['-shared'] |
|
|
|
|
|
|
|
|
|
class GnuCCompiler(GnuCompiler, CCompiler): |
|
|
|
|
def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None): |
|
|
|
@ -2066,6 +2073,9 @@ class GnuCCompiler(GnuCompiler, CCompiler): |
|
|
|
|
return options['c_winlibs'].value[:] |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
|
def get_std_shared_lib_link_args(self): |
|
|
|
|
return ['-shared'] |
|
|
|
|
|
|
|
|
|
class GnuCPPCompiler(GnuCompiler, CPPCompiler): |
|
|
|
|
|
|
|
|
|
def __init__(self, exelist, version, gcc_type, is_cross, exe_wrap, defines): |
|
|
|
@ -2193,6 +2203,11 @@ class ClangCompiler(): |
|
|
|
|
extra_args.append('-Wl,-no_weak_imports') |
|
|
|
|
return super().has_function(funcname, prefix, env, extra_args, dependencies) |
|
|
|
|
|
|
|
|
|
def get_std_shared_module_link_args(self): |
|
|
|
|
if self.clang_type == CLANG_OSX: |
|
|
|
|
return ['-bundle'] |
|
|
|
|
return ['-shared'] |
|
|
|
|
|
|
|
|
|
class ClangCCompiler(ClangCompiler, CCompiler): |
|
|
|
|
def __init__(self, exelist, version, clang_type, is_cross, exe_wrapper=None): |
|
|
|
|
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) |
|
|
|
@ -2317,8 +2332,8 @@ end program prog |
|
|
|
|
def split_shlib_to_parts(self, fname): |
|
|
|
|
return (os.path.split(fname)[0], fname) |
|
|
|
|
|
|
|
|
|
def get_soname_args(self, prefix, shlib_name, suffix, path, soversion): |
|
|
|
|
return get_gcc_soname_args(self.gcc_type, prefix, shlib_name, suffix, path, soversion) |
|
|
|
|
def get_soname_args(self, prefix, shlib_name, suffix, path, soversion, is_shared_module): |
|
|
|
|
return get_gcc_soname_args(self.gcc_type, prefix, shlib_name, suffix, path, soversion, is_shared_module) |
|
|
|
|
|
|
|
|
|
def get_dependency_gen_args(self, outtarget, outfile): |
|
|
|
|
# Disabled until this is fixed: |
|
|
|
|