From: Bruno Haible Date: Thu, 13 Mar 2003 11:49:01 +0000 (+0000) Subject: Portability problem on Solaris 8 and 9. X-Git-Tag: v0.12~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ed8621ec48248138e7b4d5e468c4af2ed8cfdd2;p=thirdparty%2Fgettext.git Portability problem on Solaris 8 and 9. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index bf4ed38f9..f76f461f2 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,9 @@ +2003-03-13 Bruno Haible + + * msggrep.c (main): On Solaris, prefer /usr/xpg4/bin/grep to + /usr/bin/grep. Needed for Solaris 2.8 and 2.9. + Reported by Sven Utcke . + 2003-03-03 Bruno Haible * msgen.c (usage): Don't say that the entries are marked fuzzy. diff --git a/gettext-tools/src/msggrep.c b/gettext-tools/src/msggrep.c index 1c5975b54..81e146577 100644 --- a/gettext-tools/src/msggrep.c +++ b/gettext-tools/src/msggrep.c @@ -329,6 +329,15 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ This is an optimization, to avoid that spawn/exec searches the PATH on every call. */ grep_path = find_in_path ("grep"); + + /* On Solaris >= 2.8, we need to use /usr/xpg4/bin/grep instead of + /usr/bin/grep, because /usr/bin/grep doesn't understand the options + -q and -e. */ +#if (defined (sun) || defined (__sun)) && defined (__SVR4) + if (strcmp (grep_path, "/usr/bin/grep") == 0 + && access ("/usr/xpg4/bin/grep", X_OK) == 0) + grep_path = "/usr/xpg4/bin/grep"; +#endif } /* Build argument lists for the 'grep' program. */