build: neater way to find libreplace and start on tevent waf build
[samba.git] / lib / talloc / wscript
index 879b37595a994d10423b4386e41a8a02d3ec64ad..989a8a8b41c161486b4d64cc9e91866efd4b82f3 100644 (file)
@@ -1,25 +1,25 @@
+VERSION = '2.0.1'
+
 srcdir = '.'
 blddir = 'build'
 
+LIBREPLACE_DIR='../replace'
+
 def set_options(opt):
-    opt.recurse('../replace')
+    opt.recurse(LIBREPLACE_DIR)
 
 def configure(conf):
-    conf.recurse('../replace')
+    conf.sub_config(LIBREPLACE_DIR)
+    conf.SAMBA_CONFIG_H()
 
 def build(bld):
-    bld.recurse('../replace')
+    bld.add_subdirs(LIBREPLACE_DIR)
 
-    bld(
-        features = 'cc cshlib',
-        source = 'talloc.c',
-        target='talloc',
-        includes = '. ../replace')
+    bld.SAMBA_LIBRARY('talloc',
+                      'talloc.c',
+                      libdeps='replace',
+                      vnum=VERSION)
 
-    # test program
-    bld(
-        features = 'cc cprogram',
-        source = 'testsuite.c testsuite_main.c',
-        target = 'talloc_testsuite',
-        uselib_local = 'replace talloc',
-        includes = '. ../replace default /usr/include')
+    bld.SAMBA_BINARY('talloc_testsuite',
+                     'testsuite.c testsuite_main.c',
+                     'talloc')