if NULL_TARGET
## In this case, gcj is found outside the build tree. However, zip is
## found in the build tree.
-GCJ = gcj
ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/zip/zip$(EXEEXT)
else
-GCJ = $(target_alias)-gcj
ZIP = zip
endif
GCJH = gcjh
## (due to problems running it in builddir). In this case the obvious
## definition of GCJ won't work; instead we resort to this ugly
## definition that gives us absolute paths.
-expanded = `cd $(MULTIBUILDTOP)../$(COMPPATH)/gcc && pwd`
-GCJ = $(expanded)/gcj$(EXEEXT) -B$(expanded)/
GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/zip/zip$(EXEEXT)
endif # CANADIAN
-GCJCOMPILE = CLASSPATH=$(here) $(LIBTOOL) --mode=compile $(GCJ) -fassume-compiled -L$(here) $(JC1FLAGS) -c
+GCJCOMPILE = $(LIBTOOL) --mode=compile $(GCJ) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -c
GCJLINK = $(LIBTOOL) --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
LIBLINK = $(LIBTOOL) --mode=link $(CC) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
## currently broken with respect to exception handling in leaf
## functions.
AM_CXXFLAGS = -fno-rtti -fvtable-thunks -fasynchronous-exceptions \
+## Some systems don't allow `$' in identifiers by default, so we force it.
+ -fdollars-in-identifiers \
@LIBGCJ_CXXFLAGS@ @EXCEPTIONSPEC@ $(WARNINGS) -D_GNU_SOURCE
if USING_GCC
AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
$(built_java_source_files:.java=.class): $(built_java_source_files)
## This little nastiness is here so that the backquoted stuff in the
## GCJ definition can be correctly expanded, if required.
- javac="$(JAVAC)"; \
- $$javac -L$(here) $(JCFLAGS) -classpath $(here):`cd $(srcdir) && /bin/pwd` \
- -d $(here) $?
+ @javac="$(JAVAC)"; \
+ for f in $?; do \
+ echo $$javac -L$(here) $(JCFLAGS) -classpath $(here):`cd $(srcdir) && /bin/pwd` -d $(here) $$f; \
+ $$javac -L$(here) $(JCFLAGS) -classpath $(here):`cd $(srcdir) && /bin/pwd` \
+ -d $(here) $$f; \
+ done
## 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.
## `make libgcj.zip' will not rebuilt foo.class. That's because
## libgcj.zip is not out-of-date with respect to foo.java.
libgcj.zip: $(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,$(subst $(srcdir)/,,$?),$(shell echo $(source) >> tmp-list))
## FIXME: this ought to depend on built_java_source_files, but right
## now it can't. Ugly.
$(MAKE) $(built_java_source_files:.java=.class)
## This little nastiness is here so that the backquoted stuff in the
## GCJ definition can be correctly expanded, if required.
- javac="$(JAVAC)"; cd $(srcdir); \
- $$javac $(JCFLAGS) -classpath $(here):`/bin/pwd` -d $(here) \
- $(subst $(srcdir)/,,$?)
- -@rm -f libgcj.zip
+ @javac="$(JAVAC)"; dir=`/bin/pwd`; cd $(srcdir); \
+ for f in `cat $$dir/tmp-list`; do \
+ echo $$javac $(JCFLAGS) -classpath $(here):`/bin/pwd` -d $(here) $$f; \
+ $$javac $(JCFLAGS) -classpath $(here):`/bin/pwd` -d $(here) $$f; \
+ done
+ -@rm -f tmp-list libgcj.zip
## Note that we explicitly want to include directory information.
$(ZIP) -r libgcj java gnu -n .class -i '*.class' -i '*/'
MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files)
-CLEANFILES = libgcj.zip
+CLEANFILES = tmp-list libgcj.zip
clean-local:
## We just remove every .class file that was created.
java/lang/ClassLoader.h: java/lang/ClassLoader.class libgcj.zip
$(GCJH) -classpath $(top_builddir) \
-friend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
+ -friend 'void _Jv_RunMain (const char *name, int argc, const char **argv, bool is_jar);' \
$(basename $<)
## Our internal main program needs to be able to create a FirstThread.
-friend '_Jv_JNIEnv * _Jv_GetCurrentJNIEnv ();' \
-friend 'void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
-friend 'class gnu::gcj::jni::NativeThread;' \
- -friend 'int _Jv_CondWait (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint nanos);' \
- -friend 'int _Jv_CondNotify (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu);' \
- -friend 'void _Jv_ThreadInterrupt (_Jv_Thread_t *data);' \
$(basename $<)
java/lang/String.h: java/lang/String.class libgcj.zip
gnu/gcj/protocol/http/Handler.java \
gnu/gcj/protocol/jar/Connection.java \
gnu/gcj/protocol/jar/Handler.java \
+gnu/gcj/runtime/FileDeleter.java \
gnu/gcj/runtime/FirstThread.java \
gnu/gcj/runtime/VMClassLoader.java \
gnu/gcj/text/BaseBreakIterator.java \
java/io/PushbackReader.java \
java/io/RandomAccessFile.java \
java/io/Reader.java \
-java/io/Replaceable.java \
-java/io/Resolvable.java \
java/io/SequenceInputStream.java \
java/io/Serializable.java \
java/io/SerializablePermission.java \
java/text/StringCharacterIterator.java \
java/util/AbstractCollection.java \
java/util/AbstractList.java \
+java/util/AbstractMap.java \
+java/util/AbstractSequentialList.java \
java/util/AbstractSet.java \
+java/util/ArrayList.java \
java/util/Arrays.java \
java/util/BasicMapEntry.java \
java/util/BitSet.java \
java/util/EventListener.java \
java/util/EventObject.java \
java/util/GregorianCalendar.java \
+java/util/HashMap.java \
java/util/Hashtable.java \
java/util/Iterator.java \
java/util/List.java \
java/util/ResourceBundle.java \
java/util/Set.java \
java/util/SimpleTimeZone.java \
+java/util/SortedMap.java \
+java/util/SortedSet.java \
java/util/Stack.java \
java/util/StringTokenizer.java \
java/util/TimeZone.java \
+java/util/Timer.java \
+java/util/TimerTask.java \
java/util/TooManyListenersException.java \
java/util/Vector.java \
java/util/jar/Attributes.java \