Author: jelmer
Date: 2005-09-21 15:18:11 +0000 (Wed, 21 Sep 2005)
New Revision: 10393

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10393

Log:
More type checking in scons
Remove unused file

Removed:
   branches/SAMBA_4_0/source/build/m4/check_shld.m4
Modified:
   branches/SAMBA_4_0/source/SConstruct
   branches/SAMBA_4_0/source/build/m4/env.m4


Changeset:
Modified: branches/SAMBA_4_0/source/SConstruct
===================================================================
--- branches/SAMBA_4_0/source/SConstruct        2005-09-21 15:17:11 UTC (rev 
10392)
+++ branches/SAMBA_4_0/source/SConstruct        2005-09-21 15:18:11 UTC (rev 
10393)
@@ -13,7 +13,7 @@
 
 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 @@
        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 @@
                ['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 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 @@
        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):

Deleted: branches/SAMBA_4_0/source/build/m4/check_shld.m4
===================================================================
--- branches/SAMBA_4_0/source/build/m4/check_shld.m4    2005-09-21 15:17:11 UTC 
(rev 10392)
+++ branches/SAMBA_4_0/source/build/m4/check_shld.m4    2005-09-21 15:18:11 UTC 
(rev 10393)
@@ -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

Modified: branches/SAMBA_4_0/source/build/m4/env.m4
===================================================================
--- branches/SAMBA_4_0/source/build/m4/env.m4   2005-09-21 15:17:11 UTC (rev 
10392)
+++ branches/SAMBA_4_0/source/build/m4/env.m4   2005-09-21 15:18:11 UTC (rev 
10393)
@@ -19,6 +19,5 @@
 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)

Reply via email to