Re: Trouble compiling CVS with g++=3.2.2

From John R. McPherson
DateMon, 20 Jan 2003 22:47:37 +1300
Subject Re: Trouble compiling CVS with g++=3.2.2
In-Reply-To (33346-24-205-179-149-1043047198-squirrel-library-ucr-edu)
On Mon, Jan 20, 2003 at 08:19:58PM +1300, Gordon Paynter wrote:

> From what I can make out, you should set ENABLE_NLS if and only if you
> have th GNU internationalised version of gettext on your system; otherwise
> you should disbale it.

Sounds right.

> For some reason, it is showing up as diabled in my
> system, causing clashes when mgpp tries to redefine textdomain. I note
> that wget also messes around with gettext and this option in some way.

That reason is that we don't check for it...

> If I manually add "#define ENABLE_NLS 1" to config.h then the files
> compile correctly.

> To go one better, if I add
> AC_DEFINE(ENABLE_NLS)
> to configure.in and
> #undef ENABLE_NLS
> to acconfig.h then I can run ./configure and compile as usual.
>
> However, I'm not going to commit this though because I don't really
> understand what I'm doing, or how to properly test for gettext before
> setting ENABLE_NLS. (My policy here is to delegate everything to do with
> automake and autoconf as quickly as I possibly can.)

We should definitely get a test for this into the configure script.
However, the version of autoconf I have both at home and on the uni
systems don't have a test for NLS. Either your newer version of
autoconf does, or it's still hard-coded in there from your edit ;)

Perhaps it's enough to see if we have a libintl.h header file, and
if we do, make sure there is a gettext() function.

Try adding the following to gsdl/config.h.in (before the #endif):
/* define if you have gettext */
#undef ENABLE_NLS

and the following to configure.in (anywhere before AC_CONFIG_SUBDIRS):
AC_CHECK_FUNC( textdomain , AC_DEFINE(ENABLE_NLS ,1) )

and run autoconf and ./configure.
(I had to make some changes as the newer version of autoconf doesn't
allow the LIBOBJS variable to be modified).

It Works For Me (tm) on debian stable with gcc-2.95

John