third_party/iniparser: Initial support for iniparser.
authorIra Cooper <ira@samba.org>
Thu, 17 Jul 2014 22:04:35 +0000 (18:04 -0400)
committerIra Cooper <ira@samba.org>
Sat, 9 Aug 2014 16:26:16 +0000 (18:26 +0200)
This is the initial support for iniparser, as well the basic
third_party framework.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
buildtools/wafsamba/samba_third_party.py [new file with mode: 0644]
buildtools/wafsamba/wafsamba.py
third_party/iniparser/src/wscript
wscript
wscript_build

diff --git a/buildtools/wafsamba/samba_third_party.py b/buildtools/wafsamba/samba_third_party.py
new file mode 100644 (file)
index 0000000..2c50ad4
--- /dev/null
@@ -0,0 +1,15 @@
+# functions to support third party libraries
+
+from Configure import conf
+import sys, Logs, os
+from samba_bundled import *
+
+@conf
+def CHECK_FOR_THIRD_PARTY(conf):
+    return os.path.exists('third_party')
+
+Build.BuildContext.CHECK_FOR_THIRD_PARTY = CHECK_FOR_THIRD_PARTY
+
+@conf
+def CHECK_INIPARSER(conf):
+    return conf.CHECK_BUNDLED_SYSTEM('iniparser', checkfunctions='iniparser_load', headers='iniparser.h')
index 8ec4cb8..a2b8eea 100644 (file)
@@ -18,6 +18,7 @@ from samba_autoproto import *
 from samba_python import *
 from samba_deps import *
 from samba_bundled import *
+from samba_third_party import *
 import samba_install
 import samba_conftests
 import samba_abi
index c66f298..df9f60d 100644 (file)
@@ -5,7 +5,7 @@ import Options
 def configure(conf):
     conf.CHECK_HEADERS('float.h')
 
-    if conf.CHECK_BUNDLED_SYSTEM('iniparser', checkfunctions='iniparser_load', headers='iniparser.h'):
+    if conf.CHECK_INIPARSER():
         conf.define('USING_SYSTEM_INIPARSER', 1)
 
 def build(bld):
diff --git a/wscript b/wscript
index cf4e93b..92e060f 100644 (file)
--- a/wscript
+++ b/wscript
@@ -120,6 +120,15 @@ def configure(conf):
         raise Utils.WafError('Python version 3.x is not supported by Samba yet')
 
     conf.RECURSE('dynconfig')
+
+    if conf.CHECK_FOR_THIRD_PARTY():
+        conf.RECURSE('third_party/iniparser/src')
+    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.')
+        else:
+            conf.define('USING_SYSTEM_INIPARSER', 1)
+
     conf.RECURSE('lib/ldb')
 
     if Options.options.with_system_mitkrb5:
@@ -146,7 +155,6 @@ def configure(conf):
     conf.RECURSE('lib/socket_wrapper')
     conf.RECURSE('lib/uid_wrapper')
     conf.RECURSE('lib/popt')
-    conf.RECURSE('lib/iniparser/src')
     conf.RECURSE('lib/subunit/c')
     conf.RECURSE('libcli/smbreadline')
     conf.RECURSE('lib/crypto')
index 59ba354..c2956ea 100644 (file)
@@ -71,8 +71,9 @@ bld.RECURSE('source4/lib/cmdline')
 bld.RECURSE('lib/socket_wrapper')
 bld.RECURSE('lib/nss_wrapper')
 bld.RECURSE('lib/uid_wrapper')
+if bld.CHECK_FOR_THIRD_PARTY():
+    bld.RECURSE('third_party/iniparser/src')
 bld.RECURSE('lib/popt')
-bld.RECURSE('lib/iniparser/src')
 bld.RECURSE('source4/lib/stream')
 bld.RECURSE('lib/afs')
 bld.RECURSE('lib/util')