aboutsummaryrefslogtreecommitdiff
path: root/libjava/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/Makefile.am')
-rw-r--r--libjava/Makefile.am92
1 files changed, 51 insertions, 41 deletions
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index b3cbb0c700e..92432eff22a 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -31,7 +31,9 @@ endif
toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary)
toolexeclib_DATA = libgcj.spec
-data_DATA = libgcj.jar
+
+jardir = $(datadir)/java
+jar_DATA = libgcj-@gcc_version@.jar
## FIXME: Using libdir violates GNU coding standards.
secdir = $(libdir)/security
@@ -69,7 +71,7 @@ endif # CANADIAN
## compiles.
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8
-GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fbootclasspath=$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c
+GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fclasspath= -fbootclasspath=$(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 $@
@@ -89,6 +91,8 @@ WARNINGS = -W -Wall
AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
## Some systems don't allow `$' in identifiers by default, so we force it.
-fdollars-in-identifiers \
+## Detect bugs in the verifier implementation, and maybe other places.
+ -Wswitch-enum \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
-DPREFIX="\"$(prefix)\""
if USING_GCC
@@ -129,22 +133,23 @@ libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \
win32-threads.cc posix.cc win32.cc \
$(c_source_files) $(java_source_files) $(built_java_source_files)
-libgcj_la_DEPENDENCIES = libgcj.jar $(javao_files) \
- $(c_files) $(GCOBJS) $(THREADOBJS) $(PLATFORMOBJS) $(LIBLTDL)
+libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar $(javao_files) \
+ $(c_files) $(GCOBJS) $(THREADOBJS) $(PLATFORMOBJS) $(LIBLTDL) \
+ $(LIBFFI) $(ZLIBS) $(GCLIBS)
libgcj_la_LIBADD = $(javao_files) $(c_files) $(GCOBJS) \
$(THREADOBJS) $(PLATFORMOBJS)
# Include THREADLIBS here to ensure that the correct version of
# certain linuxthread functions get linked:
-libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLIBS) $(LIBLTDL) \
- $(GCLIBS) $(ZLIBS) \
+libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
+ $(LIBLTDL) $(SYS_ZLIBS) \
## The mysterious backslash is consumed by make.
-version-info `grep -v '^\#' $(srcdir)/libtool-version`
libgcj_la_LINK = $(LIBLINK)
libgcjx_la_SOURCES = $(x_nat_source_files)
EXTRA_libgcjx_la_SOURCES = $(x_java_source_files)
-libgcjx_la_DEPENDENCIES = libgcj.jar $(x_javao_files)
+libgcjx_la_DEPENDENCIES = libgcj-@gcc_version@.jar $(x_javao_files)
libgcjx_la_LIBADD = $(x_javao_files)
libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
-rpath $(toolexeclibdir) \
@@ -166,13 +171,13 @@ install-exec-hook:
## a .java file with some other class which is caught. Note that we
## only want to create headers for those files which do not have
## hand-maintained headers.
-$(built_java_source_files:.java=.class): libgcj.jar
-$(java_source_files:.java=.class): libgcj.jar
+$(built_java_source_files:.java=.class): libgcj-@gcc_version@.jar
+$(java_source_files:.java=.class): libgcj-@gcc_version@.jar
## The .class files for X will not be included in libgcj.jar, but the
## rule for libgcj.jar will cause all out-of-date .class files to be
## built. We need this to generate headers for the nat-files.
-$(x_java_source_files:.java=.class): libgcj.jar
+$(x_java_source_files:.java=.class): libgcj-@gcc_version@.jar
## We have the zip file depend on the java sources and not the class
## files, because we don't know the names of all the class files.
@@ -180,25 +185,25 @@ $(x_java_source_files:.java=.class): libgcj.jar
## up-to-date, and foo.class is removed, and bar.java is touched, then
## `make libgcj.jar' will not rebuilt foo.class. That's because
## libgcj.jar is not out-of-date with respect to foo.java.
-libgcj.jar: $(built_java_source_files) $(java_source_files) $(x_java_source_files)
+libgcj-@gcc_version@.jar: $(built_java_source_files) $(java_source_files) $(x_java_source_files)
## Create a list of all Java sources, without exceeding any shell limits.
@: $(shell echo Creating list of files to compile...) $(shell rm -f tmp-list || :) $(shell touch tmp-list) $(foreach source,$?,$(shell echo $(source) >> tmp-list))
@set fnord $(MAKEFLAGS); amf=$$2; fail=no; \
javac="$(JAVAC)"; \
cat tmp-list | (while read f; do \
- echo $$javac $(JCFLAGS) -bootclasspath $(here):$(srcdir) -d $(here) $$f; \
- $$javac $(JCFLAGS) -bootclasspath $(here):$(srcdir) -d $(here) $$f \
+ echo $$javac $(JCFLAGS) -classpath \'\' -bootclasspath $(here):$(srcdir) -d $(here) $$f; \
+ $$javac $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) $$f \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes ;; *) exit 1;; esac; \
done; \
test "$$fail" = no)
- -@rm -f tmp-list libgcj.jar
+ -@rm -f tmp-list libgcj-@gcc_version@.jar
## Note that we explicitly want to include directory information.
find java gnu javax org -type d -o -type f -name '*.class' | \
sed -e '/\/\./d' -e '/\/xlib/d' | \
$(ZIP) cfM0E@ $@
MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files) $(x_javao_files) $(x_nat_files) $(x_nat_headers)
-CLEANFILES = tmp-list libgcj.jar
+CLEANFILES = tmp-list libgcj-@gcc_version@.jar
clean-local:
## We just remove every .class file that was created.
@@ -240,7 +245,7 @@ $(javao_files) $(x_javao_files): %.lo: %.java
libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES)
@: $(shell echo Creating list of files to link...) $(shell rm -f libgcj.objectlist || :) $(shell touch libgcj.objectlist) $(foreach object,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),$(shell echo $(object) >> libgcj.objectlist))
$(libgcj_la_LINK) -objectlist libgcj.objectlist \
- @LIBFFI@ \
+ @GCLIBS@ @LIBFFI@ @ZLIBS@ \
-rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS)
libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES)
@@ -256,7 +261,7 @@ libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES)
.class.h:
## FIXME: GNU make specific.
- $(GCJH) -bootclasspath $(top_builddir) $(basename $<)
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) $(basename $<)
## Header files used when compiling some of the nat* files.
ordinary_nat_headers = $(ordinary_java_source_files:.java=.h) \
@@ -272,13 +277,13 @@ x_nat_headers = $(x_java_source_files:.java=.h)
$(ordinary_nat_headers) $(x_nat_headers): %.h: %.class
java/lang/ClassLoader.h: java/lang/ClassLoader.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
-friend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
-friend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
$(basename $<)
java/lang/Thread.h: java/lang/Thread.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
-prepend 'class _Jv_JNIEnv;' \
-prepend '#define _JV_NOT_OWNER 1' \
-prepend '#define _JV_INTERRUPTED 2' \
@@ -287,11 +292,12 @@ java/lang/Thread.h: java/lang/Thread.class
-friend 'void _Jv_ThreadRun (java::lang::Thread* thread);' \
-friend 'jint _Jv_AttachCurrentThread(java::lang::Thread* thread);' \
-friend 'java::lang::Thread* _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group);' \
+ -friend 'java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group);' \
-friend 'jint _Jv_DetachCurrentThread ();' \
$(basename $<)
java/lang/String.h: java/lang/String.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
-friend 'jchar* _Jv_GetStringChars (jstring str);' \
-friend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
-friend 'jstring* _Jv_StringGetSlot (jstring);' \
@@ -301,21 +307,21 @@ java/lang/String.h: java/lang/String.class
$(basename $<)
java/lang/reflect/Constructor.h: java/lang/reflect/Constructor.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
-friend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
-friend 'class java::lang::Class;' \
-friend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
$(basename $<)
java/lang/reflect/Field.h: java/lang/reflect/Field.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
-friend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
-friend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
-friend 'class java::lang::Class;' \
$(basename $<)
java/lang/reflect/Method.h: java/lang/reflect/Method.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
-friend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
-friend 'class java::lang::Class;' \
-friend 'class java::io::ObjectInputStream;' \
@@ -323,16 +329,16 @@ java/lang/reflect/Method.h: java/lang/reflect/Method.class
$(basename $<)
gnu/gcj/runtime/VMClassLoader.h: gnu/gcj/runtime/VMClassLoader.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
-friend 'class ::java::lang::ClassLoader;' \
$(basename $<)
java/io/ObjectInputStream$$GetField.h: java/io/ObjectInputStream.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
'java/io/ObjectInputStream$$GetField'
java/io/ObjectOutputStream$$PutField.h: java/io/ObjectOutputStream.class
- $(GCJH) -bootclasspath $(top_builddir) \
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) \
'java/io/ObjectOutputStream$$PutField'
## Headers we maintain by hand and which we want to install.
@@ -345,13 +351,17 @@ $(extra_headers):
## hand.
install-data-local:
$(PRE_INSTALL)
- @for f in $(nat_headers) $(extra_headers); do \
+## We use a GNU make trick here so that we don't go over the command
+## length limit of some shells.
+ @: $(shell echo Creating list of headers to install...) $(shell rm -f tmp-ilist || :) $(shell touch tmp-ilist) $(foreach hdr,$(nat_headers) $(extra_headers),$(shell echo $(hdr) >> tmp-ilist))
+ @cat tmp-ilist | while read f; do \
d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
$(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \
if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(includedir)/$$f"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(includedir)/$$f; \
done
+ -@rm -f tmp-ilist
## FIXME: the obvious approach using lib_DATA doesn't work with
## automake 1.4.
$(mkinstalldirs) $(DESTDIR)$(secdir)
@@ -382,7 +392,7 @@ maintainer-check: libgcj.la
## This rule can be used to see if the headers are more or less
## correct.
-header-check: libgcj.jar $(nat_headers)
+header-check: libgcj-@gcc_version@.jar $(nat_headers)
rm -f htest.cc; \
for h in $(nat_headers); do \
echo "#include \"$$h\"" >> htest.cc; \
@@ -391,7 +401,7 @@ header-check: libgcj.jar $(nat_headers)
## This rule can be used to see if all the .class files verify
## correctly.
-class-check: libgcj.jar
+class-check: libgcj-@gcc_version@.jar
@ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
while read f; do \
echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
@@ -422,66 +432,66 @@ EXTRA_jv_convert_SOURCES = $(convert_source_files)
## need this because we are explicitly using libtool to link using the
## `.la' file.
jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
- -rpath $(toolexeclibdir) -shared-libgcc
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
jv_convert_LINK = $(GCJLINK)
## We explicitly link in the libraries we need. This way we don't
## need -nodefaultlibs, so we can still rely on gcj picking up the
## system libraries we need (via the specs file).
## We need the -L so that gcj can find libgcj with `-lgcj'.
## FIXME: should be _libs on some systems.
-jv_convert_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
+jv_convert_LDADD = libgcj.la -L$(here)/.libs
## Depend on the spec file to make sure it is up to date before
## linking this program.
jv_convert_DEPENDENCIES = $(convert_source_files:.java=.lo) \
- $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+ libgcj.la libgcj.spec
gij_SOURCES = gij.cc
## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
## need this because we are explicitly using libtool to link using the
## `.la' file.
-gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc
+gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
gij_LINK = $(GCJLINK)
## We explicitly link in the libraries we need. This way we don't
## need -nodefaultlibs, so we can still rely on gcj picking up the
## system libraries we need (via the specs file).
## We need the -L so that gcj can find libgcj with `-lgcj'.
## FIXME: should be _libs on some systems.
-gij_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
+gij_LDADD = libgcj.la -L$(here)/.libs
## Depend on the spec file to make sure it is up to date before
## linking this program.
-gij_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+gij_DEPENDENCIES = libgcj.la libgcj.spec
rmic_SOURCES =
## This is a dummy definition.
EXTRA_rmic_SOURCES = $(rmi_java_source_files)
rmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
- -rpath $(toolexeclibdir) -shared-libgcc
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
rmic_LINK = $(GCJLINK)
## We explicitly link in the libraries we need. This way we don't
## need -nodefaultlibs, so we can still rely on gcj picking up the
## system libraries we need (via the specs file).
## We need the -L so that gcj can find libgcj with `-lgcj'.
## FIXME: should be _libs on some systems.
-rmic_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
+rmic_LDADD = libgcj.la -L$(here)/.libs
## Depend on the spec file to make sure it is up to date before
## linking this program.
-rmic_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+rmic_DEPENDENCIES = libgcj.la libgcj.spec
rmiregistry_SOURCES =
## This is a dummy definition.
EXTRA_rmiregistry_SOURCES = $(rmi_java_source_files)
rmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
- -rpath $(toolexeclibdir) -shared-libgcc
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
rmiregistry_LINK = $(GCJLINK)
## We explicitly link in the libraries we need. This way we don't
## need -nodefaultlibs, so we can still rely on gcj picking up the
## system libraries we need (via the specs file).
## We need the -L so that gcj can find libgcj with `-lgcj'.
## FIXME: should be _libs on some systems.
-rmiregistry_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
+rmiregistry_LDADD = libgcj.la -L$(here)/.libs
## Depend on the spec file to make sure it is up to date before
## linking this program.
-rmiregistry_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+rmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
# The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
# You can get it from ftp://ftp.unicode.org/Public/MAPPINGS/EASTASIA/JIS/.