Curious issue with -b output when building Samba master branch

Richard Sharpe realrichardsharpe at
Wed Feb 4 16:47:26 MST 2015

On Wed, Feb 4, 2015 at 1:40 PM, Richard Sharpe
<realrichardsharpe at> wrote:
> Hi,
> when I run my own script that passes essentially what
> RedHat passes to configure on a Samba 4.1.x build, I see the following
> in the configure log,
> Dynconfig[SOCKET_DIR]:
>            : '/var/run'
> Dynconfig[MODULESDIR]:
>            : '/usr/lib64/samba'
>            : '/var/lib/samba/winbindd_privileged'
> but MODULESDIR is different when I run smbd -b:
>    LMHOSTSFILE: /etc/samba/lmhosts
>    LIBDIR: /usr/lib
>    MODULESDIR: /home/rsharpe/somedir/samba/bin/modules
>    SHLIBEXT: so
>    LOCKDIR: /var/lib/samba
> Why is this? How can I force the binary to have the correct thing
> because I want to be able to copy these binaries to the correct place
> on a remote node and have things work correctly.

OK, I think I have found the source of this disturbing behavior. In
dynconfig/wscript I see this little snippet of code:

def get_override(bld):
    override = { 'MODULESDIR'    : 'bin/modules',
                 'PYTHONDIR'     : 'bin/python',
                 'PYTHONARCHDIR' : 'bin/python',
                 'BINDIR'        : 'bin',
                 'SBINDIR'       : 'bin',
                 'CODEPAGEDIR'   : 'codepages',
                 'SCRIPTSBINDIR' : 'source4/scripting/bin',
                 'SETUPDIR'      : 'source4/setup'
    return override

def dynconfig_cflags(bld, list=None):
    '''work out the extra CFLAGS for dynconfig.c'''
    cflags = []
    for varname in dynconfig.keys():
        if list and not varname in list:
        value = bld.env[varname]
        if not Options.is_install:
            override = get_override(bld)
            if varname in override:
                value = os.path.join(bld.env.srcdir, override[varname])
        cflags.append('-D%s="%s"' % (varname, value))
    return cflags

Which would seem to be overriding a bunch of things if you are not
doing a make install.

Can anyone explain to me the reason for this?

In the environment I am working in I have a bunch of people who want
to have reasonable turn-around for changes and will want to copy the
just built binary to a set of other machines.

Having to go through an rpmbuild or a make install just to get one
changed binary is an enormous pain.

Is there some other way rather than hacking out that piece of code?

Richard Sharpe

More information about the samba-technical mailing list