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

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

[PATCH] gawk-3.1.0 --disable-nls build failure


From: Peter J. Farley III
Subject: [PATCH] gawk-3.1.0 --disable-nls build failure
Date: Sat, 11 Aug 2001 21:49:40 -0400

Here are patches for a small bug that that showed up building gawk 3.1.0 under DJGPP/MS-DOS.

When libiconv-1.7 and gettext-0.10.39 are loaded on a system but the "--disable-nls" option is given to configure, three modules still use gettext for messages. The three in question are dfa.c, getopt.c and regex.c. Both dfa.c and getopt.c define a macro for strings ("_(Str)") to be "gettext(Str)" regardless of whether ENABLE_NLS is defined, and all three #include libintl.h whether or not ENABLE_NLS is defined, as long as HAVE_LIBINTL_H is defined.

This causes ld failure due to the link-time NLS libraries not being used when "--disable-nls" is specified.

The patches make the use of gettext and libintl.h in these modules dependent on ENABLE_NLS being defined.

HTH

====================dfa.dif====================
*** gawk-3.1.0u/dfa.c   Mon Apr  9 10:28:38 2001
--- gawk-3.1.0/dfa.c    Sat Aug 11 20:51:12 2001
***************
*** 91,107 ****
     host does not conform to Posix.  */
  #define ISASCIIDIGIT(c) ((unsigned) (c) - '0' <= 9)

  /* If we (don't) have I18N.  */
  /* glibc defines _ */
! #ifndef _
! # ifdef HAVE_LIBINTL_H
! #  include <libintl.h>
! #  ifndef _
! #   define _(Str) gettext (Str)
  #  endif
- # else
- #  define _(Str) (Str)
  # endif
  #endif

  #include "regex.h"
--- 91,112 ----
     host does not conform to Posix.  */
  #define ISASCIIDIGIT(c) ((unsigned) (c) - '0' <= 9)

+ /* Don't use gettext if ENABLE_NLS is not defined */
  /* If we (don't) have I18N.  */
  /* glibc defines _ */
! #ifdef ENABLE_NLS
! # ifndef _
! #  ifdef HAVE_LIBINTL_H
! #   include <libintl.h>
! #   ifndef _
! #    define _(Str) gettext (Str)
! #   endif
! #  else
! #   define _(Str) (Str)
  #  endif
  # endif
+ #else
+ # define _(Str) (Str)
  #endif

  #include "regex.h"
====================dfa.dif====================

====================getopt.dif====================
*** gawk-3.1.0u/getopt.c        Tue Nov  7 13:24:18 2000
--- gawk-3.1.0/getopt.c Sat Aug 11 20:53:54 2001
***************
*** 76,91 ****
  # endif
  #endif

! #ifndef _
/* This is for other GNU distributions with internationalized messages. */
! # if defined HAVE_LIBINTL_H || defined _LIBC
! #  include <libintl.h>
! #  ifndef _
! #   define _(msgid)   gettext (msgid)
  #  endif
- # else
- #  define _(msgid)    (msgid)
  # endif
  #endif

/* This version of `getopt' appears to the caller like standard Unix `getopt'
--- 76,96 ----
  # endif
  #endif

! /* Don't use gettext if ENABLE_NLS is not defined */
! #ifdef ENABLE_NLS
! # ifndef _
/* This is for other GNU distributions with internationalized messages. */
! #  if defined HAVE_LIBINTL_H || defined _LIBC
! #   include <libintl.h>
! #   ifndef _
! #    define _(msgid)  gettext (msgid)
! #   endif
! #  else
! #   define _(msgid)   (msgid)
  #  endif
  # endif
+ #else
+ # define _(msgid)     (msgid)
  #endif

/* This version of `getopt' appears to the caller like standard Unix `getopt'
====================getopt.dif====================

====================regex.dif====================
*** gawk-3.1.0u/regex.c Tue Feb  6 16:13:52 2001
--- gawk-3.1.0/regex.c  Sat Aug 11 20:56:24 2001
***************
*** 80,88 ****
  #define btowc __btowc
  #endif

/* This is for other GNU distributions with internationalized messages. */
! #if HAVE_LIBINTL_H || defined _LIBC
! # include <libintl.h>
  #else
  # define gettext(msgid) (msgid)
  #endif
--- 80,93 ----
  #define btowc __btowc
  #endif

+ /* Don't use gettext if ENABLE_NLS is not defined */
+ #ifdef ENABLE_NLS
/* This is for other GNU distributions with internationalized messages. */
! # if HAVE_LIBINTL_H || defined _LIBC
! #  include <libintl.h>
! # else
! #  define gettext(msgid) (msgid)
! # endif
  #else
  # define gettext(msgid) (msgid)
  #endif
====================regex.dif====================

---------------------------------------------------------
Peter J. Farley III (address@hidden)




reply via email to

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