diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-09-21 15:18:11 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:39 -0500 |
commit | 90678b76d64fd478a0cb7d81e7242ac6806fe754 (patch) | |
tree | 51913d35925f3e062524995fbf439636a4d28b4d /source4/SConstruct | |
parent | b1ad4a27cb7f7a0169c4f6a3756462912a9fa8e6 (diff) | |
download | samba-90678b76d64fd478a0cb7d81e7242ac6806fe754.tar.gz samba-90678b76d64fd478a0cb7d81e7242ac6806fe754.tar.bz2 samba-90678b76d64fd478a0cb7d81e7242ac6806fe754.zip |
r10393: More type checking in scons
Remove unused file
(This used to be commit a9e71ab5d1ed8b34f158ff0e89dd67ec785b9829)
Diffstat (limited to 'source4/SConstruct')
-rw-r--r-- | source4/SConstruct | 58 |
1 files changed, 54 insertions, 4 deletions
diff --git a/source4/SConstruct b/source4/SConstruct index f399fd2c7a..0e0a8a278f 100644 --- a/source4/SConstruct +++ b/source4/SConstruct @@ -13,7 +13,7 @@ import cPickle opts = Options(None, ARGUMENTS) opts.AddOptions( - BoolOption('developer','enable developer flags', 0), + BoolOption('developer','enable developer flags', False), PathOption('prefix','installation prefix','/usr/local/samba'), BoolOption('configure','run configure checks', False), ) @@ -42,6 +42,9 @@ if hostenv['developer']: hostenv.Append(CCFLAGS='-Wno-format-y2k') hostenv.Append(CCFLAGS='-Wno-declaration-after-statement') +# Pull in GNU extensions +hostenv.Append(CPPDEFINES = {'_GNU_SOURCE': 1}) + # Store configuration data in a dictionary. def saveconfig(data): @@ -116,7 +119,7 @@ if hostenv['configure']: ['sys/syslog.h','syslog.h','stdint.h','inttypes.h','locale.h'] + \ ['shadow.h','nss.h','nss_common.h','ns_api.h','sys/security.h'] + \ ['security/pam_appl.h','sys/capability.h','syscall.h','sys/syscall.h'] + \ - ['sys/acl.h']: + ['sys/acl.h','stdbool.h']: if conf.CheckCHeader(h): defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1 @@ -132,6 +135,54 @@ if hostenv['configure']: if conf.CheckFunc(f): defines['HAVE_' + f.upper()] = 1 + needed_types = { + 'uint_t': 'unsigned int', + 'int8_t': 'signed char', + 'uint8_t': 'unsigned char', + 'int16_t': 'short', + 'uint16_t': 'unsigned short', + 'int32_t': 'long', + 'uint32_t': 'unsigned long', + 'int64_t': 'long long', + 'uint64_t': 'unsigned long long' + } + + type_headers = """ +#include <stdint.h> +""" + for t in needed_types: + if not conf.CheckType(t,type_headers): + defines[t] = needed_types[t] + + if conf.TryCompile(""" +#include <sys/types.h> + +int main() +{ + volatile int i = 0; + return 0; +}""", '.c'): + defines['HAVE_VOLATILE'] = 1 + + if conf.TryCompile(""" +#include <stdio.h> + +int main() +{ + typedef struct {unsigned x;} FOOBAR; + #define X_FOOBAR(x) ((FOOBAR) { x }) + #define FOO_ONE X_FOOBAR(1) + FOOBAR f = FOO_ONE; + static struct { + FOOBAR y; + } f2[] = { + {FOO_ONE} + }; + return 0; +}""", '.c'): + defines['HAVE_IMMEDIATE_STRUCTURES'] = 1 + + hostenv.AlwaysBuild('include/config.h') conf.Finish() [dynenv.Append(CPPDEFINES = {p: '\\"%s\\"' % paths[p]}) for p in paths] @@ -156,10 +207,9 @@ if hostenv['configure']: saveconfig(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.write('#define %s %s\n' % (x, defines[x])) for x in defines] fd.close() def create_config_h_print(*args, **kwargs): |