summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/SConstruct13
-rw-r--r--source4/auth/SConscript24
-rw-r--r--source4/auth/gensec/SConscript5
-rw-r--r--source4/auth/kerberos/SConscript6
-rw-r--r--source4/client/client.c21
-rw-r--r--source4/heimdal_build/SConscript5
-rw-r--r--source4/lib/SConscript3
-rw-r--r--source4/lib/charset/SConscript69
-rw-r--r--source4/lib/cmdline/readline.c19
-rw-r--r--source4/lib/netif/SConscript22
-rw-r--r--source4/lib/replace/SConscript11
-rw-r--r--source4/lib/replace/win32/SConscript22
-rw-r--r--source4/lib/socket/SConscript8
-rw-r--r--source4/smbd/SConscript5
14 files changed, 139 insertions, 94 deletions
diff --git a/source4/SConstruct b/source4/SConstruct
index 10b7c5f64f..6e38428b56 100644
--- a/source4/SConstruct
+++ b/source4/SConstruct
@@ -67,6 +67,8 @@ defines = loadconfig()
if defines == None:
hostenv['configure'] = 1
+
+if hostenv['configure']:
defines = {}
Export('defines')
@@ -191,13 +193,22 @@ return 0;
""", '.c'):
defines['TIME_WITH_SYS_TIME'] = 1
- if conf.TryCompile("""
+ if conf.TryCompile("""
#include <sys/time.h>
#include <unistd.h>
main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}
""", '.c'):
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()
[dynenv.Append(CPPDEFINES = {p: '\\"%s\\"' % paths[p]}) for p in paths]
diff --git a/source4/auth/SConscript b/source4/auth/SConscript
index a14fc2f48d..7b1358b908 100644
--- a/source4/auth/SConscript
+++ b/source4/auth/SConscript
@@ -15,16 +15,26 @@ if hostenv['configure']:
proto_files = []
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']
proto_files += auth_files
hostenv.StaticLibrary('auth',auth_files)
-hostenv.proto_headers += hostenv.CProtoHeader('proto.h', proto_files)
-
-hostenv.StaticLibrary('gensec_ntlmssp',
- ['ntlmssp/ntlmssp_parse.c', 'ntlmssp/ntlmssp.c',
+ntlmssp_files = ['ntlmssp/ntlmssp_parse.c', 'ntlmssp/ntlmssp.c',
'ntlmssp/ntlmssp_sign.c','ntlmssp/ntlmssp_client.c',
- 'ntlmssp/ntlmssp_server.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)
-SConscript(dirs=['kerberos','gensec'])
+SConscript(dirs=['gensec'])
diff --git a/source4/auth/gensec/SConscript b/source4/auth/gensec/SConscript
index 404f70e77c..3c90d2b4eb 100644
--- a/source4/auth/gensec/SConscript
+++ b/source4/auth/gensec/SConscript
@@ -1,13 +1,14 @@
Import('hostenv')
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.StaticLibrary('gensec',['gensec.c'])
hostenv.StaticLibrary('gensec_krb5',['gensec_krb5.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('schanneldb',['schannel_state.c'])
diff --git a/source4/auth/kerberos/SConscript b/source4/auth/kerberos/SConscript
deleted file mode 100644
index 8272f1c24a..0000000000
--- a/source4/auth/kerberos/SConscript
+++ /dev/null
@@ -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'])
diff --git a/source4/client/client.c b/source4/client/client.c
index 1e41924321..bd40c97efd 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -2611,6 +2611,27 @@ static int cmd_lcd(const char **cmd_ptr)
}
/****************************************************************************
+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
****************************************************************************/
static int cmd_reget(const char **cmd_ptr)
diff --git a/source4/heimdal_build/SConscript b/source4/heimdal_build/SConscript
index 4d85d03f9f..b90be7ba81 100644
--- a/source4/heimdal_build/SConscript
+++ b/source4/heimdal_build/SConscript
@@ -1,4 +1,7 @@
-Import('buildenv hostenv')
+Import('buildenv hostenv defines')
+
+if hostenv['configure']:
+ defines['HAVE_KRB5'] = 1
hostenv.StaticLibrary('heimdal_kdc',
['../kdc/default_config.c','../kdc/kerberos5.c','../kdc/pkinit.c',
diff --git a/source4/lib/SConscript b/source4/lib/SConscript
index caeeea5712..c41b6ea067 100644
--- a/source4/lib/SConscript
+++ b/source4/lib/SConscript
@@ -16,7 +16,6 @@ proto_files = basic_files
basic = hostenv.StaticLibrary('basic', [dynconfig,charset,talloc,basic_files])
Export('basic')
-hostenv.StaticLibrary('netif', ['netif/interface.c', 'netif/netif.c'])
hostenv.StaticLibrary('tdr', ['tdr/tdr.c'])
hostenv.StaticLibrary('crypto',
['crypto/crc32.c','crypto/md5.c','crypto/hmacmd5.c',
@@ -41,5 +40,5 @@ 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'])
+SConscript(dirs=['../param/','replace','tdb','popt','cmdline','registry', 'tls','samba3','socket','socket_wrapper','messaging','com','events', 'appweb', 'netif'])
diff --git a/source4/lib/charset/SConscript b/source4/lib/charset/SConscript
index b3305579e1..5ef640d2dc 100644
--- a/source4/lib/charset/SConscript
+++ b/source4/lib/charset/SConscript
@@ -6,62 +6,39 @@ Import('hostenv')
def _CheckIconvPath(context,path):
# Some systems have iconv in libc, some have it in libiconv (OSF/1 and
# 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()
{
iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);
return 0;
-}"""
-
- have_giconv_iconv = context.TryLink("""
-#include <stdlib.h>
-#include <giconv.h>
-""" + main, '.c')
- 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
+}""" % h, '.c'):
+ context.Result(1)
+ return True
+
+ context.Result(0)
+ return False
def CheckIconv(context):
- context.Message("checking for iconv ... ")
-
- look_dirs = ['/usr','/usr/local','/sw']
+ look_dirs = [None, '/usr','/usr/local','/sw']
for p in look_dirs:
- _CheckIconvPath(context,p) #FIXME: Handle return value
+ if _CheckIconvPath(context,p):
+ break
if context.TryRun("""
#include <iconv.h>
@@ -71,10 +48,8 @@ main() {
return 0;
}
""", '.c'):
- context.Result(1)
return (1,[])
- context.Result(0)
return (0,[])
if hostenv['configure']:
diff --git a/source4/lib/cmdline/readline.c b/source4/lib/cmdline/readline.c
index 42810c8697..7928b8db2e 100644
--- a/source4/lib/cmdline/readline.c
+++ b/source4/lib/cmdline/readline.c
@@ -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;
-}
diff --git a/source4/lib/netif/SConscript b/source4/lib/netif/SConscript
new file mode 100644
index 0000000000..3e36fc55fe
--- /dev/null
+++ b/source4/lib/netif/SConscript
@@ -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'])
diff --git a/source4/lib/replace/SConscript b/source4/lib/replace/SConscript
index 48abf2c081..47bfa481f2 100644
--- a/source4/lib/replace/SConscript
+++ b/source4/lib/replace/SConscript
@@ -1,6 +1,8 @@
#!/usr/bin/env python
Import('hostenv defines')
+rep_files = ['replace.c', 'snprintf.c','dlfcn.c']
+
if hostenv['configure']:
conf = Configure(hostenv)
for f in ['memset','syslog','setnetgrent','getnetgrent','endnetgrent', \
@@ -33,7 +35,7 @@ int main() {
if conf.CheckCHeader('dlfcn.h'):
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'
needed_types = {
@@ -59,7 +61,10 @@ int main() {
if not conf.CheckType(t,type_headers):
defines[t] = needed_types[t]
+ if not conf.TryRun(open("../../build/tests/os2_delete.c").read(), '.c'):
+ rep_files += ['repdir/repdir.c']
+
conf.Finish()
-hostenv.StaticLibrary('repdir', ['repdir/repdir.c'])
-hostenv.StaticLibrary('replace', ['replace.c', 'snprintf.c','dlfcn.c'])
+hostenv.StaticLibrary('replace', rep_files)
+SConscript(dirs=['win32'])
diff --git a/source4/lib/replace/win32/SConscript b/source4/lib/replace/win32/SConscript
new file mode 100644
index 0000000000..a23fb6a878
--- /dev/null
+++ b/source4/lib/replace/win32/SConscript
@@ -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()
+
diff --git a/source4/lib/socket/SConscript b/source4/lib/socket/SConscript
index c4e791467a..26c8bf444c 100644
--- a/source4/lib/socket/SConscript
+++ b/source4/lib/socket/SConscript
@@ -1,11 +1,11 @@
#!/usr/bin/env python
-Import('hostenv')
+Import('hostenv defines')
if hostenv['configure']:
conf = hostenv.Configure()
- conf.CheckCHeader('sys/socket.h')
- conf.CheckCHeader('sys/sockio.h')
- conf.CheckCHeader('sys/un.h')
+ for h in ['sys/socket.h','sys/sockio.h','sys/un.h']:
+ if conf.CheckCHeader(h):
+ defines['HAVE_' + h.upper().replace('/','_').replace('.','_')] = 1
#HAVE_SOCK_SIN_LEN
conf.TryCompile("""
#include <sys/types.h>
diff --git a/source4/smbd/SConscript b/source4/smbd/SConscript
index e084ce474e..55d0eb23be 100644
--- a/source4/smbd/SConscript
+++ b/source4/smbd/SConscript
@@ -1,5 +1,6 @@
Import('hostenv')
-hostenv.StaticLibrary('server_service',
- ['service.c','service_stream.c','service_task.c'])
+service_files = ['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'])