VERSION: Bump version up to Samba 4.17.13...
[samba.git] / wscript
diff --git a/wscript b/wscript
index ee7daa953b2c3e0f7005d3b69dd62b85283628aa..3af4207516daf4605a5cac3a0f54a053082838e7 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')
@@ -380,6 +394,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.