This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: java class registration via .jcr section, take 3
On 11-Aug-2001, Tom Tromey <tromey@redhat.com> wrote:
> >>>>> "Fergus" == Fergus Henderson <fjh@cs.mu.oz.au> writes:
>
> Fergus> The approach of requiring that you link with a particular
> Fergus> program really doesn't scale to multiple languages well. We
> Fergus> made that mistake with `ml', but please don't repeat it with
> Fergus> `gcj'.
>
> You aren't required to link with gcj.
Good. Please keep it that way.
> Perhaps there is a way to make it easier for everyone. I don't know
> what it is.
There's two alternatives I can think of.
(1) Instead of having separate drivers, just have one driver
with options `--java', `--fortran', `--mercury', etc.
Then you can link multiple languages by just specifying
multiple options. `gcj' can just be a wrapper around
`gcc --java', `g77' can be just a wrapper around `gcc --fortran', etc.
This is significantly easier to implement than
having collect handle it automagically.
(2) For each language, provide a program that prints out the
gcc options needed for that language. E.g. this might be
doen with `gcj --print-gcc-options` or `gcj-config --print-gcc-options`.
Likewise for any libraries that need to be linked in.
Linking would then be done by invoking gcc with the output of
these programs.
GCC_JAVA_OPTIONS = `gcj-config --print-gcc-options`
GCC_JAVA_LIBS = `gcj-config --print-libs`
GCC_FORTRAN_OPTIONS = `g77-config --print-gcc-options`
GCC_FORTRAN_LIBS = `g77-config --print-libs`
GCC = gcc
foo : $(OBJS)
$(GCC) $(GCC_JAVA_OPTIONS) $(GCC_FORTRAN_OPTIONS) $(OBJS) \
$(GCC_JAVA_LIBS) $(GCC_FORTRAN_LIBS)
Probably alternative (1) is better.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.