Bug 37000 - gen-classlist.sh uses unrecognized 'test' arguments
Summary: gen-classlist.sh uses unrecognized 'test' arguments
Status: RESOLVED DUPLICATE of bug 25557
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.2.4
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-01 15:07 UTC by David Eisner
Modified: 2008-08-06 16:41 UTC (History)
5 users (show)

See Also:
Host: sparc-sun-solaris2.9
Target: sparc-sun-solaris2.9
Build: sparc-sun-solaris2.9
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Eisner 2008-08-01 15:07:44 UTC
[I can't decide if this should be reported against gcc or classpath.  Apologies if I got it wrong.]

My gcc build is failing when gen-classlist.sh is invoked, in two places:

First place:

	top_builddir=.. top_srcdir=../../../../../../gcc-4.2.4/libjava/classpath /bin/sh ./gen-classlist.sh standard
	Adding java source files from srcdir '../../../../../../gcc-4.2.4/libjava/classpath'.
	Adding java source files from VM directory /export/data/software/cradle/build/gcc/gcc-4.2.4/libjava
	Adding java source files from VM directory /export/data/software/cradle/build/gcc/objdir/sparc-sun-solaris2.9/sparcv9/libjava
	./gen-classlist.sh: test: unknown operator -ef
	make: *** [genclasses] Error 1

Second place:

	Adding java source files from srcdir '../../../../../../gcc-4.2.4/libjava/classpath'.
	Adding java source files from VM directory /export/data/software/cradle/build/gcc/gcc-4.2.4/libjava
	Adding java source files from VM directory /export/data/software/cradle/build/gcc/objdir/sparc-sun-solaris2.9/sparcv9/libjava
	Adding generated files in builddir '..'.
	./gen-classlist.sh: test: argument expected
	make: *** [genclasses] Error 1

The first problem occurs because on Solaris 9, at least, the /bin/sh test built-in doesn't understand the -ef operator, and the second problem occurs because it doesn't understand the -e operator.  From the Solaris test(1) man page:

---8<---
          file1 -ef file2
                True if file1 and file2 exist and  refer  to  the
                same file. (Not available in sh.)
...
          -e file
                True if file exists. (Not available in sh.)
--->8---

Workaround: In gen-classlist.sh, replace those two calls to test with /usr/bin/test.
Comment 1 Brian Dessent 2008-08-01 15:19:38 UTC
Subject: Re:   New: gen-classlist.sh uses unrecognized 
 'test' arguments

Using /bin/sh with Solaris is documented to fail:
http://gcc.gnu.org/install/specific.html#x-x-solaris2

Have you tried setting CONFIG_SHELL as suggested?
Comment 2 David Eisner 2008-08-01 15:22:32 UTC
(In reply to comment #1)
> Have you tried setting CONFIG_SHELL as suggested?

Apologies, I did not see that.  I'll try this next time. 

Comment 3 David Eisner 2008-08-06 16:41:44 UTC
My bug appears to be a duplicate bug, anyway:

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25557



*** This bug has been marked as a duplicate of 25557 ***