#!/usr/bin/env python
-import Utils
import os
import sys
+import samba_git
+from waflib import Options, Errors
# work out what python external libraries we need to install
external_pkgs = {
- "dns.resolver": "dnspython/dns",
"iso8601": "pyiso8601/iso8601",
}
old_path = sys.path
try:
- sys.path.append(os.path.join(conf.curdir, os.path.dirname(package)))
+ sys.path.append(os.path.join(conf.path.abspath(), os.path.dirname(package)))
try:
__import__(module)
except ImportError:
- if (os.path.isdir(os.path.join(conf.srcdir, ".git")) and
- os.path.isfile(os.path.join(conf.srcdir, ".gitmodule"))):
- raise Utils.WafError("""\
+ if samba_git.has_submodules(conf.srcnode.abspath()):
+ raise Errors.WafError("""\
Unable to find Python module '%s'. Please install the system package or check \
out the relevant submodule by running 'git submodule update --init'.
""" % module)
else:
- raise Utils.WafError("""\
+ raise Errors.WafError("""\
Unable to find Python module '%s'. Please install the system package or place a copy in
%s.
""" % (module, package))
def configure(conf):
for module, package in external_pkgs.items():
find_third_party_module(conf, module, package)
+ conf.RECURSE('cmocka')
conf.RECURSE('popt')
conf.RECURSE('zlib')
+ conf.RECURSE('aesni-intel')
+ if conf.CONFIG_GET('ENABLE_SELFTEST'):
+ conf.RECURSE('socket_wrapper')
+ conf.RECURSE('nss_wrapper')
+ conf.RECURSE('resolv_wrapper')
+ conf.RECURSE('uid_wrapper')
+ if Options.options.with_pam:
+ conf.RECURSE('pam_wrapper')
def build(bld):
target='empty_file')
bld.INSTALL_FILES('${PYTHONARCHDIR}/samba/third_party', 'empty_file', destname='__init__.py')
+ bld.RECURSE('cmocka')
bld.RECURSE('zlib')
bld.RECURSE('popt')
+ bld.RECURSE('aesni-intel')
+ if bld.CONFIG_GET('SOCKET_WRAPPER'):
+ bld.RECURSE('socket_wrapper')
+ if bld.CONFIG_GET('NSS_WRAPPER'):
+ bld.RECURSE('nss_wrapper')
+ if bld.CONFIG_GET('RESOLV_WRAPPER'):
+ bld.RECURSE('resolv_wrapper')
+ if bld.CONFIG_GET('UID_WRAPPER'):
+ bld.RECURSE('uid_wrapper')
+ if bld.CONFIG_GET('PAM_WRAPPER'):
+ bld.RECURSE('pam_wrapper')