bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Broken build attributed to (un)defined environ


From: Michael Schloh von Bennewitz
Subject: Broken build attributed to (un)defined environ
Date: Thu, 27 May 2004 15:29:57 +0200
User-agent: Mutt/1.4.2.1i

I found a bug, and fixed it. Please see my attached patch, which is also
part of the OpenPKG gettext package:

  http://cvs.openpkg.org/dir?d=openpkg-src/gettext

In many cases gettext requires the global variable 'environ' in libc, and
many operating systems define this 'environ' in stdlib.h. Unfortunately,
gettext simply assumes that it is defined there in all operating systems,
leading to build failure in those which have no such definition in stdlib.h.

I wrote a new Autoconf macro in 'configure.in', inserted the new Autoconf
generated script code in 'configure', and test for a new identifier
'HAVE_DEFINED_ENVIRON' in the appropriate places in the source code. This
solved the problem for me, and now correctly builds on all our platforms
(previously the build broke on Solaris 10 at least).

I also noticed that a '#ifndef HAVE_ENVIRON_DECL' in both
gettext-tools/lib/setenv.c and gettext-tools/lib/unsetenv.c, and assume that
the intention of this test is just the same as mine (to avoid build failure
attributed to a missing 'environ' definition). Unfortunately, the
'HAVE_ENVIRON_DECL' identifier is not defined anywhere and thus the test is
not useful. I simply replaced the 'HAVE_ENVIRON_DECL' identifier with my own
'HAVE_DEFINED_ENVIRON' which is indeed defined in config.h.

Regards,
Michael, OpenPKG
http://www.openpkg.org/

Attachment: gettext.patch
Description: Text document

Attachment: pgp3qx1CYV3k8.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]