init.sh: correct an outdated comment
[pspp] / m4 / iconv_open.m4
index 6bf78bc5e43b3aa86dc4cd7e8870f2b3144293f7..8219ecf5cbd90c9a9ed483a21229c073dfaa5760 100644 (file)
@@ -1,5 +1,5 @@
-# iconv_open.m4 serial 6
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+# iconv_open.m4 serial 8
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,6 +10,8 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([gl_ICONV_H_DEFAULTS])
   if test "$am_cv_func_iconv" = yes; then
+    dnl Provide the <iconv.h> override, for the sake of the C++ aliases.
+    gl_REPLACE_ICONV_H
     dnl Test whether iconv_open accepts standardized encoding names.
     dnl We know that GNU libiconv and GNU libc do.
     AC_EGREP_CPP([gnu_iconv], [
@@ -61,7 +63,8 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF],
       [
         save_LIBS="$LIBS"
         LIBS="$LIBS $LIBICONV"
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <iconv.h>
 #include <errno.h>
 #include <stdio.h>
@@ -207,7 +210,9 @@ int main ()
     ASSERT (iconv_close (cd) == 0);
   }
   return 0;
-}], [gl_cv_func_iconv_supports_utf=yes], [gl_cv_func_iconv_supports_utf=no],
+}]])],
+          [gl_cv_func_iconv_supports_utf=yes],
+          [gl_cv_func_iconv_supports_utf=no],
           [
            dnl We know that GNU libiconv, GNU libc, and Solaris >= 9 do.
            dnl OSF/1 5.1 has these encodings, but inserts a BOM in the "to"