This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Problems with --disable-nls under Solaris
- From: Matthias Kurz <mk at baerlap dot north dot de>
- To: binutils at sources dot redhat dot com
- Date: Wed, 14 Sep 2005 07:38:43 +0200
- Subject: Problems with --disable-nls under Solaris
Hi.
I could not build the current CVS version under Solaris with
--disable-nls. Explanation and patch:
- Prevent inclusion of <libintl.h>, when ENABLE_NLS is not set.
When ENABLE_NLS is not set, some parts of binutils are declaring dummy
versions of bindtextdomain, texdomain etc.
<locale.h> under Solaris includes <libintl.h>, which leads to problems,
because the dummy definitions conflict with the definitions in libintl.h.
- Finally the dummy routines lead to a compilation error in gprof.c, because
they generate a warning ("statement without effect", or so) and the
compiler switch -Werror is used.
Index: binutils/bucomm.h
--- binutils/bucomm.h.orig 2005-08-16 21:35:21.000000000 +0200
+++ binutils/bucomm.h 2005-09-13 16:55:29.276456000 +0200
@@ -125,6 +125,11 @@
# endif /* HAVE_ALLOCA_H */
#endif
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
Index: gas/asintl.h
--- gas/asintl.h.orig 2005-05-05 11:12:43.000000000 +0200
+++ gas/asintl.h 2005-09-13 16:58:29.082469000 +0200
@@ -20,6 +20,11 @@
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
Index: gprof/gprof.c
--- gprof/gprof.c.orig 2005-04-23 19:13:31.000000000 +0200
+++ gprof/gprof.c 2005-09-13 17:13:52.242443000 +0200
@@ -189,8 +189,10 @@
#if defined (HAVE_SETLOCALE)
setlocale (LC_CTYPE, "");
#endif
+#ifdef ENABLE_NLS
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+#endif
whoami = argv[0];
xmalloc_set_program_name (whoami);
Index: ld/ld.h
--- ld/ld.h.orig 2005-06-09 04:05:46.000000000 +0200
+++ ld/ld.h 2005-09-13 17:24:03.767249000 +0200
@@ -23,6 +23,11 @@
#ifndef LD_H
#define LD_H
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
Well, perhaps omitting the inclusion of locale.h when --disable-nls is
given is probably also a solution, but i did not have the leisure to try
this.
(mk)
--
Matthias Kurz; Fuldastr. 3; D-28199 Bremen; VOICE +49 421 53 600 47
>> Im prämotorischen Cortex kann jeder ein Held sein. (bdw) <<