This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: * configure.in: Test for libintl.h.


On Thu, May 01, 2003 at 04:59:08PM +0200, Krister Walfridsson wrote:
> 
> 1. This test is only done for USE_NLS = yes, but the gettext function is
>    used in libstdc++-v3/src/functexcept.cc if _GLIBCPP_HAVE_LIBINTL_H is
>    defined, which it may be regardless of the status of USE_NLS.

I knew I was overlooking something.

> 2. USE_NLS is only set to 'yes' if enable_clocale_flag = gnu.
>    configure does however use enable_clocale_flag = generic for NetBSD...

In the generic case, all of this should be disabled.  (For now at least.)
The gnu setting is the only one at present which uses the NLS facilities.

Anyhow, this should handle --enable/--disable-nls, the presence or
absence of <libintl.h>, and the presence or absence of runtime support.
Still works on x86/linux.  Applied to trunk; Krister, would you let me
know whether this works for you?


2003-05-01  Phil Edwards  <pme@gcc.gnu.org>

	* acconfig.h (_GLIBCPP_USE_NLS):  New symbol.
	* configure.in:  Move libintl.h header test...
	* acinclude.m4 (GLIBCPP_ENABLE_CLOCALE):  ...to here.  Gather all
	the NLS-related test results into one symbol.
	* src/functexcept.cc:  Use it here.
	* aclocal.m4, config.h.in, configure:  Regenerated.


Index: acconfig.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acconfig.h,v
retrieving revision 1.28
diff -u -3 -p -r1.28 acconfig.h
--- acconfig.h	28 Mar 2003 18:28:39 -0000	1.28
+++ acconfig.h	2 May 2003 02:50:25 -0000
@@ -153,6 +153,9 @@
 // Define if modf is present in <math.h>
 #undef HAVE_MODF
 
+// Define if NLS translations are to be used.
+#undef _GLIBCPP_USE_NLS
+
 // @BOTTOM@
 //
 // Systems that have certain non-standard functions prefixed with an
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.237
diff -u -3 -p -r1.237 acinclude.m4
--- acinclude.m4	1 May 2003 20:19:17 -0000	1.237
+++ acinclude.m4	2 May 2003 02:50:26 -0000
@@ -1292,7 +1292,11 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
 
   # A standalone libintl (e.g., GNU libintl) may be in use.
   if test $USE_NLS = yes; then
-    AC_SEARCH_LIBS(gettext, intl,, USE_NLS=no)
+    AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
+    AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
+  fi
+  if test $USE_NLS = yes; then
+    AC_DEFINE(_GLIBCPP_USE_NLS)
   fi
 
   AC_SUBST(USE_NLS)
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.123
diff -u -3 -p -r1.123 configure.in
--- configure.in	28 Apr 2003 21:03:15 -0000	1.123
+++ configure.in	2 May 2003 02:50:29 -0000
@@ -401,7 +401,7 @@ else
   # Check for available headers.
   AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
   machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
-  sys/types.h libintl.h])
+  sys/types.h])
 
   GLIBCPP_CHECK_COMPILER_FEATURES
   GLIBCPP_CHECK_LINKER_FEATURES
Index: src/functexcept.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/functexcept.cc,v
retrieving revision 1.4
diff -u -3 -p -r1.4 functexcept.cc
--- src/functexcept.cc	28 Apr 2003 21:03:19 -0000	1.4
+++ src/functexcept.cc	2 May 2003 02:50:29 -0000
@@ -32,7 +32,7 @@
 #include <new>
 #include <typeinfo>
 #include <ios>
-#ifdef _GLIBCPP_HAVE_LIBINTL_H
+#ifdef _GLIBCPP_USE_NLS
 # include <libintl.h>
 # define _(msgid)   gettext (msgid)
 #else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]