jni and static libgcj and friends?
Martin Kahlert
martin.kahlert@infineon.com
Thu Feb 28 08:04:00 GMT 2002
Hi Jeff,
On Tue, Feb 26, 2002 at 11:27:29AM -0500, Jeff Sturm wrote:
> On 2002年2月26日, Jeff Sturm wrote:
> > In theory you could build libgcj with -prefer-pic and get what you want...
> > I tried this and it didn't seem to work.
>> My apologies... -prefer-pic *does* work. It's just that it still builds
> each object twice :(
>> Martin, try this makefile hack (be sure to re-run automake):
>> Index: Makefile.am
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
> retrieving revision 1.201
> diff -u -r1.201 Makefile.am
> --- Makefile.am 2002年02月22日 03:21:26 1.201
> +++ Makefile.am 2002年02月26日 16:24:06
> @@ -69,7 +69,7 @@
> ## compiles.
> GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8
>> -GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c
> +GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile -prefer-pic $(GCJ_WITH_FLAGS) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c
> GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
> LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
>> @@ -77,7 +77,7 @@
> ## values of `CXX' and will then get confused and fail to work. So,
> ## we use --tag explicitly. Someday automake will be changed to do
> ## this automatically.
> -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
> +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile -prefer-pic $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
>> JAVAC = $(GCJ_WITH_FLAGS) -C
I seem to be too silly for that. I applied your patch (to snapshot
gcc-20020218 if that matters) and run automake inside the libjava (source
tree) directory.
After that i tried a bootstrap with
../gcc-20020218/configure --prefix=${prefix} \
--enable-languages=c++,f77,java \
--with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld \
--disable-threads --enable-shared=libstdc++
gmake boostrap
This is the result:
gmake[2]: Entering directory `/data/titan_1/kahlert/TTT/obj_titan/sparc-sun-solaris2.7/libjava'
Makefile:950: target `java/i' doesn't match the target pattern
Makefile:950: target `gnu/java/locale/Locale' doesn't match the target pattern
Makefile:966: target `java/i' doesn't match the target pattern
Makefile:966: target `gnu/java/locale/Locale' doesn't match the target pattern
gmake[2]: Circular java/i <- libgcj.jar dependency dropped.
/usr/bin/ksh ./libtool --tag=GCJ --mode=compile -prefer-pic /data/titan_1/kahlert/TTT/obj_titan/gcc/gcj -B/data/titan_1/kahlert/TTT/obj_titan/sparc-sun-solaris2.7/libjava/ -B/data/titan_1/kahlert/TTT/obj_titan/gcc/ --encoding=UTF-8 -fassume-compiled -fclasspath=/data/titan_1/kahlert/TTT/obj_titan/sparc-sun-solaris2.7/libjava -L/data/titan_1/kahlert/TTT/obj_titan/sparc-sun-solaris2.7/libjava -g -O2 -MD -MT java/i -MF java/i -c -o java/i
libtool: unrecognized option `-prefer-pic'
Try `libtool --help' for more information.
gmake[2]: *** [java/i] Error 1
gmake[2]: Leaving directory `/data/titan_1/kahlert/TTT/obj_titan/sparc-sun-solaris2.7/libjava'
gmake[1]: *** [all-target-libjava] Error 2
gmake[1]: Leaving directory `/data/titan_1/kahlert/TTT/obj_titan'
gmake: *** [bootstrap] Error 2
Sorry, but i am neiter a libtool nor automake expert/user.
Thanks
Martin.
--
The early bird catches the worm. If you want something else for
breakfast, get up later.
More information about the Java
mailing list