s3-waf: add pthreadpool support.
authorGünther Deschner <gd@samba.org>
Wed, 27 Apr 2011 11:16:59 +0000 (13:16 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 27 Apr 2011 15:57:32 +0000 (17:57 +0200)
Volker, please check.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Apr 27 17:57:32 CEST 2011 on sn-devel-104

source3/lib/pthreadpool/wscript_build [new file with mode: 0644]
source3/wscript
source3/wscript_build

diff --git a/source3/lib/pthreadpool/wscript_build b/source3/lib/pthreadpool/wscript_build
new file mode 100644 (file)
index 0000000..7679b58
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+bld.SAMBA3_SUBSYSTEM('PTHREADPOOL',
+                     source='pthreadpool.c',
+                     deps='pthread',
+                     enabled=bld.env.WITH_PTHREADPOOL)
+
+bld.SAMBA3_BINARY('pthreadpooltest',
+                  source='tests.c',
+                  deps='PTHREADPOOL',
+                  enabled=bld.env.WITH_PTHREADPOOL)
index 3f9dfd93032af523324497f92f703629fc5e64aa..7f178a4c55d2bfdb4aef032cdaebb647560923de 100644 (file)
@@ -1669,6 +1669,13 @@ main() {
         conf.CHECK_HEADERS('pthread.h')
         conf.DEFINE('HAVE_PTHREAD', '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')
+
     default_static_modules=TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam
                                       auth_sam auth_unix auth_winbind auth_wbc auth_server
                                       auth_domain auth_builtin vfs_default
index ca37ce3ed16e8d9db466059a7acb467b1f09e032..a6ce559e583238675cd96ae78f7c4bde97fa06f4 100755 (executable)
@@ -57,8 +57,6 @@ LIBCLI_WINREG_SRC = '''rpc_client/cli_winreg.c
 # that requires knowledge of security contexts
 REG_PARSE_PRS_SRC = '''registry/reg_parse_prs.c'''
 
-PTHREADPOOL_SRC = ''
-
 LIB_SRC = '''
           lib/messages.c lib/messages_local.c
           lib/messages_ctdbd.c lib/packet.c lib/ctdbd_conn.c
@@ -91,7 +89,7 @@ LIB_SRC = '''
           lib/module.c lib/events.c
           lib/server_contexts.c
           lib/ldap_escape.c
-          lib/secdesc.c ${PTHREADPOOL_SRC}
+          lib/secdesc.c
           lib/fncall.c
           libads/krb5_errs.c lib/system_smbd.c lib/audit.c
           lib/file_id.c lib/idmap_cache.c'''
@@ -780,7 +778,7 @@ bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
 
 bld.SAMBA3_LIBRARY('samba3core',
                    source=LIB_SRC,
-                   deps='LIBCRYPTO ndr ndr-util security NDR_SECURITY charset NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 CHARSET3 UTIL_TDB UTIL_PW SAMBA_VERSION krb5 flag_mapping util_reg passdb',
+                   deps='LIBCRYPTO ndr ndr-util security NDR_SECURITY charset NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 CHARSET3 UTIL_TDB UTIL_PW SAMBA_VERSION krb5 flag_mapping util_reg passdb PTHREADPOOL',
                    private_library=True,
                    vars=locals())
 
@@ -1361,6 +1359,7 @@ bld.RECURSE('../nsswitch')
 bld.RECURSE('../nsswitch/libwbclient')
 bld.RECURSE('auth')
 bld.RECURSE('libgpo/gpext')
+bld.RECURSE('lib/pthreadpool')
 bld.RECURSE('librpc')
 bld.RECURSE('librpc/idl')
 bld.RECURSE('modules')