summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-11-07 10:51:11 +0100
committerAndreas Schneider <asn@cryptomilk.org>2017-11-25 10:14:13 +0100
commit22bf36c85ae11cd280a58729348c76032910dc16 (patch)
treebf049502c4c965c34e54053e2a0afa7323f01bf4
parent6cf7abbcfdad84fee57852862ebe44aa6115ca25 (diff)
downloadsamba-22bf36c85ae11cd280a58729348c76032910dc16.tar.gz
build: Move socket_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
-rw-r--r--buildtools/wafsamba/samba_third_party.py5
-rw-r--r--ctdb/wscript21
-rw-r--r--lib/README2
-rw-r--r--third_party/socket_wrapper/socket_wrapper.c (renamed from lib/socket_wrapper/socket_wrapper.c)4
-rw-r--r--third_party/socket_wrapper/wscript (renamed from lib/socket_wrapper/wscript)4
-rw-r--r--third_party/wscript4
-rw-r--r--wscript8
-rw-r--r--wscript_build2
8 files changed, 34 insertions, 16 deletions
diff --git a/buildtools/wafsamba/samba_third_party.py b/buildtools/wafsamba/samba_third_party.py
index ac77be74f5a..170c101099a 100644
--- a/buildtools/wafsamba/samba_third_party.py
+++ b/buildtools/wafsamba/samba_third_party.py
@@ -39,3 +39,8 @@ def CHECK_CMOCKA(conf):
return conf.CHECK_BUNDLED_SYSTEM_PKG('cmocka', minversion='1.1.1')
Build.BuildContext.CHECK_CMOCKA = CHECK_CMOCKA
+
+@conf
+def CHECK_SOCKET_WRAPPER(conf):
+ return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.1.7')
+Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER
diff --git a/ctdb/wscript b/ctdb/wscript
index fdd187b7d26..f5a248191d2 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -30,7 +30,7 @@ default_prefix = Options.default_prefix = '/usr/local'
samba_dist.DIST_DIRS('''ctdb:. lib/replace:lib/replace lib/talloc:lib/talloc
lib/tevent:lib/tevent lib/tdb:lib/tdb
- lib/socket_wrapper:lib/socket_wrapper
+ third_party/socket_wrapper:third_party/socket_wrapper
third_party/popt:third_party/popt
lib/util:lib/util lib/tdb_wrap:lib/tdb_wrap
lib/ccan:lib/ccan libcli/util:libcli/util
@@ -112,20 +112,29 @@ def configure(conf):
if conf.CHECK_FOR_THIRD_PARTY():
conf.RECURSE('third_party/popt')
+ if conf.env.standalone_ctdb or conf.CONFIG_GET('ENABLE_SELFTEST'):
+ conf.RECURSE('third_party/socket_wrapper')
+ conf.env.SOCKET_WRAPPER_SO_PATH = conf.CONFIG_GET('LIBSOCKET_WRAPPER_SO_PATH')
else:
if not conf.CHECK_POPT():
raise Utils.WafError('popt development packages have not been found\nIf third_party is installed, check that it is in the proper place.')
else:
conf.define('USING_SYSTEM_POPT', 1)
+ conf.env.SOCKET_WRAPPER_SO_PATH = ''
+
+
+ if conf.env.standalone_ctdb or conf.CONFIG_GET('ENABLE_SELFTEST'):
+ if not conf.CHECK_SOCKET_WRAPPER():
+ raise Utils.WafError('socket_wrapper package has not been found.\nIf third_party is installed, check that it is in the proper place.')
+ else:
+ conf.define('USING_SYSTEM_SOCKET_WRAPPER', 1)
+ conf.env.SOCKET_WRAPPER_SO_PATH = conf.CONFIG_GET('LIBSOCKET_WRAPPER_SO_PATH')
conf.RECURSE('lib/util')
conf.RECURSE('lib/talloc')
conf.RECURSE('lib/tevent')
conf.RECURSE('lib/tdb')
- if conf.env.standalone_ctdb or conf.CONFIG_GET('ENABLE_SELFTEST'):
- conf.RECURSE('lib/socket_wrapper')
- conf.env.SOCKET_WRAPPER_SO_PATH = conf.CONFIG_GET('LIBSOCKET_WRAPPER_SO_PATH')
conf.CHECK_HEADERS('sched.h')
conf.CHECK_HEADERS('procinfo.h')
@@ -315,6 +324,8 @@ def build(bld):
bld.RECURSE('lib/replace')
if bld.CHECK_FOR_THIRD_PARTY():
bld.RECURSE('third_party/popt')
+ if bld.env.standalone_ctdb or bld.CONFIG_GET('SOCKET_WRAPPER'):
+ bld.RECURSE('third_party/socket_wrapper')
bld.RECURSE('lib/tdb_wrap')
bld.RECURSE('lib/util')
@@ -323,8 +334,6 @@ def build(bld):
bld.RECURSE('lib/talloc')
bld.RECURSE('lib/tevent')
bld.RECURSE('lib/tdb')
- if bld.env.standalone_ctdb or bld.CONFIG_GET('SOCKET_WRAPPER'):
- bld.RECURSE('lib/socket_wrapper')
if bld.env.standalone_ctdb:
# If a combined build is implemented, CTDB will want to
diff --git a/lib/README b/lib/README
index 85b7952db8f..971438b0576 100644
--- a/lib/README
+++ b/lib/README
@@ -5,8 +5,6 @@ nss_wrapper - Wrapper for the user and group NSS API allowing the use
popt - Command-line option parsing library
replace - Provides replacements for standard (POSIX, C99) functions
not provided by the host platform.
-socket_wrapper - Wrapper library allowing TCP/IP traffic to be redirected
- over Unix domain sockets.
subunit - Utilities and bindings for working with the Subunit test result
reporting protocol.
talloc - Hierarchical pool based memory allocator
diff --git a/lib/socket_wrapper/socket_wrapper.c b/third_party/socket_wrapper/socket_wrapper.c
index ba289e6fbaf..43b92f76f1e 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/third_party/socket_wrapper/socket_wrapper.c
@@ -1233,7 +1233,7 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
if (addr == 0) {
/* 0.0.0.0 */
- is_bcast = 0;
+ is_bcast = 0;
type = d_type;
iface = socket_wrapper_default_iface();
} else if (a_type && addr == 0xFFFFFFFF) {
@@ -2019,7 +2019,7 @@ static int swrap_pcap_get_fd(const char *fname)
if (fd != -1) {
struct swrap_file_hdr file_hdr;
file_hdr.magic = 0xA1B2C3D4;
- file_hdr.version_major = 0x0002;
+ file_hdr.version_major = 0x0002;
file_hdr.version_minor = 0x0004;
file_hdr.timezone = 0x00000000;
file_hdr.sigfigs = 0x00000000;
diff --git a/lib/socket_wrapper/wscript b/third_party/socket_wrapper/wscript
index dbefa83ea33..514265b92b6 100644
--- a/lib/socket_wrapper/wscript
+++ b/third_party/socket_wrapper/wscript
@@ -5,7 +5,7 @@ import os
VERSION="1.1.7"
def configure(conf):
- if conf.CHECK_BUNDLED_SYSTEM('socket_wrapper', minversion=VERSION, set_target=False):
+ if conf.CHECK_SOCKET_WRAPPER():
conf.DEFINE('USING_SYSTEM_SOCKET_WRAPPER', 1)
libsocket_wrapper_so_path = 'libsocket_wrapper.so'
else:
@@ -97,7 +97,7 @@ def configure(conf):
# Create full path to socket_wrapper
blddir = os.path.realpath(conf.blddir)
- libsocket_wrapper_so_path = blddir + '/default/lib/socket_wrapper/libsocket-wrapper.so'
+ libsocket_wrapper_so_path = blddir + '/default/third_party/socket_wrapper/libsocket-wrapper.so'
conf.DEFINE('LIBSOCKET_WRAPPER_SO_PATH', libsocket_wrapper_so_path)
conf.DEFINE('SOCKET_WRAPPER', 1)
diff --git a/third_party/wscript b/third_party/wscript
index 7c2923f611e..a5192eb5f1c 100644
--- a/third_party/wscript
+++ b/third_party/wscript
@@ -51,6 +51,8 @@ def configure(conf):
conf.RECURSE('popt')
conf.RECURSE('zlib')
conf.RECURSE('aesni-intel')
+ if conf.CONFIG_GET('ENABLE_SELFTEST'):
+ conf.RECURSE('socket_wrapper')
def build(bld):
@@ -75,3 +77,5 @@ def build(bld):
bld.RECURSE('zlib')
bld.RECURSE('popt')
bld.RECURSE('aesni-intel')
+ if bld.CONFIG_GET('SOCKET_WRAPPER'):
+ bld.RECURSE('socket_wrapper')
diff --git a/wscript b/wscript
index 35cb9d1b08d..f7bdb1f3d39 100644
--- a/wscript
+++ b/wscript
@@ -135,6 +135,7 @@ def configure(conf):
raise Utils.WafError('Python version 3.x is not supported by Samba yet')
conf.RECURSE('dynconfig')
+ conf.RECURSE('selftest')
if conf.CHECK_FOR_THIRD_PARTY():
conf.RECURSE('third_party')
@@ -154,6 +155,11 @@ def configure(conf):
else:
conf.define('USING_SYSTEM_CMOCKA', 1)
+ if conf.CONFIG_GET('ENABLE_SELFTEST'):
+ if not conf.CHECK_SOCKET_WRAPPER():
+ raise Utils.WafError('socket_wrapper package has not been found.\nIf third_party is installed, check that it is in the proper place.')
+ else:
+ conf.define('USING_SYSTEM_SOCKET_WRAPPER', 1)
conf.RECURSE('lib/ldb')
@@ -182,11 +188,9 @@ def configure(conf):
conf.RECURSE('libcli/smbreadline')
conf.RECURSE('lib/crypto')
conf.RECURSE('pidl')
- conf.RECURSE('selftest')
if conf.CONFIG_GET('ENABLE_SELFTEST'):
conf.RECURSE('lib/nss_wrapper')
conf.RECURSE('lib/resolv_wrapper')
- conf.RECURSE('lib/socket_wrapper')
conf.RECURSE('lib/uid_wrapper')
if Options.options.with_pam:
conf.RECURSE('lib/pam_wrapper')
diff --git a/wscript_build b/wscript_build
index 52f8de1c13b..4d8c098e9af 100644
--- a/wscript_build
+++ b/wscript_build
@@ -71,8 +71,6 @@ if bld.CONFIG_GET('NSS_WRAPPER'):
bld.RECURSE('lib/nss_wrapper')
if bld.CONFIG_GET('PAM_WRAPPER') and Options.options.with_pam:
bld.RECURSE('lib/pam_wrapper')
-if bld.CONFIG_GET('SOCKET_WRAPPER'):
- bld.RECURSE('lib/socket_wrapper')
if bld.CONFIG_GET('RESOLV_WRAPPER'):
bld.RECURSE('lib/resolv_wrapper')
if bld.CONFIG_GET('UID_WRAPPER'):