[PATCHSET]: let configure(waf) fail if --with-ads was specified but ad support was not found

Michael Adam obnox at samba.org
Thu Nov 1 09:18:16 MDT 2012


Hi,

the attached patchset improves the waf configure in that it
now fails if --with-ads was specified, but sufficient support not
found.

Michael

-------------- next part --------------
From 14ce27c6feb1706f5666887d72f9d300889b2435 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb at sernet.de>
Date: Wed, 31 Oct 2012 14:45:03 +0100
Subject: [PATCH 1/2] build(waf): Fail "configure --with-ads" if AD support
 was not found.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Previous "auto" mode is now available if neither "--with-ads" nor
"--without-ads" was specified on the configure command line.

Signed-off-by: Bj?rn Baumbach <bb at sernet.de>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/wscript |   32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index 96ab4de..f8d8403 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -24,7 +24,7 @@ def set_options(opt):
 
     opt.SAMBA3_ADD_OPTION('winbind')
     opt.SAMBA3_ADD_OPTION('swat')
-    opt.SAMBA3_ADD_OPTION('ads')
+    opt.SAMBA3_ADD_OPTION('ads', default=None)
     opt.SAMBA3_ADD_OPTION('ldap')
     opt.SAMBA3_ADD_OPTION('cups', with_name="enable", without_name="disable")
     opt.SAMBA3_ADD_OPTION('iprint', with_name="enable", without_name="disable")
@@ -566,7 +566,9 @@ msg.msg_acctrightslen = sizeof(fd);
         conf.SET_TARGET_TYPE('ldap', 'EMPTY')
         conf.SET_TARGET_TYPE('lber', 'EMPTY')
 
-    if Options.options.with_ads:
+    if Options.options.with_ads == False:
+        use_ads=False
+    else:
         use_ads=True
         if not conf.CONFIG_SET('HAVE_ENCTYPE_ARCFOUR_HMAC_MD5') and \
            not conf.CONFIG_SET('HAVE_ENCTYPE_ARCFOUR_HMAC'):
@@ -630,17 +632,23 @@ msg.msg_acctrightslen = sizeof(fd);
             Logs.warn("need gss_krb5_export_lucid_sec_context for SPNEGO and gss_wrap support")
             use_ads=False
 
-        if use_ads:
-            conf.DEFINE('WITH_ADS', '1')
-            conf.DEFINE('HAVE_KRB5', '1')
-            if conf.CONFIG_SET('HAVE_LDAP'):
-                conf.env['HAVE_ADS'] = '1'
+    if use_ads:
+        conf.DEFINE('WITH_ADS', '1')
+        conf.DEFINE('HAVE_KRB5', '1')
+        if conf.CONFIG_SET('HAVE_LDAP'):
+            conf.env['HAVE_ADS'] = '1'
+    else:
+        if Options.options.with_ads == False:
+            Logs.info("building without Active Directory support (--without-ads)")
+        elif Options.options.with_ads == True:
+            Logs.error("Active Directory support not available: krb5 libs don't have all required features")
+            conf.fatal("Active Directory support not found, but --with-ads was specified")
         else:
-            Logs.warn("krb5 libs don't have all features required for Active Directory support")
-            conf.undefine('HAVE_KRB5_H')
-            conf.undefine('HAVE_GSSAPI_H')
-            conf.undefine('HAVE_GSSAPI_GSSAPI_GENERIC_H')
-            conf.undefine('HAVE_GSSAPI_GSSAPI_H')
+            Logs.info("building without Active Directory support: krb5 libs don't have all required features")
+        conf.undefine('HAVE_KRB5_H')
+        conf.undefine('HAVE_GSSAPI_H')
+        conf.undefine('HAVE_GSSAPI_GSSAPI_GENERIC_H')
+        conf.undefine('HAVE_GSSAPI_GSSAPI_H')
 
     if Options.options.with_utmp:
         conf.env.with_utmp = True
-- 
1.7.9.5


From 1cc58aaa937e0c5b6bd0e45350ad686a723a9ff6 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Thu, 1 Nov 2012 14:26:08 +0100
Subject: [PATCH 2/2] build(waf): Logs.info() the fact that build is done with
 Active Directory support

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/wscript |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/source3/wscript b/source3/wscript
index f8d8403..cb88b9c 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -637,6 +637,8 @@ msg.msg_acctrightslen = sizeof(fd);
         conf.DEFINE('HAVE_KRB5', '1')
         if conf.CONFIG_SET('HAVE_LDAP'):
             conf.env['HAVE_ADS'] = '1'
+        Logs.info("building with Active Directory support")
+
     else:
         if Options.options.with_ads == False:
             Logs.info("building without Active Directory support (--without-ads)")
-- 
1.7.9.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121101/43994a17/attachment.pgp>


More information about the samba-technical mailing list