]> granicus.if.org Git - recode/commitdiff
Force -liconv if available
authorFrançois Pinard <pinard@iro.umontreal.ca>
Thu, 13 Mar 2008 19:17:17 +0000 (15:17 -0400)
committerFrançois Pinard <pinard@iro.umontreal.ca>
Thu, 13 Mar 2008 19:18:36 +0000 (15:18 -0400)
ChangeLog
config.h.in
configure
configure.ac

index c974cc9eddf06c63392e9072f8a36c26dbb9508a..1120e158f4f354652de6c2876a8374c82869da73 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-13  François Pinard  <pinard@iro.umontreal.ca>
+
+       * configure.ac: Force -liconv if libiconv is available.
+
 2008-03-10  François Pinard  <pinard@iro.umontreal.ca>
 
        * tables.py: Add option -v.
index 50769be1f9b0f0ce311804203d87d86780d14b8e..a6cbdf17e27c907002ba41ed2d88bc3cbfbcebd6 100644 (file)
@@ -61,6 +61,9 @@
 /* Define to 1 if you have the <langinfo.h> header file. */
 #undef HAVE_LANGINFO_H
 
+/* Define to 1 if you have the `iconv' library (-liconv). */
+#undef HAVE_LIBICONV
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
index d7a283109482348bea1cdfb42ea9586fef2ff36d..72b82dbbca20bac788c2a11e4a2666cbf3b02200 100755 (executable)
--- a/configure
+++ b/configure
@@ -20806,6 +20806,77 @@ _ACEOF
 
 
 
+{ echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5
+echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6; }
+if test "${ac_cv_lib_iconv_libiconv+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char libiconv ();
+int
+main ()
+{
+return libiconv ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_iconv_libiconv=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_iconv_libiconv=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_libiconv" >&6; }
+if test $ac_cv_lib_iconv_libiconv = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBICONV 1
+_ACEOF
+
+  LIBS="-liconv $LIBS"
+
+fi
+
+
 
 
 
index a3ce2f6ff1d8835956752efc01999ad0df66ccb8..fba934a67120d2abbba84677df6087530b5a0fd0 100644 (file)
@@ -23,6 +23,7 @@ AC_CHECK_HEADERS(limits.h locale.h memory.h stdbool.h stddef.h stdlib.h string.h
 AC_TYPE_SIGNAL
 jm_STRUCT_UTIMBUF
 
+AC_CHECK_LIB(iconv, libiconv)
 AC_CHECK_FUNCS(dup2 mbrtowc rename setlocale strerror strndup wcrtomb)
 AC_REPLACE_FUNCS(strtol strtoul)
 AC_FUNC_ALLOCA