diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-09-26 15:15:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:58 -0500 |
commit | e337caeed1459f876449611ae1684616d0ea8f55 (patch) | |
tree | 172bc1ed142701b20975771e3d788a0fb9aea034 /source4/lib/charset | |
parent | 98a7da234869576c0b4b41ede9fd64a022c3ec58 (diff) | |
download | samba-e337caeed1459f876449611ae1684616d0ea8f55.tar.gz samba-e337caeed1459f876449611ae1684616d0ea8f55.tar.bz2 samba-e337caeed1459f876449611ae1684616d0ea8f55.zip |
r10509: Some more sconscript fixes. Now getting to link stage for smbclient
(This used to be commit 6df956edbab7ad5e72b2f20e74ab0f0d62528932)
Diffstat (limited to 'source4/lib/charset')
-rw-r--r-- | source4/lib/charset/SConscript | 69 |
1 files changed, 22 insertions, 47 deletions
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']: |