diff options
author | Tim Potter <tpot@samba.org> | 2005-09-21 07:12:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:33 -0500 |
commit | 5e4c8b8cd375131094e0fe40bd4c048539206ac2 (patch) | |
tree | ba07779e90db3aa80bedd63276ed2619d732ba5b | |
parent | d191c7d9932b8e8ad96c4345a6ceca67326806ac (diff) | |
download | samba-5e4c8b8cd375131094e0fe40bd4c048539206ac2.tar.gz samba-5e4c8b8cd375131094e0fe40bd4c048539206ac2.tar.bz2 samba-5e4c8b8cd375131094e0fe40bd4c048539206ac2.zip |
r10378: Build config.h file from dictionary of defines and always use it.
(This used to be commit 252b64eb20db9152d357188d45fb39bb3d0b61bc)
-rw-r--r-- | source4/SConstruct | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source4/SConstruct b/source4/SConstruct index 58f2640d09..f399fd2c7a 100644 --- a/source4/SConstruct +++ b/source4/SConstruct @@ -15,7 +15,6 @@ opts = Options(None, ARGUMENTS) 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 @@ hostenv.CProtoHeader(target='include/proto.h',source=proto_files) 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}) |