From 90678b76d64fd478a0cb7d81e7242ac6806fe754 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 Sep 2005 15:18:11 +0000 Subject: r10393: More type checking in scons Remove unused file (This used to be commit a9e71ab5d1ed8b34f158ff0e89dd67ec785b9829) --- source4/SConstruct | 58 +++++++++++++++++++++++++++++++++++++++--- source4/build/m4/check_shld.m4 | 6 ----- source4/build/m4/env.m4 | 1 - 3 files changed, 54 insertions(+), 11 deletions(-) delete mode 100644 source4/build/m4/check_shld.m4 (limited to 'source4') 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 +""" + for t in needed_types: + if not conf.CheckType(t,type_headers): + defines[t] = needed_types[t] + + if conf.TryCompile(""" +#include + +int main() +{ + volatile int i = 0; + return 0; +}""", '.c'): + defines['HAVE_VOLATILE'] = 1 + + if conf.TryCompile(""" +#include + +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): diff --git a/source4/build/m4/check_shld.m4 b/source4/build/m4/check_shld.m4 deleted file mode 100644 index de43aa0298..0000000000 --- a/source4/build/m4/check_shld.m4 +++ /dev/null @@ -1,6 +0,0 @@ -dnl SMB Build Environment Shared Ld Checks -dnl ------------------------------------------------------- -dnl Copyright (C) Stefan (metze) Metzmacher 2004 -dnl Released under the GNU GPL -dnl ------------------------------------------------------- -dnl diff --git a/source4/build/m4/env.m4 b/source4/build/m4/env.m4 index cba2780efa..f156bd34b9 100644 --- a/source4/build/m4/env.m4 +++ b/source4/build/m4/env.m4 @@ -19,6 +19,5 @@ sinclude(build/m4/check_path.m4) sinclude(build/m4/check_perl.m4) sinclude(build/m4/check_cc.m4) sinclude(build/m4/check_ld.m4) -sinclude(build/m4/check_shld.m4) sinclude(build/m4/check_types.m4) sinclude(build/m4/check_doc.m4) -- cgit