Imported Upstream version 0.9.25

parent 5e1dd8c5
_tevent_add_fd: struct tevent_fd *(struct tevent_context *, TALLOC_CTX *, int, uint16_t, tevent_fd_handler_t, void *, const char *, const char *)
_tevent_add_signal: struct tevent_signal *(struct tevent_context *, TALLOC_CTX *, int, int, tevent_signal_handler_t, void *, const char *, const char *)
_tevent_add_timer: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
_tevent_create_immediate: struct tevent_immediate *(TALLOC_CTX *, const char *)
_tevent_loop_once: int (struct tevent_context *, const char *)
_tevent_loop_until: int (struct tevent_context *, bool (*)(void *), void *, const char *)
_tevent_loop_wait: int (struct tevent_context *, const char *)
_tevent_queue_create: struct tevent_queue *(TALLOC_CTX *, const char *, const char *)
_tevent_req_callback_data: void *(struct tevent_req *)
_tevent_req_cancel: bool (struct tevent_req *, const char *)
_tevent_req_create: struct tevent_req *(TALLOC_CTX *, void *, size_t, const char *, const char *)
_tevent_req_data: void *(struct tevent_req *)
_tevent_req_done: void (struct tevent_req *, const char *)
_tevent_req_error: bool (struct tevent_req *, uint64_t, const char *)
_tevent_req_nomem: bool (const void *, struct tevent_req *, const char *)
_tevent_req_notify_callback: void (struct tevent_req *, const char *)
_tevent_req_oom: void (struct tevent_req *, const char *)
_tevent_schedule_immediate: void (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *)
tevent_backend_list: const char **(TALLOC_CTX *)
tevent_cleanup_pending_signal_handlers: void (struct tevent_signal *)
tevent_common_add_fd: struct tevent_fd *(struct tevent_context *, TALLOC_CTX *, int, uint16_t, tevent_fd_handler_t, void *, const char *, const char *)
tevent_common_add_signal: struct tevent_signal *(struct tevent_context *, TALLOC_CTX *, int, int, tevent_signal_handler_t, void *, const char *, const char *)
tevent_common_add_timer: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
tevent_common_add_timer_v2: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
tevent_common_check_signal: int (struct tevent_context *)
tevent_common_context_destructor: int (struct tevent_context *)
tevent_common_fd_destructor: int (struct tevent_fd *)
tevent_common_fd_get_flags: uint16_t (struct tevent_fd *)
tevent_common_fd_set_close_fn: void (struct tevent_fd *, tevent_fd_close_fn_t)
tevent_common_fd_set_flags: void (struct tevent_fd *, uint16_t)
tevent_common_loop_immediate: bool (struct tevent_context *)
tevent_common_loop_timer_delay: struct timeval (struct tevent_context *)
tevent_common_loop_wait: int (struct tevent_context *, const char *)
tevent_common_schedule_immediate: void (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *)
tevent_context_init: struct tevent_context *(TALLOC_CTX *)
tevent_context_init_byname: struct tevent_context *(TALLOC_CTX *, const char *)
tevent_context_init_ops: struct tevent_context *(TALLOC_CTX *, const struct tevent_ops *, void *)
tevent_debug: void (struct tevent_context *, enum tevent_debug_level, const char *, ...)
tevent_fd_get_flags: uint16_t (struct tevent_fd *)
tevent_fd_set_auto_close: void (struct tevent_fd *)
tevent_fd_set_close_fn: void (struct tevent_fd *, tevent_fd_close_fn_t)
tevent_fd_set_flags: void (struct tevent_fd *, uint16_t)
tevent_get_trace_callback: void (struct tevent_context *, tevent_trace_callback_t *, void *)
tevent_loop_allow_nesting: void (struct tevent_context *)
tevent_loop_set_nesting_hook: void (struct tevent_context *, tevent_nesting_hook, void *)
tevent_num_signals: size_t (void)
tevent_queue_add: bool (struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_add_entry: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_add_optimize_empty: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_length: size_t (struct tevent_queue *)
tevent_queue_running: bool (struct tevent_queue *)
tevent_queue_start: void (struct tevent_queue *)
tevent_queue_stop: void (struct tevent_queue *)
tevent_queue_wait_recv: bool (struct tevent_req *)
tevent_queue_wait_send: struct tevent_req *(TALLOC_CTX *, struct tevent_context *, struct tevent_queue *)
tevent_re_initialise: int (struct tevent_context *)
tevent_register_backend: bool (const char *, const struct tevent_ops *)
tevent_req_default_print: char *(struct tevent_req *, TALLOC_CTX *)
tevent_req_defer_callback: void (struct tevent_req *, struct tevent_context *)
tevent_req_is_error: bool (struct tevent_req *, enum tevent_req_state *, uint64_t *)
tevent_req_is_in_progress: bool (struct tevent_req *)
tevent_req_poll: bool (struct tevent_req *, struct tevent_context *)
tevent_req_post: struct tevent_req *(struct tevent_req *, struct tevent_context *)
tevent_req_print: char *(TALLOC_CTX *, struct tevent_req *)
tevent_req_received: void (struct tevent_req *)
tevent_req_set_callback: void (struct tevent_req *, tevent_req_fn, void *)
tevent_req_set_cancel_fn: void (struct tevent_req *, tevent_req_cancel_fn)
tevent_req_set_cleanup_fn: void (struct tevent_req *, tevent_req_cleanup_fn)
tevent_req_set_endtime: bool (struct tevent_req *, struct tevent_context *, struct timeval)
tevent_req_set_print_fn: void (struct tevent_req *, tevent_req_print_fn)
tevent_sa_info_queue_count: size_t (void)
tevent_set_abort_fn: void (void (*)(const char *))
tevent_set_debug: int (struct tevent_context *, void (*)(void *, enum tevent_debug_level, const char *, va_list), void *)
tevent_set_debug_stderr: int (struct tevent_context *)
tevent_set_default_backend: void (const char *)
tevent_set_trace_callback: void (struct tevent_context *, tevent_trace_callback_t, void *)
tevent_signal_support: bool (struct tevent_context *)
tevent_timeval_add: struct timeval (const struct timeval *, uint32_t, uint32_t)
tevent_timeval_compare: int (const struct timeval *, const struct timeval *)
tevent_timeval_current: struct timeval (void)
tevent_timeval_current_ofs: struct timeval (uint32_t, uint32_t)
tevent_timeval_is_zero: bool (const struct timeval *)
tevent_timeval_set: struct timeval (uint32_t, uint32_t)
tevent_timeval_until: struct timeval (const struct timeval *, const struct timeval *)
tevent_timeval_zero: struct timeval (void)
tevent_trace_point_callback: void (struct tevent_context *, enum tevent_trace_point)
tevent_wakeup_recv: bool (struct tevent_req *)
tevent_wakeup_send: struct tevent_req *(TALLOC_CTX *, struct tevent_context *, struct timeval)
......@@ -22,8 +22,10 @@
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
import signal
from unittest import TestCase, TestProgram
import gc
import _tevent
from unittest import TestCase
class BackendListTests(TestCase):
......@@ -60,3 +62,51 @@ class ContextTests(TestCase):
def test_add_signal(self):
sig = self.ctx.add_signal(signal.SIGINT, 0, lambda callback: None)
self.assertTrue(isinstance(sig, _tevent.Signal))
def test_timer(self):
"""Test a timer is can be scheduled"""
collecting_list = []
# time "0" has already passed, callback will be scheduled immediately
timer = self.ctx.add_timer(0, lambda t: collecting_list.append(True))
self.assertTrue(timer.active)
self.assertEqual(collecting_list, [])
self.ctx.loop_once()
self.assertFalse(timer.active)
self.assertEqual(collecting_list, [True])
def test_timer_deallocate_timer(self):
"""Test timer is scheduled even if reference to it isn't held"""
collecting_list = []
def callback(t):
collecting_list.append(True)
timer = self.ctx.add_timer(0, lambda t: collecting_list.append(True))
gc.collect()
self.assertEqual(collecting_list, [])
self.ctx.loop_once()
self.assertEqual(collecting_list, [True])
def test_timer_deallocate_context(self):
"""Test timer is unscheduled when context is freed"""
collecting_list = []
def callback(t):
collecting_list.append(True)
timer = self.ctx.add_timer(0, lambda t: collecting_list.append(True))
self.assertTrue(timer.active)
del self.ctx
gc.collect()
self.assertEqual(collecting_list, [])
self.assertFalse(timer.active)
def test_timer_offset(self):
"""Test scheduling timer with an offset"""
collecting_list = []
self.ctx.add_timer_offset(0.2, lambda t: collecting_list.append(2))
self.ctx.add_timer_offset(0.1, lambda t: collecting_list.append(1))
self.assertEqual(collecting_list, [])
self.ctx.loop_once()
self.assertEqual(collecting_list, [1])
self.ctx.loop_once()
self.assertEqual(collecting_list, [1, 2])
if __name__ == '__main__':
TestProgram()
......@@ -63,7 +63,7 @@ def test(dir):
except OSError: pass
def find_lib():
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
return os.path.abspath(os.path.join(os.path.dirname(__file__), '../../third_party/waf'))
wafdir = find_lib()
w = join(wafdir, 'wafadmin')
......
#!/usr/bin/env python
#
# Sample run-on-target script
# This is a script that can be used as cross-execute parameter to samba
# configuration process, running the command on a remote target for which
# the cross-compiled configure test was compiled.
#
# To use:
# ./configure \
# --cross-compile \
# '--cross-execute=./buildtools/example/run_on_target.py --host=<host>'
#
# A more elaborate example:
# ./configure \
# --cross-compile \
# '--cross-execute=./buildtools/example/run_on_target.py --host=<host> --user=<user> "--ssh=ssh -i <some key file>" --destdir=/path/to/dir'
#
# Typically this is to be used also with --cross-answers, so that the
# cross answers file gets built and further builds can be made without
# the help of a remote target.
#
# The following assumptions are made:
# 1. rsync is available on build machine and target machine
# 2. A running ssh service on target machine with password-less shell login
# 3. A directory writable by the password-less login user
# 4. The tests on the target can run and provide reliable results
# from the login account's home directory. This is significant
# for example in locking tests which
# create files in the current directory. As a workaround to this
# assumption, the TESTDIR environment variable can be set on the target
# (using ssh command line or server config) and the tests shall
# chdir to that directory.
#
import sys
import os
import subprocess
from optparse import OptionParser
# those are defaults, but can be overidden using command line
SSH = 'ssh'
USER = None
HOST = 'localhost'
def xfer_files(ssh, srcdir, host, user, targ_destdir):
"""Transfer executable files to target
Use rsync to copy the directory containing program to run
INTO a destination directory on the target. An exact copy
of the source directory is created on the target machine,
possibly deleting files on the target machine which do not
exist on the source directory.
The idea is that the test may include files in addition to
the compiled binary, and all of those files reside alongside
the binary in a source directory.
For example, if the test to run is /foo/bar/test and the
destination directory on the target is /tbaz, then /tbaz/bar
on the target shall be an exact copy of /foo/bar on the source,
including deletion of files inside /tbaz/bar which do not exist
on the source.
"""
userhost = host
if user:
userhost = '%s@%s' % (user, host)
cmd = 'rsync --verbose -rl --ignore-times --delete -e "%s" %s %s:%s/' % \
(ssh, srcdir, userhost, targ_destdir)
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(out, err) = p.communicate()
if p.returncode != 0:
raise Exception('failed syncing files\n stdout:\n%s\nstderr:%s\n'
% (out, err))
def exec_remote(ssh, host, user, destdir, targdir, prog, args):
"""Run a test on the target
Using password-less ssh, run the compiled binary on the target.
An assumption is that there's no need to cd into the target dir,
same as there's no need to do it on a native build.
"""
userhost = host
if user:
userhost = '%s@%s' % (user, host)
cmd = '%s %s %s/%s/%s' % (ssh, userhost, destdir, targdir, prog)
if args:
cmd = cmd + ' ' + ' '.join(args)
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(out, err) = p.communicate()
return (p.returncode, out)
def main(argv):
usage = "usage: %prog [options] <prog> [args]"
parser = OptionParser(usage)
parser.add_option('--ssh', help="SSH client and additional flags",
default=SSH)
parser.add_option('--host', help="target host name or IP address",
default=HOST)
parser.add_option('--user', help="login user on target",
default=USER)
parser.add_option('--destdir', help="work directory on target",
default='~')
(options, args) = parser.parse_args(argv)
if len(args) < 1:
parser.error("please supply test program to run")
progpath = args[0]
# assume that a test that was not compiled fails (e.g. getconf)
if progpath[0] != '/':
return (1, "")
progdir = os.path.dirname(progpath)
prog = os.path.basename(progpath)
targ_progdir = os.path.basename(progdir)
xfer_files(
options.ssh,
progdir,
options.host,
options.user,
options.destdir)
(rc, out) = exec_remote(options.ssh,
options.host,
options.user,
options.destdir,
targ_progdir,
prog, args[1:])
return (rc, out)
if __name__ == '__main__':
(rc, out) = main(sys.argv[1:])
sys.stdout.write(out)
sys.exit(rc)
#!/bin/sh
# Update our copy of waf
TARGETDIR="`dirname $0`"
WORKDIR="`mktemp -d -t update-waf-XXXXXX`"
mkdir -p "$WORKDIR"
git clone https://code.google.com/p/waf.waf15/ "$WORKDIR"
rsync -C -avz --delete "$WORKDIR/wafadmin/" "$TARGETDIR/wafadmin/"
rm -rf "$WORKDIR"
......@@ -62,7 +62,7 @@ def s3_fix_kwargs(bld, kwargs):
s3reldir = os_path_relpath(s3dir, bld.curdir)
# the extra_includes list is relative to the source3 directory
extra_includes = [ '.', 'include', 'lib', '../lib/tdb_compat' ]
extra_includes = [ '.', 'include', 'lib' ]
# local heimdal paths only included when USING_SYSTEM_KRB5 is not set
if not bld.CONFIG_SET("USING_SYSTEM_KRB5"):
extra_includes += [ '../source4/heimdal/lib/com_err',
......
......@@ -846,3 +846,7 @@ def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
if not sys.platform.startswith("openbsd") and conf.env.undefined_ignore_ldflags == []:
if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']):
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
@conf
def CHECK_CFG(self, *k, **kw):
return self.check_cfg(*k, **kw)
......@@ -13,7 +13,7 @@ def SAMBA_AUTOPROTO(bld, header, source):
name = name,
source = source,
target = header,
on_results=True,
update_outputs=True,
ext_out='.c',
before ='cc',
rule = '${PERL} "${SCRIPT}/mkproto.pl" --srcdir=.. --builddir=. --public=/dev/null --private="${TGT}" ${SRC}'
......
......@@ -565,7 +565,6 @@ def samba_config_c_parse_flags(line1, uselib, env):
# bugs in the real parse_flags() function.
#
if x == '-Wl,-rpath' or x == '-Wl,-R':
linkflags.remove(x)
x = lst1.pop(0)
if x.startswith('-Wl,'):
rpath = x[4:]
......
......@@ -2,11 +2,12 @@
import Utils, Logs, sys, os, Options, re
from Configure import conf
import shlex
real_Popen = None
ANSWER_UNKNOWN = (254, "")
ANSWER_FAIL = (255, "")
ANSWER_NO = (1, "")
ANSWER_OK = (0, "")
cross_answers_incomplete = False
......@@ -19,15 +20,27 @@ def add_answer(ca_file, msg, answer):
except:
Logs.error("Unable to open cross-answers file %s" % ca_file)
sys.exit(1)
(retcode, retstring) = answer
# if retstring is more than one line then we probably
# don't care about its actual content (the tests should
# yield one-line output in order to comply with the cross-answer
# format)
retstring = retstring.strip()
if len(retstring.split('\n')) > 1:
retstring = ''
answer = (retcode, retstring)
if answer == ANSWER_OK:
f.write('%s: OK\n' % msg)
elif answer == ANSWER_UNKNOWN:
f.write('%s: UNKNOWN\n' % msg)
elif answer == ANSWER_FAIL:
f.write('%s: FAIL\n' % msg)
elif answer == ANSWER_NO:
f.write('%s: NO\n' % msg)
else:
(retcode, retstring) = answer
f.write('%s: (%d, "%s")' % (msg, retcode, retstring))
if retcode == 0:
f.write('%s: "%s"\n' % (msg, retstring))
else:
f.write('%s: (%d, "%s")\n' % (msg, retcode, retstring))
f.close()
......@@ -36,14 +49,13 @@ def cross_answer(ca_file, msg):
try:
f = open(ca_file, 'r')
except:
add_answer(ca_file, msg, ANSWER_UNKNOWN)
return ANSWER_UNKNOWN
for line in f:
line = line.strip()
if line == '' or line[0] == '#':
continue
if line.find(':') != -1:
a = line.split(':')
a = line.split(':', 1)
thismsg = a[0].strip()
if thismsg != msg:
continue
......@@ -56,10 +68,12 @@ def cross_answer(ca_file, msg):
return ANSWER_UNKNOWN
elif ans == "FAIL" or ans == "NO":
f.close()
return ANSWER_FAIL
return ANSWER_NO
elif ans[0] == '"':
f.close()
return (0, ans.strip('"'))
elif ans[0] == "'":
f.close()
return (0, ans.strip("'"))
else:
m = re.match('\(\s*(-?\d+)\s*,\s*\"(.*)\"\s*\)', ans)
......@@ -69,7 +83,6 @@ def cross_answer(ca_file, msg):
else:
raise Utils.WafError("Bad answer format '%s' in %s" % (line, ca_file))
f.close()
add_answer(ca_file, msg, ANSWER_UNKNOWN)
return ANSWER_UNKNOWN
......@@ -77,24 +90,47 @@ class cross_Popen(Utils.pproc.Popen):
'''cross-compilation wrapper for Popen'''
def __init__(*k, **kw):
(obj, args) = k
if '--cross-execute' in args:
# when --cross-execute is set, then change the arguments
# to use the cross emulator
i = args.index('--cross-execute')
newargs = args[i+1].split()
newargs.extend(args[0:i])
args = newargs
elif '--cross-answers' in args:
use_answers = False
ans = ANSWER_UNKNOWN
# Three possibilities:
# 1. Only cross-answers - try the cross-answers file, and if
# there's no corresponding answer, add to the file and mark
# the configure process as unfinished.
# 2. Only cross-execute - get the answer from cross-execute
# 3. Both - try the cross-answers file, and if there is no
# corresponding answer - use cross-execute to get an answer,
# and add that answer to the file.
if '--cross-answers' in args:
# when --cross-answers is set, then change the arguments
# to use the cross answers if available
use_answers = True
i = args.index('--cross-answers')
ca_file = args[i+1]
msg = args[i+2]
ans = cross_answer(ca_file, msg)
if '--cross-execute' in args and ans == ANSWER_UNKNOWN:
# when --cross-execute is set, then change the arguments
# to use the cross emulator
i = args.index('--cross-execute')
newargs = shlex.split(args[i+1])
newargs.extend(args[0:i])
if use_answers:
p = real_Popen(newargs,
stdout=Utils.pproc.PIPE,
stderr=Utils.pproc.PIPE)
ce_out, ce_err = p.communicate()
ans = (p.returncode, ce_out)
add_answer(ca_file, msg, ans)
else:
args = newargs
if use_answers:
if ans == ANSWER_UNKNOWN:
global cross_answers_incomplete
cross_answers_incomplete = True
add_answer(ca_file, msg, ans)
(retcode, retstring) = ans
args = ['/bin/sh', '-c', "echo -n '%s'; exit %d" % (retstring, retcode)]
real_Popen.__init__(*(obj, args), **kw)
......@@ -115,7 +151,8 @@ def SAMBA_CROSS_ARGS(conf, msg=None):
if conf.env.CROSS_EXECUTE:
ret.extend(['--cross-execute', conf.env.CROSS_EXECUTE])
elif conf.env.CROSS_ANSWERS:
if conf.env.CROSS_ANSWERS:
if msg is None:
raise Utils.WafError("Cannot have NULL msg in cross-answers")
ret.extend(['--cross-answers', os.path.join(Options.launch_dir, conf.env.CROSS_ANSWERS), msg])
......
......@@ -86,12 +86,6 @@ def vcs_dir_contents(path):
env = dict(os.environ)
env["GIT_DIR"] = os.path.join(repo, ".git")
break
elif os.path.isdir(os.path.join(repo, ".bzr")):
ls_files_cmd = [ 'bzr', 'ls', '--recursive', '--versioned',
os_path_relpath(path, repo)]
cwd = repo
env = None
break
repo = os.path.dirname(repo)
if repo == "/":
raise Exception("unsupported or no vcs for %s" % path)
......
import os
import subprocess
def find_git(env=None):
"""Find the git binary."""
if env is not None and 'GIT' in env:
return env['GIT']
# Get version from GIT
if os.path.exists("/usr/bin/git"):
# this is useful when doing make dist without configuring
return "/usr/bin/git"
return None
def has_submodules(path):
"""Check whether a source directory is git-versioned and has submodules.
:param path: Path to Samba source directory
"""
return (os.path.isdir(os.path.join(path, ".git")) and
os.path.isfile(os.path.join(path, ".gitmodules")))
def read_submodule_status(path, env=None):
"""Check status of submodules.
:param path: Path to git directory
:param env: Optional waf environment
:return: Yields tuples with submodule relpath and status
(one of: 'out-of-date', 'not-checked-out', 'up-to-date')
:raise RuntimeError: raised when parsing of 'git submodule status' output
fails.
"""
if not has_submodules(path):
# No point in running git.
return
git = find_git(env)
if git is None:
return
p = subprocess.Popen([git, "submodule", "status"], stdout=subprocess.PIPE,
cwd=path)
(stdout, stderr) = p.communicate(None)
for l in stdout.splitlines():
l = l.rstrip()
status = l[0]
l = l[1:]
parts = l.split(" ")
if len(parts) > 2 and status in ("-", "+"):
yield (parts[1], "out-of-date")
elif len(parts) == 2 and status == "-":
yield (parts[1], "not-checked-out")
elif len(parts) > 2 and status == " ":
yield (parts[1], "up-to-date")
else:
raise RuntimeError("Unable to parse submodule status: %r, %r" % (status, parts))
......@@ -59,90 +59,97 @@ def install_library(self):
bld = self.bld
install_ldflags = install_rpath(self)
build_ldflags = build_rpath(bld)
if not Options.is_install or not getattr(self, 'samba_install', True):
# just need to set the build rpath if we are not installing
self.env.RPATH = build_ldflags
return
# setup the install path, expanding variables
install_path = getattr(self, 'samba_inst_path', None)
if install_path is None:
if getattr(self, 'private_library', False):
install_path = '${PRIVATELIBDIR}'
else:
install_path = '${LIBDIR}'
install_path = bld.EXPAND_VARIABLES(install_path)
target_name = self.target
if install_ldflags != build_ldflags:
# we will be creating a new target name, and using that for the
# install link. That stops us from overwriting the existing build
# target, which has different ldflags
self.done_install_library = True
t = self.clone('default')
t.posted = False
t.target += '.inst'
self.env.RPATH = build_ldflags
else:
t = self
t.env.RPATH = install_ldflags
default_env = bld.all_envs['default']
try:
if self.env['IS_EXTRA_PYTHON']:
bld.all_envs['default'] = bld.all_envs['extrapython']
dev_link = None
install_ldflags = install_rpath(self)
build_ldflags = build_rpath(bld)
# in the following the names are:
# - inst_name is the name with .inst. in it, in the build
# directory
# - install_name is the name in the install directory
# - install_link is a symlink in the install directory, to install_name
if not Options.is_install or not getattr(self, 'samba_install', True):
# just need to set the build rpath if we are not installing
self.env.RPATH = build_ldflags
return
if getattr(self, 'samba_realname', None):
install_name = self.samba_realname
install_link = None
if getattr(self, 'soname', ''):
install_link = self.soname
if getattr(self, 'samba_type', None) == 'PYTHON':
inst_name = bld.make_libname(t.target, nolibprefix=True, python=True)
# setup the install path, expanding variables
install_path = getattr(self, 'samba_inst_path', None)
if install_path is None:
if getattr(self, 'private_library', False):
install_path = '${PRIVATELIBDIR}'
else:
install_path = '${LIBDIR}'
install_path = bld.EXPAND_VARIABLES(install_path)
target_name = self.target
if install_ldflags != build_ldflags:
# we will be creating a new target name, and using that for the
# install link. That stops us from overwriting the existing build
# target, which has different ldflags
self.done_install_library = True
t = self.clone(self.env)
t.posted = False
t.target += '.inst'
self.env.RPATH = build_ldflags
else:
t = self
t.env.RPATH = install_ldflags
dev_link = None