This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PING: Fix PR 15575: HAVE_LANGINFO_CODESET


This patch adds a configure test to define HAVE_LANGINFO_CODESET if nl_langinfo is available. This was removed during a configure clean-up some time ago but is required by the Java front end to determine the default encoding for source files. The patch was first submitted here:

http://gcc.gnu.org/ml/gcc-patches/2004-05/msg01414.html

OK to commit?

Bryce

2004-10-20  Bryce McKinlay  <mckinlay@redhat.com>

	PR java/15575
	* configure.ac: Declare AM_LANGINFO_CODESET.
	* aclocal.m4: Define AM_LANGINFO_CODESET.

Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.77
diff -u -r2.77 configure.ac
--- configure.ac	19 Oct 2004 00:21:03 -0000	2.77
+++ configure.ac	20 Oct 2004 20:56:30 -0000
@@ -1024,6 +1024,8 @@
 
 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"
Index: aclocal.m4
===================================================================
RCS file: /cvs/gcc/gcc/gcc/aclocal.m4,v
retrieving revision 1.98
diff -u -r1.98 aclocal.m4
--- aclocal.m4	12 Oct 2004 08:22:25 -0000	1.98
+++ aclocal.m4	20 Oct 2004 20:56:30 -0000
@@ -433,6 +433,22 @@
   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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]