diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-09-24 16:23:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:52 -0500 |
commit | 3d4ea18d4dd9031adc16348c16595d6c216b2d84 (patch) | |
tree | b43aba2aff1820c4ed365132cc2feca544ed402a /source4 | |
parent | 63b43dd12fb579aaaccedd07aaa630cb1cd7aa88 (diff) | |
download | samba-3d4ea18d4dd9031adc16348c16595d6c216b2d84.tar.gz samba-3d4ea18d4dd9031adc16348c16595d6c216b2d84.tar.bz2 samba-3d4ea18d4dd9031adc16348c16595d6c216b2d84.zip |
r10478: More work on proto headers; we now generate a couple of smaller ones
that are then included by include/proto.h
(This used to be commit 703ffbaaaca11f3d8781cfe9e7542fcaa626d991)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/SConstruct | 35 | ||||
-rw-r--r-- | source4/auth/SConscript | 16 | ||||
-rw-r--r-- | source4/auth/gensec/SConscript | 4 | ||||
-rw-r--r-- | source4/auth/ntlmssp/SConscript | 5 | ||||
-rw-r--r-- | source4/build/scons/proto.py | 3 | ||||
-rw-r--r-- | source4/dsdb/SConscript | 4 | ||||
-rw-r--r-- | source4/lib/SConscript | 14 | ||||
-rw-r--r-- | source4/lib/replace/SConscript | 10 | ||||
-rw-r--r-- | source4/libcli/SConscript | 24 | ||||
-rw-r--r-- | source4/libcli/auth/SConscript | 3 | ||||
-rw-r--r-- | source4/libcli/ldap/SConscript | 5 | ||||
-rw-r--r-- | source4/libcli/security/SConscript | 5 | ||||
-rw-r--r-- | source4/librpc/SConscript | 6 | ||||
-rw-r--r-- | source4/param/SConscript | 4 | ||||
-rw-r--r-- | source4/script/mkproto.sh | 2 |
15 files changed, 98 insertions, 42 deletions
diff --git a/source4/SConstruct b/source4/SConstruct index 7b355222dc..2ff867f0ad 100644 --- a/source4/SConstruct +++ b/source4/SConstruct @@ -11,6 +11,7 @@ # - finish fallback code # - finish proto code # - support for init functions +# - separate config file for lib/replace/ import cPickle, string, os @@ -111,7 +112,7 @@ if hostenv['configure']: conf = hostenv.Configure() - for h in ['sys/select.h','fcntl.h','sys/fcntl.h','sys/time.h'] + \ + for h in ['sys/select.h','fcntl.h','sys/fcntl.h'] + \ ['utime.h','grp.h','sys/id.h','limits.h','memory.h'] + \ ['compat.h','math.h','sys/param.h','ctype.h','sys/wait.h'] + \ ['sys/resource.h','sys/ioctl.h','sys/ipc.h','sys/mode.h'] + \ @@ -171,6 +172,22 @@ int main() defines['HAVE_IMMEDIATE_STRUCTURES'] = 1 hostenv.AlwaysBuild('include/config.h') + + if conf.TryCompile(""" +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> + +int +main () +{ +if ((struct tm *) 0) +return 0; + return 0; +} +""", '.c'): + defines['TIME_WITH_SYS_TIME'] = 1 + conf.Finish() [dynenv.Append(CPPDEFINES = {p: '\\"%s\\"' % paths[p]}) for p in paths] @@ -178,8 +195,7 @@ int main() dynconfig = dynenv.Object('dynconfig.c') Export('dynconfig') -proto_files = [] -Export('proto_files') +hostenv.proto_headers = [] SConscript( dirs=['lib','torture','rpc_server','cldap_server','libcli', @@ -187,7 +203,18 @@ SConscript( 'smbd','dsdb','heimdal_build','ntptr','kdc','smb_server','ntvfs', 'winbind','scripting','auth', 'librpc','script/tests']) -hostenv.CProtoHeader(target='include/proto.h',source=proto_files) +# proto.h + +def create_global_proto(env, target, source): + fd = open(str(target[0]), 'w') + [fd.write('#include "%s"\n' % x) for x in source] + fd.close() + +def create_global_proto_print(*args, **kwargs): + print 'Building global proto.h' + +hostenv.Command('include/proto.h', hostenv.proto_headers, + Action(create_global_proto, create_global_proto_print)) # Save configuration diff --git a/source4/auth/SConscript b/source4/auth/SConscript index 557690cfdb..a14fc2f48d 100644 --- a/source4/auth/SConscript +++ b/source4/auth/SConscript @@ -1,3 +1,4 @@ +#!/usr/bin/env python Import('hostenv') hostenv.StaticLibrary('auth_sam.c') @@ -12,7 +13,18 @@ if hostenv['configure']: have_pam = conf.CheckLibWithHeader('pam', 'security/pam_appl.h', 'c', 'pam_start') conf.Finish() +proto_files = [] hostenv.StaticLibrary('pam_errors.c') -hostenv.StaticLibrary('auth',['auth.c','auth_util.c','auth_sam_reply.c','ntlm_check.c']) +proto_files += ['pam_errors.c'] +auth_files = ['auth.c','auth_util.c','auth_sam_reply.c','ntlm_check.c'] +proto_files += auth_files +hostenv.StaticLibrary('auth',auth_files) -SConscript(dirs=['ntlmssp','kerberos','gensec']) +hostenv.proto_headers += hostenv.CProtoHeader('proto.h', proto_files) + +hostenv.StaticLibrary('gensec_ntlmssp', + ['ntlmssp/ntlmssp_parse.c', 'ntlmssp/ntlmssp.c', + 'ntlmssp/ntlmssp_sign.c','ntlmssp/ntlmssp_client.c', + 'ntlmssp/ntlmssp_server.c']) + +SConscript(dirs=['kerberos','gensec']) diff --git a/source4/auth/gensec/SConscript b/source4/auth/gensec/SConscript index 93b291fb1b..404f70e77c 100644 --- a/source4/auth/gensec/SConscript +++ b/source4/auth/gensec/SConscript @@ -1,9 +1,9 @@ -Import('hostenv', 'proto_files') +Import('hostenv') gensec_files = ['gensec.c', 'gensec_krb5.c', 'gensec_gssapi.c', 'spnego.c', 'schannel.c', 'schannel_sign.c', 'schannel_state.c'] -proto_files += [File(x) for x in gensec_files] +hostenv.proto_headers += hostenv.CProtoHeader('proto.h', gensec_files) hostenv.StaticLibrary('gensec',['gensec.c']) hostenv.StaticLibrary('gensec_krb5',['gensec_krb5.c']) diff --git a/source4/auth/ntlmssp/SConscript b/source4/auth/ntlmssp/SConscript deleted file mode 100644 index 1fb21c02cd..0000000000 --- a/source4/auth/ntlmssp/SConscript +++ /dev/null @@ -1,5 +0,0 @@ -Import('hostenv') - -hostenv.StaticLibrary('gensec_ntlmssp', - ['ntlmssp_parse.c','ntlmssp.c','ntlmssp_sign.c','ntlmssp_client.c', - 'ntlmssp_server.c']) diff --git a/source4/build/scons/proto.py b/source4/build/scons/proto.py index fc5cc1b7c1..ef9d1d11b2 100644 --- a/source4/build/scons/proto.py +++ b/source4/build/scons/proto.py @@ -13,8 +13,7 @@ proto_builder = SCons.Builder.Builder(action='$PROTOCOM', def generate(env): env['MKPROTO'] = './script/mkproto.sh' - env['PROTO_DEFINE'] = '_PROTO_H_' - env['PROTOCOM'] = '$MKPROTO "$PERL" -h $PROTO_DEFINE ${TARGETS[0]} $SOURCES' + env['PROTOCOM'] = '$MKPROTO "$PERL" ${TARGETS[0]} $SOURCES' env['BUILDERS']['CProtoHeader'] = proto_builder def exists(env): diff --git a/source4/dsdb/SConscript b/source4/dsdb/SConscript index 1a64382053..34c1f8f7e2 100644 --- a/source4/dsdb/SConscript +++ b/source4/dsdb/SConscript @@ -2,4 +2,6 @@ Import('hostenv') hostenv.StaticLibrary('ldb_objectguid',['samdb/ldb_modules/objectguid.c']) hostenv.StaticLibrary('ldb_samldb',['samdb/ldb_modules/samldb.c']) hostenv.StaticLibrary('ldb_samba3sam',['samdb/ldb_modules/samba3sam.c']) -hostenv.StaticLibrary('samdb',['samdb/samdb.c','samdb/samdb_privilege.c','common/flag_mapping.c']) +samdb_files = ['samdb/samdb.c','samdb/samdb_privilege.c','common/flag_mapping.c'] +hostenv.StaticLibrary('samdb',samdb_files) +hostenv.proto_headers += hostenv.CProtoHeader(samdb_files) diff --git a/source4/lib/SConscript b/source4/lib/SConscript index 328d6233e4..caeeea5712 100644 --- a/source4/lib/SConscript +++ b/source4/lib/SConscript @@ -2,7 +2,7 @@ Import('hostenv') # tastes like -*- python -*- SConscript(dirs=['talloc','charset']) -Import('talloc', 'dynconfig', 'charset', 'proto_files') +Import('talloc', 'dynconfig', 'charset') basic_files = ['version.c', 'xfile.c', 'debug.c', 'fault.c', 'signal.c', 'system.c', 'time.c', 'genrand.c', 'dprintf.c', @@ -11,7 +11,7 @@ basic_files = ['version.c', 'xfile.c', 'debug.c', 'fault.c', 'fsusage.c', 'ms_fnmatch.c', 'select.c', 'mutex.c', 'idtree.c', 'db_wrap.c'] -proto_files += [File(x) for x in basic_files] +proto_files = basic_files basic = hostenv.StaticLibrary('basic', [dynconfig,charset,talloc,basic_files]) Export('basic') @@ -29,11 +29,17 @@ hostenv.StaticLibrary('unix_privs',['unix_privs.c']) SConscript(dirs=['ldb']) Import('ldb') -gendb = hostenv.StaticLibrary('gendb', ['gendb.c',ldb]) +gendb_files = ['gendb.c'] +proto_files += gendb_files +gendb = hostenv.StaticLibrary('gendb', [gendb_files,ldb]) Export('gendb') -credentials = hostenv.StaticLibrary('credentials',['credentials.c',basic,gendb]) +credentials_files = ['credentials.c'] +proto_files += credentials_files +credentials = hostenv.StaticLibrary('credentials',[credentials_files,basic,gendb]) Export('credentials') +hostenv.proto_headers += hostenv.CProtoHeader('proto.h', proto_files) + SConscript(dirs=['../param/','replace','tdb','popt','cmdline','registry', 'tls','samba3','socket','socket_wrapper','messaging','com','events', 'appweb']) diff --git a/source4/lib/replace/SConscript b/source4/lib/replace/SConscript index 60652b0b15..48abf2c081 100644 --- a/source4/lib/replace/SConscript +++ b/source4/lib/replace/SConscript @@ -19,6 +19,16 @@ if hostenv['configure']: if conf.CheckFunc(f,'c'): defines['HAVE_' + f.upper()] = 1 + # Check for errno declaration + if conf.TryCompile(""" +#include <errno.h> + +int main() { + int i = (int)errno; + return 0; +}""", '.c'): + defines['HAVE_ERRNO_DECL'] = 1 + for h in ['dlfcn.h']: if conf.CheckCHeader('dlfcn.h'): defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1 diff --git a/source4/libcli/SConscript b/source4/libcli/SConscript index d073f2e5db..8240e0fc2b 100644 --- a/source4/libcli/SConscript +++ b/source4/libcli/SConscript @@ -1,7 +1,8 @@ Import('hostenv') -hostenv.StaticLibrary('cli_utils', - ['util/asn1.c', 'util/doserr.c','util/errormap.c','util/clierror.c', - 'util/nterr.c','util/smbdes.c']) +proto_files = [] +cli_utils_files = ['util/asn1.c', 'util/doserr.c','util/errormap.c','util/clierror.c', 'util/nterr.c','util/smbdes.c'] +proto_files += cli_utils_files +hostenv.StaticLibrary('cli_utils', cli_utils_files) hostenv.StaticLibrary('cli_lsa', ['util/clilsa.c']) hostenv.StaticLibrary('cli_composite_base', ['composite/composite.c']) @@ -38,4 +39,19 @@ hostenv.StaticLibrary('cli_raw', 'raw/rawfileinfo.c','raw/rawnotify.c','raw/rawioctl.c', 'raw/rawacl.c','raw/rawdate.c','raw/rawlpq.c']) -SConscript(dirs=['auth','ldap','security'],exports='hostenv') +security_files = ['security/security_token.c','security/security_descriptor.c', + 'security/dom_sid.c', 'security/access_check.c', + 'security/privilege.c', '../librpc/ndr/ndr_sec_helper.c'] +proto_files += security_files +hostenv.StaticLibrary('cli_security', security_files) + +auth_files = ['auth/credentials.c','auth/session.c','auth/smbencrypt.c'] +proto_files += auth_files +hostenv.StaticLibrary('cli_auth',auth_files) + +ldap_files = ['ldap/ldap.c','ldap/ldap_client.c','ldap/ldap_bind.c', + 'ldap/ldap_msg.c','ldap/ldap_ndr.c','ldap/ldap_ildap.c'] +proto_files += ldap_files +hostenv.StaticLibrary('cli_ldap',ldap_files) + +hostenv.proto_headers += hostenv.CProtoHeader('proto.h', proto_files) diff --git a/source4/libcli/auth/SConscript b/source4/libcli/auth/SConscript deleted file mode 100644 index d527faac30..0000000000 --- a/source4/libcli/auth/SConscript +++ /dev/null @@ -1,3 +0,0 @@ -Import('hostenv') - -hostenv.StaticLibrary('cli_auth',['credentials.c','session.c','smbencrypt.c']) diff --git a/source4/libcli/ldap/SConscript b/source4/libcli/ldap/SConscript deleted file mode 100644 index eef9a9f41c..0000000000 --- a/source4/libcli/ldap/SConscript +++ /dev/null @@ -1,5 +0,0 @@ -Import('hostenv') - -hostenv.StaticLibrary('cli_ldap', - ['ldap.c','ldap_client.c','ldap_bind.c','ldap_msg.c','ldap_ndr.c', - 'ldap_ildap.c']) diff --git a/source4/libcli/security/SConscript b/source4/libcli/security/SConscript deleted file mode 100644 index e81051e07e..0000000000 --- a/source4/libcli/security/SConscript +++ /dev/null @@ -1,5 +0,0 @@ -Import('hostenv') - -hostenv.StaticLibrary('cli_security', - ['security_token.c','security_descriptor.c','dom_sid.c', - 'access_check.c','privilege.c']) diff --git a/source4/librpc/SConscript b/source4/librpc/SConscript index 97ada3cc13..9c9965eaaa 100644 --- a/source4/librpc/SConscript +++ b/source4/librpc/SConscript @@ -1,11 +1,11 @@ #!/usr/bin/python -Import('hostenv', 'proto_files') +Import('hostenv') ndr_base_files = ['ndr/ndr.c', 'ndr/ndr_basic.c', 'ndr/ndr_string.c', 'ndr/ndr_obfuscate.c', 'ndr/ndr_misc.c'] hostenv.StaticLibrary('ndr_base', ndr_base_files) -proto_files += [File(x) for x in ndr_base_files] +hostenv.proto_headers += hostenv.CProtoHeader('ndr/proto.h', ndr_base_files) hostenv.StaticLibrary('ndr_compression', ['ndr/ndr_compression.c']) @@ -15,7 +15,7 @@ rpc_base_files = ['rpc/dcerpc.c', 'rpc/dcerpc_auth.c', 'rpc/dcerpc_schannel.c', 'rpc/dcerpc_smb.c', 'rpc/dcerpc_sock.c'] hostenv.StaticLibrary('rpc_base', rpc_base_files) -proto_files += [File(x) for x in rpc_base_files] +hostenv.proto_headers += hostenv.CProtoHeader('rpc/proto.h', rpc_base_files) from glob import glob hostenv.NdrMarshaller(glob('idl/*.idl')) diff --git a/source4/param/SConscript b/source4/param/SConscript index 4dfca40d4a..2b8eb89b30 100644 --- a/source4/param/SConscript +++ b/source4/param/SConscript @@ -2,7 +2,9 @@ Import('hostenv') # tastes like -*- python -*- Import('dynconfig basic') -param = hostenv.StaticLibrary('loadparm',['loadparm.c','params.c',dynconfig,basic]) +param_files = ['loadparm.c','params.c'] +param = hostenv.StaticLibrary('loadparm',[param_files,dynconfig,basic]) +hostenv.proto_headers += hostenv.CProtoHeader('proto.h', param_files) Export('param') generic = hostenv.StaticLibrary('generic',['generic.c']) Export('generic') diff --git a/source4/script/mkproto.sh b/source4/script/mkproto.sh index 6cd9cd6018..c6da261b65 100644 --- a/source4/script/mkproto.sh +++ b/source4/script/mkproto.sh @@ -18,7 +18,7 @@ then headeropt="-h $2" shift; shift; else - headeropt="" + headeropt="-h _`echo $1 | tr ./ __`_" fi header="$1" |