third_party/popt: Initial support for popt.
[sfrench/samba-autobuild/.git] / ctdb / wscript
index 389afbbc5e66e1f7bbecac00186c0b47d468000e..5014f056e5514db8f46c5d81d039b330783436f7 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')