talloc: version 2.1.9
[samba.git] / lib / talloc / wscript
index c520294fa264bbcd2c5bc1b2a3ca0e6bc9ee28b7..7f9bad743555b442be30a91bf50cb361bfa0de18 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'talloc'
-VERSION = '2.1.2'
+VERSION = '2.1.9'
 
 
 blddir = 'bin'
@@ -42,6 +42,10 @@ def configure(conf):
 
     conf.env.standalone_talloc = conf.IN_LAUNCH_DIR()
 
+    conf.define('TALLOC_BUILD_VERSION_MAJOR', int(VERSION.split('.')[0]))
+    conf.define('TALLOC_BUILD_VERSION_MINOR', int(VERSION.split('.')[1]))
+    conf.define('TALLOC_BUILD_VERSION_RELEASE', int(VERSION.split('.')[2]))
+
     conf.env.disable_python = getattr(Options.options, 'disable_python', False)
 
     if not conf.env.standalone_talloc:
@@ -66,6 +70,9 @@ def configure(conf):
             Logs.warn('Disabling pytalloc-util as python devel libs not found')
             conf.env.disable_python = True
 
+    conf.CHECK_HEADERS('sys/auxv.h')
+    conf.CHECK_FUNCS('getauxval')
+
     conf.SAMBA_CONFIG_H()
 
     conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
@@ -97,6 +104,10 @@ def build(bld):
                          testsuite_deps,
                          install=False)
 
+        bld.SAMBA_BINARY('talloc_test_magic_differs_helper',
+                         'test_magic_differs_helper.c',
+                         'talloc', install=False)
+
     else:
         private_library = True
 
@@ -109,7 +120,7 @@ def build(bld):
                           abi_match='talloc* _talloc*',
                           hide_symbols=True,
                           vnum=VERSION,
-                          public_headers='talloc.h',
+                          public_headers=('' if private_library else 'talloc.h'),
                           pc_files='talloc.pc',
                           public_headers_install=not private_library,
                           private_library=private_library,
@@ -126,21 +137,19 @@ def build(bld):
                 vnum=VERSION,
                 hide_symbols=True,
                 abi_directory='ABI',
-                abi_match='pytalloc_*',
+                abi_match='pytalloc_* _pytalloc_*',
                 private_library=private_library,
-                public_headers='pytalloc.h',
+                public_headers=('' if private_library else 'pytalloc.h'),
                 pc_files='pytalloc-util.pc'
                 )
             bld.SAMBA_PYTHON('pytalloc',
                             'pytalloc.c',
                             deps='talloc ' + name,
-                            enabled=True,
                             realname='talloc.so')
 
             bld.SAMBA_PYTHON('test_pytalloc',
                             'test_pytalloc.c',
                             deps='pytalloc',
-                            enabled=True,
                             realname='_test_pytalloc.so',
                             install=False)
 
@@ -148,20 +157,18 @@ def build(bld):
 def test(ctx):
     '''run talloc testsuite'''
     import Utils, samba_utils
-    env = samba_utils.LOAD_ENVIRONMENT()
     cmd = os.path.join(Utils.g_module.blddir, 'talloc_testsuite')
     ret = samba_utils.RUN_COMMAND(cmd)
     print("testsuite returned %d" % ret)
-    if 'USING_SYSTEM_PYTALLOC_UTIL' not in env.defines and not env.disable_python:
-        cmd = "PYTHONPATH=%s %s test_pytalloc.py" % (
-            os.path.join(Utils.g_module.blddir, 'python'),
-            env['PYTHON'],
-        )
-        pyret = samba_utils.RUN_COMMAND(cmd)
-    else:
-        pyret = 0
+    magic_helper_cmd = os.path.join(Utils.g_module.blddir, 'talloc_test_magic_differs_helper')
+    magic_cmd = os.path.join(srcdir, 'lib', 'talloc',
+                             'test_magic_differs.sh')
+
+    magic_ret = samba_utils.RUN_COMMAND(magic_cmd + " " +  magic_helper_cmd)
+    print("magic differs test returned %d" % magic_ret)
+    pyret = samba_utils.RUN_PYTHON_TESTS(['test_pytalloc.py'])
     print("python testsuite returned %d" % pyret)
-    sys.exit(ret or pyret)
+    sys.exit(ret or magic_ret or pyret)
 
 def dist():
     '''makes a tarball for distribution'''