s4-waf: fixed finding of buildtools and srcdir
authorAndrew Tridgell <tridge@samba.org>
Sun, 4 Apr 2010 01:40:05 +0000 (11:40 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:25 +0000 (20:27 +1000)
lib/replace/wscript
lib/talloc/wscript
lib/tdb/wscript
lib/tevent/wscript
source4/lib/ldb/wscript

index db6bc5c450131e18c2cc18d7c5c632d82e9f4be3..af70c47a248eff06fd5228f5f9a9838770f49ee9 100644 (file)
@@ -5,16 +5,16 @@ VERSION = '1.2.1'
 
 blddir = 'bin'
 
-import sys, os
+import sys, os, Utils
 
 # find the buildtools directory
-buildtools = 'buildtools ../../buildtools'
-for d in buildtools.split():
-    if os.path.exists(d):
-        srcdir = os.path.dirname(d) or '.'
-        break
+buildtools = 'buildtools'
+while not os.path.exists(buildtools) and len(buildtools.split('/')) < 5:
+    buildtools = '../' + buildtools
+srcdir = os.path.dirname(buildtools) or '.'
+
+sys.path.insert(0, buildtools + "/wafsamba")
 
-sys.path.insert(0, srcdir+"/buildtools/wafsamba")
 import wafsamba, samba_dist
 import Options, os, preproc
 
index 17b3b1d3498b8867f66e727369a9c0d473745361..e577643595eab9ef04cfc6f49c3f1d12b3549d13 100644 (file)
@@ -5,16 +5,18 @@ VERSION = '2.0.2'
 
 blddir = 'bin'
 
+import os, sys
+
 # find the buildtools directory
-import os
-buildtools = 'buildtools ../../buildtools'
-for d in buildtools.split():
-    if os.path.exists(d):
-        srcdir = os.path.dirname(d) or '.'
-        break
+buildtools = 'buildtools'
+while not os.path.exists(buildtools) and len(buildtools.split('/')) < 5:
+    buildtools = '../' + buildtools
+srcdir = os.path.dirname(buildtools) or '.'
+
+sys.path.insert(0, buildtools + "/wafsamba")
 
 
-LIBREPLACE_DIR= srcdir + '/lib/replace'
+LIBREPLACE_DIR= '../replace'
 
 import sys
 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
index 3004c2dd92e05eca76162085fdada66e30040f19..8c941948c88393231ea41ee5cbf70760ee417dbf 100644 (file)
@@ -8,19 +8,18 @@ blddir = 'bin'
 import sys, os
 
 # find the buildtools directory
-buildtools = 'buildtools ../../buildtools'
-for d in buildtools.split():
-    if os.path.exists(d):
-        srcdir = os.path.dirname(d) or '.'
-        break
+buildtools = 'buildtools'
+while not os.path.exists(buildtools) and len(buildtools.split('/')) < 5:
+    buildtools = '../' + buildtools
+srcdir = os.path.dirname(buildtools) or '.'
 
-sys.path.insert(0, srcdir+"/buildtools/wafsamba")
+sys.path.insert(0, buildtools + "/wafsamba")
 import wafsamba, samba_dist
 
 samba_dist.DIST_DIRS('lib/tdb:. lib/replace:lib/replace buildtools:buildtools')
 
 
-LIBREPLACE_DIR= srcdir + '/lib/replace'
+LIBREPLACE_DIR= '../replace'
 
 def set_options(opt):
     opt.BUILTIN_DEFAULT('replace')
index 976048d0163c1da93fa3909fcb8a37da92b3ce4f..cc139ccee578b815dbd776377e7d63c808ae4cb4 100644 (file)
@@ -8,19 +8,19 @@ blddir = 'bin'
 import sys, os
 
 # find the buildtools directory
-buildtools = 'buildtools ../../buildtools'
-for d in buildtools.split():
-    if os.path.exists(d):
-        srcdir = os.path.dirname(d) or '.'
-        break
+buildtools = 'buildtools'
+while not os.path.exists(buildtools) and len(buildtools.split('/')) < 5:
+    buildtools = '../' + buildtools
+srcdir = os.path.dirname(buildtools) or '.'
+
+sys.path.insert(0, buildtools + "/wafsamba")
 
-sys.path.insert(0, srcdir+"/buildtools/wafsamba")
 import wafsamba, samba_dist
 
 samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools')
 
-LIBREPLACE_DIR= srcdir + '/lib/replace'
-LIBTALLOC_DIR=  srcdir + '/lib/talloc'
+LIBREPLACE_DIR= '../replace'
+LIBTALLOC_DIR=  '../talloc'
 
 def set_options(opt):
     opt.BUILTIN_DEFAULT('replace')
index e40d46ee7593a3578b2230cd4c0bfb0a2ae3b795..968485f69f0c5d44ff4f67616b785e9d3c00a943 100644 (file)
@@ -7,22 +7,21 @@ blddir = 'bin'
 
 import sys, os
 # find the buildtools directory
-buildtools = 'buildtools ../../../buildtools'
-for d in buildtools.split():
-    if os.path.exists(d):
-        srcdir = os.path.dirname(d) or '.'
-        break
+buildtools = 'buildtools'
+while not os.path.exists(buildtools) and len(buildtools.split('/')) < 5:
+    buildtools = '../' + buildtools
+srcdir = os.path.dirname(buildtools) or '.'
 
-sys.path.insert(0, srcdir+"/buildtools/wafsamba")
+sys.path.insert(0, buildtools + "/wafsamba")
 import wafsamba, samba_dist
 
 samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
                         lib/tdb:lib/tdb lib/tevent:lib/tevent buildtools:buildtools''')
 
 
-LIBTDB_DIR= srcdir + '/lib/tdb'
-LIBTEVENT_DIR= srcdir + '/lib/tevent'
-LIBPOPT_DIR= srcdir + '/lib/popt'
+LIBTDB_DIR= '../../../lib/tdb'
+LIBTEVENT_DIR= '../../../lib/tevent'
+LIBPOPT_DIR= '../../../lib/popt'
 
 def set_options(opt):
     opt.BUILTIN_DEFAULT('replace')