build: Move resolv_wrapper to third_party
authorAndreas Schneider <asn@samba.org>
Tue, 7 Nov 2017 10:55:04 +0000 (11:55 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 25 Nov 2017 09:14:13 +0000 (10:14 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
buildtools/wafsamba/samba_third_party.py
third_party/resolv_wrapper/resolv_wrapper.c [moved from lib/resolv_wrapper/resolv_wrapper.c with 100% similarity]
third_party/resolv_wrapper/wscript [moved from lib/resolv_wrapper/wscript with 94% similarity]
third_party/wscript
wscript
wscript_build

index 917f8b9..9933615 100644 (file)
@@ -49,3 +49,8 @@ Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER
 def CHECK_NSS_WRAPPER(conf):
     return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.3')
 Build.BuildContext.CHECK_NSS_WRAPPER = CHECK_NSS_WRAPPER
+
+@conf
+def CHECK_RESOLV_WRAPPER(conf):
+    return conf.CHECK_BUNDLED_SYSTEM_PKG('resolv_wrapper', minversion='1.1.4')
+Build.BuildContext.CHECK_RESOLV_WRAPPER = CHECK_RESOLV_WRAPPER
similarity index 94%
rename from lib/resolv_wrapper/wscript
rename to third_party/resolv_wrapper/wscript
index 25371ed..be3e82b 100644 (file)
@@ -5,7 +5,7 @@ import os
 VERSION="1.1.4"
 
 def configure(conf):
-    if conf.CHECK_BUNDLED_SYSTEM('resolv_wrapper', minversion=VERSION, set_target=False):
+    if conf.CHECK_RESOLV_WRAPPER():
         conf.DEFINE('USING_SYSTEM_RESOLV_WRAPPER', 1)
         libresolv_wrapper_so_path = 'libresolv_wrapper.so'
     else:
@@ -80,7 +80,7 @@ def configure(conf):
 
         # Create full path to resolv_wrapper
         blddir = os.path.realpath(conf.blddir)
-        libresolv_wrapper_so_path = blddir + '/default/lib/resolv_wrapper/libresolv-wrapper.so'
+        libresolv_wrapper_so_path = blddir + '/default/third_party/resolv_wrapper/libresolv-wrapper.so'
 
     conf.DEFINE('LIBRESOLV_WRAPPER_SO_PATH', libresolv_wrapper_so_path)
     conf.DEFINE('RESOLV_WRAPPER', 1)
index 9c6bccf..a39c1eb 100644 (file)
@@ -54,6 +54,7 @@ def configure(conf):
     if conf.CONFIG_GET('ENABLE_SELFTEST'):
         conf.RECURSE('socket_wrapper')
         conf.RECURSE('nss_wrapper')
+        conf.RECURSE('resolv_wrapper')
 
 
 def build(bld):
@@ -82,3 +83,5 @@ def build(bld):
         bld.RECURSE('socket_wrapper')
     if bld.CONFIG_GET('NSS_WRAPPER'):
         bld.RECURSE('nss_wrapper')
+    if bld.CONFIG_GET('RESOLV_WRAPPER'):
+        bld.RECURSE('resolv_wrapper')
diff --git a/wscript b/wscript
index 30cf025..771555a 100644 (file)
--- a/wscript
+++ b/wscript
@@ -166,6 +166,11 @@ def configure(conf):
             else:
                 conf.define('USING_SYSTEM_NSS_WRAPPER', 1)
 
+            if not conf.CHECK_RESOLV_WRAPPER():
+                raise Utils.WafError('resolv_wrapper package has not been found.\nIf third_party is installed, check that it is in the proper place.')
+            else:
+                conf.define('USING_SYSTEM_RESOLV_WRAPPER', 1)
+
     conf.RECURSE('lib/ldb')
 
     if not (Options.options.without_ad_dc):
@@ -194,7 +199,6 @@ def configure(conf):
     conf.RECURSE('lib/crypto')
     conf.RECURSE('pidl')
     if conf.CONFIG_GET('ENABLE_SELFTEST'):
-        conf.RECURSE('lib/resolv_wrapper')
         conf.RECURSE('lib/uid_wrapper')
         if Options.options.with_pam:
             conf.RECURSE('lib/pam_wrapper')
index d3982a3..2e89228 100644 (file)
@@ -69,8 +69,6 @@ bld.RECURSE('source4/lib/cmdline')
 bld.RECURSE('source4/lib/http')
 if bld.CONFIG_GET('PAM_WRAPPER') and Options.options.with_pam:
     bld.RECURSE('lib/pam_wrapper')
-if bld.CONFIG_GET('RESOLV_WRAPPER'):
-    bld.RECURSE('lib/resolv_wrapper')
 if bld.CONFIG_GET('UID_WRAPPER'):
     bld.RECURSE('lib/uid_wrapper')
 if bld.CHECK_FOR_THIRD_PARTY():