From dd25d75b96e9930e441663e5d8e95a84eeed5c62 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Fri, 3 Feb 2017 15:13:49 -0800 Subject: [PATCH] Move pthreadpool to top of the tree. Signed-off-by: Matthieu Patou Reviewed-by: Jeremy Allison --- {source3/lib => lib}/pthreadpool/Makefile | 0 {source3/lib => lib}/pthreadpool/pthreadpool.c | 0 {source3/lib => lib}/pthreadpool/pthreadpool.h | 0 {source3/lib => lib}/pthreadpool/pthreadpool_pipe.c | 0 {source3/lib => lib}/pthreadpool/pthreadpool_pipe.h | 0 {source3/lib => lib}/pthreadpool/pthreadpool_sync.c | 0 {source3/lib => lib}/pthreadpool/pthreadpool_tevent.c | 0 {source3/lib => lib}/pthreadpool/pthreadpool_tevent.h | 0 {source3/lib => lib}/pthreadpool/tests.c | 0 {source3/lib => lib}/pthreadpool/wscript_build | 6 +++--- source3/lib/fncall.c | 2 +- source3/modules/vfs_aio_pthread.c | 2 +- source3/torture/bench_pthreadpool.c | 2 +- source3/wscript | 8 -------- wscript | 10 ++++++++++ wscript_build | 1 + 16 files changed, 17 insertions(+), 14 deletions(-) rename {source3/lib => lib}/pthreadpool/Makefile (100%) rename {source3/lib => lib}/pthreadpool/pthreadpool.c (100%) rename {source3/lib => lib}/pthreadpool/pthreadpool.h (100%) rename {source3/lib => lib}/pthreadpool/pthreadpool_pipe.c (100%) rename {source3/lib => lib}/pthreadpool/pthreadpool_pipe.h (100%) rename {source3/lib => lib}/pthreadpool/pthreadpool_sync.c (100%) rename {source3/lib => lib}/pthreadpool/pthreadpool_tevent.c (100%) rename {source3/lib => lib}/pthreadpool/pthreadpool_tevent.h (100%) rename {source3/lib => lib}/pthreadpool/tests.c (100%) rename {source3/lib => lib}/pthreadpool/wscript_build (86%) diff --git a/source3/lib/pthreadpool/Makefile b/lib/pthreadpool/Makefile similarity index 100% rename from source3/lib/pthreadpool/Makefile rename to lib/pthreadpool/Makefile diff --git a/source3/lib/pthreadpool/pthreadpool.c b/lib/pthreadpool/pthreadpool.c similarity index 100% rename from source3/lib/pthreadpool/pthreadpool.c rename to lib/pthreadpool/pthreadpool.c diff --git a/source3/lib/pthreadpool/pthreadpool.h b/lib/pthreadpool/pthreadpool.h similarity index 100% rename from source3/lib/pthreadpool/pthreadpool.h rename to lib/pthreadpool/pthreadpool.h diff --git a/source3/lib/pthreadpool/pthreadpool_pipe.c b/lib/pthreadpool/pthreadpool_pipe.c similarity index 100% rename from source3/lib/pthreadpool/pthreadpool_pipe.c rename to lib/pthreadpool/pthreadpool_pipe.c diff --git a/source3/lib/pthreadpool/pthreadpool_pipe.h b/lib/pthreadpool/pthreadpool_pipe.h similarity index 100% rename from source3/lib/pthreadpool/pthreadpool_pipe.h rename to lib/pthreadpool/pthreadpool_pipe.h diff --git a/source3/lib/pthreadpool/pthreadpool_sync.c b/lib/pthreadpool/pthreadpool_sync.c similarity index 100% rename from source3/lib/pthreadpool/pthreadpool_sync.c rename to lib/pthreadpool/pthreadpool_sync.c diff --git a/source3/lib/pthreadpool/pthreadpool_tevent.c b/lib/pthreadpool/pthreadpool_tevent.c similarity index 100% rename from source3/lib/pthreadpool/pthreadpool_tevent.c rename to lib/pthreadpool/pthreadpool_tevent.c diff --git a/source3/lib/pthreadpool/pthreadpool_tevent.h b/lib/pthreadpool/pthreadpool_tevent.h similarity index 100% rename from source3/lib/pthreadpool/pthreadpool_tevent.h rename to lib/pthreadpool/pthreadpool_tevent.h diff --git a/source3/lib/pthreadpool/tests.c b/lib/pthreadpool/tests.c similarity index 100% rename from source3/lib/pthreadpool/tests.c rename to lib/pthreadpool/tests.c diff --git a/source3/lib/pthreadpool/wscript_build b/lib/pthreadpool/wscript_build similarity index 86% rename from source3/lib/pthreadpool/wscript_build rename to lib/pthreadpool/wscript_build index 8195af7c322..d5304635915 100644 --- a/source3/lib/pthreadpool/wscript_build +++ b/lib/pthreadpool/wscript_build @@ -1,14 +1,14 @@ #!/usr/bin/env python if bld.env.WITH_PTHREADPOOL: - bld.SAMBA3_SUBSYSTEM('PTHREADPOOL', + bld.SAMBA_SUBSYSTEM('PTHREADPOOL', source='''pthreadpool.c pthreadpool_pipe.c pthreadpool_tevent.c ''', deps='pthread rt replace tevent-util') else: - bld.SAMBA3_SUBSYSTEM('PTHREADPOOL', + bld.SAMBA_SUBSYSTEM('PTHREADPOOL', source='''pthreadpool_sync.c pthreadpool_pipe.c pthreadpool_tevent.c @@ -16,7 +16,7 @@ else: deps='replace tevent-util') -bld.SAMBA3_BINARY('pthreadpooltest', +bld.SAMBA_BINARY('pthreadpooltest', source='tests.c', deps='PTHREADPOOL', enabled=bld.env.WITH_PTHREADPOOL, diff --git a/source3/lib/fncall.c b/source3/lib/fncall.c index 0923c148dba..34db4725e89 100644 --- a/source3/lib/fncall.c +++ b/source3/lib/fncall.c @@ -20,7 +20,7 @@ #include "includes.h" #include "../lib/util/tevent_unix.h" -#include "lib/pthreadpool/pthreadpool_pipe.h" +#include "../lib/pthreadpool/pthreadpool_pipe.h" struct fncall_state { struct fncall_context *ctx; diff --git a/source3/modules/vfs_aio_pthread.c b/source3/modules/vfs_aio_pthread.c index 6edf250ebdc..97ae86f999f 100644 --- a/source3/modules/vfs_aio_pthread.c +++ b/source3/modules/vfs_aio_pthread.c @@ -26,7 +26,7 @@ #include "system/shmem.h" #include "smbd/smbd.h" #include "smbd/globals.h" -#include "lib/pthreadpool/pthreadpool_pipe.h" +#include "../lib/pthreadpool/pthreadpool_pipe.h" #ifdef HAVE_LINUX_FALLOC_H #include #endif diff --git a/source3/torture/bench_pthreadpool.c b/source3/torture/bench_pthreadpool.c index 82a84cf53cd..4269b5360f8 100644 --- a/source3/torture/bench_pthreadpool.c +++ b/source3/torture/bench_pthreadpool.c @@ -19,7 +19,7 @@ */ #include "includes.h" -#include "lib/pthreadpool/pthreadpool_pipe.h" +#include "../lib/pthreadpool/pthreadpool_pipe.h" #include "proto.h" extern int torture_numops; diff --git a/source3/wscript b/source3/wscript index 443affd64e2..821d4ed114f 100644 --- a/source3/wscript +++ b/source3/wscript @@ -46,7 +46,6 @@ def set_options(opt): opt.SAMBA3_ADD_OPTION('quotas') opt.SAMBA3_ADD_OPTION('sendfile-support') opt.SAMBA3_ADD_OPTION('utmp') - opt.SAMBA3_ADD_OPTION('pthreadpool', with_name="enable", without_name="disable", default=True) opt.SAMBA3_ADD_OPTION('avahi', with_name="enable", without_name="disable") opt.SAMBA3_ADD_OPTION('iconv') opt.SAMBA3_ADD_OPTION('acl-support') @@ -1564,13 +1563,6 @@ main() { conf.DEFINE('WITH_PROFILE', 1); conf.CHECK_FUNCS('getrusage', headers="sys/time.h sys/resource.h") - if Options.options.with_pthreadpool: - if conf.CONFIG_SET('HAVE_PTHREAD'): - conf.DEFINE('WITH_PTHREADPOOL', '1') - else: - Logs.warn("pthreadpool support cannot be enabled when pthread support was not found") - conf.undefine('WITH_PTHREADPOOL') - if (conf.CHECK_HEADERS('linux/ioctl.h sys/ioctl.h linux/fs.h') and conf.CHECK_DECLS('FS_IOC_GETFLAGS FS_COMPR_FL', headers='linux/fs.h')): conf.DEFINE('HAVE_LINUX_IOCTL', '1') diff --git a/wscript b/wscript index 9168db122ae..9706e0f9c9a 100644 --- a/wscript +++ b/wscript @@ -9,6 +9,7 @@ VERSION=None import sys, os, tempfile sys.path.insert(0, srcdir+"/buildtools/wafsamba") import wafsamba, Options, samba_dist, samba_git, Scripting, Utils, samba_version +import Logs, samba_utils samba_dist.DIST_DIRS('.') @@ -44,6 +45,7 @@ def set_options(opt): opt.RECURSE('source3') opt.RECURSE('lib/util') opt.RECURSE('ctdb') + opt.samba_add_onoff_option('pthreadpool', with_name="enable", without_name="disable", default=True) opt.add_option('--with-system-mitkrb5', help='enable system MIT krb5 build (includes Samba 4 client and Samba 3 code base).'+ @@ -183,6 +185,14 @@ def configure(conf): if Options.options.with_system_mitkrb5: raise Utils.WafError('--with-ntvfs-fileserver conflicts with --with-system-mitkrb5') conf.DEFINE('WITH_NTVFS_FILESERVER', 1) + + if Options.options.with_pthreadpool: + if conf.CONFIG_SET('HAVE_PTHREAD'): + conf.DEFINE('WITH_PTHREADPOOL', '1') + else: + Logs.warn("pthreadpool support cannot be enabled when pthread support was not found") + conf.undefine('WITH_PTHREADPOOL') + conf.RECURSE('source3') conf.RECURSE('lib/texpect') if conf.env.with_ctdb: diff --git a/wscript_build b/wscript_build index 0c3a2aee864..954eed11061 100644 --- a/wscript_build +++ b/wscript_build @@ -145,6 +145,7 @@ bld.RECURSE('source4/scripting') bld.RECURSE('pidl') bld.RECURSE('lib') bld.RECURSE('libds/common') +bld.RECURSE('lib/pthreadpool') bld.RECURSE('source3') bld.RECURSE('dfs_server') bld.RECURSE('file_server') -- 2.34.1