Hi Guys,

On 31/03/12 10:20, Vladimir 'φ-coder/phcoder' Serbinenko wrote:

According to Ukrainian translation translators binutils don't load the
translations. My short investigation traced it to the following code:
#if defined (HAVE_SETLOCALE)&&  defined (HAVE_LC_MESSAGES)
   setlocale (LC_MESSAGES, "");
#endif
#if defined (HAVE_SETLOCALE)
   setlocale (LC_CTYPE, "");
#endif

As you can see it's condititional to HAVE_SETLOCALE and
HAVE_LC_MESSAGES. But the corresponding defines go exclusively to
intl/config.h and is not present and hence undefined in other */config.h
used by individual programs.

This appears to be a simple case of some missing configure machinery which can be fixed by a patch like the one attached. Not being a configure guru however I wonder if anyone here has any suggestions or comments on how this ought to be done ?

Cheers
  Nick

[binutils|gas|gold|ld]/ChangeLog
2012-04-03  Nick Clifton  <ni...@redhat.com>

        * configure.in (AM_LC_MESSAGES): Add.
        (AC_CHECK_FUNCS): Add selocale.
        * config.in (HAVE_LC_MESSAGES): Add.
        (HAVE_SETLOCALE): Add.
        * aclocal.m4: Regenerate.
        * configure: Regenerate.
Index: gas/config.in
===================================================================
RCS file: /cvs/src/src/gas/config.in,v
retrieving revision 1.38
diff -u -3 -p -r1.38 config.in
--- gas/config.in	3 Jul 2010 20:52:24 -0000	1.38
+++ gas/config.in	3 Apr 2012 16:29:46 -0000
@@ -66,6 +66,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
@@ -84,6 +87,9 @@
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
Index: gas/configure.in
===================================================================
RCS file: /cvs/src/src/gas/configure.in,v
retrieving revision 1.226
diff -u -3 -p -r1.226 configure.in
--- gas/configure.in	2 Nov 2011 03:09:05 -0000	1.226
+++ gas/configure.in	3 Apr 2012 16:29:48 -0000
@@ -657,6 +657,9 @@ AC_CHECK_FUNCS(unlink remove, break)
 # Some systems don't have sbrk().
 AC_CHECK_FUNCS(sbrk)
 
+AC_CHECK_FUNCS(setlocale)
+AM_LC_MESSAGES
+
 # do we need the math library?
 case "${need_libm}" in
 yes)
Index: gold/config.in
===================================================================
RCS file: /cvs/src/src/gold/config.in,v
retrieving revision 1.30
diff -u -3 -p -r1.30 config.in
--- gold/config.in	3 Nov 2011 04:32:00 -0000	1.30
+++ gold/config.in	3 Apr 2012 16:29:48 -0000
@@ -81,6 +81,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
 /* Define to 1 if you have the `mallinfo' function. */
 #undef HAVE_MALLINFO
 
@@ -114,6 +117,9 @@
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
Index: gold/configure.ac
===================================================================
RCS file: /cvs/src/src/gold/configure.ac,v
retrieving revision 1.70
diff -u -3 -p -r1.70 configure.ac
--- gold/configure.ac	30 Jan 2012 21:13:30 -0000	1.70
+++ gold/configure.ac	3 Apr 2012 16:29:49 -0000
@@ -536,6 +536,9 @@ fi
 
 AC_LANG_POP(C++)
 
+AC_CHECK_FUNCS(setlocale)
+AM_LC_MESSAGES
+
 AM_MAINTAINER_MODE
 
 AC_OUTPUT(Makefile testsuite/Makefile po/Makefile.in:po/Make-in)
Index: ld/config.in
===================================================================
RCS file: /cvs/src/src/ld/config.in,v
retrieving revision 1.32
diff -u -3 -p -r1.32 config.in
--- ld/config.in	6 Jun 2011 14:51:42 -0000	1.32
+++ ld/config.in	3 Apr 2012 16:29:49 -0000
@@ -67,6 +67,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
@@ -97,6 +100,9 @@
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
Index: ld/configure.in
===================================================================
RCS file: /cvs/src/src/ld/configure.in,v
retrieving revision 1.72
diff -u -3 -p -r1.72 configure.in
--- ld/configure.in	27 Mar 2012 19:23:59 -0000	1.72
+++ ld/configure.in	3 Apr 2012 16:29:51 -0000
@@ -120,6 +120,8 @@ esac
 
 AM_BINUTILS_WARNINGS
 
+AM_LC_MESSAGES
+
 AC_CONFIG_HEADERS([config.h:config.in])
 
 if test -z "$target" ; then
@@ -162,7 +164,7 @@ AC_SUBST(NATIVE_LIB_DIRS)
 
 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h elf-hints.h limits.h sys/param.h)
 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h)
-AC_CHECK_FUNCS(glob mkstemp realpath sbrk waitpid)
+AC_CHECK_FUNCS(glob mkstemp realpath sbrk setlocale waitpid)
 AC_CHECK_FUNCS(open lseek close)
 AC_HEADER_DIRENT
 
Index: binutils/config.in
===================================================================
RCS file: /cvs/src/src/binutils/config.in,v
retrieving revision 1.34
diff -u -3 -p -r1.34 config.in
--- binutils/config.in	21 Dec 2011 19:39:11 -0000	1.34
+++ binutils/config.in	3 Apr 2012 16:29:51 -0000
@@ -85,6 +85,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
@@ -100,6 +103,9 @@
 /* Define to 1 if you have the `sbrk' function. */
 #undef HAVE_SBRK
 
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
 /* Define to 1 if you have the `setmode' function. */
 #undef HAVE_SETMODE
 
Index: binutils/configure.in
===================================================================
RCS file: /cvs/src/src/binutils/configure.in,v
retrieving revision 1.106
diff -u -3 -p -r1.106 configure.in
--- binutils/configure.in	10 Jan 2012 00:02:45 -0000	1.106
+++ binutils/configure.in	3 Apr 2012 16:29:52 -0000
@@ -92,7 +92,7 @@ AC_SUBST(DEMANGLER_NAME)
 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
 AC_HEADER_SYS_WAIT
 AC_FUNC_ALLOCA
-AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
+AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll setlocale)
 AC_CHECK_FUNC([mkstemp],
 	      AC_DEFINE([HAVE_MKSTEMP], 1,
 	      [Define to 1 if you have the `mkstemp' function.]))
@@ -103,6 +103,8 @@ AC_CHECK_FUNC([mkdtemp],
 # Some systems have frexp only in -lm, not in -lc.
 AC_SEARCH_LIBS(frexp, m)
 
+AM_LC_MESSAGES
+
 AC_MSG_CHECKING(for time_t in time.h)
 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to