s3-waf: make the --with-Xdir options work more like in the classic build.
authorGünther Deschner <gd@samba.org>
Thu, 6 Jan 2011 23:05:27 +0000 (00:05 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 6 Jan 2011 23:57:10 +0000 (00:57 +0100)
Also remove duplicates and sort the tables.

Still not sure if I understand the reason of processing the flags table after
the diroptions table, as every option you give it via configure was overwritten
immediately.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Jan  7 00:57:10 CET 2011 on sn-devel-104

source3/build/dynconfig.py
source3/build/wscript

index 4bc97e5eddb4a5aa9b0f621833409f78dbba6fd2..f755f7fef5a0e3c5bceed14d2881d9538e7ca4b2 100644 (file)
@@ -2,51 +2,48 @@ import string, Utils
 
 # list of directory options to offer in configure
 dir_options = {
-    'with-piddir'                         : [ '${PREFIX}/var/locks', 'where to put pid files' ],
-    'with-privatedir'                     : [ '${PREFIX}/private', 'Where to put sam.ldb and other private files' ],
-    'with-winbindd-socket-dir'            : [ '${PREFIX}/var/lib/winbindd', 'winbind socket directory' ],
-    'with-winbindd-privileged-socket-dir' : [ '${PREFIX}/var/lib/winbindd_privileged', 'winbind privileged socket directory'],
-    'with-ntp-signd-socket-dir'           : [ '${PREFIX}/var/run/ntp_signd', 'NTP signed directory'],
-    'with-lockdir'                        : [ '${PREFIX}/var/locks', 'where to put lock files' ],
-    'with-codepagedir'                    : [ '${PREFIX}/lib/samba', 'where to put codepages' ],
-    'with-privatedir'                     : [ '${PREFIX}/private', 'where to put smbpasswd' ],
     'with-cachedir'                       : [ '${PREFIX}/var/locks', 'where to put temporary cache files' ],
-    'with-logfilebase'                    : [ '${PREFIX}/var/log/samba', 'Where to put log files' ],
+    'with-codepagedir'                    : [ '${PREFIX}/lib/samba', 'where to put codepages' ],
     'with-configdir'                      : [ '${PREFIX}/etc/samba', 'Where to put configuration files' ],
-    'with-swatdir'                        : [ '${PREFIX}/swat', 'Where to put SWAT files' ],
-    'with-statedir'                       : [ '${PREFIX}/var/locks', 'where to put persistent state files' ],
-    'with-cachedir'                       : [ '${PREFIX}/var/locks', 'where to put temporary cache files' ],
+    'with-lockdir'                        : [ '${PREFIX}/var/locks', 'where to put lock files' ],
+    'with-logfilebase'                    : [ '${PREFIX}/var/log/samba', 'Where to put log files' ],
     'with-ncalrpcdir'                     : [ '${PREFIX}/var/ncalrpc', 'where to put ncalrpc sockets' ],
+    'with-ntp-signd-socket-dir'           : [ '${PREFIX}/var/run/ntp_signd', 'NTP signed directory'],
     'with-pammodulesdir'                  : [ '', 'Which directory to use for PAM modules' ],
-    'with-codepagedir'                    : [ '${PREFIX}/lib/samba', 'Where to put codepages' ],
+    'with-piddir'                         : [ '${PREFIX}/var/locks', 'where to put pid files' ],
+    'with-privatedir'                     : [ '${PREFIX}/private', 'where to put smbpasswd' ],
     'with-selftest-prefix'                : [ '', 'The prefix where make test will be run' ],
-    'with-selftest-shrdir'                : [ '', 'The share directory that make test will be run against' ]
+    'with-selftest-shrdir'                : [ '', 'The share directory that make test will be run against' ],
+    'with-statedir'                       : [ '${PREFIX}/var/locks', 'where to put persistent state files' ],
+    'with-swatdir'                        : [ '${PREFIX}/swat', 'Where to put SWAT files' ],
+    'with-winbindd-privileged-socket-dir' : [ '${PREFIX}/var/lib/winbindd_privileged', 'winbind privileged socket directory'],
+    'with-winbindd-socket-dir'            : [ '${PREFIX}/var/lib/winbindd', 'winbind socket directory' ],
     }
 
 # list of cflags to use for dynconfig.c
 dyn_cflags = {
-    'CONFIGFILE'                     : '${SYSCONFDIR}/smb.conf',
     'BINDIR'                         : '${BINDIR}',
-    'SBINDIR'                        : '${SBINDIR}',
+    'CACHEDIR'                       : '${CACHEDIR}',
+    'CODEPAGEDIR'                    : '${CODEPAGEDIR}',
+    'CONFIGDIR'                      : '${SYSCONFDIR}',
+    'CONFIGFILE'                     : '${SYSCONFDIR}/smb.conf',
+    'DATADIR'                        : '${DATADIR}',
     'LIBDIR'                         : '${LIBDIR}',
-    'STATEDIR'                       : '${LOCALSTATEDIR}',
     'LMHOSTSFILE'                    : '${SYSCONFDIR}/lmhosts',
     'LOCKDIR'                        : '${LOCALSTATEDIR}/locks',
-    'PIDDIR'                         : '${LOCALSTATEDIR}/run',
-    'DATADIR'                        : '${DATADIR}',
     'LOGFILEBASE'                    : '${LOCALSTATEDIR}',
-    'CONFIGDIR'                      : '${SYSCONFDIR}',
+    'MODULESDIR'                     : '${PREFIX}/modules',
     'NCALRPCDIR'                     : '${LOCALSTATEDIR}/ncalrpc',
-    'SWATDIR'                        : '${PREFIX}/swat',
+    'NTP_SIGND_SOCKET_DIR'           : '${NTP_SIGND_SOCKET_DIR}',
+    'PIDDIR'                         : '${LOCALSTATEDIR}/run',
     'PRIVATE_DIR'                    : '${PRIVATEDIR}',
-    'MODULESDIR'                     : '${PREFIX}/modules',
+    'SBINDIR'                        : '${SBINDIR}',
     'SETUPDIR'                       : '${DATADIR}/setup',
+    'SMB_PASSWD_FILE'                : '${PRIVATEDIR}/smbpasswd',
+    'STATEDIR'                       : '${LOCALSTATEDIR}',
+    'SWATDIR'                        : '${PREFIX}/swat',
     'WINBINDD_PRIVILEGED_SOCKET_DIR' : '${WINBINDD_PRIVILEGED_SOCKET_DIR}',
     'WINBINDD_SOCKET_DIR'            : '${WINBINDD_SOCKET_DIR}',
-    'NTP_SIGND_SOCKET_DIR'           : '${NTP_SIGND_SOCKET_DIR}',
-    'CODEPAGEDIR'                    : '${CODEPAGEDIR}',
-    'CACHEDIR'                       : '${CACHEDIR}',
-    'SMB_PASSWD_FILE'                : '${PRIVATEDIR}/smbpasswd',
     }
 
 def get_varname(v):
index 3b0c66a9f4b38af9f322f9c0f0198beffdbe063f..c6eb55fc29d07a209e70bd850714acaa1a8a7e91 100644 (file)
@@ -23,6 +23,7 @@ def configure(conf):
     for option in dir_options.keys():
         varname = get_varname(option)
         value = getattr(Options.options, varname, None)
+        value = Utils.subst_vars(value, conf.env)
         conf.ASSERT(value is not None, "Missing configure option %s" % varname)
         conf.ASSERT(varname not in conf.env, "Variable %s already defined" % varname)
         conf.env[varname] = value
@@ -33,7 +34,8 @@ def configure(conf):
         v = Utils.subst_vars(v, conf.env)
         conf.ASSERT(v != '', "Empty dynconfig value for %s" % f)
         conf.ASSERT(v.find('${') == -1, "Unsubstituted variable in %s : %s : %s" % (f, dyn_cflags[f], v))
-        conf.env[f] = v
+        if f not in conf.env:
+            conf.env[f] = v
         if f in cflags_vars:
             conf.DEFINE(f, v, quote=True)