From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24052 invoked by alias); 4 Aug 2008 17:18:13 -0000 Received: (qmail 24033 invoked by uid 48); 4 Aug 2008 17:18:12 -0000 Date: Mon, 04 Aug 2008 17:18:00 -0000 Message-ID: <20080804171812.24032.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libgcj/37019] [4.2 Regression] Inconsistent gcc-4.2.3/libjava/configure uses "grep" and "egrep" and "grep -E" and "$EGGREP" but not ggrep -- sed also is trouble In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "rob1weld at aol dot com" Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2008-q3/txt/msg00017.txt.bz2 ------- Comment #2 from rob1weld at aol dot com 2008-08-04 17:18 ------- >Ralf Wildenhues 2008-08-04 08:57 wrote: >I see the egrep issue. Would you click the "CONFIRMED" button please. > Can you please specify for which grep and sed commands you see errors? I need to build some dependencies (that will take a few days) before I can run the _entire_ script, but I do have an initial report (see below) ... > The assumption is that all systems do have sed and grep available, but > that the vendor versions of these tools have some quirks that make it > unsuitable for some (but not all) uses. Wrt. egrep and fgrep, there > are systems for which 'grep -E' and 'grep -F' have to be used. > If any of these assumptions are not valid, then I would like to know > details, so that the Autoconf manual can be updated to reflect this. > > If any of these assumptions are not valid ... > > have some quirks that make it unsuitable for some (but not all) uses Assume that _ALL_ commands (grep, make, egrep, diff, _everything_) are not "valid" _GNU_ commands. The creator of the Operating System can name any command any name they want (EG: Ralph can be spelled Ralf or Rolf etc). Similarly grep can be called sed and sed can be called diff -- I'm not suggested that is a good idea, just that it is possible. >>From a practical point of view it makes sense to run the command with "--version" (or "-v" or "-V") and check that it is indeed a GNU program and that the version is "new enough" that _ALL_ following uses of the command will operate correctly. Yes, that would be a rewrite of a lot of scripts but if you want to make sure that everything works you need the sanity tests to run at the beginning of each script. If you don't check that you are sane then how can you decide anything ? --- The Solaris 11 OS that I am using is only a couple of months old. When I do a directory listing to find my "g-prefixed" commands I get a list like this (I edited out some obvious commands that are not "g-prefixed" versions and hopefully was not too heavy-handed): # ls -l /usr/bin/g* -r-xr-xr-x 1 root bin 30432 Jun 26 18:26 /usr/bin/gcmp ... -r-xr-xr-x 1 root bin 151740 Jun 26 18:26 /usr/bin/gdiff -r-xr-xr-x 1 root bin 36712 Jun 26 18:26 /usr/bin/gdiff3 ... -r-xr-xr-x 3 root bin 116268 Jun 26 17:02 /usr/bin/gegrep ... -r-xr-xr-x 3 root bin 116268 Jun 26 17:02 /usr/bin/gfgrep -r-xr-xr-x 1 root bin 23568 Jun 26 19:58 /usr/bin/ggettext -r-xr-xr-x 3 root bin 116268 Jun 26 17:02 /usr/bin/ggrep ... -r-xr-xr-x 1 root bin 151780 Jun 26 18:00 /usr/bin/gm4 -r-xr-xr-x 1 root bin 153036 Jun 26 18:01 /usr/bin/gmake ... -r-xr-xr-x 1 root bin 315084 Jun 26 19:58 /usr/bin/gmsgfmt ... -r-xr-xr-x 1 root bin 88376 Jun 26 16:48 /usr/bin/gpatch ... -r-xr-xr-x 1 root bin 34728 Jun 26 18:26 /usr/bin/gsdiff ... -r-xr-xr-x 1 root bin 312884 Jun 26 17:02 /usr/bin/gtar That is about all I can spot from eye / memory / knowledge about GNUisms. That list is, again: gcmp, gdiff, gdiff3, gegrep, gfgrep, ggettext, ggrep, gm4, gmake, gmsgfmt, gpatch, gsdiff, gtar, (etc, possibly I missed one). This means that any attempt to use these programs (on Solaris and _some_ other OSes) will fail. Here is the output for each program and for Solaris 11's "g-prefixed" version: --- # cmp --version cmp: illegal option -- version usage: cmp [-l | -s] file1 file2 [skip1] [skip2] # gcmp --version cmp (GNU diffutils) 2.8.1 Copyright (C) 2002 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. Written by Torbjorn Granlund and David MacKenzie. --- # diff --version diff: illegal option -- version usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 # gdiff --version diff (GNU diffutils) 2.8.1 Copyright (C) 2002 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. Written by Paul Eggert, Mike Haertel, David Hayes, Richard Stallman, and Len Tower. --- # diff3 --version usage: diff3 file1 file2 file3 # gdiff3 --version diff3 (GNU diffutils) 2.8.1 Copyright (C) 2002 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. Written by Randy Smith. --- # egrep --version egrep: illegal option -- version usage: egrep [ -bchilnsv ] [ -e exp ] [ -f file ] [ strings ] [ file ] ... # gegrep --version egrep (GNU grep) 2.5 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --- # fgrep --version fgrep: illegal option -- version usage: fgrep [ -bchilnsvx ] [ -e exp ] [ -f file ] [ strings ] [ file ] ... # gfgrep --version fgrep (GNU grep) 2.5 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --- (NOTE: Solaris's "gettext" echos the "--version" _without_ a C/R) --- # gettext --version --version# ggettext --version ggettext (GNU gettext-runtime) 0.16.1 Copyright (C) 1995-1997, 2000-2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Ulrich Drepper. --- # grep --version grep: illegal option -- version Usage: grep -hblcnsviw pattern file . . . # ggrep --version grep (GNU grep) 2.5 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --- # m4 --version m4: bad option: --version # gm4 --version GNU m4 1.4.2 --- # make --version make: Warning: Ignoring DistributedMake -v option make: Warning: Ignoring DistributedMake -o option make: Fatal error: No dmake output dir argument after -o flag # gmake --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-pc-solaris2.11 --- # msgfmt --version ERROR: Cannot open file --version. # gmsgfmt --version gmsgfmt (GNU gettext-tools) 0.16.1 Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Ulrich Drepper. --- # patch --version patch: Invalid options. patch: Usage: patch [-blNR] [-c|-e|-n] [-d dir] [-D define] [-i patchfile]\ [-o outfile] [-p num] [-r rejectfile] [file] # gpatch --version patch 2.5.9 Copyright (C) 1988 Larry Wall Copyright (C) 2003 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. written by Larry Wall and Paul Eggert --- # sdiff --version Usage: sdiff [-l] [-s] [-o output] [-w #] file1 file2 # gsdiff --version sdiff (GNU diffutils) 2.8.1 Copyright (C) 2002 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. Written by Thomas Lord. --- # tar --version tar: s: unknown function modifier Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@/[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}... # gtar --version tar (GNU tar) 1.17 Copyright (C) 2007 Free Software Foundation, Inc. License GPLv2+: GNU GPL version 2 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. --- -------------------- To answer your question "Can you please specify for which grep and sed commands you see errors?" here is an attempt to comply (until I finish the dependencies (_if_ they can be built on this platform)) I can't finsh running the script (and will have to remove the "qt" options I am configuring with). Here is a comparison of the i386-pc-solaris2.11/libjava/config.log files with the origonal "configure" and my modified "configure" where I added "g-prefixes" everywhere I could see it was necessary. To shorten the list I edited the output by hand: # gdiff -Naur config_Origonal_configure.log config_Modified-1_configure.log (Enclosed as an attachment in next message) You can see how serious this is. The configury is getting a one-off error in uname, doesn't know the "Invocation command line", reads the wrong specs file, checks "gcc -v" instead of "xgcc -v", the list goes on and on ... Basically the first few mistakes compound the rest and even _IF_ a later grep command _could_ work (command is compatable with both (Solaris) grep and (GNU) ggrep) it has little chance if it is fed incorrect information. (See attachment in next message). Thanks for looking at this Ralf. YT, Rob -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37019