source4/librpc/rpc/dcerpc.c sq bla
[metze/samba/wip.git] / wscript
diff --git a/wscript b/wscript
index 155de7c282629146b4ff3f6b85f034a4269ee529..0557fa7070ea089b7e0a7fca792964c6db36444b 100644 (file)
--- a/wscript
+++ b/wscript
@@ -35,13 +35,11 @@ def system_mitkrb5_callback(option, opt, value, parser):
 def options(opt):
     opt.BUILTIN_DEFAULT('NONE')
     opt.PRIVATE_EXTENSION_DEFAULT('samba4')
-    opt.RECURSE('lib/audit_logging')
     opt.RECURSE('lib/replace')
     opt.RECURSE('dynconfig')
     opt.RECURSE('packaging')
     opt.RECURSE('lib/ldb')
     opt.RECURSE('selftest')
-    opt.RECURSE('source4/lib/tls')
     opt.RECURSE('source4/dsdb/samdb/ldb_modules')
     opt.RECURSE('pidl')
     opt.RECURSE('source3')
@@ -56,6 +54,14 @@ def options(opt):
                    help='build Samba with system MIT Kerberos. ' +
                         'You may specify list of paths where Kerberos is installed (e.g. /usr/local /usr/kerberos) to search krb5-config',
                    action='callback', callback=system_mitkrb5_callback, dest='with_system_mitkrb5', default=False)
+
+    opt.add_option('--with-experimental-mit-ad-dc',
+                   help='Enable the experimental MIT Kerberos-backed AD DC.  ' +
+                   'Note that security patches are not issued for this configuration',
+                   action='store_true',
+                   dest='with_experimental_mit_ad_dc',
+                   default=False)
+
     opt.add_option('--with-system-mitkdc',
                    help=('Specify the path to the krb5kdc binary from MIT Kerberos'),
                    type="string",
@@ -103,6 +109,13 @@ def options(opt):
     opt.load('python') # options for disabling pyc or pyo compilation
     # enable options related to building python extensions
 
+    opt.add_option('--with-json',
+                   action='store_true', dest='with_json',
+                   help=("Build with JSON support (default=True). This "
+                         "requires the jansson development headers."))
+    opt.add_option('--without-json',
+                   action='store_false', dest='with_json',
+                   help=("Build without JSON support."))
 
 def configure(conf):
     version = samba_version.load_version(env=conf.env)
@@ -137,8 +150,8 @@ def configure(conf):
         if not (Options.options.without_ad_dc):
             raise Errors.WafError('--disable-python requires --without-ad-dc')
 
-    conf.SAMBA_CHECK_PYTHON(mandatory=True, version=(2, 6, 0))
-    conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=(not conf.env.disable_python))
+    conf.SAMBA_CHECK_PYTHON()
+    conf.SAMBA_CHECK_PYTHON_HEADERS()
 
     if sys.platform == 'darwin' and not conf.env['HAVE_ENVIRON_DECL']:
         # Mac OSX needs to have this and it's also needed that the python is compiled with this
@@ -151,9 +164,6 @@ def configure(conf):
     if sys.platform == 'darwin':
         conf.ADD_LDFLAGS('-framework CoreFoundation')
 
-    if int(conf.env['PYTHON_VERSION'][0]) >= 3:
-        raise Errors.WafError('Python version 3.x is not supported by Samba yet')
-
     conf.RECURSE('dynconfig')
     conf.RECURSE('selftest')
 
@@ -211,31 +221,37 @@ def configure(conf):
         conf.DEFINE('AD_DC_BUILD_IS_ENABLED', 1)
 
     if Options.options.with_system_mitkrb5:
+        if not Options.options.with_experimental_mit_ad_dc and \
+           not Options.options.without_ad_dc:
+            raise Errors.WafError('The MIT Kerberos build of Samba as an AD DC ' +
+                                  'is experimental. Therefore '
+                                  '--with-system-mitkrb5 requires either ' +
+                                  '--with-experimental-mit-ad-dc or ' +
+                                  '--without-ad-dc')
+
         conf.PROCESS_SEPARATE_RULE('system_mitkrb5')
+
     if not (Options.options.without_ad_dc or Options.options.with_system_mitkrb5):
         conf.DEFINE('AD_DC_BUILD_IS_ENABLED', 1)
 
     if Options.options.with_system_heimdalkrb5:
         if Options.options.with_system_mitkrb5:
-            raise Utils.WafError('--with-system-heimdalkrb5 conflicts with ' +
-                                 '--with-system-mitkrb5')
+            raise Errors.WafError('--with-system-heimdalkrb5 conflicts with ' +
+                                  '--with-system-mitkrb5')
         if not Options.options.without_ad_dc:
-            raise Utils.WafError('--with-system-heimdalkrb5 requires ' +
-                                 '--without-ad-dc')
+            raise Errors.WafError('--with-system-heimdalkrb5 requires ' +
+                                  '--without-ad-dc')
         conf.env.SYSTEM_LIBS += ('heimdal', 'asn1', 'com_err', 'roken',
                                  'hx509', 'wind', 'gssapi', 'hcrypto',
                                  'krb5', 'heimbase', 'asn1_compile',
                                  'compile_et', 'kdc', 'hdb', 'heimntlm')
+        conf.PROCESS_SEPARATE_RULE('system_heimdal')
+
+    if not conf.CONFIG_GET('KRB5_VENDOR'):
+        conf.PROCESS_SEPARATE_RULE('embedded_heimdal')
+
+    conf.PROCESS_SEPARATE_RULE('system_gnutls')
 
-    # Only process heimdal_build for non-MIT KRB5 builds
-    # When MIT KRB5 checks are done as above, conf.env.KRB5_VENDOR will be set
-    # to the lowcased output of 'krb5-config --vendor'.
-    # If it is not set or the output is 'heimdal', we are dealing with
-    # system-provided or embedded Heimdal build
-    if conf.CONFIG_GET('KRB5_VENDOR') in (None, 'heimdal'):
-        conf.RECURSE('source4/heimdal_build')
-    conf.RECURSE('lib/audit_logging')
-    conf.RECURSE('source4/lib/tls')
     conf.RECURSE('source4/dsdb/samdb/ldb_modules')
     conf.RECURSE('source4/ntvfs/sysdep')
     conf.RECURSE('lib/util')
@@ -260,20 +276,34 @@ def configure(conf):
         conf.DEFINE('WITH_NTVFS_FILESERVER', 1)
 
     if Options.options.with_pthreadpool:
-        if conf.CONFIG_SET('HAVE_PTHREAD') and \
-           conf.CONFIG_SET('HAVE___THREAD') and \
-           conf.CONFIG_SET('HAVE_ATOMIC_THREAD_FENCE_SUPPORT'):
+        if conf.CONFIG_SET('HAVE_PTHREAD'):
             conf.DEFINE('WITH_PTHREADPOOL', '1')
         else:
-            if not conf.CONFIG_SET('HAVE_PTHREAD'):
-                Logs.warn("pthreadpool support cannot be enabled when pthread support was not found")
-            if not conf.CONFIG_SET('HAVE_ATOMIC_THREAD_FENCE_SUPPORT'):
-                Logs.warn("""pthreadpool support cannot be enabled when there is
-                          no support for atomic_thead_fence()""")
-            if not conf.CONFIG_SET('HAVE___THREAD'):
-                Logs.warn("pthreadpool support cannot be enabled when __thread support was not found")
+            Logs.warn("pthreadpool support cannot be enabled when pthread support was not found")
             conf.undefine('WITH_PTHREADPOOL')
 
+    conf.SET_TARGET_TYPE('jansson', 'EMPTY')
+
+    if Options.options.with_json != False:
+        if conf.CHECK_CFG(package='jansson', args='--cflags --libs',
+                          msg='Checking for jansson'):
+            conf.CHECK_FUNCS_IN('json_object', 'jansson')
+
+    if not conf.CONFIG_GET('HAVE_JSON_OBJECT'):
+        if Options.options.with_json != False:
+            conf.fatal("Jansson JSON support not found. "
+                       "Try installing libjansson-dev or jansson-devel. "
+                       "Otherwise, use --without-json to build without "
+                       "JSON support. "
+                       "JSON support is required for the JSON "
+                       "formatted audit log feature, the AD DC, and "
+                       "the JSON printers of the net utility")
+        if not Options.options.without_ad_dc:
+            raise Errors.WafError('--without-json requires --without-ad-dc. '
+                                 'Jansson JSON library is required for '
+                                 'building the AD DC')
+        Logs.info("Building without Jansson JSON log support")
+
     conf.RECURSE('source3')
     conf.RECURSE('lib/texpect')
     conf.RECURSE('python')