r10509: Some more sconscript fixes. Now getting to link stage for smbclient
authorJelmer Vernooij <jelmer@samba.org>
Mon, 26 Sep 2005 15:15:50 +0000 (15:15 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:38:58 +0000 (13:38 -0500)
(This used to be commit 6df956edbab7ad5e72b2f20e74ab0f0d62528932)

14 files changed:
source4/SConstruct
source4/auth/SConscript
source4/auth/gensec/SConscript
source4/auth/kerberos/SConscript [deleted file]
source4/client/client.c
source4/heimdal_build/SConscript
source4/lib/SConscript
source4/lib/charset/SConscript
source4/lib/cmdline/readline.c
source4/lib/netif/SConscript [new file with mode: 0644]
source4/lib/replace/SConscript
source4/lib/replace/win32/SConscript [new file with mode: 0644]
source4/lib/socket/SConscript
source4/smbd/SConscript

index 10b7c5f64f9eb2581bbf99aa71e32c80a167639e..6e38428b5676483d7e3d5c98be00f54de3b17995 100644 (file)
@@ -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]
index a14fc2f48d1c7415f837cdc1b696f18b5f846039..7b1358b90819c2d57441026180345d27f9cdb46a 100644 (file)
@@ -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'])
index 404f70e77c468e3101752f9803733071ebc27425..3c90d2b4ebfca0df751308215715a175adba1bc6 100644 (file)
@@ -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 (file)
index 8272f1c..0000000
+++ /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'])
index 1e41924321b8678e8fa55bc9f15328b7967aa7c8..bd40c97efdde93593b2e9a8f1c8e9c2687616304 100644 (file)
@@ -2610,6 +2610,27 @@ static int cmd_lcd(const char **cmd_ptr)
        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
  ****************************************************************************/
index 4d85d03f9f2b888a6f37c9b231f83213c35e9b77..b90be7ba81bf7e0015993b0595ed91e440bdcdd5 100644 (file)
@@ -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',
index caeeea5712368fa26622f9fc758a5550530663e3..c41b6ea067ffe2b8fc8012416c3f5bcf7e7abef5 100644 (file)
@@ -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'])
 
index b3305579e1f3309c3e0996559f0d1e45734ec10b..5ef640d2dc0a5fb5377c35cdfd92789b0efcbc98 100644 (file)
@@ -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']:
index 42810c8697c6099492f083857d6eb1107fb81821..7928b8db2e3233c4a5a4b2740d547731e7582280 100644 (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;
-}
diff --git a/source4/lib/netif/SConscript b/source4/lib/netif/SConscript
new file mode 100644 (file)
index 0000000..3e36fc5
--- /dev/null
@@ -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'])
index 48abf2c0813ab5e26de138cedf76820065d64f0e..47bfa481f228aca38b1e30dc215ce1fd7e79eaa7 100644 (file)
@@ -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 (file)
index 0000000..a23fb6a
--- /dev/null
@@ -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()
+
index c4e791467a1d58ed26595ae6b76b2181c59a238a..26c8bf444c7e7707e5a1d16e76a175620b761463 100644 (file)
@@ -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>
index e084ce474e43e0ab0639a42be61e4822941da8c8..55d0eb23be83d08a22c9a33966527c93f66c7028 100644 (file)
@@ -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'])