third_party/popt: Initial support for popt.
authorIra Cooper <ira@samba.org>
Wed, 23 Jul 2014 04:34:17 +0000 (21:34 -0700)
committerIra Cooper <ira@samba.org>
Sat, 9 Aug 2014 16:26:17 +0000 (18:26 +0200)
ctdb, ldb, and samba are supported builds for third_party popt.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
buildtools/wafsamba/samba_third_party.py
ctdb/third_party [new symlink]
ctdb/wscript
lib/ldb/wscript
source4/torture/winbind/wscript_build
source4/torture/wscript_build
testsuite/headers/wscript_build
third_party/popt/wscript
wscript
wscript_build

index b62bcc8..408d557 100644 (file)
@@ -33,3 +33,9 @@ def CHECK_ZLIB(conf):
                                      implied_deps='replace')
 
 Build.BuildContext.CHECK_ZLIB = CHECK_ZLIB
+
+@conf
+def CHECK_POPT(conf):
+    return conf.CHECK_BUNDLED_SYSTEM('popt', checkfunctions='poptGetContext', headers='popt.h')
+
+Build.BuildContext.CHECK_POPT = CHECK_POPT
diff --git a/ctdb/third_party b/ctdb/third_party
new file mode 120000 (symlink)
index 0000000..d838c05
--- /dev/null
@@ -0,0 +1 @@
+../third_party
\ No newline at end of file
index 389afbb..5014f05 100755 (executable)
@@ -12,7 +12,7 @@ while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
     srcdir = srcdir + '/..'
 sys.path.insert(0, srcdir + '/buildtools/wafsamba')
 
-import wafsamba, samba_dist, Options, Logs
+import wafsamba, samba_dist, Options, Logs, Utils
 import samba_utils, samba_version
 
 env = samba_utils.LOAD_ENVIRONMENT()
@@ -66,7 +66,14 @@ def configure(conf):
         Options.options.disable_python = True
 
     conf.RECURSE('lib/replace')
-    conf.RECURSE('lib/popt')
+    if conf.CHECK_FOR_THIRD_PARTY():
+       conf.RECURSE('third_party/popt')
+    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.RECURSE('lib/talloc')
     conf.RECURSE('lib/tevent')
     conf.RECURSE('lib/tdb')
@@ -155,7 +162,9 @@ def configure(conf):
 
 def build(bld):
     bld.RECURSE('lib/replace')
-    bld.RECURSE('lib/popt')
+    if bld.CHECK_FOR_THIRD_PARTY():
+       bld.RECURSE('third_party/popt')
+
     bld.RECURSE('lib/talloc')
     bld.RECURSE('lib/tevent')
     bld.RECURSE('lib/tdb')
index ba75d67..be04544 100755 (executable)
@@ -16,7 +16,8 @@ sys.path.insert(0, srcdir + '/buildtools/wafsamba')
 import wafsamba, samba_dist, Options
 
 samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
-                        lib/tdb:lib/tdb lib/tdb:lib/tdb lib/tevent:lib/tevent lib/popt:lib/popt
+                        lib/tdb:lib/tdb lib/tdb:lib/tdb lib/tevent:lib/tevent
+                       third_party/popt:third_party/popt
                         buildtools:buildtools''')
 
 
@@ -31,7 +32,15 @@ def set_options(opt):
 def configure(conf):
     conf.RECURSE('lib/tdb')
     conf.RECURSE('lib/tevent')
-    conf.RECURSE('lib/popt')
+
+    if conf.CHECK_FOR_THIRD_PARTY():
+        conf.RECURSE('third_party/popt')
+    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.RECURSE('lib/replace')
     conf.find_program('python', var='PYTHON')
     conf.find_program('xsltproc', var='XSLTPROC')
@@ -75,7 +84,10 @@ def configure(conf):
 
 def build(bld):
     bld.RECURSE('lib/tevent')
-    bld.RECURSE('lib/popt')
+
+    if os.path.exists('third_party'):
+        bld.RECURSE('third_party/popt')
+
     bld.RECURSE('lib/replace')
     bld.RECURSE('lib/tdb')
 
index 0ae9852..0def23e 100644 (file)
@@ -6,6 +6,6 @@ bld.SAMBA_MODULE('TORTURE_WINBIND',
        autoproto='proto.h',
        subsystem='smbtorture',
        init_function='torture_winbind_init',
-       deps='wbclient winbind-client torture PAM_ERRORS',
+       deps='popt wbclient winbind-client torture PAM_ERRORS',
        internal_module=True
        )
index 4ba7675..39192b0 100755 (executable)
@@ -3,7 +3,7 @@
 
 bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
        source='util_smb.c',
-       public_deps='torture POPT_CREDENTIALS',
+       public_deps='torture popt POPT_CREDENTIALS',
        deps='smbclient-raw'
        )
 
@@ -12,7 +12,7 @@ bld.SAMBA_MODULE('TORTURE_BASIC',
        source='basic/base.c basic/misc.c basic/scanner.c basic/utable.c basic/charset.c basic/mangle_test.c basic/denytest.c basic/aliases.c basic/locking.c basic/secleak.c basic/rename.c basic/dir.c basic/delete.c basic/unlink.c basic/disconnect.c basic/delaywrite.c basic/attr.c basic/properties.c',
        allow_warnings=True,
        subsystem='smbtorture',
-       deps='LIBCLI_SMB POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
+       deps='LIBCLI_SMB popt POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
        internal_module=True,
        autoproto='basic/proto.h',
        init_function='torture_base_init'
@@ -25,7 +25,7 @@ bld.SAMBA_MODULE('TORTURE_RAW',
        autoproto='raw/proto.h',
        subsystem='smbtorture',
        init_function='torture_raw_init',
-       deps='LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE POPT_CREDENTIALS TORTURE_UTIL',
+       deps='LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE popt POPT_CREDENTIALS TORTURE_UTIL',
        internal_module=True
        )
 
@@ -55,7 +55,7 @@ bld.SAMBA_MODULE('torture_rpc',
        autoproto='rpc/proto.h',
        subsystem='smbtorture',
        init_function='torture_rpc_init',
-       deps='ndr-table RPC_NDR_UNIXINFO dcerpc-samr RPC_NDR_WINREG RPC_NDR_INITSHUTDOWN RPC_NDR_OXIDRESOLVER RPC_NDR_EVENTLOG RPC_NDR_ECHO RPC_NDR_SVCCTL RPC_NDR_NETLOGON dcerpc-atsvc RPC_NDR_DRSUAPI RPC_NDR_LSA RPC_NDR_EPMAPPER RPC_NDR_DFS RPC_NDR_FRSAPI RPC_NDR_SPOOLSS RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER RPC_NDR_NTSVCS WB_HELPER samba-net LIBCLI_AUTH POPT_CREDENTIALS TORTURE_LDAP TORTURE_UTIL TORTURE_RAP service process_model RPC_NDR_BROWSER LIBCLI_DRSUAPI TORTURE_DFS RPC_NDR_FSRVP '+heimdal_specific['rpc'][1],
+       deps='ndr-table RPC_NDR_UNIXINFO dcerpc-samr RPC_NDR_WINREG RPC_NDR_INITSHUTDOWN RPC_NDR_OXIDRESOLVER RPC_NDR_EVENTLOG RPC_NDR_ECHO RPC_NDR_SVCCTL RPC_NDR_NETLOGON dcerpc-atsvc RPC_NDR_DRSUAPI RPC_NDR_LSA RPC_NDR_EPMAPPER RPC_NDR_DFS RPC_NDR_FRSAPI RPC_NDR_SPOOLSS RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER RPC_NDR_NTSVCS WB_HELPER samba-net LIBCLI_AUTH popt POPT_CREDENTIALS TORTURE_LDAP TORTURE_UTIL TORTURE_RAP service process_model RPC_NDR_BROWSER LIBCLI_DRSUAPI TORTURE_DFS RPC_NDR_FSRVP '+heimdal_specific['rpc'][1],
        internal_module=True
        )
 
@@ -85,7 +85,7 @@ bld.SAMBA_MODULE('TORTURE_AUTH',
        source='auth/ntlmssp.c auth/pac.c auth/smbencrypt.c',
        autoproto='auth/proto.h',
        subsystem='smbtorture',
-       deps='LIBCLI_SMB gensec auth4 authkrb5 POPT_CREDENTIALS smbpasswdparser torture com_err gensec_ntlmssp',
+       deps='LIBCLI_SMB gensec auth4 authkrb5 popt POPT_CREDENTIALS smbpasswdparser torture com_err gensec_ntlmssp',
        internal_module=True
        )
 
@@ -114,7 +114,7 @@ bld.SAMBA_MODULE('TORTURE_UNIX',
 bld.SAMBA_MODULE('TORTURE_LDAP',
        source='ldap/common.c ldap/basic.c ldap/schema.c ldap/uptodatevector.c ldap/cldap.c ldap/netlogon.c ldap/cldapbench.c ldap/ldap_sort.c ldap/nested_search.c',
        subsystem='smbtorture',
-       deps='cli-ldap cli_cldap samdb POPT_CREDENTIALS torture ldbsamba',
+       deps='cli-ldap cli_cldap samdb popt POPT_CREDENTIALS torture ldbsamba',
        internal_module=True,
        autoproto='ldap/proto.h',
        init_function='torture_ldap_init'
@@ -136,7 +136,7 @@ bld.SAMBA_MODULE('TORTURE_NET',
        autoproto='libnet/proto.h',
        subsystem='smbtorture',
        init_function='torture_net_init',
-       deps='samba-net POPT_CREDENTIALS torture_rpc PROVISION',
+       deps='samba-net popt POPT_CREDENTIALS torture_rpc PROVISION',
        internal_module=True
        )
 
@@ -146,7 +146,7 @@ bld.SAMBA_MODULE('TORTURE_NTP',
        autoproto='ntp/proto.h',
        subsystem='smbtorture',
        init_function='torture_ntp_init',
-       deps='POPT_CREDENTIALS torture_rpc',
+       deps='popt POPT_CREDENTIALS torture_rpc',
        internal_module=True
        )
 
index 635c864..f612ad9 100644 (file)
@@ -35,7 +35,7 @@ for lib in ['talloc', 'tevent', 'tdb', 'ldb', 'popt' ]:
         cflags += bld.env.CPPPATH_ST % p + ' '
 
 if not bld.env.USING_SYSTEM_POPT:
-    cflags += bld.env.CPPPATH_ST % '../lib/popt'
+    cflags += bld.env.CPPPATH_ST % '../third_party/popt'
 
 if bld.env.DEVELOPER_MODE:
     bld.SAMBA_BINARY('test_headers',
index d622841..e81572c 100644 (file)
@@ -5,7 +5,7 @@ import Options
 def configure(conf):
     conf.CHECK_HEADERS('float.h')
 
-    if conf.CHECK_BUNDLED_SYSTEM('popt', checkfunctions='poptGetContext', headers='popt.h'):
+    if conf.CHECK_POPT():
         conf.define('USING_SYSTEM_POPT', 1)
 
 def build(bld):
diff --git a/wscript b/wscript
index 377ab66..76e1f38 100644 (file)
--- a/wscript
+++ b/wscript
@@ -124,6 +124,7 @@ def configure(conf):
     if conf.CHECK_FOR_THIRD_PARTY():
         conf.RECURSE('third_party/iniparser/src')
         conf.RECURSE('third_party/zlib')
+        conf.RECURSE('third_party/popt')
     else:
         if not conf.CHECK_INIPARSER():
             raise Utils.WafError('iniparser development packages have not been found.\nIf third_party is installed, check that it is in the proper place.')
@@ -133,7 +134,12 @@ def configure(conf):
         if not conf.CHECK_ZLIB():
             raise Utils.WafError('zlib development packages have not been found.\nIf third_party is installed, check that it is in the proper place.')
         else:
-            conf.define('USING_SYSTEM_ZLIB',1);
+            conf.define('USING_SYSTEM_ZLIB',1)
+
+        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.RECURSE('lib/ldb')
 
@@ -159,7 +165,6 @@ def configure(conf):
     conf.RECURSE('nsswitch')
     conf.RECURSE('lib/socket_wrapper')
     conf.RECURSE('lib/uid_wrapper')
-    conf.RECURSE('lib/popt')
     conf.RECURSE('lib/subunit/c')
     conf.RECURSE('libcli/smbreadline')
     conf.RECURSE('lib/crypto')
index 328038f..b071817 100644 (file)
@@ -74,7 +74,7 @@ bld.RECURSE('lib/uid_wrapper')
 if bld.CHECK_FOR_THIRD_PARTY():
     bld.RECURSE('third_party/iniparser/src')
     bld.RECURSE('third_party/zlib')
-bld.RECURSE('lib/popt')
+    bld.RECURSE('third_party/popt')
 bld.RECURSE('source4/lib/stream')
 bld.RECURSE('lib/afs')
 bld.RECURSE('lib/util')