| Fixes compilation with -nls useflag on FreeBSD (and probably others). |
| |
| See http://bugs.gentoo.org/253777. |
| |
| --- grep-2.5.3.orig/lib/error.c |
| +++ grep-2.5.3/lib/error.c |
| @@ -26,8 +26,8 @@ |
| #endif |
| |
| #include <stdio.h> |
| -#if HAVE_LIBINTL_H |
| -# include <libintl.h> |
| +#if defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) |
| +# include <libintl.h> |
| #endif |
| |
| #if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC |
| --- grep-2.5.3.orig/lib/getopt.c |
| +++ grep-2.5.3/lib/getopt.c |
| @@ -77,7 +77,7 @@ |
| #ifndef _ |
| /* This is for other GNU distributions with internationalized messages. |
| When compiling libc, the _ macro is predefined. */ |
| -# ifdef HAVE_LIBINTL_H |
| +# if defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) |
| # include <libintl.h> |
| # define _(msgid) gettext (msgid) |
| # else |
| --- grep-2.5.3.orig/lib/obstack.c |
| +++ grep-2.5.3/lib/obstack.c |
| @@ -451,7 +451,7 @@ |
| |
| /* Define the error handler. */ |
| #ifndef _ |
| -# ifdef HAVE_LIBINTL_H |
| +# if defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) |
| # include <libintl.h> |
| # ifndef _ |
| # define _(Str) gettext (Str) |
| --- grep-2.5.3.orig/lib/regex.c |
| +++ grep-2.5.3/lib/regex.c |
| @@ -116,7 +116,7 @@ |
| #endif |
| |
| /* This is for other GNU distributions with internationalized messages. */ |
| -#if HAVE_LIBINTL_H || defined _LIBC |
| +#if ENABLE_NLS && (HAVE_LIBINTL_H || defined _LIBC) |
| # include <libintl.h> |
| # ifdef _LIBC |
| # undef gettext |