From f46b79bdb8824c7c95dee0a282b2c852091bcfce Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Thu, 17 Jul 2014 18:04:35 -0400 Subject: third_party/iniparser: Initial support for iniparser. This is the initial support for iniparser, as well the basic third_party framework. Signed-off-by: Ira Cooper Reviewed-by: Jeremy Allison --- buildtools/wafsamba/samba_third_party.py | 15 +++++++++++++++ buildtools/wafsamba/wafsamba.py | 1 + third_party/iniparser/src/wscript | 2 +- wscript | 10 +++++++++- wscript_build | 3 ++- 5 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 buildtools/wafsamba/samba_third_party.py diff --git a/buildtools/wafsamba/samba_third_party.py b/buildtools/wafsamba/samba_third_party.py new file mode 100644 index 00000000000..2c50ad4a8b2 --- /dev/null +++ b/buildtools/wafsamba/samba_third_party.py @@ -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') diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 8ec4cb80863..a2b8eea8e31 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -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 diff --git a/third_party/iniparser/src/wscript b/third_party/iniparser/src/wscript index c66f2980486..df9f60dc409 100644 --- a/third_party/iniparser/src/wscript +++ b/third_party/iniparser/src/wscript @@ -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 cf4e93b1c07..92e060f36f0 100644 --- 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') diff --git a/wscript_build b/wscript_build index 59ba354d48c..c2956ea5ed8 100644 --- a/wscript_build +++ b/wscript_build @@ -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') -- cgit v1.2.1