Simplifying dynconfig

Andrew Bartlett abartlet at samba.org
Fri Oct 3 12:50:10 MDT 2014


Martin,

You wrote that you dislike the complexity of dynconfig.  I agree!

I also wanted to reassure you that now we have waf, and thanks to some
of the loadparm work over the years, and finally because we have removed
the dynconfig overrides from the source3 popt code, there is little need
for it.  

The only calls to set_dyn_* are:

dynconfig/dynconfig.c:const char *set_dyn_##name(const char *newpath) \
dynconfig/dynconfig.h:const char *set_dyn_##name(const char *newpath);  \
source3/lib/popt_common.c:                              set_dyn_CONFIGFILE(getenv("SMB_CONF_PATH"));
source3/lib/popt_common.c:                      set_dyn_CONFIGFILE(arg);
source3/lib/popt_common.c:                      set_dyn_LOGFILEBASE(arg);
source3/nmbd/nmbd.c:                    set_dyn_CONFIGFILE(fname);
source3/nmbd/nmbd.c:            set_dyn_LMHOSTSFILE(p_lmhosts);
source3/smbd/server_reload.c:                   set_dyn_CONFIGFILE(fname);
source3/torture/torture.c:                      set_dyn_CONFIGFILE(getenv("SMB_CONF_PATH"));
source3/utils/smbpasswd.c:                      set_dyn_CONFIGFILE(optarg);
source3/winbindd/winbindd.c:                    set_dyn_CONFIGFILE(fname);

Even some of these an probably be removed, but it shows that the rest of
the dyn_ global variables and get_dyn_*() functions can be converted
back into a CPP defines quite safely.

The original purpose was to allow a recompile of Samba with a new prefix
without building the whole tree, when we had the autoconf build and
didn't fully specify our dependencies.  Those days are thankfully over.

The remaining useful purpose is the code to set this at configure time
(dynconfig/wscript), and of course that needs to remain. 

Andrew Bartlett
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list