Hi, The attached patch is needed to be able to link correctly grep when configured with --disable-nls on non glibc systems with gettext installed; currently ld fails resolving _libintl_gettext because some gettext symbols are used when libintl.h is present, which is wrong since it does not mean that gettext will be linked in.
-- Emanuele Giaquinta
Index: lib/obstack.c =================================================================== RCS file: /sources/grep/grep/lib/obstack.c,v retrieving revision 1.2 diff -u -b -B -r1.2 obstack.c --- lib/obstack.c 2 May 2005 09:47:48 -0000 1.2 +++ lib/obstack.c 23 Jun 2006 11:50:24 -0000 @@ -451,7 +451,7 @@ /* Define the error handler. */ #ifndef _ -# ifdef HAVE_LIBINTL_H +# ifdef ENABLE_NLS # include <libintl.h> # ifndef _ # define _(Str) gettext (Str) Index: lib/regex.c =================================================================== RCS file: /sources/grep/grep/lib/regex.c,v retrieving revision 1.5 diff -u -b -B -r1.5 regex.c --- lib/regex.c 2 May 2005 09:47:48 -0000 1.5 +++ lib/regex.c 23 Jun 2006 11:50:31 -0000 @@ -116,7 +116,7 @@ #endif /* This is for other GNU distributions with internationalized messages. */ -#if HAVE_LIBINTL_H || defined _LIBC +#if ENABLE_NLS || defined _LIBC # include <libintl.h> # ifdef _LIBC # undef gettext
