diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-11-23 22:44:53 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-11-24 00:19:15 +0100 |
commit | 93d311c07e0b38193f823515b068e87dec144312 (patch) | |
tree | c6fa5b78769e6f6df4ca515e115d54455ced8f7c /source4/dynconfig | |
parent | 5d014cad087baf4d40af58cec2b6b875356e8548 (diff) | |
download | samba-93d311c07e0b38193f823515b068e87dec144312.tar.gz samba-93d311c07e0b38193f823515b068e87dec144312.tar.xz samba-93d311c07e0b38193f823515b068e87dec144312.zip |
s4-dynconfig: override more paths when running from the build directory
this ensures consistency between binaries and scripts when testing as
a developer
Diffstat (limited to 'source4/dynconfig')
-rw-r--r-- | source4/dynconfig/dynconfig.c | 1 | ||||
-rw-r--r-- | source4/dynconfig/dynconfig.h | 1 | ||||
-rw-r--r-- | source4/dynconfig/wscript | 17 |
3 files changed, 13 insertions, 6 deletions
diff --git a/source4/dynconfig/dynconfig.c b/source4/dynconfig/dynconfig.c index 358874ea38b..ac791411bf4 100644 --- a/source4/dynconfig/dynconfig.c +++ b/source4/dynconfig/dynconfig.c @@ -66,6 +66,7 @@ const char *dyn_##name = name; \ /* these are in common with s3 */ DEFINE_DYN_CONFIG_PARAM(SBINDIR) +DEFINE_DYN_CONFIG_PARAM(SCRIPTSBINDIR) DEFINE_DYN_CONFIG_PARAM(BINDIR) DEFINE_DYN_CONFIG_PARAM(SWATDIR) DEFINE_DYN_CONFIG_PARAM(CONFIGFILE) /**< Location of smb.conf file. **/ diff --git a/source4/dynconfig/dynconfig.h b/source4/dynconfig/dynconfig.h index 48f8ab628fe..48b4f54b21c 100644 --- a/source4/dynconfig/dynconfig.h +++ b/source4/dynconfig/dynconfig.h @@ -26,6 +26,7 @@ extern const char *dyn_BINDIR; extern const char *dyn_SBINDIR; +extern const char *dyn_SCRIPTSBINDIR; extern const char *dyn_CONFIGFILE; extern const char *dyn_NCALRPCDIR; extern const char *dyn_LOGFILEBASE; diff --git a/source4/dynconfig/wscript b/source4/dynconfig/wscript index d975698ddf4..375d4a14ea2 100644 --- a/source4/dynconfig/wscript +++ b/source4/dynconfig/wscript @@ -17,6 +17,7 @@ dir_options = { dyn_cflags = { 'BINDIR' : '${BINDIR}', 'SBINDIR' : '${SBINDIR}', + 'SCRIPTSBINDIR' : '${SBINDIR}', 'CONFIGDIR' : '${SYSCONFDIR}', 'CONFIGFILE' : '${SYSCONFDIR}/smb.conf', 'LMHOSTSFILE' : '${SYSCONFDIR}/lmhosts', @@ -47,6 +48,7 @@ dyn_cflags = { dyn_cflags_fhs = { 'BINDIR' : '${BINDIR}', 'SBINDIR' : '${SBINDIR}', + 'SCRIPTSBINDIR' : '${SBINDIR}', 'CONFIGDIR' : '${SYSCONFDIR}/samba', 'CONFIGFILE' : '${SYSCONFDIR}/samba/smb.conf', 'LMHOSTSFILE' : '${SYSCONFDIR}/samba/lmhosts', @@ -119,15 +121,18 @@ def configure(conf): def dynconfig_cflags(bld, list=None): '''work out the extra CFLAGS for dynconfig.c''' cflags = [] + # override some paths when running from the build directory + override = { 'MODULESDIR' : 'bin/modules', + 'SCRIPTSBINDIR' : 'scripting/bin', + 'SETUPDIR' : 'setup' } for f in dyn_cflags.keys(): if list and not f in list: continue - if not Options.is_install and f == 'MODULESDIR': - # we want binaries run from the source dir to use the current - # modules, not the installed ones - cflags.append('-DMODULESDIR="%s"' % os.path.join(os.getcwd(), 'bin/modules')) - else: - cflags.append('-D%s="%s"' % (f, bld.env[f])) + value = bld.env[f] + if not Options.is_install: + if f in override: + value = os.path.join(os.getcwd(), override[f]) + cflags.append('-D%s="%s"' % (f, value)) return cflags Build.BuildContext.dynconfig_cflags = dynconfig_cflags |