from samba_deps import *
from samba_bundled import *
from samba_third_party import *
+import samba_cross
import samba_install
import samba_conftests
import samba_abi
def generate_empty_file(task):
- target_fname = installed_location=task.outputs[0].bldpath(task.env)
- target_file = open(installed_location, 'w')
- target_file.close()
+ task.outputs[0].write('')
return 0
#################################################################
bundled_extension, private_library)
ldflags = TO_LIST(ldflags)
+ if bld.env['ENABLE_RELRO'] is True:
+ ldflags.extend(TO_LIST('-Wl,-z,relro,-z,now'))
- features = 'cc cshlib symlink_lib install_lib'
+ features = 'c cshlib symlink_lib install_lib'
if pyext:
features += ' pyext'
if pyembed:
if abi_directory:
features += ' abi_check'
+ if pyembed and bld.env['PYTHON_SO_ABI_FLAG']:
+ # For ABI checking, we don't care about the exact Python version.
+ # Replace the Python ABI tag (e.g. ".cpython-35m") by a generic ".py3"
+ abi_flag = bld.env['PYTHON_SO_ABI_FLAG']
+ replacement = '.py%s' % bld.env['PYTHON_VERSION'].split('.')[0]
+ version_libname = libname.replace(abi_flag, replacement)
+ else:
+ version_libname = libname
+
vscript = None
if bld.env.HAVE_LD_VERSION_SCRIPT:
if private_library:
version = None
if version:
vscript = "%s.vscript" % libname
- bld.ABI_VSCRIPT(libname, abi_directory, version, vscript,
+ bld.ABI_VSCRIPT(version_libname, abi_directory, version, vscript,
abi_match)
fullname = apply_pattern(bundled_name, bld.env.shlib_PATTERN)
fullpath = bld.path.find_or_declare(fullname)
if not vscriptpath:
raise Utils.WafError("unable to find vscript path for %s" % vscript)
bld.add_manual_dependency(fullpath, vscriptpath)
- if Options.is_install:
+ if bld.is_install:
# also make the .inst file depend on the vscript
instname = apply_pattern(bundled_name + '.inst', bld.env.shlib_PATTERN)
bld.add_manual_dependency(bld.path.find_or_declare(instname), bld.path.find_or_declare(vscript))
samba_deps = deps,
samba_includes = includes,
version_script = vscript,
+ version_libname = version_libname,
local_include = local_include,
global_include = global_include,
vnum = vnum,
if not SET_TARGET_TYPE(bld, binname, 'BINARY'):
return
- features = 'cc cprogram symlink_bin install_bin'
+ features = 'c cprogram symlink_bin install_bin'
if pyembed:
features += ' pyembed'
bld.SET_BUILD_GROUP(group)
- features = 'cc'
+ features = 'c'
if pyext:
features += ' pyext'
if pyembed:
-@runonce
+@Utils.run_once
def SETUP_BUILD_GROUPS(bld):
'''setup build groups used to ensure that the different build
phases happen consecutively'''