Use AC_TRY_RUN instead of AC_TRY_LINK when checking for iconv() in -liconv
authorMatthew Barnes <mbarnes@redhat.com>
Mon, 26 Mar 2007 22:36:10 +0000 (22:36 +0000)
committerMatthew Barnes <mbarnes@src.gnome.org>
Mon, 26 Mar 2007 22:36:10 +0000 (22:36 +0000)
2007-03-26  Matthew Barnes  <mbarnes@redhat.com>

* configure.in: Use AC_TRY_RUN instead of AC_TRY_LINK when checking
for iconv() in -liconv (#388788).  Patch from Elijah Newren.

* iconv-detect.c: Fix an implicit function declaration.

svn path=/trunk/; revision=7668

ChangeLog
configure.in
iconv-detect.c

index ccdca67..20ecb6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-26  Matthew Barnes  <mbarnes@redhat.com>
+
+       * configure.in: Use AC_TRY_RUN instead of AC_TRY_LINK when checking
+       for iconv() in -liconv (#388788).  Patch from Elijah Newren.
+
+       * iconv-detect.c: Fix an implicit function declaration.
+
 2007-03-26  Harish Krishnaswamy <harish.krishnaswamy@gmail.com>
        
        * MAINTAINERS : Updates on the new guards.
index 2ca966c..5d23d15 100644 (file)
@@ -237,12 +237,15 @@ save_CFLAGS="$CFLAGS"
 save_LIBS="$LIBS"
 CFLAGS="$CFLAGS $ICONV_CFLAGS"
 LIBS="$LIBS $ICONV_LIBS -liconv"
-AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_LINK([
+AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_RUN([
 #include <iconv.h>
-], [
+
+int main (int argc, char **argv)
+{
        iconv_t cd;
        cd = iconv_open ("UTF-8", "ISO-8859-1");
-], ac_cv_libiconv=yes, ac_cv_libiconv=no))
+}
+], ac_cv_libiconv=yes, ac_cv_libiconv=no, ac_cv_libiconv=no))
 if test $ac_cv_libiconv = yes; then
        ICONV_LIBS="$ICONV_LIBS -liconv"
        have_iconv=yes
index 7c1858a..96b4ed1 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <iconv.h>
 
 enum {