Move pthreadpool to top of the tree.
authorMatthieu Patou <mat@matws.net>
Fri, 3 Feb 2017 23:13:49 +0000 (15:13 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 9 Feb 2017 19:04:12 +0000 (20:04 +0100)
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
16 files changed:
lib/pthreadpool/Makefile [moved from source3/lib/pthreadpool/Makefile with 100% similarity]
lib/pthreadpool/pthreadpool.c [moved from source3/lib/pthreadpool/pthreadpool.c with 100% similarity]
lib/pthreadpool/pthreadpool.h [moved from source3/lib/pthreadpool/pthreadpool.h with 100% similarity]
lib/pthreadpool/pthreadpool_pipe.c [moved from source3/lib/pthreadpool/pthreadpool_pipe.c with 100% similarity]
lib/pthreadpool/pthreadpool_pipe.h [moved from source3/lib/pthreadpool/pthreadpool_pipe.h with 100% similarity]
lib/pthreadpool/pthreadpool_sync.c [moved from source3/lib/pthreadpool/pthreadpool_sync.c with 100% similarity]
lib/pthreadpool/pthreadpool_tevent.c [moved from source3/lib/pthreadpool/pthreadpool_tevent.c with 100% similarity]
lib/pthreadpool/pthreadpool_tevent.h [moved from source3/lib/pthreadpool/pthreadpool_tevent.h with 100% similarity]
lib/pthreadpool/tests.c [moved from source3/lib/pthreadpool/tests.c with 100% similarity]
lib/pthreadpool/wscript_build [moved from source3/lib/pthreadpool/wscript_build with 86% similarity]
source3/lib/fncall.c
source3/modules/vfs_aio_pthread.c
source3/torture/bench_pthreadpool.c
source3/wscript
wscript
wscript_build

similarity index 86%
rename from source3/lib/pthreadpool/wscript_build
rename to lib/pthreadpool/wscript_build
index 8195af7..d530463 100644 (file)
@@ -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,
index 0923c14..34db472 100644 (file)
@@ -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;
index 6edf250..97ae86f 100644 (file)
@@ -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 <linux/falloc.h>
 #endif
index 82a84cf..4269b53 100644 (file)
@@ -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;
index 443affd..821d4ed 100644 (file)
@@ -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 9168db1..9706e0f 100644 (file)
--- 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:
index 0c3a2ae..954eed1 100644 (file)
@@ -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')