This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Problems with --disable-nls under Solaris


Hi Matthias,

- 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.

Thanks for reporting this problem and submitting a patch to fix it. I have applied your patch with one small change: I moved the definitions of _LIBINTL_H and _LIBGETTEXT_H to inside the block that includes <locale.h> and I added a comment describing what was going on, like this:


#ifdef HAVE_LOCALE_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 definitions in libintl.h. So we define these values to prevent
the bogus inclusion of libintl.h. */
# define _LIBINTL_H
# define _LIBGETTEXT_H
# endif
# include <locale.h>
#endif


I also created ChangeLog entries for your changes:

binutils/gas/ld ChangeLog
2005-09-30  Matthias Kurz  <mk@baerlap.north.de>

	* bucomm.h: Prevent the inclusion of <libintl.h> from the Solaris
	version of <locale.h> when ENABLE_NLS is not defined.


gprof/ChangeLog 2005-09-30 Matthias Kurz <mk@baerlap.north.de>

	* gprof.c (main):Only invoke bindtextdomain() and textdomain() if
	ENABLE_NLS is defined.


Cheers Nick



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