s3:smbd multichannel: always refresh the network information
[metze/samba-autobuild-v4-18-test/.git] / wscript
diff --git a/wscript b/wscript
index ee7daa953b2c3e0f7005d3b69dd62b85283628aa..b87b043e12bd9f8c33fd35b0f6ca57b9ad32c3df 100644 (file)
--- a/wscript
+++ b/wscript
@@ -129,6 +129,10 @@ def options(opt):
                    action='store_false', dest='with_json',
                    help=("Build without JSON support."))
 
+    opt.samba_add_onoff_option('smb1-server',
+                               dest='with_smb1server',
+                               help=("Build smbd with SMB1 support (default=yes)."))
+
 def configure(conf):
     version = samba_version.load_version(env=conf.env)
 
@@ -141,11 +145,21 @@ def configure(conf):
         conf.env.DEVELOPER = True
         # if we are in a git tree without a pre-commit hook, install a
         # simple default.
-        pre_commit_hook = os.path.join(Context.g_module.top, '.git/hooks/pre-commit')
-        if (os.path.isdir(os.path.dirname(pre_commit_hook)) and
-            not os.path.exists(pre_commit_hook)):
-            shutil.copy(os.path.join(Context.g_module.top, 'script/git-hooks/pre-commit-hook'),
-                        pre_commit_hook)
+        # we need git for 'waf dist'
+        githooksdir = None
+        conf.find_program('git', var='GIT')
+        if 'GIT' in conf.env:
+            githooksdir = conf.CHECK_COMMAND('%s rev-parse --git-path hooks' % conf.env.GIT[0],
+                               msg='Finding githooks directory',
+                               define=None,
+                               on_target=False)
+        if githooksdir and os.path.isdir(githooksdir):
+            pre_commit_hook = os.path.join(githooksdir, 'pre-commit')
+            if not os.path.exists(pre_commit_hook):
+                Logs.info("Installing script/git-hooks/pre-commit-hook as %s" %
+                          pre_commit_hook)
+                shutil.copy(os.path.join(Context.g_module.top, 'script/git-hooks/pre-commit-hook'),
+                            pre_commit_hook)
 
     conf.ADD_EXTRA_INCLUDES('#include/public #source4 #lib #source4/lib #source4/include #include #lib/replace')
 
@@ -179,6 +193,8 @@ def configure(conf):
     conf.RECURSE('dynconfig')
     conf.RECURSE('selftest')
 
+    conf.PROCESS_SEPARATE_RULE('system_gnutls')
+
     conf.CHECK_CFG(package='zlib', minversion='1.2.3',
                    args='--cflags --libs',
                    mandatory=True)
@@ -287,8 +303,6 @@ def configure(conf):
     if not conf.CONFIG_GET('KRB5_VENDOR'):
         conf.PROCESS_SEPARATE_RULE('embedded_heimdal')
 
-    conf.PROCESS_SEPARATE_RULE('system_gnutls')
-
     conf.RECURSE('source4/dsdb/samdb/ldb_modules')
     conf.RECURSE('source4/ntvfs/sysdep')
     conf.RECURSE('lib/util')
@@ -334,12 +348,14 @@ def configure(conf):
 
     conf.RECURSE('source3')
     conf.RECURSE('lib/texpect')
+    conf.RECURSE('lib/tsocket')
     conf.RECURSE('python')
     if conf.env.with_ctdb:
         conf.RECURSE('ctdb')
     conf.RECURSE('lib/socket')
     conf.RECURSE('lib/mscat')
     conf.RECURSE('packaging')
+    conf.RECURSE('lib/krb5_wrap')
 
     conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
 
@@ -348,7 +364,8 @@ def configure(conf):
     # allows us to find problems on our development hosts faster.
     # It also results in faster load time.
 
-    if conf.CHECK_LDFLAGS('-Wl,--as-needed'):
+    if (not Options.options.address_sanitizer
+        and conf.CHECK_LDFLAGS('-Wl,--as-needed')):
         conf.env.append_unique('LINKFLAGS', '-Wl,--as-needed')
 
     if not conf.CHECK_NEED_LC("-lc not needed"):
@@ -380,6 +397,16 @@ def configure(conf):
                          msg="Checking compiler for full RELRO support"):
             conf.env['ENABLE_RELRO'] = True
 
+    if conf.CONFIG_GET('ENABLE_SELFTEST') and \
+       Options.options.with_smb1server == False and \
+       Options.options.without_ad_dc != True:
+        conf.fatal('--without-smb1-server cannot be specified with '
+                   '--enable-selftest/--enable-developer if '
+                   '--without-ad-dc is NOT set!')
+
+    if Options.options.with_smb1server != False:
+        conf.DEFINE('WITH_SMB1SERVER', '1')
+
     #
     # FreeBSD is broken. It doesn't include 'extern char **environ'
     # in any shared library, but statically inside crt0.o.
@@ -515,6 +542,11 @@ def distcheck():
     '''test that distribution tarball builds and installs'''
     samba_version.load_version(env=None)
 
+def printversion(ctx):
+    '''print version'''
+    ver = samba_version.load_version(env=None)
+    print('Samba Version: ' + ver.STRING_WITH_NICKNAME)
+
 def wildcard_cmd(cmd):
     '''called on a unknown command'''
     from samba_wildcard import run_named_build_task