Switch to side-by-side view

--- a/src/configure
+++ b/src/configure
@@ -1161,7 +1161,8 @@
    exit 1
 fi
 
-##### Look for iconv in libc (Linux), or libiconv in /usr/local/lib:/usr/lib
+##### Look for iconv. We first look for libiconv in /usr/local/lib:/usr/lib
+##    then in libc (Linux, solaris)
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -1170,8 +1171,9 @@
 
 LIBICONV=""
 S_LDFLAGS=$LDFLAGS
-dir=/usr/lib
+dir=/usr/local/lib
 LDFLAGS="$S_LDFLAGS -L$dir"
+unset ac_cv_lib_iconv_iconv_open
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -1931,13 +1933,13 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for iconv_open in -lc" >&5
-echo $ECHO_N "checking for iconv_open in -lc... $ECHO_C" >&6
-if test "${ac_cv_lib_c_iconv_open+set}" = set; then
+echo "$as_me:$LINENO: checking for iconv_open in -liconv" >&5
+echo $ECHO_N "checking for iconv_open in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc  $LIBS"
+LIBS="-liconv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 #include "confdefs.h"
@@ -1975,23 +1977,23 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_c_iconv_open=yes
+  ac_cv_lib_iconv_iconv_open=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_lib_c_iconv_open=no
+ac_cv_lib_iconv_iconv_open=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_c_iconv_open" >&5
-echo "${ECHO_T}$ac_cv_lib_c_iconv_open" >&6
-if test $ac_cv_lib_c_iconv_open = yes; then
-  LIBICONV=NONE;INCICONV=-I/usr/include
+echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv_open" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv_open" >&6
+if test $ac_cv_lib_iconv_iconv_open = yes; then
+  LIBICONV="-L$dir -liconv";INCICONV=-I/usr/local/include
 fi
 
 if test A"$LIBICONV" = A ; then
-  dir=/usr/local/lib
+  dir=/usr/lib
   LDFLAGS="$S_LDFLAGS -L$dir"
   unset ac_cv_lib_iconv_iconv_open
   echo "$as_me:$LINENO: checking for iconv_open in -liconv" >&5
@@ -2050,20 +2052,20 @@
 echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv_open" >&5
 echo "${ECHO_T}$ac_cv_lib_iconv_iconv_open" >&6
 if test $ac_cv_lib_iconv_iconv_open = yes; then
-  LIBICONV="-L$dir -liconv";INCICONV=-I/usr/local/include
+  LIBICONV="-L$dir -liconv";INCICONV=-I/usr/include
 fi
 
   if test A"$LIBICONV" = A; then
-    dir=/usr/local/lib
+    dir=/usr/lib
     LDFLAGS="$S_LDFLAGS -L$dir"
     unset ac_cv_lib_iconv_iconv_open
-    echo "$as_me:$LINENO: checking for iconv_open in -liconv" >&5
-echo $ECHO_N "checking for iconv_open in -liconv... $ECHO_C" >&6
-if test "${ac_cv_lib_iconv_iconv_open+set}" = set; then
+    echo "$as_me:$LINENO: checking for iconv_open in -lc" >&5
+echo $ECHO_N "checking for iconv_open in -lc... $ECHO_C" >&6
+if test "${ac_cv_lib_c_iconv_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-liconv  $LIBS"
+LIBS="-lc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 #include "confdefs.h"
@@ -2101,19 +2103,19 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_iconv_iconv_open=yes
+  ac_cv_lib_c_iconv_open=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_lib_iconv_iconv_open=no
+ac_cv_lib_c_iconv_open=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv_open" >&5
-echo "${ECHO_T}$ac_cv_lib_iconv_iconv_open" >&6
-if test $ac_cv_lib_iconv_iconv_open = yes; then
-  LIBICONV="-L$dir -liconv";INCICONV=-I/usr/include
+echo "$as_me:$LINENO: result: $ac_cv_lib_c_iconv_open" >&5
+echo "${ECHO_T}$ac_cv_lib_c_iconv_open" >&6
+if test $ac_cv_lib_c_iconv_open = yes; then
+  LIBICONV=NONE;INCICONV=-I/usr/include
 fi
 
   fi