This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gold patch committed: Avoid compilation problem with --disable-nls
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: Thu, 24 Jul 2008 14:46:50 -0700
- Subject: gold patch committed: Avoid compilation problem with --disable-nls
PR 6716 is about a problem building gold with --disable-nls. I fixed
it much as it is fixed in the binutils. Patch committed.
Ian
2008-07-24 Ian Lance Taylor <iant@google.com>
PR 6716
* gold.h: Always include <clocale>. Add Solaris workarounds
following code in binutils/sysdep.h.
Index: gold.h
===================================================================
RCS file: /cvs/src/src/gold/gold.h,v
retrieving revision 1.27
diff -u -r1.27 gold.h
--- gold.h 21 May 2008 21:37:44 -0000 1.27
+++ gold.h 24 Jul 2008 21:45:06 -0000
@@ -29,6 +29,20 @@
#include <cstddef>
#include <sys/types.h>
+#ifndef ENABLE_NLS
+ // The Solaris version of locale.h always includes libintl.h. If we
+ // have been configured with --disable-nls then ENABLE_NLS will not
+ // be defined and the dummy definitions of bindtextdomain (et al)
+ // below will conflict with the defintions in libintl.h. So we
+ // define these values to prevent the bogus inclusion of libintl.h.
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
+// Always include <clocale> first to avoid conflicts with the macros
+// used when ENABLE_NLS is not defined.
+#include <clocale>
+
#ifdef ENABLE_NLS
# include <libintl.h>
# define _(String) gettext (String)