mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
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 703ffbaaac
)
This commit is contained in:
parent
63b43dd12f
commit
3d4ea18d4d
@ -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
|
||||
|
||||
|
@ -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'])
|
||||
|
@ -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'])
|
||||
|
@ -1,5 +0,0 @@
|
||||
Import('hostenv')
|
||||
|
||||
hostenv.StaticLibrary('gensec_ntlmssp',
|
||||
['ntlmssp_parse.c','ntlmssp.c','ntlmssp_sign.c','ntlmssp_client.c',
|
||||
'ntlmssp_server.c'])
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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'])
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -1,3 +0,0 @@
|
||||
Import('hostenv')
|
||||
|
||||
hostenv.StaticLibrary('cli_auth',['credentials.c','session.c','smbencrypt.c'])
|
@ -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'])
|
@ -1,5 +0,0 @@
|
||||
Import('hostenv')
|
||||
|
||||
hostenv.StaticLibrary('cli_security',
|
||||
['security_token.c','security_descriptor.c','dom_sid.c',
|
||||
'access_check.c','privilege.c'])
|
@ -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'))
|
||||
|
@ -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')
|
||||
|
@ -18,7 +18,7 @@ then
|
||||
headeropt="-h $2"
|
||||
shift; shift;
|
||||
else
|
||||
headeropt=""
|
||||
headeropt="-h _`echo $1 | tr ./ __`_"
|
||||
fi
|
||||
|
||||
header="$1"
|
||||
|
Loading…
Reference in New Issue
Block a user