Bug 30607 - gcj -I x -C doesn't include x as source dir search patch
Summary: gcj -I x -C doesn't include x as source dir search patch
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-27 00:38 UTC by Mark Wielaard
Modified: 2007-01-29 21:39 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-01-29 19:34:11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2007-01-27 00:38:50 UTC
Given an directory x with two source files:

- x/a.java
  public class a extends b { }
- x/b.java
  public class b { }

With gcj 4.1.1 it was possible to include x as source patch search dir with -I and compile as follows:
$ gcj -C -I x x/a.java

With current svn trunk (and ecj1 installed) this gives:
$ /usr/local/gcc43/bin/gcj -C -I x x/a.java
x/a.java:1: error: b cannot be resolved to a type
        public class a extends b { }
                               ^
1 problem (1 error)
Comment 1 Marco Trudel 2007-01-27 10:12:15 UTC
I can confirm that. However, I don't know if it's a bug or just luck that it worked before. I think the correct command would be:
gcj -C -Ix x/a.java (no space between -I" and "x")

This way it works and I think (I'm absolutely not sure) this is the official way.
Comment 2 Tom Tromey 2007-01-29 19:16:32 UTC
I didn't realize that -I's argument could be separate, but 
now I see this in c.opt:

I
C ObjC C++ ObjC++ Joined Separate
-I <dir>	Add <dir> to the end of the main include path

Comment 3 Tom Tromey 2007-01-29 19:34:11 UTC
Tetsing a patch.
Comment 4 Tom Tromey 2007-01-29 21:30:26 UTC
Subject: Bug 30607

Author: tromey
Date: Mon Jan 29 21:30:10 2007
New Revision: 121311

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121311
Log:
	PR java/30607:
	* jvspec.c (lang_specific_driver): Handle separate -I argument.
	* lang.opt (-I): Add 'Separate'.

Modified:
    trunk/gcc/java/ChangeLog
    trunk/gcc/java/jvspec.c
    trunk/gcc/java/lang.opt

Comment 5 Tom Tromey 2007-01-29 21:38:16 UTC
Subject: Bug 30607

Author: tromey
Date: Mon Jan 29 21:38:06 2007
New Revision: 121312

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121312
Log:
	PR java/30607:
	* jvspec.c (lang_specific_driver): Handle separate -I argument.
	* lang.opt (-I): Add 'Separate'.

Modified:
    branches/redhat/gcc-4_1-branch-java-merge-20070117/gcc/java/ChangeLog
    branches/redhat/gcc-4_1-branch-java-merge-20070117/gcc/java/jvspec.c
    branches/redhat/gcc-4_1-branch-java-merge-20070117/gcc/java/lang.opt

Comment 6 Tom Tromey 2007-01-29 21:39:00 UTC
Fix checked in.