diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/SConscript | 3 | ||||
-rw-r--r-- | source4/lib/charset/SConscript | 69 | ||||
-rw-r--r-- | source4/lib/cmdline/readline.c | 19 | ||||
-rw-r--r-- | source4/lib/netif/SConscript | 22 | ||||
-rw-r--r-- | source4/lib/replace/SConscript | 11 | ||||
-rw-r--r-- | source4/lib/replace/win32/SConscript | 22 | ||||
-rw-r--r-- | source4/lib/socket/SConscript | 8 |
7 files changed, 79 insertions, 75 deletions
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> |