1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r10509: Some more sconscript fixes. Now getting to link stage for smbclient

(This used to be commit 6df956edba)
This commit is contained in:
Jelmer Vernooij 2005-09-26 15:15:50 +00:00 committed by Gerald (Jerry) Carter
parent 98a7da2348
commit e337caeed1
14 changed files with 139 additions and 94 deletions

View File

@ -67,6 +67,8 @@ defines = loadconfig()
if defines == None: if defines == None:
hostenv['configure'] = 1 hostenv['configure'] = 1
if hostenv['configure']:
defines = {} defines = {}
Export('defines') Export('defines')
@ -191,13 +193,22 @@ return 0;
""", '.c'): """, '.c'):
defines['TIME_WITH_SYS_TIME'] = 1 defines['TIME_WITH_SYS_TIME'] = 1
if conf.TryCompile(""" if conf.TryCompile("""
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
main() { struct timeval tv; exit(gettimeofday(&tv, NULL));} main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}
""", '.c'): """, '.c'):
defines['HAVE_GETTIMEOFDAY_TZ'] = 1 defines['HAVE_GETTIMEOFDAY_TZ'] = 1
# Check for header that defines "DIR"
for h in ['dirent.h','sys/ndir.h','sys/dir.h','ndir.h']:
if conf.TryCompile("""
#include <%s>
int main() { DIR *x; return 0; }""" % h, '.c'):
defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1
break
conf.Finish() conf.Finish()
[dynenv.Append(CPPDEFINES = {p: '\\"%s\\"' % paths[p]}) for p in paths] [dynenv.Append(CPPDEFINES = {p: '\\"%s\\"' % paths[p]}) for p in paths]

View File

@ -15,16 +15,26 @@ if hostenv['configure']:
proto_files = [] proto_files = []
hostenv.StaticLibrary('pam_errors.c') hostenv.StaticLibrary('pam_errors.c')
proto_files += ['pam_errors.c'] proto_files += ['pam_errors.c', 'auth_sam.c']
auth_files = ['auth.c','auth_util.c','auth_sam_reply.c','ntlm_check.c'] auth_files = ['auth.c','auth_util.c','auth_sam_reply.c','ntlm_check.c']
proto_files += auth_files proto_files += auth_files
hostenv.StaticLibrary('auth',auth_files) hostenv.StaticLibrary('auth',auth_files)
ntlmssp_files = ['ntlmssp/ntlmssp_parse.c', 'ntlmssp/ntlmssp.c',
'ntlmssp/ntlmssp_sign.c','ntlmssp/ntlmssp_client.c',
'ntlmssp/ntlmssp_server.c']
proto_files += ntlmssp_files
hostenv.StaticLibrary('gensec_ntlmssp', ntlmssp_files)
kerberos_files = ['kerberos/kerberos.c','kerberos/clikrb5.c',
'kerberos/kerberos_verify.c','kerberos/kerberos_util.c',
'kerberos/kerberos_pac.c','kerberos/gssapi_parse.c',
'kerberos/krb5_init_context.c']
proto_files += kerberos_files
hostenv.StaticLibrary('kerberos', kerberos_files)
hostenv.proto_headers += hostenv.CProtoHeader('proto.h', proto_files) hostenv.proto_headers += hostenv.CProtoHeader('proto.h', proto_files)
hostenv.StaticLibrary('gensec_ntlmssp', SConscript(dirs=['gensec'])
['ntlmssp/ntlmssp_parse.c', 'ntlmssp/ntlmssp.c',
'ntlmssp/ntlmssp_sign.c','ntlmssp/ntlmssp_client.c',
'ntlmssp/ntlmssp_server.c'])
SConscript(dirs=['kerberos','gensec'])

View File

@ -1,13 +1,14 @@
Import('hostenv') Import('hostenv')
gensec_files = ['gensec.c', 'gensec_krb5.c', 'gensec_gssapi.c', 'spnego.c', gensec_files = ['gensec.c', 'gensec_krb5.c', 'gensec_gssapi.c', 'spnego.c',
'schannel.c', 'schannel_sign.c', 'schannel_state.c'] 'spnego_parse.c', 'schannel.c', 'schannel_sign.c',
'schannel_state.c']
hostenv.proto_headers += hostenv.CProtoHeader('proto.h', gensec_files) hostenv.proto_headers += hostenv.CProtoHeader('proto.h', gensec_files)
hostenv.StaticLibrary('gensec',['gensec.c']) hostenv.StaticLibrary('gensec',['gensec.c'])
hostenv.StaticLibrary('gensec_krb5',['gensec_krb5.c']) hostenv.StaticLibrary('gensec_krb5',['gensec_krb5.c'])
hostenv.StaticLibrary('gensec_gssapi',['gensec_gssapi.c']) hostenv.StaticLibrary('gensec_gssapi',['gensec_gssapi.c'])
hostenv.StaticLibrary('gensec_spnego',['spnego.c']) hostenv.StaticLibrary('gensec_spnego',['spnego.c','spnego_parse.c'])
hostenv.StaticLibrary('gensec_schannel',['schannel.c','schannel_sign.c']) hostenv.StaticLibrary('gensec_schannel',['schannel.c','schannel_sign.c'])
hostenv.StaticLibrary('schanneldb',['schannel_state.c']) hostenv.StaticLibrary('schanneldb',['schannel_state.c'])

View File

@ -1,6 +0,0 @@
Import('hostenv')
hostenv.StaticLibrary('kerberos',
['kerberos.c','clikrb5.c','kerberos_verify.c',
'kerberos_util.c','kerberos_pac.c','gssapi_parse.c',
'krb5_init_context.c'])

View File

@ -2610,6 +2610,27 @@ static int cmd_lcd(const char **cmd_ptr)
return 0; return 0;
} }
/****************************************************************************
history
****************************************************************************/
static int cmd_history(const char **cmd_ptr)
{
#if defined(HAVE_LIBREADLINE)
HIST_ENTRY **hlist;
int i;
hlist = history_list();
for (i = 0; hlist && hlist[i]; i++) {
DEBUG(0, ("%d: %s\n", i, hlist[i]->line));
}
#else
DEBUG(0,("no history without readline support\n"));
#endif
return 0;
}
/**************************************************************************** /****************************************************************************
get a file restarting at end of local file get a file restarting at end of local file
****************************************************************************/ ****************************************************************************/

View File

@ -1,4 +1,7 @@
Import('buildenv hostenv') Import('buildenv hostenv defines')
if hostenv['configure']:
defines['HAVE_KRB5'] = 1
hostenv.StaticLibrary('heimdal_kdc', hostenv.StaticLibrary('heimdal_kdc',
['../kdc/default_config.c','../kdc/kerberos5.c','../kdc/pkinit.c', ['../kdc/default_config.c','../kdc/kerberos5.c','../kdc/pkinit.c',

View File

@ -16,7 +16,6 @@ proto_files = basic_files
basic = hostenv.StaticLibrary('basic', [dynconfig,charset,talloc,basic_files]) basic = hostenv.StaticLibrary('basic', [dynconfig,charset,talloc,basic_files])
Export('basic') Export('basic')
hostenv.StaticLibrary('netif', ['netif/interface.c', 'netif/netif.c'])
hostenv.StaticLibrary('tdr', ['tdr/tdr.c']) hostenv.StaticLibrary('tdr', ['tdr/tdr.c'])
hostenv.StaticLibrary('crypto', hostenv.StaticLibrary('crypto',
['crypto/crc32.c','crypto/md5.c','crypto/hmacmd5.c', ['crypto/crc32.c','crypto/md5.c','crypto/hmacmd5.c',
@ -41,5 +40,5 @@ Export('credentials')
hostenv.proto_headers += hostenv.CProtoHeader('proto.h', proto_files) 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']) SConscript(dirs=['../param/','replace','tdb','popt','cmdline','registry', 'tls','samba3','socket','socket_wrapper','messaging','com','events', 'appweb', 'netif'])

View File

@ -6,62 +6,39 @@ Import('hostenv')
def _CheckIconvPath(context,path): def _CheckIconvPath(context,path):
# Some systems have iconv in libc, some have it in libiconv (OSF/1 and # Some systems have iconv in libc, some have it in libiconv (OSF/1 and
# those with the standalone portable libiconv installed). # those with the standalone portable libiconv installed).
context.Message("checking for iconv in " + path + " ... ") if path:
context.Message("checking for iconv in " + path + " ... ")
context.env.Append(LIBPATH=path)
else:
context.Message("checking for iconv in default path ... ")
for l in [None,'giconv','iconv']:
for h in ['giconv.h','iconv.h']:
if l:
context.env['LIBS'] = [l]
if context.TryLink("""
#include <stdlib.h>
#include <%s>
main = """
int main() int main()
{ {
iconv_t cd = iconv_open("",""); iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL); iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd); iconv_close(cd);
return 0; return 0;
}""" }""" % h, '.c'):
context.Result(1)
have_giconv_iconv = context.TryLink(""" return True
#include <stdlib.h>
#include <giconv.h> context.Result(0)
""" + main, '.c') return False
if have_giconv_iconv:
context.Result(1)
return ("giconv.h", "")
have_iconv_iconv = context.TryLink("""
#include <stdlib.h>
#include <iconv.h>
""" + main, '.c')
if have_iconv_iconv:
context.Result(1)
return ("iconv.h", "")
#FIXME: Add -lgiconv
have_giconv_lib_iconv = context.TryLink("""
#include <stdlib.h>
#include <giconv.h>
""" + main, '.c')
if have_giconv_lib_iconv:
context.Result(1)
return ("giconv.h", "-lgiconv")
#FIXME: Add -liconv
have_iconv_lib_iconv = context.TryLink("""
#include <stdlib.h>
#include <iconv.h>
"""+main,'.c')
if have_iconv_lib_iconv:
context.Result(1)
return ("iconv.h", "-liconv")
return None
def CheckIconv(context): def CheckIconv(context):
context.Message("checking for iconv ... ") look_dirs = [None, '/usr','/usr/local','/sw']
look_dirs = ['/usr','/usr/local','/sw']
for p in look_dirs: for p in look_dirs:
_CheckIconvPath(context,p) #FIXME: Handle return value if _CheckIconvPath(context,p):
break
if context.TryRun(""" if context.TryRun("""
#include <iconv.h> #include <iconv.h>
@ -71,10 +48,8 @@ main() {
return 0; return 0;
} }
""", '.c'): """, '.c'):
context.Result(1)
return (1,[]) return (1,[])
context.Result(0)
return (0,[]) return (0,[])
if hostenv['configure']: if hostenv['configure']:

View File

@ -140,23 +140,4 @@ void smb_readline_ca_char(char c)
} }
/****************************************************************************
history
****************************************************************************/
int cmd_history(const char **cmd_ptr)
{
#if defined(HAVE_LIBREADLINE)
HIST_ENTRY **hlist;
int i;
hlist = history_list();
for (i = 0; hlist && hlist[i]; i++) {
DEBUG(0, ("%d: %s\n", i, hlist[i]->line));
}
#else
DEBUG(0,("no history without readline support\n"));
#endif
return 0;
}

View File

@ -0,0 +1,22 @@
Import('hostenv defines')
if hostenv['configure']:
conf = Configure(hostenv)
for h in ['arpa/inet.h','net/if.h','netdb.h','netinet/in.h','netinet/ip.h','netinet/tcp.h','netinet/in_systm.h','netinet/in_ip.h']:
if conf.CheckCHeader(h):
defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1
for d in ['HAVE_IFACE_IFCONF','HAVE_IFACE_AIX','HAVE_IFACE_IFREQ']:
if conf.TryRun("""
#define %s 1
#define AUTOCONF_TEST 1
#include "confdefs.h"
#include "netif.c"
""" % d, '.c'):
defines[d] = 1
break
conf.Finish()
hostenv.StaticLibrary('netif', ['interface.c', 'netif.c'])

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
Import('hostenv defines') Import('hostenv defines')
rep_files = ['replace.c', 'snprintf.c','dlfcn.c']
if hostenv['configure']: if hostenv['configure']:
conf = Configure(hostenv) conf = Configure(hostenv)
for f in ['memset','syslog','setnetgrent','getnetgrent','endnetgrent', \ for f in ['memset','syslog','setnetgrent','getnetgrent','endnetgrent', \
@ -33,7 +35,7 @@ int main() {
if conf.CheckCHeader('dlfcn.h'): if conf.CheckCHeader('dlfcn.h'):
defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1 defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1
if not conf.CheckType('socklen_t'): if not conf.CheckType('socklen_t', "#include <sys/socket.h>"):
defines['socklen_t'] = 'int' defines['socklen_t'] = 'int'
needed_types = { needed_types = {
@ -59,7 +61,10 @@ int main() {
if not conf.CheckType(t,type_headers): if not conf.CheckType(t,type_headers):
defines[t] = needed_types[t] defines[t] = needed_types[t]
if not conf.TryRun(open("../../build/tests/os2_delete.c").read(), '.c'):
rep_files += ['repdir/repdir.c']
conf.Finish() conf.Finish()
hostenv.StaticLibrary('repdir', ['repdir/repdir.c']) hostenv.StaticLibrary('replace', rep_files)
hostenv.StaticLibrary('replace', ['replace.c', 'snprintf.c','dlfcn.c']) SConscript(dirs=['win32'])

View File

@ -0,0 +1,22 @@
Import('hostenv defines')
if hostenv['configure']:
conf = Configure(hostenv)
for h in ['direct.h','windows.h','winsock2.h','ws2tcpip.h']:
if conf.CheckCHeader(h):
defines['HAVE_' + h.upper().replace('.','_')] = 1
conf.TryCompile("""
#include <stdio.h>
#ifdef HAVE_DIRECT_H
#include <direct.h>
#endif
int main()
{
mkdir("foo",0777);
return 0;
}
""", '.c')
conf.Finish()

View File

@ -1,11 +1,11 @@
#!/usr/bin/env python #!/usr/bin/env python
Import('hostenv') Import('hostenv defines')
if hostenv['configure']: if hostenv['configure']:
conf = hostenv.Configure() conf = hostenv.Configure()
conf.CheckCHeader('sys/socket.h') for h in ['sys/socket.h','sys/sockio.h','sys/un.h']:
conf.CheckCHeader('sys/sockio.h') if conf.CheckCHeader(h):
conf.CheckCHeader('sys/un.h') defines['HAVE_' + h.upper().replace('/','_').replace('.','_')] = 1
#HAVE_SOCK_SIN_LEN #HAVE_SOCK_SIN_LEN
conf.TryCompile(""" conf.TryCompile("""
#include <sys/types.h> #include <sys/types.h>

View File

@ -1,5 +1,6 @@
Import('hostenv') Import('hostenv')
hostenv.StaticLibrary('server_service', service_files = ['service.c','service_stream.c','service_task.c']
['service.c','service_stream.c','service_task.c']) hostenv.StaticLibrary('server_service', service_files)
hostenv.proto_headers += hostenv.CProtoHeader('proto.h', service_files)
hostenv.Program('smbd',['server.c']) hostenv.Program('smbd',['server.c'])