re PR java/15575 (HAVE_LANGINFO_CODESET never defined)
authorBryce McKinlay <mckinlay@redhat.com>
Wed, 20 Oct 2004 21:36:47 +0000 (21:36 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Wed, 20 Oct 2004 21:36:47 +0000 (22:36 +0100)
2004-10-20  Bryce McKinlay  <mckinlay@redhat.com>

PR java/15575
* configure.ac: Declare AM_LANGINFO_CODESET.
* aclocal.m4: Define AM_LANGINFO_CODESET.
* configure, config.in: Rebuilt.

From-SVN: r89345

gcc/ChangeLog
gcc/aclocal.m4
gcc/config.in
gcc/configure
gcc/configure.ac

index 937a0e16834cd14aea527caaf97058fde95f40f4..5ecd023d91f1bfbcc2c23bac17c181f9caa05b05 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-20  Bryce McKinlay  <mckinlay@redhat.com>
+
+       PR java/15575
+       * configure.ac: Declare AM_LANGINFO_CODESET.
+       * aclocal.m4: Define AM_LANGINFO_CODESET.
+       * configure, config.in: Rebuilt.
+
 2004-10-20  Kazu Hirata  <kazu@cs.umass.edu>
 
        * expr.c (store_expr): Remove code that is run when
index 7bf291323e814ddf2ac17f1dae13681c64757a2f..dfcc20be148fce21ba5b50e353d267ff31e88a98 100644 (file)
@@ -433,6 +433,22 @@ AC_CACHE_CHECK(for __int64, ac_cv_c___int64,
   fi
 ])
 
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+    [AC_TRY_LINK([#include <langinfo.h>],
+      [char* cs = nl_langinfo(CODESET);],
+      am_cv_langinfo_codeset=yes,
+      am_cv_langinfo_codeset=no)
+    ])
+  if test $am_cv_langinfo_codeset = yes; then
+    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+  fi
+])
+
 AC_DEFUN([gcc_AC_INITFINI_ARRAY],
 [AC_ARG_ENABLE(initfini-array,
        [  --enable-initfini-array      use .init_array/.fini_array sections],
index e71ac94de7521d930f246cc9822acfeef4718d32..d819cf74cacad75a2f7703b6a143ee889d5a9577 100644 (file)
 /* Define to 1 if you have the `kill' function. */
 #undef HAVE_KILL
 
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
 /* Define to 1 if you have the <langinfo.h> header file. */
 #undef HAVE_LANGINFO_H
 
index 6805f56cde1f1e85880e5b6cb12fad52ed5981de..402585e5b0fee7f3b6eef1d2efb8ebc0a0ddf93f 100755 (executable)
@@ -11039,6 +11039,71 @@ _ACEOF
   fi
 
 
+
+  echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <langinfo.h>
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  am_cv_langinfo_codeset=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_langinfo_codeset=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
+  if test $am_cv_langinfo_codeset = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LANGINFO_CODESET 1
+_ACEOF
+
+  fi
+
+
 # We will need to find libiberty.h and ansidecl.h
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
index ee559a29fe7149a9f2a792daca6a9a07f5716334..7f943c6b7f948a9c65ae5c09e60d8a27aa6bad57 100644 (file)
@@ -1024,6 +1024,8 @@ AC_SUBST(LIBICONV_DEP)
 
 AM_LC_MESSAGES
 
+AM_LANGINFO_CODESET
+
 # We will need to find libiberty.h and ansidecl.h
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"