diff options
author | Richard Sharpe <sharpe@samba.org> | 2003-08-13 19:35:37 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2003-08-13 19:35:37 +0000 |
commit | 7c0b5720854a12a9634c504c9139988be1c253b4 (patch) | |
tree | ef21459cc9d01fc3aeca67fefedc5f3d314159ca /source3 | |
parent | e6a062278783101c1680d1e404c2fa2406c65511 (diff) | |
download | samba-7c0b5720854a12a9634c504c9139988be1c253b4.tar.gz samba-7c0b5720854a12a9634c504c9139988be1c253b4.tar.bz2 samba-7c0b5720854a12a9634c504c9139988be1c253b4.zip |
Hoist the code for checking whether or not iconv actually works up into the
loop that looks for iconv, because we might have more than one version
of iconv available and the first version might not work like we want, so
we have to keep looking.
We have yet to look for other character conversions as well, but for now,
let's see what the build farm makes of the changes.
(This used to be commit 13be2ca51a6125a6de22fa7afb88ba0688f23ab8)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/configure.in | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/source3/configure.in b/source3/configure.in index dd37ad33c1..9dcc53364b 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1558,32 +1558,35 @@ dnl Try to find iconv(3) LIBS="$save_LIBS $LIBS" ICONV_LOCATION=$i export LDFLAGS LIBS CPPFLAGS - break - else - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS - export LDFLAGS LIBS CPPFLAGS +dnl Now, check for a working iconv ... we want to do it here because +dnl there might be a working iconv further down the list of LOOK_DIRS + + ############ + # check for iconv in libc + ic_save_LIBS="$LIBS" + LIBS="$LIBS -L$ICONV_LOCATION/lib" + AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[ + AC_TRY_RUN([ +#include <$jm_cv_include> +main(){ + iconv_t cd = iconv_open("ASCII", "UCS-2LE"); + if (cd == 0 || cd == (iconv_t)-1) return -1; + return 0; +} + ], + samba_cv_HAVE_NATIVE_ICONV=yes,samba_cv_HAVE_NATIVE_ICONV=no,samba_cv_HAVE_NATIVE_ICONV=cross)]) + LIBS="$ic_save_LIBS" + if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then + AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv]) + break + fi +dnl We didn't find a working iconv, so keep going fi + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + export LDFLAGS LIBS CPPFLAGS done -############ -# check for iconv in libc -ic_save_LIBS="$LIBS" -LIBS="$LIBS -L$ICONV_LOCATION/lib" -AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[ -AC_TRY_RUN([ -#include <$jm_cv_include> -main() { - iconv_t cd = iconv_open("ASCII", "UCS-2LE"); - if (cd == 0 || cd == (iconv_t)-1) return -1; - return 0; -} -], -samba_cv_HAVE_NATIVE_ICONV=yes,samba_cv_HAVE_NATIVE_ICONV=no,samba_cv_HAVE_NATIVE_ICONV=cross)]) -if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then - AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv]) -fi -LIBS="$ic_save_LIBS" if test x"$ICONV_FOUND" = x"no" -o x"$samba_cv_HAVE_NATIVE_ICONV" != x"yes" ; then AC_MSG_WARN([Sufficient support for iconv function was not found. |