summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-07-21 19:23:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:15 -0500
commit77e12fe6cb492b6622bee9fdd1d170f12d3d90b6 (patch)
tree07eb458f3519abaf2d49d0282b7d94665f495593 /source3
parent5cc398d23dcbc615341a74f42c9b2fff9bd00062 (diff)
downloadsamba-77e12fe6cb492b6622bee9fdd1d170f12d3d90b6.tar.gz
samba-77e12fe6cb492b6622bee9fdd1d170f12d3d90b6.tar.bz2
samba-77e12fe6cb492b6622bee9fdd1d170f12d3d90b6.zip
r1561: iconv detection fix from James Peach <jpeach@sgi.com>
(This used to be commit 62bd60e4458f6e9bdaab7b5c81b040a0b3310f30)
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in32
1 files changed, 19 insertions, 13 deletions
diff --git a/source3/configure.in b/source3/configure.in
index d30e6574a5..d6285ce2d5 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1692,31 +1692,37 @@ AC_ARG_WITH(libiconv,
fi
])
-ICONV_FOUND="no"
-libext=""
for i in $LOOK_DIRS ; do
save_LIBS=$LIBS
save_LDFLAGS=$LDFLAGS
save_CPPFLAGS=$CPPFLAGS
+ ICONV_FOUND="no"
+ unset libext
CPPFLAGS="$CPPFLAGS -I$i/include"
dnl This is here to handle -withval stuff for --with-libiconv
dnl Perhaps we should always add a -L
dnl Check lib and lib32 library variants to cater for IRIX ABI-specific
-dnl installation paths.
- for l in "lib" "lib32" ; do
- LDFLAGS="$LDFLAGS -L$i/$l"
- LIBS=
- export LDFLAGS LIBS CPPFLAGS
+dnl installation paths. This gets a little tricky since we might have iconv
+dnl in both libiconv and in libc. In this case the jm_ICONV test will always
+dnl succeed when the header is found. To counter this, make sure the
+dnl library directory is there and check the ABI directory first (which
+dnl should be harmless on other systems.
+ for l in "lib32" "lib" ; do
+ if test -d "$i/$l" ; then
+ LDFLAGS="$save_LDFLAGS -L$i/$l"
+ LIBS=
+ export LDFLAGS LIBS CPPFLAGS
dnl Try to find iconv(3)
- jm_ICONV($i)
- if test "$ICONV_FOUND" = yes; then
- libext="$l"
- break;
+ jm_ICONV($i/$l)
+ if test x"$ICONV_FOUND" = "xyes" ; then
+ libext="$l"
+ break;
+ fi
fi
done
- if test "$ICONV_FOUND" = yes; then
+ if test x"$ICONV_FOUND" = "xyes" ; then
LDFLAGS=$save_LDFLAGS
LIB_ADD_DIR(LDFLAGS, "$i/$libext")
CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
@@ -1730,7 +1736,7 @@ dnl there might be a working iconv further down the list of LOOK_DIRS
# check for iconv in libc
ic_save_LIBS="$LIBS"
if test x"$ICONV_PATH_SPEC" = "xyes" ; then
- LIBS="$LIBS -L$ICONV_LOCATION/lib"
+ LIBS="$LIBS -L$ICONV_LOCATION/$libext"
fi
if test x"$jm_cv_lib_iconv" != x; then
LIBS="$LIBS -l$jm_cv_lib_iconv"