* Makefile.am (CLEANFILES): Don't mention $(class_files).
(clean-local): New target
* java/lang/natRuntime.cc: Include <ltdl.h> if required.
(load, loadLibrary): Now native.
(init): New method.
* java/lang/Runtime.java (load, loadLibrary): Now native.
(init): New native method.
(Runtime): Use init.
* prims.cc: Include <ltdl.h> if required.
(JvRunMain): Call LTDL_SET_PRELOADED_SYMBOLS.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26785
138bc75d-0d04-0410-961f-
82ee72b054a4
+1999-05-05 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (CLEANFILES): Don't mention $(class_files).
+ (clean-local): New target
+
+ * java/lang/natRuntime.cc: Include <ltdl.h> if required.
+ (load, loadLibrary): Now native.
+ (init): New method.
+ * java/lang/Runtime.java (load, loadLibrary): Now native.
+ (init): New native method.
+ (Runtime): Use init.
+ * prims.cc: Include <ltdl.h> if required.
+ (JvRunMain): Call LTDL_SET_PRELOADED_SYMBOLS.
+
1999-05-05 Gilles Zunino <Gilles.Zunino@hei.fr>
* configure.in: Switch from irix threads to posix threads
$(ZIP) -r libgcj java gnu -n .class -i '*.class' -i '*/'
MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files)
-CLEANFILES = libgcj.zip $(class_files)
+CLEANFILES = libgcj.zip
+
+clean-local:
+## We just remove every .class file that was created.
+ find . -name '*.class' -print | xargs rm -f
SUFFIXES = .class .java .h
libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) -release $(VERSION)
MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files)
-CLEANFILES = libgcj.zip $(class_files)
+CLEANFILES = libgcj.zip
SUFFIXES = .class .java .h
clean-am: clean-hdr clean-toolexeclibLTLIBRARIES clean-compile \
clean-libtool clean-binPROGRAMS clean-noinstPROGRAMS \
- clean-tags clean-depend clean-generic mostlyclean-am
+ clean-tags clean-depend clean-generic mostlyclean-am \
+ clean-local
clean: clean-recursive
-@rm -f libgcj.zip
$(ZIP) -r libgcj java gnu -n .class -i '*.class' -i '*/'
+clean-local:
+ find . -name '*.class' -print | xargs rm -f
+
.class.lo:
$(GCJCOMPILE) -o $@ $<
s.checkLink(lib);
}
- public synchronized void load (String pathname)
- {
- checkLink (pathname);
- // FIXME.
- throw new UnsatisfiedLinkError ("Runtime.load not implemented");
- }
- public synchronized void loadLibrary (String libname)
- {
- checkLink (libname);
- // FIXME.
- throw new UnsatisfiedLinkError ("Runtime.loadLibrary not implemented");
- }
+ public native void load (String pathname);
+ public native void loadLibrary (String libname);
public native void runFinalization ();
public native void traceInstructions (boolean on);
public native void traceMethodCalls (boolean on);
+ // A helper for the constructor.
+ private final native void init ();
+
// The sole constructor.
private Runtime ()
{
- finalize_on_exit = false;
+ init ();
}
// Private data.
#include <cni.h>
#include <jvm.h>
#include <java/lang/Runtime.h>
+#include <java/lang/UnknownError.h>
+#include <java/lang/UnsatisfiedLinkError.h>
+
+#ifdef USE_LTDL
+#include <ltdl.h>
+#endif
void
java::lang::Runtime::exit (jint status)
}
void
+java::lang::Runtime::load (jstring path)
+{
+ JvSynchronize sync (this);
+ checkLink (path);
+ using namespace java::lang;
+#ifdef USE_LTDL
+ // FIXME: make sure path is absolute.
+ lt_dlhandle h = lt_dlopen (FIXME);
+ if (h == NULL)
+ {
+ const char *msg = lt_dlerror ();
+ _Jv_Throw (new UnsatisfiedLinkError (JvNewStringLatin1 (msg)));
+ }
+#else
+ _Jv_Throw (new UnknownError
+ (JvNewStringLatin1 ("Runtime.load not implemented")));
+#endif /* USE_LTDL */
+}
+
+void
+java::lang::Runtime::loadLibrary (jstring lib)
+{
+ JvSynchronize sync (this);
+ checkLink (lib);
+ using namespace java::lang;
+#ifdef USE_LTDL
+ // FIXME: make sure path is absolute.
+ lt_dlhandle h = lt_dlopenext (FIXME);
+ if (h == NULL)
+ {
+ const char *msg = lt_dlerror ();
+ _Jv_Throw (new UnsatisfiedLinkError (JvNewStringLatin1 (msg)));
+ }
+#else
+ _Jv_Throw (new UnknownError
+ (JvNewStringLatin1 ("Runtime.loadLibrary not implemented")));
+#endif /* USE_LTDL */
+}
+
+void
+java::lang::Runtime::init (void)
+{
+ finalize_on_exit = false;
+#ifdef USE_LTDL
+ lt_dlinit ();
+#endif
+}
+
+void
java::lang::Runtime::runFinalization (void)
{
_Jv_RunFinalizers ();
#include <java/lang/reflect/Modifier.h>
#include <java/io/PrintStream.h>
+#ifdef USE_LTDL
+#include <ltdl.h>
+#endif
#define ObjectClass _CL_Q34java4lang6Object
extern java::lang::Class ObjectClass;
no_memory = new java::lang::OutOfMemoryError;
+#ifdef USE_LTDL
+ LTDL_SET_PRELOADED_SYMBOLS ();
+#endif
+
arg_vec = JvConvertArgv (argc - 1, argv + 1);
main_group = new java::lang::ThreadGroup (23);
main_thread = new java::lang::FirstThread (main_group, klass, arg_vec);