import samba_conftests
import samba_abi
import samba_headers
-import tru64cc
import generic_cc
import samba_dist
import samba_wildcard
import configure_file
import samba_waf18
-# some systems have broken threading in python
-if os.environ.get('WAF_NOTHREADS') == '1':
- import nothreads
-
LIB_PATH="shared"
os.environ['PYTHONUNBUFFERED'] = '1'
t.link_name = link_name
if pc_files is not None and not private_library:
- if pyembed and bld.env['IS_EXTRA_PYTHON']:
+ if pyembed:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum, extra_name=bld.env['PYTHON_SO_ABI_FLAG'])
else:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
-@conf
-def ENABLE_TIMESTAMP_DEPENDENCIES(conf):
- """use timestamps instead of file contents for deps
- this currently doesn't work"""
- def h_file(filename):
- import stat
- st = os.stat(filename)
- if stat.S_ISDIR(st[stat.ST_MODE]): raise IOError('not a file')
- m = Utils.md5()
- m.update(str(st.st_mtime))
- m.update(str(st.st_size))
- m.update(filename)
- return m.digest()
- Utils.h_file = h_file
-
-
def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None):
'''used to copy scripts from the source tree into the build directory
for use by selftest'''
replacement="""sys.path.insert(0, "%s")
sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], task.env["PYTHONDIR"])
- if task.env["PYTHON"][0] == "/":
- replacement_shebang = "#!%s\n" % task.env["PYTHON"]
+ if task.env["PYTHON"][0].startswith("/"):
+ replacement_shebang = "#!%s\n" % task.env["PYTHON"][0]
else:
- replacement_shebang = "#!/usr/bin/env %s\n" % task.env["PYTHON"]
+ replacement_shebang = "#!/usr/bin/env %s\n" % task.env["PYTHON"][0]
installed_location=task.outputs[0].bldpath(task.env)
source_file = open(task.inputs[0].srcpath(task.env))
lineno = 0
for line in source_file:
newline = line
- if (lineno == 0 and task.env["PYTHON_SPECIFIED"] is True and
+ if (lineno == 0 and
line[:2] == "#!"):
newline = replacement_shebang
elif pattern in line:
installed_file.write(newline)
lineno = lineno + 1
installed_file.close()
- os.chmod(installed_location, 0755)
+ os.chmod(installed_location, 0o755)
return 0
def copy_and_fix_perl_path(task):
installed_file.write(newline)
lineno = lineno + 1
installed_file.close()
- os.chmod(installed_location, 0755)
+ os.chmod(installed_location, 0o755)
return 0
return []
destpath = bld.EXPAND_VARIABLES(path)
+ if Options.options.destdir:
+ destpath = os.path.join(Options.options.destdir, destpath.lstrip(os.sep))
if bld.is_install > 0:
if not os.path.isdir(destpath):
try:
+ Logs.info('* create %s', destpath)
os.makedirs(destpath)
os.chmod(destpath, chmod)
except OSError as e:
'''build and install manual pages'''
bld.env.SAMBA_EXPAND_XSL = bld.srcnode.abspath() + '/docs-xml/xslt/expand-sambadoc.xsl'
bld.env.SAMBA_MAN_XSL = bld.srcnode.abspath() + '/docs-xml/xslt/man.xsl'
- bld.env.SAMBA_CATALOG = bld.srcnode.abspath() + '/bin/default/docs-xml/build/catalog.xml'
+ bld.env.SAMBA_CATALOG = bld.bldnode.abspath() + '/docs-xml/build/catalog.xml'
bld.env.SAMBA_CATALOGS = 'file:///etc/xml/catalog file:///usr/local/share/xml/catalog file://' + bld.env.SAMBA_CATALOG
for m in manpages.split():