waf: use PYTHONARCHDIR for installing python shared libs
authorAndrew Tridgell <tridge@samba.org>
Fri, 14 Jan 2011 06:20:01 +0000 (17:20 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 14 Jan 2011 07:19:39 +0000 (08:19 +0100)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jan 14 08:19:40 CET 2011 on sn-devel-104

buildtools/wafsamba/samba_python.py
buildtools/wafsamba/wafsamba.py
source4/dynconfig/dynconfig.c
source4/dynconfig/dynconfig.h
source4/dynconfig/wscript
source4/scripting/python/modules.c
source4/wscript

index a663b1910d063336c1340142ae8855d7e176ecdb..e9afa939a3e9ee614c26de32fd20b3235071a962 100644 (file)
@@ -63,7 +63,7 @@ def SAMBA_PYTHON(bld, name,
                       link_name=link_name,
                       pyembed=True,
                       target_type='PYTHON',
-                      install_path='${PYTHONDIR}',
+                      install_path='${PYTHONARCHDIR}',
                       enabled=enabled)
 
 Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON
index 571cd480c76c657dc3e4df6ddf30db1de65e2a55..050777fe5d3cadf947d227ea2c38604ae83ca475 100644 (file)
@@ -634,8 +634,8 @@ def install_file(bld, destdir, file, chmod=MODE_644, flat=False,
     if python_fixup:
         # fixup the python path it will use to find Samba modules
         inst_file = file + '.inst'
-        if bld.env["PYTHONDIR"] not in sys.path:
-            regex = "s|\(sys.path.insert.*\)bin/python\(.*\)$|\\1${PYTHONDIR}\\2|g"
+        if bld.env["PYTHONARCHDIR"] not in sys.path:
+            regex = "s|\(sys.path.insert.*\)bin/python\(.*\)$|\\1${PYTHONARCHDIR}\\2|g"
         else:
             # Eliminate updating sys.path if the target python dir is already
             # in python path.
index 0c23452cc33ed3395f6bd23c66d08e51819599a3..9fbfed05434263ce0f595bf0a41062fc614dcbcd 100644 (file)
@@ -92,4 +92,5 @@ DEFINE_DYN_CONFIG_PARAM(WINBINDD_SOCKET_DIR)
 DEFINE_DYN_CONFIG_PARAM(WINBINDD_PRIVILEGED_SOCKET_DIR)
 DEFINE_DYN_CONFIG_PARAM(NTP_SIGND_SOCKET_DIR)
 DEFINE_DYN_CONFIG_PARAM(PYTHONDIR)
+DEFINE_DYN_CONFIG_PARAM(PYTHONARCHDIR)
 DEFINE_DYN_CONFIG_PARAM(SCRIPTSBINDIR)
index c7590813a4e3e51726a6507f0bc099e5f074fd50..579f45b3f1628aa0d5cbfc682c0ebf401d90a3d2 100644 (file)
@@ -56,4 +56,5 @@ DEFINE_DYN_CONFIG_PROTO(WINBINDD_SOCKET_DIR)
 DEFINE_DYN_CONFIG_PROTO(WINBINDD_PRIVILEGED_SOCKET_DIR)
 DEFINE_DYN_CONFIG_PROTO(NTP_SIGND_SOCKET_DIR)
 DEFINE_DYN_CONFIG_PROTO(PYTHONDIR)
+DEFINE_DYN_CONFIG_PROTO(PYTHONARCHDIR)
 DEFINE_DYN_CONFIG_PROTO(SCRIPTSBINDIR)
index 375d4a14ea2f835cf21cfc28b7a56a4ccf070369..00580471826b57bd93610a1b0a6eccc397374f8c 100644 (file)
@@ -32,6 +32,7 @@ dyn_cflags = {
     'NTP_SIGND_SOCKET_DIR'           : '${NTP_SIGND_SOCKET_DIR}',
     'NCALRPCDIR'                     : '${LOCALSTATEDIR}/ncalrpc',
     'PYTHONDIR'                      : '${PYTHONDIR}',
+    'PYTHONARCHDIR'                  : '${PYTHONARCHDIR}',
     'MODULESDIR'                     : '${PREFIX}/modules',
     'INCLUDEDIR'                     : '${PREFIX}/include',
     'PKGCONFIGDIR'                   : '${LIBDIR}/pkgconfig',
@@ -62,7 +63,7 @@ dyn_cflags_fhs = {
     'WINBINDD_PRIVILEGED_SOCKET_DIR' : '${LOCALSTATEDIR}/run/samba/winbindd_privileged',
     'NTP_SIGND_SOCKET_DIR'           : '${LOCALSTATEDIR}/run/samba/ntp_signd',
     'NCALRPCDIR'                     : '${LOCALSTATEDIR}/ncalrpc',
-    'PYTHONDIR'                      : '${PYTHONDIR}',
+    'PYTHONARCHDIR'                  : '${PYTHONARCHDIR}',
     'MODULESDIR'                     : '${LIBDIR}/samba',
     'LIBEXECDIR'                     : '${MODULESDIR}',
     'INCLUDEDIR'                     : '${INCLUDEDIR}/samba-4.0',
index 18253758b8c24180a758a8c8600ecf970474fe1a..960239e8636ecc23a03ae4d05ef3b51db238660a 100644 (file)
@@ -50,6 +50,10 @@ bool py_update_path(const char *bindir)
                return false;
        }
 
+       if (!PySys_PathPrepend(py_path, dyn_PYTHONARCHDIR)) {
+               return false;
+       }
+
        if (!PySys_PathPrepend(py_path, dyn_PYTHONDIR)) {
                return false;
        }
index 8c1bc71f9e10522e71f8fac9fc12871586617999..3fdeb3c14e438c11b24d84bff647fbdb4b5e3c8c 100644 (file)
@@ -122,6 +122,8 @@ def configure(conf):
     # we don't want PYTHONDIR in config.h, as otherwise changing
     # --prefix causes a complete rebuild
     del(conf.env.defines['PYTHONDIR'])
+    del(conf.env.defines['PYTHONARCHDIR'])
+
     conf.SAMBA_CONFIG_H('include/config.h')