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

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

grep 2.5.1 and OS/2


From: Andreas Buening
Subject: grep 2.5.1 and OS/2
Date: Sun, 02 Mar 2003 21:27:23 +0100

Hello!

I've just compiled grep 2.5.1 for OS/2 and I've noticed the following
problems:

1. Even if --disable-nls is specified grep is linked with gettext.
   Reason: Code like that:

#ifndef _
# ifdef HAVE_LIBINTL_H
#  include <libintl.h>
#  ifndef _
#   define _(Str) gettext (Str)
#  endif
# else
#  define _(Str) (Str)
# endif
#endif

which is in dfa.c and in several lib/*.c files. If libintl.h exists
but --disable-nls was specified then _ is defined to gettext.
Solution: Don't check for libintl.h in configure.in:

configure.in:
---------------------------------------
--- old/grep-2.5.1/configure.in Tue Mar 26 15:48:16 2002
+++ gnu/grep-2.5.1/configure.in Sun Feb 23 18:42:06 2003
@@ -38,8 +38,8 @@

 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(string.h stdlib.h sys/param.h memory.h unistd.h libintl.h)
-AC_CHECK_HEADERS(wctype.h wchar.h)
+AC_CHECK_HEADERS([string.h stdlib.h sys/param.h memory.h unistd.h])
+AC_CHECK_HEADERS([wctype.h wchar.h])
 AC_HEADER_DIRENT
 AC_HEADER_STAT
 AC_MBSTATE_T
---------------------------------------


2. Special initialize_main() for OS/2 necessary.
3. Define HAVE_DIR_EACCES_BUG.
4. define strcasecmp() and S_ISBLK()

src/system.h:
---------------------------------------
--- old/grep-2.5.1/src/system.h Thu Feb  8 17:01:32 2001
+++ gnu/grep-2.5.1/src/system.h Sun Feb 23 18:38:26 2003
@@ -80,6 +80,10 @@

 int isdir PARAMS ((char const *));

+#if defined(__EMX__) && !defined(HAVE_DIR_EACCES_BUG)
+# define HAVE_DIR_EACCES_BUG
+#endif
+
 #ifdef HAVE_DIR_EACCES_BUG
 # ifdef EISDIR
 #  define is_EISDIR(e, f) \
@@ -201,6 +205,23 @@
 # include <locale.h>
 #endif

+#ifdef __EMX__
+# include <sys/types.h>
+# include <sys/stat.h>
+# ifndef S_ISBLK
+#  define S_ISBLK(x) 0
+# endif
+# if !HAVE_STRCASECMP
+#  define strcasecmp stricmp
+# endif
+#endif
+
 #ifndef initialize_main
-#define initialize_main(argcp, argvp)
+# ifdef __EMX__
+#  define initialize_main(argcp, argvp) \
+  { _response(argcp, argvp); _wildcard(argcp, argvp); }
+# else /* NOT __EMX__ */
+#  define initialize_main(argcp, argvp)
+# endif
 #endif
+
---------------------------------------


5. /dev/null is writeonly on OS/2. With the small change below
   all tests work fine with the included regex. Btw, have you ever
   tried to link with a newer GNU regex snapshot? This seems to
   work suboptimal.

tests/file.sh:
---------------------------------------
--- old/grep-2.5.1/tests/file.sh        Mon Nov 19 13:23:28 2001
+++ gnu/grep-2.5.1/tests/file.sh        Sun Feb 23 18:56:24 2003
@@ -47,7 +47,9 @@
        failures=1
 fi

-cp /dev/null patfile
+# cp /dev/null patfile
+rm -f patfile
+touch patfile

 # null pattern : no match
 echo "abbcd" | ${GREP} -F -f patfile > /dev/null 2>&1
---------------------------------------


6. Please, could you provide .gmo and .info files for the next release
   as it's usual for most other GNU packages? A lot of Unix systems
   don't have makeinfo or info installed. Thanks.
7. Could you update some of the helper files, please? Like autoconf,
   automake, gettext, po/Makefile.in.in?
8. You can remove the autom4te*.cache directory.


ChangeLog:
2003-03-02  Andreas Buening <address@hidden>
        * Don't check for libintl.h in configure.in.
        * Support for OS/2 in system.h.
        * Minor change in tests/file.sh.


Please, reply directly to me because I haven't subscribed to any
bug-gnu-utils mailinglist. Thanks.


Bye,
Andreas




reply via email to

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