Author: tpot Date: 2005-09-21 07:12:23 +0000 (Wed, 21 Sep 2005) New Revision: 10378
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10378 Log: Build config.h file from dictionary of defines and always use it. Modified: branches/SAMBA_4_0/source/SConstruct Changeset: Modified: branches/SAMBA_4_0/source/SConstruct =================================================================== --- branches/SAMBA_4_0/source/SConstruct 2005-09-21 05:39:18 UTC (rev 10377) +++ branches/SAMBA_4_0/source/SConstruct 2005-09-21 07:12:23 UTC (rev 10378) @@ -15,7 +15,6 @@ opts.AddOptions( BoolOption('developer','enable developer flags', 0), PathOption('prefix','installation prefix','/usr/local/samba'), - BoolOption('configh','use config.h file', 0), BoolOption('configure','run configure checks', False), ) @@ -156,10 +155,16 @@ if hostenv['configure']: saveconfig(defines) -if hostenv['configh']: - def create_config_h(env,target,source): - pass #FIXME - hostenv.Command('include/config.h',[],create_config_h) - hostenv.Append(CPPDEFINES = {'HAVE_CONFIG_H': 1}) -else: - [hostenv.Append(CPPDEFINES = {p: defines[p]}) for p in defines] +# How to create config.h file + +def create_config_h(env, target, source): + fd = open(str(target[0]), 'w') + [fd.write('#define %s\n' % x) for x in defines] + fd.close() + +def create_config_h_print(*args, **kwargs): + print 'Building config.h' + +hostenv.Command('include/config.h', [], + Action(create_config_h, create_config_h_print)) +hostenv.Append(CPPDEFINES = {'HAVE_CONFIG_H': 1})