pyldb: avoid segfault when adding an element with no name
[nivanova/samba-autobuild/.git] / python / wscript
index 623ca44b00595a013b0c3b7fc229e38123cafdba..916031896d362a35139fe796e8aa5c63265a92b7 100644 (file)
@@ -3,7 +3,10 @@
 import os
 
 def configure(conf):
-    kerberos_py = conf.srcdir + "/python/samba/provision/kerberos_implementation.py"
+    if conf.env.disable_python:
+        return
+
+    kerberos_py = conf.srcnode.abspath() + "/python/samba/provision/kerberos_implementation.py"
 
     f = open(kerberos_py, 'w')
     try:
@@ -39,19 +42,31 @@ def configure(conf):
         f.close()
 
 def build(bld):
-    bld.SAMBA_LIBRARY('samba_python',
+
+
+    pytalloc_util = bld.pyembed_libname('pytalloc-util')
+    pyparam_util = bld.pyembed_libname('pyparam_util')
+    libpython = bld.pyembed_libname('LIBPYTHON')
+    pyrpc_util = bld.pyembed_libname('pyrpc_util')
+    samba_python = bld.pyembed_libname('samba_python')
+    bld.SAMBA_LIBRARY(samba_python,
                       source=[],
-                      deps='''
-                           LIBPYTHON
-                           pytalloc-util
-                           pyrpc_util
-                           ''',
+                      deps='%s %s %s' % (libpython, pytalloc_util, pyrpc_util),
                       grouping_library=True,
                       private_library=True,
                       pyembed=True,
                       enabled=bld.PYTHON_BUILD_IS_ENABLED())
+    bld.SAMBA_PYTHON('python_glue',
+                     source='pyglue.c',
+                     deps='''
+                              %s
+                              samba-util
+                              netif
+                              %s
+                              ''' % (pyparam_util, pytalloc_util),
+                     realname='samba/_glue.so')
 
-    bld.SAMBA_SUBSYSTEM('LIBPYTHON',
+    bld.SAMBA_SUBSYSTEM(libpython,
                         source='modules.c',
                         public_deps='',
                         init_function_sentinel='{NULL,NULL}',
@@ -59,25 +74,10 @@ def build(bld):
                         pyext=True,
                         enabled=bld.PYTHON_BUILD_IS_ENABLED())
 
-    for env in bld.gen_python_environments():
-        pytalloc_util = bld.pyembed_libname('pytalloc-util')
-        pyparam_util = bld.pyembed_libname('pyparam_util')
-
-        bld.SAMBA_PYTHON('python_glue',
-                         source='pyglue.c',
-                         deps='''
-                              %s
-                              samba-util
-                              netif
-                              %s
-                              ''' % (pyparam_util, pytalloc_util),
-                         realname='samba/_glue.so')
-
     if bld.PYTHON_BUILD_IS_ENABLED():
-        for env in bld.gen_python_environments():
-            # install out various python scripts for use by make test
-            bld.SAMBA_SCRIPT('samba_python_files',
-                             pattern='samba/**/*.py',
-                             installdir='python')
-
-            bld.INSTALL_WILDCARD('${PYTHONARCHDIR}', 'samba/**/*.py', flat=False)
+        # install out various python scripts for use by make test
+        bld.SAMBA_SCRIPT('samba_python_files',
+                         pattern='samba/**/*.py',
+                         installdir='python')
+        
+        bld.INSTALL_WILDCARD('${PYTHONARCHDIR}', 'samba/**/*.py', flat=False)