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 917f8b92956352a697670492344f1038397eaa15..99336154deffb99a7a653e5969b412551d0ecbaf 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
 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 25371ed80be664f7bda911fcf04d9dafe2c3d39f..be3e82be3ea1baa5aeeacdd867a67b0948784b43 100644 (file)
@@ -5,7 +5,7 @@ import os
 VERSION="1.1.4"
 
 def configure(conf):
 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:
         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)
 
         # 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)
 
     conf.DEFINE('LIBRESOLV_WRAPPER_SO_PATH', libresolv_wrapper_so_path)
     conf.DEFINE('RESOLV_WRAPPER', 1)
index 9c6bccffb61219cfcec0be87904c1bbe15c5f2a5..a39c1ebdc100c6daa7b8a901c09a2e194d226884 100644 (file)
@@ -54,6 +54,7 @@ def configure(conf):
     if conf.CONFIG_GET('ENABLE_SELFTEST'):
         conf.RECURSE('socket_wrapper')
         conf.RECURSE('nss_wrapper')
     if conf.CONFIG_GET('ENABLE_SELFTEST'):
         conf.RECURSE('socket_wrapper')
         conf.RECURSE('nss_wrapper')
+        conf.RECURSE('resolv_wrapper')
 
 
 def build(bld):
 
 
 def build(bld):
@@ -82,3 +83,5 @@ def build(bld):
         bld.RECURSE('socket_wrapper')
     if bld.CONFIG_GET('NSS_WRAPPER'):
         bld.RECURSE('nss_wrapper')
         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 30cf02517389fbf948dc3ff188c5bb25e28d5fcd..771555a1c04431750e2c39e6e4275f9b6eb69a50 100644 (file)
--- a/wscript
+++ b/wscript
@@ -166,6 +166,11 @@ def configure(conf):
             else:
                 conf.define('USING_SYSTEM_NSS_WRAPPER', 1)
 
             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):
     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/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')
         conf.RECURSE('lib/uid_wrapper')
         if Options.options.with_pam:
             conf.RECURSE('lib/pam_wrapper')
index d3982a3963441dfc70dd53b9b9a9461343de1032..2e8922803986a171b8ea5fbac736fa2b3c594119 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')
 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():
 if bld.CONFIG_GET('UID_WRAPPER'):
     bld.RECURSE('lib/uid_wrapper')
 if bld.CHECK_FOR_THIRD_PARTY():