aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@redhat.com>2002-05-06 18:57:41 +0000
committerGeoffrey Keating <geoffk@redhat.com>2002-05-06 18:57:41 +0000
commit14e7b9dfd908cade912d27fc34a4f519c103fb95 (patch)
tree12c4e49ebde9830582c76f0b154b36f1cacb313f /libjava
parent4e4ea26bdebb46010d6a663846aaa113a06cd8d6 (diff)
Merge to tag pch-merge-20020430.
In gcc/ChangeLog: The LANG_HOOKS_FUNCTION_MARK macro was deleted. The LANG_HOOKS_FUNCTION_FREE macro was renamed to LANG_HOOKS_FUNCTION_FINAL. * Makefile.in (GTFILES): Add bitmap.h. * except.c (struct eh_region): Mark field 'aka' to be skipped. * config/alpha/alpha.c [TARGET_ABI_UNICOSMK] (alpha_init_machine_status): Give proper type. * Makefile.in (c-lang.o): Depend on gtype-c.h. (optabs.o): Depend on gt-optabs.h. (GTFILES): Add optabs.o. (gt-optabs.h): Add rule. * optabs.c: Include gt-optabs.h. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/pch-branch@53233 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog549
-rw-r--r--libjava/Makefile.am92
-rw-r--r--libjava/Makefile.in126
-rw-r--r--libjava/THANKS18
-rw-r--r--libjava/acconfig.h7
-rwxr-xr-xlibjava/configure849
-rw-r--r--libjava/configure.host36
-rw-r--r--libjava/configure.in95
-rw-r--r--libjava/exception.cc3
-rw-r--r--libjava/gcj/Makefile.am5
-rw-r--r--libjava/gcj/Makefile.in46
-rw-r--r--libjava/gcj/cni.h8
-rw-r--r--libjava/gcj/javaprims.h2
-rw-r--r--libjava/gcj/libgcj-config.h.in9
-rw-r--r--libjava/gnu/gcj/convert/Convert.java2
-rw-r--r--libjava/gnu/gcj/io/shs.h8
-rw-r--r--libjava/gnu/gcj/natCore.cc14
-rw-r--r--libjava/gnu/gcj/protocol/http/Connection.java2
-rw-r--r--libjava/gnu/java/beans/BeanInfoEmbryo.java19
-rw-r--r--libjava/gnu/java/beans/editors/NativeBooleanEditor.java11
-rw-r--r--libjava/gnu/java/rmi/registry/RegistryImpl.java28
-rw-r--r--libjava/gnu/java/rmi/rmic/RMIC.java2
-rw-r--r--libjava/include/Makefile.in7
-rw-r--r--libjava/include/config.h.in7
-rw-r--r--libjava/include/dwarf2-signal.h112
-rw-r--r--libjava/include/i386-signal.h67
-rw-r--r--libjava/include/java-insns.h6
-rw-r--r--libjava/include/jni.h26
-rw-r--r--libjava/include/jvm.h8
-rw-r--r--libjava/include/name-finder.h27
-rw-r--r--libjava/include/posix-threads.h9
-rw-r--r--libjava/include/posix.h2
-rw-r--r--libjava/include/sparc-signal.h9
-rw-r--r--libjava/include/win32.h11
-rw-r--r--libjava/interpret.cc2
-rw-r--r--libjava/java/awt/Button.java4
-rw-r--r--libjava/java/awt/Checkbox.java12
-rw-r--r--libjava/java/awt/CheckboxMenuItem.java12
-rw-r--r--libjava/java/awt/Choice.java12
-rw-r--r--libjava/java/awt/Component.java4
-rw-r--r--libjava/java/awt/List.java17
-rw-r--r--libjava/java/awt/MenuItem.java2
-rw-r--r--libjava/java/awt/Scrollbar.java12
-rw-r--r--libjava/java/awt/TextComponent.java15
-rw-r--r--libjava/java/awt/TextField.java14
-rw-r--r--libjava/java/awt/geom/Point2D.java2
-rw-r--r--libjava/java/beans/IntrospectionException.java46
-rw-r--r--libjava/java/beans/Introspector.java857
-rw-r--r--libjava/java/beans/PropertyVetoException.java69
-rw-r--r--libjava/java/io/File.java5
-rw-r--r--libjava/java/io/FileInputStream.java4
-rw-r--r--libjava/java/io/PushbackInputStream.java19
-rw-r--r--libjava/java/io/PushbackReader.java732
-rw-r--r--libjava/java/io/natFileDescriptorWin32.cc7
-rw-r--r--libjava/java/io/natFileWin32.cc55
-rw-r--r--libjava/java/lang/Character.java2
-rw-r--r--libjava/java/lang/ieeefp.h12
-rw-r--r--libjava/java/lang/natClassLoader.cc5
-rw-r--r--libjava/java/lang/natDouble.cc12
-rw-r--r--libjava/java/lang/natRuntime.cc5
-rw-r--r--libjava/java/lang/natSystem.cc42
-rw-r--r--libjava/java/lang/natThread.cc17
-rw-r--r--libjava/java/lang/reflect/Modifier.java16
-rw-r--r--libjava/java/net/PlainDatagramSocketImpl.java32
-rw-r--r--libjava/java/net/PlainSocketImpl.java21
-rw-r--r--libjava/java/net/natPlainDatagramSocketImpl.cc34
-rw-r--r--libjava/java/net/natPlainSocketImpl.cc14
-rw-r--r--libjava/java/util/AbstractMap.java10
-rw-r--r--libjava/java/util/ArrayList.java14
-rw-r--r--libjava/java/util/Arrays.java91
-rw-r--r--libjava/java/util/BitSet.java15
-rw-r--r--libjava/java/util/GregorianCalendar.java6
-rw-r--r--libjava/java/util/Hashtable.java22
-rw-r--r--libjava/java/util/IdentityHashMap.java2
-rw-r--r--libjava/java/util/Vector.java18
-rw-r--r--libjava/jni.cc73
-rw-r--r--libjava/libgcj.spec.in2
-rw-r--r--libjava/libltdl/.cvsignore16
-rw-r--r--libjava/libltdl/ChangeLog4
-rw-r--r--libjava/libtool-version2
-rw-r--r--libjava/mauve-libgcj50
-rw-r--r--libjava/name-finder.cc19
-rw-r--r--libjava/posix-threads.cc3
-rw-r--r--libjava/posix.cc19
-rw-r--r--libjava/sysdep/i386/locks.h8
-rw-r--r--libjava/sysdep/powerpc/locks.h8
-rw-r--r--libjava/testsuite/ChangeLog100
-rw-r--r--libjava/testsuite/Makefile.in7
-rw-r--r--libjava/testsuite/lib/libjava.exp31
-rw-r--r--libjava/testsuite/libjava.compile/PR5902.java5
-rw-r--r--libjava/testsuite/libjava.compile/PR5913.java10
-rw-r--r--libjava/testsuite/libjava.jni/jni.exp45
-rw-r--r--libjava/testsuite/libjava.lang/InvokeReturn.java4
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Interrupt.java23
-rw-r--r--libjava/testsuite/libjava.mauve/mauve.exp6
-rw-r--r--libjava/testsuite/libjava.mauve/xfails52
-rw-r--r--libjava/verify.cc61
-rw-r--r--libjava/win32.cc155
98 files changed, 3509 insertions, 1708 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 2fe3e68ba1d..7aaf7121fa0 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,551 @@
+2002-04-29 Gerhard Tonn <GerhardTonn@swol.de>
+
+ * java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN for S/390.
+
+2002-04-29 Adam King <aking@dreammechanics.com>
+
+ * java/io/natFileDescriptorWin32.cc (open): Move file pointer to end
+ of file in APPEND mode.
+
+2002-04-25 David S. Miller <davem@redhat.com>
+
+ PR target/6422
+ * include/dwarf2-signal.h (MAKE_THROW_FRAME for sparc*): Set
+ program counter to next program counter minus 8. Update
+ comments in this macro to explain why.
+
+2002-04-26 Tom Tromey <tromey@redhat.com>
+
+ * verify.cc (construct_primitive_array_type) [void_type]: New
+ case.
+ (branch_prepass): Added dummy entries for unused instruction
+ values.
+ (verify_instructions_0): Likewise.
+ * interpret.cc (continue1): Comment fix.
+ * include/java-insns.h (op_xxxunusedxxx1): Removed.
+ * Makefile.in: Rebuilt.
+ * Makefile.am: Added -Wswitch-enum.
+
+2002-04-24 Tom Tromey <tromey@redhat.com>
+
+ * gnu/gcj/natCore.cc (create): Use __builtin_alloca, and compute
+ correct length of UTF-8 encoded name. Strip leading `/'.
+ (_Jv_RegisterResource): Use _Jv_Malloc.
+
+2002-04-23 Adam Megacz <adam@xwt.org>
+
+ * win32.cc, include/win32.cc (backtrace): Added this function
+ because Win32 does not supply it.
+
+2002-04-21 David S. Miller <davem@redhat.com>
+
+ * include/dwarf2-signal.h (MAKE_THROW_FRAME, sparc32): Document
+ magic instruction reading sequence.
+
+2002-04-21 Mark Wielaard <mark@klomp.org>
+
+ * mauve-libgcj: Don't run java.lang.ref tests since they are buggy.
+
+2002-04-19 David S. Miller <davem@redhat.com>
+
+ * include/dwarf2-signal.h (SIGNAL_HANDLER): Name siginfo_t pointer
+ arg.
+ (MAKE_THROW_FRAME): Define for 32-bit and 64-bit sparc.
+ (INIT_SEGV, INIT_FPE): Use direct __libc_sigaction installation
+ on Sparc too.
+ * include/sparc-signal.h (FLUSH_REGISTER_WINDOWS): Define properly
+ for 64-bit sparc.
+ (MAKE_THROW_FRAME): Use long for sp/retaddr so 64-bit works.
+ * sysdeps/sparc/locks.h: New file.
+ * configure.in (SIGNAL_HANDLER): Set to include/sparc-signal.h
+ on all sparc Solaris configurations. Set to
+ include/dwarf2-signal.h on sparc Linux.
+ * configure: Regenerate
+ * configure.host (can_unwind_signal): sparc*-linux* can do it now.
+
+2002-04-19 Hans Boehm <Hans_Boehm@hp.com>
+
+ * configure: Rebuilt.
+ * configure.in (backtrace): Function doesn't work on IA-64.
+
+2002-04-17 Adam King <aking@dreammechanics.com>
+
+ * java/io/File.java (normalizePath): Add Win32 support for auto
+ conversion of a '/' path separator to Win32's '\' separator.
+
+2002-04-16 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/6081:
+ * Makefile.in: Rebuilt.
+ * Makefile.am (install-data-local): Use GNU make trick to avoid
+ shell limit.
+
+2002-04-16 Adam King <aking@dreammechanics.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * java/io/natFileWin32.cc (performList): Return the correct array
+ type. Don't duplicate the creation of a File since it's already
+ done earlier in the method and the existing code would cause a
+ ArrayStoreException. Don't use fixed-size array.
+ (_access, _stat, attr, getCanonicalPath, performMkdir,
+ performRenameTo): Don't use fixed-size array.
+ (getCanonicalPath): Use throw, not _Jv_Throw.
+
+2002-04-15 DJ Delorie <dj@redhat.com>
+
+ * configure.in: Allow building in $srcdir.
+ * configure: Regenerated.
+
+2002-04-14 Mark Wielaard <mark@klomp.org>
+
+ * java/net/natPlainDatagramSocketImpl.cc (close): Set timeout to 0.
+ * java/net/natSocketImpl.cc (close): Likewise.
+
+2002-04-14 Mark Wielaard <mark@klomp.org>
+
+ * gnu/gcj/protocol/http/Connection.java (usingProxy): return false.
+
+2002-04-13 Adam King <aking@dreammechanics.com>
+
+ * java/lang/natDouble.cc (parseDouble): Allow a number to end with
+ the f/F/d/D modifiers.
+
+2002-04-12 Anthony Green <green@redhat.com>
+
+ * Makefile.am (jardir, jar_DATA): Define (for libgcj.jar).
+ Create libgcj-@gcc_version@.jar instead of libgcj.jar.
+ * Makefile.in: Rebuilt.
+ * configure.in: Substitute gcc_version.
+ * configure: Rebuilt.
+
+2002-04-11 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * configure.host: Set can_unwind_signal on hosts which support it.
+ Don't set CHECKREFSPEC and DIVIDESPEC for FreeBSD.
+ * configure.in: Set CHECKREFSPEC and DIVIDESPEC if not using SJLJ
+ exceptions and can_unwind_signal isn't set.
+ * configure: Rebuilt.
+
+2002-04-11 Tom Tromey <tromey@redhat.com>
+
+ * win32.cc (_Jv_platform_initProperties): Fix spelling of _Jv_Free.
+
+2002-04-11 Adam King <aking@dreammechanics.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * include/jvm.h (_Jv_ThrowBadArrayIndex,
+ _Jv_ThrowNullPointerException): Mark as noreturn.
+ * win32.cc (_Jv_platform_initProperties): Use _Jv_MallocUnchecked
+ and _Jv_free. Correctly invoke GetTempPath(). Indentation
+ fixes.
+
+2002-04-10 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (java/lang/Thread.h): Mark
+ _Jv_AttachCurrentThreadAsDaemon as friend.
+ * gcj/javaprims.h (_Jv_AttachCurrentThreadAsDaemon): Declare.
+ * gcj/cni.h (JvAttachCurrentThreadAsDaemon): New function.
+ * java/lang/natThread.cc (_Jv_AttachCurrentThreadAsDaemon): New
+ function.
+ * java/lang/natRuntime.cc (_load): Recognize JNI_VERSION_1_4.
+ * jni.cc (_Jv_JNI_GetVersion): Return JNI_VERSION_1_4.
+ (_Jv_JNI_InvokeFunctions): Added
+ _Jv_JNI_AttachCurrentThreadAsDaemon.
+ (_Jv_JNI_GetEnv): Handle JNI_VERSION_1_4.
+ (JNI_GetDefaultJavaVMInitArgs): Likewise.
+ (JNI_CreateJavaVM): Likewise.
+ (_Jv_JNI_AttachCurrentThread): Likewise.
+ (_Jv_JNI_AttachCurrentThread): Added `is_daemon' argument.
+ (_Jv_JNI_AttachCurrentThreadAsDaemon): New method.
+ (_Jv_JNIFunctions): Initialize new fields.
+ (_Jv_JNI_NewDirectByteBuffer): New function.
+ (_Jv_JNI_GetDirectBufferAddress): Likewise.
+ (_Jv_JNI_GetDirectBufferCapacity): Likewise.
+ * include/jni.h (JNI_VERSION_1_4): New macro.
+ (JNIInvokeInterface::AttachCurrentThreadAsDaemon): New field.
+ (_Jv_JavaVM::AttachCurrentThreadAsDaemon): New method.
+ (JNINativeInterface::NewDirectByteBuffer): New field.
+ (JNINativeInterface::GetDirectBufferAddress): New field.
+ (JNINativeInterface::GetDirectBufferCapacity): New field.
+ (_Jv_JNIEnv::NewDirectByteBuffer): New method.
+ (_Jv_JNIEnv::GetDirectBufferAddress): New method.
+ (_Jv_JNIEnv::GetDirectBufferCapacity): New method.
+
+2002-04-09 Tom Tromey <tromey@redhat.com>
+
+ * win32.cc (_Jv_platform_initProperties): Use GetTempPath.
+
+2002-04-08 Alberto Biancardi <alberto.biancardi@unipv.it>
+
+ Fix for PR libgcj/6187:
+ * java/awt/geom/Point2D.java (distance): Call distanceSq, not
+ distance.
+
+2002-04-07 Mark Wielaard <mark@klomp.org>
+
+ * java/util/AbstractMap.java (putAll): Use entrySet size.
+ (toString): Explicitly use getKey() and getValue().
+
+2002-04-07 Mark Wielaard <mark@klomp.org>
+
+ * java/util/Hashtable.java (contains): Remove NullPointer check.
+ (containsValue): Add NullPointer check.
+ (remove): Always throw NullPointerException when key
+ is null.
+
+2002-04-07 Adam King <aking@dreammechanics.com>
+
+ * java/lang/natSystem.cc (init_properties): Call new function
+ _Jv_platform_initProperties.
+ * win32.cc (_Jv_platform_initProperties): New function that adds Win32
+ support for the System properties os.name, os.arch, os.version,
+ user.name, user.home, and user.dir.
+ * include/posix.h, include/win32.h, posix.cc: New function
+ _Jv_platform_initProperties.
+
+2002-04-06 Mark Wielaard <mark@klomp.org>
+
+ * java/lang/Character,java (isDefined): getType() != UNASSIGNED.
+
+2002-04-06 Mark Wielaard <mark@klomp.org>
+
+ * java/util/ArrayList.java (addAll(int,Collection)): System.arraycopy
+ all of the remaining elements.
+ * java/util/Vector.java (addAll(int,Collection)): Likewise.
+ (removeRange): If toIndex == fromIndex do
+ nothing, if toIndex < fromIndex throw IndexOutIfBoundsException.
+ (removeAll): Always throw NullPointerException when collection is
+ null.
+ (retrainAll): Likewise.
+
+2002-04-05 Mark Wielaard <mark@klomp.org>
+
+ * java/util/ArrayList.java (removeRange): If toIndex == fromIndex do
+ nothing, if toIndex < fromIndex throw IndexOutIfBoundsException.
+
+2002-04-05 Adam Megacz <adam@xwt.org>
+
+ * exception.cc (abort): added static modifier
+
+2002-04-04 Adam Megacz <adam@xwt.org>
+
+ * include/win32.h (_Jv_platform_close_on_exec): added inline
+ modifier.
+
+2002-04-04 Loren J. Rittle <ljrittle@acm.org>
+
+ * configure.host: Add case statement to support generic port
+ properties. Add *-*-freebsd* section.
+
+2002-04-04 Mark Wielaard <mark@klomp.org>
+
+ * mauve-libgcj: Add JLS1.0 and JLS1.1 tags, ignore Character.unicode
+ test.
+ * testsuite/libjava.mauve/xfails: Remove working tests DoubleTest,
+ FloatTest and ObjectStreamClass. Add FAIL for Introspector.jdk11 tests
+ that depend on awt code and BufferedByteOutputStream.interrupt.
+
+2002-04-04 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/util/Arrays.java (qsort): Fix off-by-one errors and use of
+ incorrect "hi" value when count > 40.
+
+2002-04-03 Mark Wielaard <mark@klomp.org>
+
+ * java/lang/reflect/Modifier.java (toString(int,StringBuffer)): Fix
+ ordering.
+
+2002-04-02 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natClassLoader.cc (findClass): Compare against `3',
+ not `0'.
+
+2002-04-02 Mark Wielaard <mark@klomp.org>
+
+ * mauve-libgcj: add java.net.DatagramSocket.DatagramSocketTest2 to
+ list of testsuite crashers.
+
+2002-04-02 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/util/IdentityHashMap.java (put): Set new threshold correctly
+ when resizing table.
+
+2002-04-01 Mark Wielaard <mark@klomp.org>
+
+ * java/util/BitSet.java (BitSet(int)): if nbits < 0 throw
+ NegativeArraySizeException
+ (clear(int)): Use sign extended shift.
+ (flip(int)): Likewise.
+ (get(int)): Likewise.
+ (nextClearBit(int)): Likewise.
+ (nextSetBit(int)): Likewise.
+ (set(int)): Likewise.
+
+2002-04-01 Mark Wielaard <mark@klomp.org>
+
+ * mauve-libgcj: Add JDK1.3, JDK1.4, JLS1.2 tests, remove ignored tests
+ that can be compiled now and add testsuite crashers to ignore list.
+
+2002-03-31 Alexandre Oliva <aoliva@redhat.com>
+
+ * libgcj.spec.in, libgcj-test.spec.in: Revert for now.
+
+ * libgcj.spec.in: Override libgcc, not lib.
+ * libgcj-test.spec.in: Likewise.
+
+2002-03-29 Tom Tromey <tromey@redhat.com>
+
+ * java/net/natPlainDatagramSocketImpl.cc (close): New function.
+ * java/net/natPlainSocketImpl.cc (close): Indentation fix.
+
+2002-03-27 Jeff Sturm <jsturm@one-point.com>
+
+ * java/net/PlainDatagramSocketImpl.java
+ (close): Use native implementation.
+ (finalize): New method.
+
+ * java/net/PlainSocketImpl.java (finalize): New method.
+
+ * java/net/natPlainDatagramSocketImpl.cc
+ (java/io/FileDescriptor.h): Don't include.
+ (close): Implement method here.
+ (create): Don't assign fd.
+
+ * java/net/natPlainSocketImpl.cc
+ (java/io/FileDescriptor.h): Don't include.
+ (create): Don't assign fd.
+ (accept): Likewise.
+ (close): Synchronize.
+
+2002-03-27 Richard Henderson <rth@redhat.com>
+
+ * include/posix-threads.h [alpha] (_Jv_ThreadSelf): Avoid a copy.
+
+2002-03-25 Andrew Haley <aph@cambridge.redhat.com>, Hans Boehm <Hans_Boehm@hp.com>
+
+ * include/dwarf2-signal.h (MAKE_THROW_FRAME): Add for IA-64.
+ (INIT_SEGV, INIT_FPE): Add versions that use __libc_sigaction
+ instead of syscall on IA-64.
+ Add FIXME comment.
+
+2002-03-27 Anthony Green <green@redhat.com>
+
+ * libgcj.spec.in: Add CHECKREFSPEC.
+ * configure.in: Ditto.
+ * configure.host: Ditto. Check references for xscale-elf.
+ * configure: Rebuilt.
+
+2002-03-26 Hans Boehm <Hans_Boehm@hp.com>
+
+ * include/dwarf2-signal.h: Temporarily back out last change.
+
+2002-03-26 Loren J. Rittle <ljrittle@acm.org>
+
+ * include/posix-threads.h: Support <.../pal.h> on FreeBSD/alpha.
+
+2002-03-25 Andrew Haley <aph@cambridge.redhat.com>, Hans Boehm <Hans_Boehm@hp.com>
+
+ * configure.in, configure: enable dwarf2-exception-style
+ exception handling on IA-64.
+ * include/dwarf2-signal.h (MAKE_THROW_FRAME): Add for IA-64.
+ (INIT_SEGV, INIT_FPE): Use __libc_sigaction instead of syscall.
+ Add FIXME comment.
+
+2002-03-25 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.am (libgcj_la_LDFLAGS): Use THREADLDFLAGS.
+ (jv_convert_LDFLAGS): Likewise.
+ (gij_LDFLAGS): Likewise.
+ (rmic_LDFLAGS): Likewise.
+ (rmiregistry_LDFLAGS): Likewise.
+ * configure.in (THREADLDFLAGS): New subst; set correctly for
+ *BSD.
+
+2002-03-25 Tom Tromey <tromey@redhat.com>
+
+ For PR libgcj/5303:
+ * gnu/java/rmi/registry/RegistryImpl.java (main): Recognize --help
+ and --version.
+ (help): New method.
+ (version): Likewise.
+ * gnu/gcj/convert/Convert.java (version): Removed extraneous
+ "GNU".
+ * gnu/java/rmi/rmic/RMIC.java (parseOptions): Removed extraneous
+ "GNU".
+
+2002-03-25 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/Component.java (processEvent): Check ComponentEvent
+ after KeyEvent.
+
+2002-03-24 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/io/PushbackReader.java: Reformat.
+
+ * java/io/FileInputStream.java (skip): Call fd.getFilePointer() and
+ calculate correct number of bytes skipped.
+
+ Based on patch from Intel's ORP team:
+ * java/io/PushbackInputStream.java (available): Calculate correct
+ number of bytes in buffer.
+ (read): Remove redundant bound check. Return bytes from both the
+ buffer and the stream.
+
+2002-03-24 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/TextComponent.java (TextComponent): Editable by
+ default.
+
+ * java/awt/MenuItem.java (eventMask): No longer private.
+ * java/awt/Button.java (dispatchEventImpl): Only dispatch to
+ superclass if we didn't handle event.
+ * java/awt/Checkbox.java (dispatchEventImpl): New method.
+ * java/awt/CheckboxMenuItem.java (dispatchEventImpl): New method.
+ * java/awt/Choice.java (dispatchEventImpl): New method.
+ * java/awt/List.java (dispatchEventImpl): New method.
+ * java/awt/Scrollbar.java (dispatchEventImpl): New method.
+ * java/awt/TextComponent.java (dispatchEventImpl): New method.
+ * java/awt/TextField.java (dispatchEventImpl): New method.
+
+2002-03-24 Eric Blake <ebb9@email.byu.edu>
+
+ * java/beans/IntrospectionException.java: Update to 1.4.
+ * java/beans/PropertyVetoException.java: Ditto.
+
+2002-03-24 Eric Blake <ebb9@email.byu.edu>
+
+ * gnu/java/beans/BeanInfoEmbryo.java (hasMethod): Use
+ Arrays.equals instead of ArrayHelper.equalsArray.
+
+2002-03-24 C. Brian Jones <cbj@gnu.org>
+
+ * java/beans/Introspector.java: added new static final fields
+ introduced in 1.2, lots of other updates remain to be done
+
+2002-03-24 C. Brian Jones <cbj@gnu.org>
+
+ * java/beans/Introspector.java: reformatting
+
+2002-03-24 C. Brian Jones <cbj@gnu.org>
+
+ * java/beans/Introspector.java: default beanInfoSearchPath will
+ not include sun.beans.infos given we provide no such package and
+ the API doesn't really require it; gnu.java.beans.info is the
+ default.
+
+2002-03-24 Mark Wielaard <mark@klomp.org>
+
+ Thanks to Orp developers
+ * gnu/java/beans/editors/NativeBooleanEditor.java (setAsText(String)):
+ switch TRUE and FALSE return values.
+
+2002-03-23 Tom Tromey <tromey@redhat.com>
+
+ * include/name-finder.h (_Jv_name_finder::myclose): New method.
+ * name-finder.cc (_Jv_name_finder): Initialize file descriptors.
+
+2002-03-23 Michael Smith <msmith@spinnakernet.com>
+
+ * java/util/GregorianCalendar.java (minimums, maximums): Correct
+ MONTH entry. Fixes PR libgcj/6045.
+
+2002-03-23 Jeff Sturm <jsturm@one-point.com>
+
+ * java/nat/natPlainSocketImpl.cc (write): Abort loop on error.
+
+2002-03-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * posix-threads.cc (_Jv_ThreadSelf_out_of_line): Use write_barrier,
+ not release_set.
+ * sysdep/powerpc/locks.h (write_barrier): New function.
+ * sysdep/i386/locks.h (write_barrier): New function.
+
+2002-03-19 Martin Kahlert <martin.kahlert@infineon.com>
+
+ * include/jni.h Use correct C comments.
+
+2002-03-18 Tom Tromey <tromey@redhat.com>
+
+ * include/jni.h (JNIIMPORT): New macro.
+ (JNIEXPORT): Likewise.
+ (JNICALL): Likewise.
+
+2002-03-18 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.host (i?86-*): Use -fuse-divide-subroutine on Solaris
+ systems.
+
+2002-03-18 Andrew Haley <aph@cambridge.redhat.com>
+
+ * include/i386-signal.h (old_i386_kernel_sigaction): New.
+ INIT_SEGV: Use old_i386_kernel_sigaction.
+ INIT_FP: Likewise.
+
+2002-03-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/lang/natSystem.cc (init_properties): Update VM version
+ properties.
+ * configure.in: Set GCJVERSION.
+ * acconfig.h: Add GCJVERSION.
+ * configure: Rebuilt.
+ * include/config.h.in: Rebuilt.
+
+2002-03-17 Anthony Green <green@redhat.com>
+
+ * java/lang/ieeefp.h: Add ARM thumb support (copied from newlib).
+
+2002-03-17 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ Build a single libgcj.so, without separate gc and zlib libraries.
+ * configure.in: Use convenience libraries for boehm-gc and zlib. Set
+ SYS_ZLIBS if system zlib is used.
+ * configure: Rebuilt.
+ * Makefile.am: Use boehm-gc and zlib convenience libraries.
+ * Makefile.in: Rebuilt.
+ * libtool-version: Increment .so version number.
+
+ * Makefile.am: Escape quotes in echo.
+ * Makefile.in: Rebuilt.
+
+2002-03-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * Makefile.am: Use empty -classpath flag in addition to -bootclasspath.
+ * Makefile.in: Rebuilt.
+
+2002-03-15 Anthony Green <green@redhat.com>
+
+ * configure.host (FILE): New macro for specifing File
+ implementation.
+ * configure: Rebuilt.
+ * configure.in: Use FILE. Define HAVE_TIME for newlib targets.
+
+2002-03-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.am (jv_convert_LDADD): Don't list libraries that are
+ already implicitly brought in from libgcj.la.
+ (gij_LDADD, rmic_LDADD, rmiregistry_LDADD): Likewise.
+ * Makefile.in: Rebuilt.
+
+2002-03-15 Eric Blake <ebb9@email.byu.edu>
+
+ * THANKS: Fix punctuation, alphabetization.
+
+2002-03-15 Tom Tromey <tromey@redhat.com>
+ Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ Fix for PR libgcj/5944.
+ * gnu/gcj/io/shs.h: Define uint8_t and uint32_t.
+
+2002-03-15 Anthony Green <green@redhat.com>
+
+ * configure.in (tool_include_dir): Define.
+ * configure: Rebuilt.
+ * gcj/Makefile.am: Install libgcj-config.h relative to
+ tool_include_dir.
+ * gcj/Makefile: Rebuilt.
+ * gcj/libgcj-config.h: Add warning comment.
+
2002-03-12 Andreas Tobler <a.tobler@schweiz.ch>
* configure.host (powerpc*-darwin*): Enable interpreter.
@@ -68,7 +616,6 @@
* java/lang/natObject.cc: Move thread synchronization primitives to
system-dependent headers.
->>>>>>> 1.1231
2002-03-09 Adam Megacz <adam@xwt.org>
* java/io/natFileDescriptorWin32.cc (read): Return -1 if zero
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/.
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 612e98e5116..0b288e56a64 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -67,6 +67,7 @@ AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
AR = @AR@
AS = @AS@
CC = @CC@
+CHECKREFSPEC = @CHECKREFSPEC@
COMPPATH = @COMPPATH@
CXX = @CXX@
CXXCPP = @CXXCPP@
@@ -79,6 +80,7 @@ GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
+GCJVERSION = @GCJVERSION@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
@@ -107,21 +109,24 @@ RANLIB = @RANLIB@
STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
+SYS_ZLIBS = @SYS_ZLIBS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
+THREADLDFLAGS = @THREADLDFLAGS@
THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
VERSION = @VERSION@
-ZDEPS = @ZDEPS@
ZINCS = @ZINCS@
ZLIBS = @ZLIBS@
ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
+gcc_version = @gcc_version@
glibjava_CXX = @glibjava_CXX@
here = @here@
libgcj_basedir = @libgcj_basedir@
mkinstalldirs = @mkinstalldirs@
+tool_include_dir = @tool_include_dir@
AUTOMAKE_OPTIONS = foreign
@TESTSUBDIR_TRUE@SUBDIRS = \
@@ -140,7 +145,9 @@ AUTOMAKE_OPTIONS = foreign
toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary)
toolexeclib_DATA = libgcj.spec
-data_DATA = libgcj.jar
+
+jardir = $(datadir)/java
+jar_DATA = libgcj-@gcc_version@.jar
secdir = $(libdir)/security
@@ -161,7 +168,7 @@ bin_SCRIPTS = addr2name.awk
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 $@
@@ -174,6 +181,7 @@ GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -W -Wall
AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
-fdollars-in-identifiers \
+ -Wswitch-enum \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
-DPREFIX="\"$(prefix)\""
@@ -208,8 +216,9 @@ 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) \
@@ -217,15 +226,15 @@ libgcj_la_LIBADD = $(javao_files) $(c_files) $(GCOBJS) \
# 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) \
-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) \
@@ -234,7 +243,7 @@ libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
libgcjx_la_LINK = $(LIBLINK)
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
SUFFIXES = .class .java .h
@@ -262,37 +271,37 @@ CONVERT_DIR = gnu/gcj/convert
jv_convert_SOURCES =
EXTRA_jv_convert_SOURCES = $(convert_source_files)
jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
- -rpath $(toolexeclibdir) -shared-libgcc
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
jv_convert_LINK = $(GCJLINK)
-jv_convert_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
+jv_convert_LDADD = libgcj.la -L$(here)/.libs
jv_convert_DEPENDENCIES = $(convert_source_files:.java=.lo) \
- $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+ libgcj.la libgcj.spec
gij_SOURCES = gij.cc
-gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc
+gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
gij_LINK = $(GCJLINK)
-gij_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
-gij_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+gij_LDADD = libgcj.la -L$(here)/.libs
+gij_DEPENDENCIES = libgcj.la libgcj.spec
rmic_SOURCES =
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)
-rmic_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
-rmic_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+rmic_LDADD = libgcj.la -L$(here)/.libs
+rmic_DEPENDENCIES = libgcj.la libgcj.spec
rmiregistry_SOURCES =
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)
-rmiregistry_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
-rmiregistry_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+rmiregistry_LDADD = libgcj.la -L$(here)/.libs
+rmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
gen_from_JIS_SOURCES =
EXTRA_gen_from_JIS_SOURCES = $(srcdir)/$(CONVERT_DIR)/gen-from-JIS.c \
@@ -1728,7 +1737,7 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CF
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DATA = $(data_DATA) $(toolexeclib_DATA)
+DATA = $(jar_DATA) $(toolexeclib_DATA)
DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \
THANKS acinclude.m4 aclocal.m4 configure configure.in \
@@ -2865,23 +2874,23 @@ uninstall-binSCRIPTS:
.cc.lo:
$(LTCXXCOMPILE) -c $<
-install-dataDATA: $(data_DATA)
+install-jarDATA: $(jar_DATA)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(datadir)
- @list='$(data_DATA)'; for p in $$list; do \
+ $(mkinstalldirs) $(DESTDIR)$(jardir)
+ @list='$(jar_DATA)'; for p in $$list; do \
if test -f $(srcdir)/$$p; then \
- echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(datadir)/$$p"; \
- $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(datadir)/$$p; \
+ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(jardir)/$$p"; \
+ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(jardir)/$$p; \
else if test -f $$p; then \
- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(datadir)/$$p"; \
- $(INSTALL_DATA) $$p $(DESTDIR)$(datadir)/$$p; \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(jardir)/$$p"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(jardir)/$$p; \
fi; fi; \
done
-uninstall-dataDATA:
+uninstall-jarDATA:
@$(NORMAL_UNINSTALL)
- list='$(data_DATA)'; for p in $$list; do \
- rm -f $(DESTDIR)$(datadir)/$$p; \
+ list='$(jar_DATA)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(jardir)/$$p; \
done
install-toolexeclibDATA: $(toolexeclib_DATA)
@@ -3120,14 +3129,14 @@ install-exec-am: install-toolexeclibLTLIBRARIES install-binPROGRAMS \
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-exec: install-exec-recursive
-install-data-am: install-dataDATA install-data-local
+install-data-am: install-jarDATA install-data-local
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am: uninstall-toolexeclibLTLIBRARIES uninstall-binPROGRAMS \
- uninstall-binSCRIPTS uninstall-dataDATA \
+ uninstall-binSCRIPTS uninstall-jarDATA \
uninstall-toolexeclibDATA
uninstall: uninstall-recursive
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA)
@@ -3137,7 +3146,7 @@ install-strip:
installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) $(DESTDIR)$(bindir) \
- $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) \
+ $(DESTDIR)$(bindir) $(DESTDIR)$(jardir) \
$(DESTDIR)$(toolexeclibdir)
@@ -3197,7 +3206,7 @@ distclean-binPROGRAMS clean-binPROGRAMS maintainer-clean-binPROGRAMS \
uninstall-binPROGRAMS install-binPROGRAMS mostlyclean-noinstPROGRAMS \
distclean-noinstPROGRAMS clean-noinstPROGRAMS \
maintainer-clean-noinstPROGRAMS uninstall-binSCRIPTS install-binSCRIPTS \
-uninstall-dataDATA install-dataDATA uninstall-toolexeclibDATA \
+uninstall-jarDATA install-jarDATA uninstall-toolexeclibDATA \
install-toolexeclibDATA install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
@@ -3221,22 +3230,22 @@ install-exec-hook:
$(LN_S) libgcjx.la gnu-awt-xlib.la; \
fi
-$(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
-$(x_java_source_files:.java=.class): libgcj.jar
+$(x_java_source_files:.java=.class): libgcj-@gcc_version@.jar
-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)
@: $(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
find java gnu javax org -type d -o -type f -name '*.class' | \
sed -e '/\/\./d' -e '/\/xlib/d' | \
$(ZIP) cfM0E@ $@
@@ -3270,7 +3279,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)
@@ -3279,18 +3288,18 @@ libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES)
-rpath $(toolexeclibdir) $(libgcjx_la_LDFLAGS) $(LIBS)
.class.h:
- $(GCJH) -bootclasspath $(top_builddir) $(basename $<)
+ $(GCJH) -classpath '' -bootclasspath $(top_builddir) $(basename $<)
$(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' \
@@ -3299,11 +3308,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);' \
@@ -3313,21 +3323,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;' \
@@ -3335,16 +3345,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'
$(extra_headers):
@@ -3352,13 +3362,15 @@ $(extra_headers):
install-data-local:
$(PRE_INSTALL)
- @for f in $(nat_headers) $(extra_headers); do \
+ @: $(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
$(mkinstalldirs) $(DESTDIR)$(secdir)
@for f in classpath.security libgcj.security; do \
echo " $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f"; \
@@ -3371,14 +3383,14 @@ maintainer-check: libgcj.la
| grep -v 'Jv' \
| grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
-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; \
done; \
$(CXXCOMPILE) -fsyntax-only htest.cc
-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"; \
diff --git a/libjava/THANKS b/libjava/THANKS
index 53af79a8a16..5b8c07d8e5c 100644
--- a/libjava/THANKS
+++ b/libjava/THANKS
@@ -8,11 +8,12 @@ Godmar Back for his improvements and encouragement.
Scott Bambrough for help porting the compiler.
Jon Beniston for his Win32 port.
Geoff Berry for his object serialization work and various patches.
+Eric Blake for helping to make gcj and libgcj conform to the specifications.
Hans-J. Boehm for his garbage collector, IA-64 libffi port, and other work.
Per Bothner for dreaming up, designing and implementing much of gcj.
Joerg Brunsmann for compiler hacking and help with the FAQ.
-Glenn Chambers for help with the FAQ.
Steve Chamberlain for config fixes and the picoJava port.
+Glenn Chambers for help with the FAQ.
John-Marc Chandonia for various library patches.
Eric Christopher for his porting help and clean-ups.
The GNU Classpath project for all of their merged runtime code.
@@ -24,15 +25,15 @@ Anthony Green for various contributions.
Stu Grossman for gdb hacking, allowing us to debug our code.
Andrew Haley for his amazing compiler and library efforts.
Jakub Jelinek for improving the build system.
+Warren Levy for his tremendous library work.
Oskar Liljeblad for hacking on AWT and his many bug reports and patches.
+All of the Mauve project contributors, for test code.
Bryce McKinlay for numerous gcj and libgcj fixes and improvements.
+Adam Megacz for his work on the Win32 port.
Jason Molenda for establishing the project infrastructure
on sources.redhat.com.
Mike Moreton for his various patches.
Alexandre Oliva for all of this porting and testing efforts.
-Kresten Krab Thorup for his fantastic bytecode interpreter.
-Warren Levy for his tremendous library work.
-All of the Mauve project contributors, for test code.
Rainer Orth for configuration clean-ups and porting help.
Alexandre Petit-Bianco for implementing much of the compiler,
and continued maintainership.
@@ -41,11 +42,15 @@ Bradley Schatz for his work on the FAQ.
Jason Schroeder for jcf-dump patches.
John Stracke for his HTTP protocol fixes.
Jeff Sturm for porting help, bug fixes, and encouragement.
+Kresten Krab Thorup for his fantastic bytecode interpreter.
+Andreas Tobler for his work porting libgcj to Darwin.
Tom Tromey for his many contributions and libgcj maintainership.
Matt Welsh for help with Linux Threads.
Urban Widmark for help fixing java.io.
+Mark Wielaard for new library code and his work integrating with Classpath.
Gilles Zunino for help porting to Irix.
+
We'd also like to thank the folks who have contributed time and energy
in testing GCJ:
@@ -69,11 +74,11 @@ Charles-Antoine Gauthier
Simon Gornall
Fred Gray
John Griffin
+Patrik Hagglund
Phil Hargett
+Amancio Hasty
Bryan W. Headley
Kevin B. Hendricks
-Patrik Hagglund
-Amancio Hasty
Joep Jansen
David Kidd
Tobias Kuipers
@@ -96,7 +101,6 @@ Tim Souder
Adam Sulmicki
Frederik Warg
Gregory Warnes
-Mark Wielaard
David E. Young
Thank you all!
diff --git a/libjava/acconfig.h b/libjava/acconfig.h
index 400710dd5eb..8ffdd34ab68 100644
--- a/libjava/acconfig.h
+++ b/libjava/acconfig.h
@@ -89,6 +89,13 @@
/* Define if global `timezone' exists. */
#undef HAVE_TIMEZONE
+/* Define to version of GCJ in use. */
+#undef GCJVERSION
+
+/* Define if if the synchronization code should try to avoid pthread_self
+ calls by caching thread IDs in a hashtable. */
+#undef SLOW_PTHREAD_SELF
+
/* Define if you have the appropriate function. */
#undef HAVE_ACCESS
#undef HAVE_STAT
diff --git a/libjava/configure b/libjava/configure
index f53e19ca905..711f39eedef 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -80,6 +80,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -194,6 +195,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -364,6 +366,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -529,12 +536,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -575,7 +586,7 @@ fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:579: checking whether ln -s works" >&5
+echo "configure:590: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -621,7 +632,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:625: checking for a BSD compatible install" >&5
+echo "configure:636: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -674,7 +685,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:678: checking whether build environment is sane" >&5
+echo "configure:689: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -731,7 +742,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:735: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:746: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -764,12 +775,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:768: checking for Cygwin environment" >&5
+echo "configure:779: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 773 "configure"
+#line 784 "configure"
#include "confdefs.h"
int main() {
@@ -780,7 +791,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -797,19 +808,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:801: checking for mingw32 environment" >&5
+echo "configure:812: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 806 "configure"
+#line 817 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -936,7 +947,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:940: checking host system type" >&5
+echo "configure:951: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -957,7 +968,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:961: checking target system type" >&5
+echo "configure:972: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -975,7 +986,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:979: checking build system type" >&5
+echo "configure:990: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1004,7 +1015,7 @@ test "$host_alias" != "$target_alias" &&
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1008: checking for $ac_word" >&5
+echo "configure:1019: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1034,7 +1045,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1038: checking for $ac_word" >&5
+echo "configure:1049: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1085,7 +1096,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1089: checking for $ac_word" >&5
+echo "configure:1100: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1118,7 +1129,7 @@ fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1122: checking whether we are using GNU C" >&5
+echo "configure:1133: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1127,7 +1138,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1146,7 +1157,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1150: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1161: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1177,45 +1188,60 @@ else
fi
fi
-for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
+
+# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use
+# glibjava_CXX instead of glibcpp_CXX. That's because we're passed a
+# different definition of CXX than other directories, since we don't
+# depend on libstdc++-v3 having already been built.
+
+
+
+# Use glibjava_CXX so that we do not cause CXX to be cached with the
+# flags that come in CXX while configuring libjava. They're different
+# from those used for all other target libraries. If CXX is set in
+# the environment, respect that here.
+glibjava_CXX=$CXX
+for ac_prog in $CCC c++ g++ gcc CC cxx cc++
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1186: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+echo "configure:1210: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_glibjava_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
+ if test -n "$glibjava_CXX"; then
+ ac_cv_prog_glibjava_CXX="$glibjava_CXX" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CXX="$ac_prog"
+ ac_cv_prog_glibjava_CXX="$ac_prog"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
-CXX="$ac_cv_prog_CXX"
-if test -n "$CXX"; then
- echo "$ac_t""$CXX" 1>&6
+glibjava_CXX="$ac_cv_prog_glibjava_CXX"
+if test -n "$glibjava_CXX"; then
+ echo "$ac_t""$glibjava_CXX" 1>&6
else
echo "$ac_t""no" 1>&6
fi
-test -n "$CXX" && break
+test -n "$glibjava_CXX" && break
done
-test -n "$CXX" || CXX="gcc"
+test -n "$glibjava_CXX" || glibjava_CXX="gcc"
+CXX=$glibjava_CXX
+test -z "$glibjava_CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1219: checking whether we are using GNU C++" >&5
+echo "configure:1245: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1224,7 +1250,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
@@ -1235,15 +1261,11 @@ echo "$ac_t""$ac_cv_prog_gxx" 1>&6
if test $ac_cv_prog_gxx = yes; then
GXX=yes
-else
- GXX=
-fi
-
-ac_test_CXXFLAGS="${CXXFLAGS+set}"
-ac_save_CXXFLAGS="$CXXFLAGS"
-CXXFLAGS=
-echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1247: checking whether ${CXX-g++} accepts -g" >&5
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=
+ echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:1269: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1258,20 +1280,16 @@ rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
+ if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ elif test $ac_cv_prog_cxx_g = yes; then
CXXFLAGS="-g -O2"
else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
CXXFLAGS="-O2"
- else
- CXXFLAGS=
fi
+else
+ GXX=
+ test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
fi
@@ -1296,7 +1314,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1300: checking for working aclocal" >&5
+echo "configure:1318: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1309,7 +1327,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1313: checking for working autoconf" >&5
+echo "configure:1331: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1322,7 +1340,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1326: checking for working automake" >&5
+echo "configure:1344: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1335,7 +1353,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1339: checking for working autoheader" >&5
+echo "configure:1357: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1348,7 +1366,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1352: checking for working makeinfo" >&5
+echo "configure:1370: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1367,7 +1385,7 @@ fi
# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
# be run before AC_CANONICAL_HOST.
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1371: checking build system type" >&5
+echo "configure:1389: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1388,7 +1406,7 @@ echo "$ac_t""$build" 1>&6
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1392: checking for $ac_word" >&5
+echo "configure:1410: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1420,7 +1438,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1424: checking for $ac_word" >&5
+echo "configure:1442: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1452,7 +1470,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1456: checking for $ac_word" >&5
+echo "configure:1474: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1484,7 +1502,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1488: checking for $ac_word" >&5
+echo "configure:1506: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1529,7 +1547,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1533: checking for a BSD compatible install" >&5
+echo "configure:1551: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1583,7 +1601,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1587: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1605: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
@@ -1621,7 +1639,7 @@ if false; then
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1625: checking for executable suffix" >&5
+echo "configure:1643: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1631,10 +1649,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj) ;;
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -1782,7 +1800,7 @@ ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1786: checking for ld used by GCC" >&5
+echo "configure:1804: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1812,10 +1830,10 @@ echo "configure:1786: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1816: checking for GNU ld" >&5
+echo "configure:1834: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1819: checking for non-GNU ld" >&5
+echo "configure:1837: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1850,7 +1868,7 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1854: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1872: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1867,7 +1885,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1871: checking for $LD option to reload object files" >&5
+echo "configure:1889: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1879,7 +1897,7 @@ reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1883: checking for BSD-compatible nm" >&5
+echo "configure:1901: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1917,7 +1935,7 @@ NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1921: checking how to recognise dependant libraries" >&5
+echo "configure:1939: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2081,13 +2099,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:2085: checking for object suffix" >&5
+echo "configure:2103: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:2091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -2111,7 +2129,7 @@ case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:2115: checking for ${ac_tool_prefix}file" >&5
+echo "configure:2133: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2173,7 +2191,7 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:2177: checking for file" >&5
+echo "configure:2195: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2244,7 +2262,7 @@ esac
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2248: checking for $ac_word" >&5
+echo "configure:2266: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2276,7 +2294,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2280: checking for $ac_word" >&5
+echo "configure:2298: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2311,7 +2329,7 @@ fi
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2315: checking for $ac_word" >&5
+echo "configure:2333: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2343,7 +2361,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2347: checking for $ac_word" >&5
+echo "configure:2365: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2410,8 +2428,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 2414 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2432 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
@@ -2432,7 +2450,7 @@ case $host in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2436: checking whether the C compiler needs -belf" >&5
+echo "configure:2454: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2445,14 +2463,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 2449 "configure"
+#line 2467 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2482,7 +2500,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
esac
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:2486: checking how to run the C++ preprocessor" >&5
+echo "configure:2504: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2495,12 +2513,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 2499 "configure"
+#line 2517 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -2734,7 +2752,7 @@ EOF
fi
echo $ac_n "checking for exception model to use""... $ac_c" 1>&6
-echo "configure:2738: checking for exception model to use" >&5
+echo "configure:2756: checking for exception model to use" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2749,7 +2767,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
:
else
cat > conftest.$ac_ext << EOF
-#line 2753 "configure"
+#line 2771 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -2760,7 +2778,7 @@ void foo()
EOF
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=-S
-if { (eval echo configure:2764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
enable_sjlj_exceptions=yes
elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
@@ -2791,6 +2809,14 @@ cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_exception_model_name" 1>&6
+# If we are non using SJLJ exceptions, and this host does not have support
+# for unwinding from a signal handler, enable checked dereferences and divides.
+if test $can_unwind_signal = no && test $enable_sjlj_exceptions = no; then
+ CHECKREFSPEC=-fcheck-references
+ DIVIDESPEC=-fuse-divide-subroutine
+ EXCEPTIONSPEC=
+fi
+
# Check whether --enable-java-net or --disable-java-net was given.
if test "${enable_java_net+set}" = set; then
enableval="$enable_java_net"
@@ -2824,7 +2850,7 @@ if test "$with_libffi" != no; then
#define USE_LIBFFI 1
EOF
- LIBFFI=../libffi/libfficonvenience.la
+ LIBFFI=../libffi/libffi_convenience.la
LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I$(MULTIBUILDTOP)../libffi/include'
fi
@@ -2882,7 +2908,7 @@ esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2886: checking how to run the C preprocessor" >&5
+echo "configure:2912: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2897,13 +2923,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2901 "configure"
+#line 2927 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -2914,13 +2940,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2918 "configure"
+#line 2944 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -2931,13 +2957,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2935 "configure"
+#line 2961 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -2962,7 +2988,7 @@ fi
echo "$ac_t""$CPP" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 2966 "configure"
+#line 2992 "configure"
#include "confdefs.h"
#include <stdint.h>
EOF
@@ -2977,7 +3003,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2981 "configure"
+#line 3007 "configure"
#include "confdefs.h"
#include <inttypes.h>
EOF
@@ -2992,7 +3018,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2996 "configure"
+#line 3022 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3007,7 +3033,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3011 "configure"
+#line 3037 "configure"
#include "confdefs.h"
#include <sys/config.h>
EOF
@@ -3024,7 +3050,7 @@ rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3028 "configure"
+#line 3054 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3039,7 +3065,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3043 "configure"
+#line 3069 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3091,7 +3117,7 @@ ZLIBTESTSPEC=
libsubdir=.libs
echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:3095: checking for garbage collector to use" >&5
+echo "configure:3121: checking for garbage collector to use" >&5
# Check whether --enable-java-gc or --disable-java-gc was given.
if test "${enable_java_gc+set}" = set; then
enableval="$enable_java_gc"
@@ -3111,14 +3137,11 @@ GCTESTSPEC=
case "$GC" in
boehm)
echo "$ac_t""boehm" 1>&6
- GCDEPS='$(top_builddir)/../boehm-gc/libgcjgc.la'
- # We include the path to the boehm-gc build directory.
- # See Makefile.am to understand why.
- GCLIBS="$GCDEPS -L\$(here)/../boehm-gc/$libsubdir"
+ GCLIBS=../boehm-gc/libgcjgc_convenience.la
GCINCS='-I$(top_srcdir)/../boehm-gc/include'
- GCSPEC='-lgcjgc'
JC1GCSPEC='-fuse-boehm-gc'
GCTESTSPEC="-L`pwd`/../boehm-gc/.libs -rpath `pwd`/../boehm-gc/.libs"
+
GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
GCOBJS=boehm.lo
GCHDR=boehm-gc.h
@@ -3147,7 +3170,7 @@ esac
echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
-echo "configure:3151: checking for thread model used by GCC" >&5
+echo "configure:3174: checking for thread model used by GCC" >&5
THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
echo "$ac_t""$THREADS" 1>&6
@@ -3176,6 +3199,7 @@ EOF
;;
esac
+THREADLDFLAGS=
THREADLIBS=
THREADINCS=
THREADDEPS=
@@ -3194,7 +3218,7 @@ case "$THREADS" in
# Before FreeBSD 5, it didn't have -lpthread (or any library which
# merely adds pthread_* functions) but it does have a -pthread switch
# which is required at link-time to select -lc_r *instead* of -lc.
- THREADLIBS=-pthread
+ THREADLDFLAGS=-pthread
# Don't set THREADSPEC here as might be expected since -pthread is
# not processed when found within a spec file, it must come from
# the command line. For now, the user must provide the -pthread
@@ -3206,7 +3230,7 @@ case "$THREADS" in
# FreeBSD 5 implements a model much closer to other modern UNIX
# which support threads. However, it still does not support
# -lpthread.
- THREADLIBS=-pthread
+ THREADLDFLAGS=-pthread
THREADSPEC=-lc_r
;;
*)
@@ -3256,6 +3280,8 @@ esac
+if test -d sysdep; then true; else mkdir sysdep; fi
+
HASH_SYNC_SPEC=
# Hash synchronization is only useful with posix threads right now.
@@ -3286,6 +3312,14 @@ NATIVE=yes
# We're in the tree with gcc, and need to include some of its headers.
GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
+# Figure out where generated headers like libgcj-config.h get installed.
+gcc_version_trigger=${libgcj_basedir}/../gcc/version.c
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+tool_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include
+
+
+
if test -n "${with_cross_host}"; then
# We are being configured with a cross compiler. AC_REPLACE_FUNCS
# may not work correctly, because the compiler may not be able to
@@ -3306,6 +3340,10 @@ EOF
EOF
cat >> confdefs.h <<\EOF
+#define HAVE_TIME 1
+EOF
+
+ cat >> confdefs.h <<\EOF
#define HAVE_GMTIME_R 1
EOF
@@ -3327,9 +3365,6 @@ EOF
EOF
- ZLIBSPEC=-lzgcj
- ZLIBTESTSPEC="-L`pwd`/../zlib/.libs -rpath `pwd`/../zlib/.libs"
-
# If Canadian cross, then don't pick up tools from the build
# directory.
if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
@@ -3342,12 +3377,12 @@ else
for ac_func in strerror ioctl select fstat open fsync sleep opendir
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3346: checking for $ac_func" >&5
+echo "configure:3381: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3351 "configure"
+#line 3386 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3370,7 +3405,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3397,12 +3432,12 @@ done
for ac_func in gmtime_r localtime_r readdir_r getpwuid_r getcwd
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3401: checking for $ac_func" >&5
+echo "configure:3436: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3406 "configure"
+#line 3441 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3425,7 +3460,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3452,12 +3487,12 @@ done
for ac_func in access stat mkdir rename rmdir unlink realpath utime chmod
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3456: checking for $ac_func" >&5
+echo "configure:3491: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3461 "configure"
+#line 3496 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3480,7 +3515,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3507,12 +3542,12 @@ done
for ac_func in nl_langinfo setlocale
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3511: checking for $ac_func" >&5
+echo "configure:3546: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3516 "configure"
+#line 3551 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3535,7 +3570,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3562,12 +3597,12 @@ done
for ac_func in inet_aton inet_addr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3566: checking for $ac_func" >&5
+echo "configure:3601: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3571 "configure"
+#line 3606 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3590,7 +3625,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3617,12 +3652,12 @@ done
for ac_func in inet_pton uname inet_ntoa
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3621: checking for $ac_func" >&5
+echo "configure:3656: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3626 "configure"
+#line 3661 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3645,7 +3680,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3669,15 +3704,15 @@ else
fi
done
- for ac_func in backtrace fork execvp pipe sigaction
+ for ac_func in fork execvp pipe sigaction
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3676: checking for $ac_func" >&5
+echo "configure:3711: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3681 "configure"
+#line 3716 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3700,7 +3735,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3728,17 +3763,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3732: checking for $ac_hdr" >&5
+echo "configure:3767: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3737 "configure"
+#line 3772 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3764,8 +3799,69 @@ else
fi
done
+ echo $ac_n "checking for backtrace""... $ac_c" 1>&6
+echo "configure:3804: checking for backtrace" >&5
+if eval "test \"`echo '$''{'ac_cv_func_backtrace'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3809 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char backtrace(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char backtrace();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_backtrace) || defined (__stub___backtrace)
+choke me
+#else
+backtrace();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_backtrace=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_backtrace=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'backtrace`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ case "$host" in
+ ia64-*-linux*)
+ # Has broken backtrace()
+ ;;
+ *)
+ cat >> confdefs.h <<\EOF
+#define HAVE_BACKTRACE 1
+EOF
+
+ ;;
+ esac
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6
-echo "configure:3769: checking for dladdr in -ldl" >&5
+echo "configure:3865: checking for dladdr in -ldl" >&5
ac_lib_var=`echo dl'_'dladdr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3773,7 +3869,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3777 "configure"
+#line 3873 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3784,7 +3880,7 @@ int main() {
dladdr()
; return 0; }
EOF
-if { (eval echo configure:3788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3813,7 +3909,7 @@ do
ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_file""... $ac_c" 1>&6
-echo "configure:3817: checking for $ac_file" >&5
+echo "configure:3913: checking for $ac_file" >&5
if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3861,7 +3957,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:3865: checking for iconv" >&5
+echo "configure:3961: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3869,7 +3965,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 3873 "configure"
+#line 3969 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -3879,7 +3975,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:3883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -3891,7 +3987,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 3895 "configure"
+#line 3991 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -3901,7 +3997,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
@@ -3922,13 +4018,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:3926: checking for iconv declaration" >&5
+echo "configure:4022: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3932 "configure"
+#line 4028 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -3947,7 +4043,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:3951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -3976,19 +4072,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3980: checking for LC_MESSAGES" >&5
+echo "configure:4076: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3985 "configure"
+#line 4081 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:3992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -4009,12 +4105,12 @@ EOF
fi
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:4013: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:4109: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4018 "configure"
+#line 4114 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -4022,7 +4118,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:4026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -4043,12 +4139,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:4047: checking for tm_zone in struct tm" >&5
+echo "configure:4143: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4052 "configure"
+#line 4148 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -4056,7 +4152,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:4060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -4076,12 +4172,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:4080: checking for tzname" >&5
+echo "configure:4176: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4085 "configure"
+#line 4181 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -4091,7 +4187,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:4095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -4116,12 +4212,12 @@ fi
for ac_func in gethostbyname_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4120: checking for $ac_func" >&5
+echo "configure:4216: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4125 "configure"
+#line 4221 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4144,7 +4240,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4171,7 +4267,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 4175 "configure"
+#line 4271 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -4191,7 +4287,7 @@ rm -f conftest*
*" -D_REENTRANT "*) ;;
*)
echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6
-echo "configure:4195: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
+echo "configure:4291: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
if eval "test \"`echo '$''{'libjava_cv_gethostbyname_r_needs_reentrant'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4204,14 +4300,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
-#line 4208 "configure"
+#line 4304 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:4215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=no
else
@@ -4221,14 +4317,14 @@ else
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
cat > conftest.$ac_ext <<EOF
-#line 4225 "configure"
+#line 4321 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:4232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=yes
else
@@ -4263,12 +4359,12 @@ EOF
esac
echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6
-echo "configure:4267: checking for struct hostent_data" >&5
+echo "configure:4363: checking for struct hostent_data" >&5
if eval "test \"`echo '$''{'libjava_cv_struct_hostent_data'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4272 "configure"
+#line 4368 "configure"
#include "confdefs.h"
#if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
@@ -4279,7 +4375,7 @@ int main() {
struct hostent_data data;
; return 0; }
EOF
-if { (eval echo configure:4283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_struct_hostent_data=yes
else
@@ -4311,7 +4407,7 @@ done
# to exist where expected. (The root issue: AC_CHECK_FUNCS assumes C
# linkage check is enough, yet C++ code requires proper prototypes.)
cat > conftest.$ac_ext <<EOF
-#line 4315 "configure"
+#line 4411 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -4322,12 +4418,12 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
for ac_func in gethostbyaddr_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4326: checking for $ac_func" >&5
+echo "configure:4422: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4331 "configure"
+#line 4427 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4350,7 +4446,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4377,7 +4473,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 4381 "configure"
+#line 4477 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -4404,12 +4500,12 @@ rm -f conftest*
for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4408: checking for $ac_func" >&5
+echo "configure:4504: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4413 "configure"
+#line 4509 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4432,7 +4528,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4456,7 +4552,7 @@ EOF
EOF
cat > conftest.$ac_ext <<EOF
-#line 4460 "configure"
+#line 4556 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -4487,12 +4583,12 @@ done
for ac_func in pthread_mutexattr_settype pthread_mutexattr_setkind_np
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4491: checking for $ac_func" >&5
+echo "configure:4587: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4496 "configure"
+#line 4592 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4515,7 +4611,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4545,12 +4641,12 @@ done
for ac_func in sched_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4549: checking for $ac_func" >&5
+echo "configure:4645: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4554 "configure"
+#line 4650 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4573,7 +4669,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4595,7 +4691,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:4599: checking for sched_yield in -lrt" >&5
+echo "configure:4695: checking for sched_yield in -lrt" >&5
ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4603,7 +4699,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4607 "configure"
+#line 4703 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4614,7 +4710,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4640,7 +4736,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:4644: checking for sched_yield in -lposix4" >&5
+echo "configure:4740: checking for sched_yield in -lposix4" >&5
ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4648,7 +4744,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4652 "configure"
+#line 4748 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4659,7 +4755,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:4663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4695,7 +4791,7 @@ done
# We can save a little space at runtime if the mutex has m_count
# or __m_count. This is a nice hack for Linux.
cat > conftest.$ac_ext <<EOF
-#line 4699 "configure"
+#line 4795 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -4704,7 +4800,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE_M_COUNT 1
@@ -4716,7 +4812,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 4720 "configure"
+#line 4816 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -4725,7 +4821,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE___M_COUNT 1
@@ -4745,12 +4841,12 @@ rm -f conftest*
for ac_func in gettimeofday time ftime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4749: checking for $ac_func" >&5
+echo "configure:4845: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4754 "configure"
+#line 4850 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4773,7 +4869,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4804,12 +4900,12 @@ done
for ac_func in memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4808: checking for $ac_func" >&5
+echo "configure:4904: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4813 "configure"
+#line 4909 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4832,7 +4928,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4862,12 +4958,12 @@ done
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4866: checking for $ac_func" >&5
+echo "configure:4962: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4871 "configure"
+#line 4967 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4890,7 +4986,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4919,7 +5015,7 @@ done
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4923: checking for dlopen in -ldl" >&5
+echo "configure:5019: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4927,7 +5023,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4931 "configure"
+#line 5027 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4938,7 +5034,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:4942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4983,7 +5079,7 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:4987: checking for socket libraries" >&5
+echo "configure:5083: checking for socket libraries" >&5
if eval "test \"`echo '$''{'gcj_cv_lib_sockets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4991,12 +5087,12 @@ else
gcj_checkBoth=0
unset ac_cv_func_connect
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:4995: checking for connect" >&5
+echo "configure:5091: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5000 "configure"
+#line 5096 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -5019,7 +5115,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:5023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -5042,7 +5138,7 @@ fi
if test "$gcj_checkSocket" = 1; then
unset ac_cv_func_connect
echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:5046: checking for main in -lsocket" >&5
+echo "configure:5142: checking for main in -lsocket" >&5
ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5050,14 +5146,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5054 "configure"
+#line 5150 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5084,12 +5180,12 @@ fi
LIBS="$LIBS -lsocket -lnsl"
unset ac_cv_func_accept
echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:5088: checking for accept" >&5
+echo "configure:5184: checking for accept" >&5
if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5093 "configure"
+#line 5189 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept(); below. */
@@ -5112,7 +5208,7 @@ accept();
; return 0; }
EOF
-if { (eval echo configure:5116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_accept=yes"
else
@@ -5139,12 +5235,12 @@ fi
gcj_oldLibs=$LIBS
LIBS="$LIBS $gcj_cv_lib_sockets"
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:5143: checking for gethostbyname" >&5
+echo "configure:5239: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5148 "configure"
+#line 5244 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -5167,7 +5263,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:5171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -5185,7 +5281,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:5189: checking for main in -lnsl" >&5
+echo "configure:5285: checking for main in -lnsl" >&5
ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5193,14 +5289,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5197 "configure"
+#line 5293 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5232,7 +5328,7 @@ echo "$ac_t""$gcj_cv_lib_sockets" 1>&6
if test "$with_system_zlib" = yes; then
echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:5236: checking for deflate in -lz" >&5
+echo "configure:5332: checking for deflate in -lz" >&5
ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5240,7 +5336,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5244 "configure"
+#line 5340 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5251,7 +5347,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:5255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5269,19 +5365,16 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
ZLIBSPEC=-lz
else
echo "$ac_t""no" 1>&6
-ZLIBSPEC=-lzgcj
+ZLIBSPEC=
fi
- else
- ZLIBSPEC=-lzgcj
- ZLIBTESTSPEC="-L`pwd`/../zlib/.libs -rpath `pwd`/../zlib/.libs"
fi
# On Solaris, and maybe other architectures, the Boehm collector
# requires -ldl.
if test "$GC" = boehm; then
echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6
-echo "configure:5285: checking for main in -ldl" >&5
+echo "configure:5378: checking for main in -ldl" >&5
ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5289,14 +5382,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5293 "configure"
+#line 5386 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5362,7 +5455,7 @@ fi
# Extract the first word of "${ac_tool_prefix}gcj", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcj; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5366: checking for $ac_word" >&5
+echo "configure:5459: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5394,7 +5487,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "gcj", so it can be a program name with args.
set dummy gcj; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5398: checking for $ac_word" >&5
+echo "configure:5491: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5456,13 +5549,13 @@ exec 5>>./config.log
CPPFLAGS=$GCJ_SAVE_CPPFLAGS
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:5460: checking size of void *" >&5
+echo "configure:5553: checking size of void *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 5466 "configure"
+#line 5559 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -5472,7 +5565,7 @@ int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:5476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
@@ -5496,16 +5589,16 @@ EOF
ZLIBS=
-ZDEPS=
+SYS_ZLIBS=
ZINCS=
-if test "x$ZLIBSPEC" = "x-lzgcj"; then
- # We include the path to the zlib build directory.
- # See Makefile.am to understand why.
- ZDEPS='$(top_builddir)/../zlib/libzgcj.la'
- ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
+
+if test -z "$ZLIBSPEC"; then
+ # Use zlib from the GCC tree.
ZINCS='-I$(top_srcdir)/../zlib'
+ ZLIBS=../zlib/libzgcj_convenience.la
else
- ZLIBS="$ZLIBSPEC"
+ # System's zlib.
+ SYS_ZLIBS="$ZLIBSPEC"
fi
@@ -5515,6 +5608,7 @@ fi
+
if test "$CANADIAN" = yes; then
CANADIAN_TRUE=
CANADIAN_FALSE='#'
@@ -5562,19 +5656,30 @@ fi
+# Determine gcj version number.
+
+gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`
+
+GCJVERSION=$gcjversion
+
+cat >> confdefs.h <<EOF
+#define GCJVERSION "$GCJVERSION"
+EOF
+
+
echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6
-echo "configure:5567: checking for g++ -ffloat-store bug" >&5
+echo "configure:5672: checking for g++ -ffloat-store bug" >&5
save_CFLAGS="$CFLAGS"
CFLAGS="-x c++ -O2 -ffloat-store"
cat > conftest.$ac_ext <<EOF
-#line 5571 "configure"
+#line 5676 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:5578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""no" 1>&6
else
@@ -5594,17 +5699,17 @@ for ac_hdr in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5598: checking for $ac_hdr" >&5
+echo "configure:5703: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5603 "configure"
+#line 5708 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5634,17 +5739,17 @@ for ac_hdr in dirent.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5638: checking for $ac_hdr" >&5
+echo "configure:5743: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5643 "configure"
+#line 5748 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5674,17 +5779,17 @@ for ac_hdr in inttypes.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5678: checking for $ac_hdr" >&5
+echo "configure:5783: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5683 "configure"
+#line 5788 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5720,12 +5825,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:5724: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:5829: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5729 "configure"
+#line 5834 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -5741,7 +5846,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:5745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -5763,12 +5868,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:5767: checking for ANSI C header files" >&5
+echo "configure:5872: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5772 "configure"
+#line 5877 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -5776,7 +5881,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5885: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5793,7 +5898,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 5797 "configure"
+#line 5902 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -5811,7 +5916,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 5815 "configure"
+#line 5920 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -5832,7 +5937,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 5836 "configure"
+#line 5941 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -5843,7 +5948,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:5847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -5867,12 +5972,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:5871: checking for ssize_t" >&5
+echo "configure:5976: checking for ssize_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5876 "configure"
+#line 5981 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5901,9 +6006,9 @@ fi
echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:5905: checking for in_addr_t" >&5
+echo "configure:6010: checking for in_addr_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 5907 "configure"
+#line 6012 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5917,7 +6022,7 @@ int main() {
in_addr_t foo;
; return 0; }
EOF
-if { (eval echo configure:5921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_IN_ADDR_T 1
@@ -5933,16 +6038,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:5937: checking whether struct ip_mreq is in netinet/in.h" >&5
+echo "configure:6042: checking whether struct ip_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 5939 "configure"
+#line 6044 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ip_mreq mreq;
; return 0; }
EOF
-if { (eval echo configure:5946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IP_MREQ 1
@@ -5958,16 +6063,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:5962: checking whether struct ipv6_mreq is in netinet/in.h" >&5
+echo "configure:6067: checking whether struct ipv6_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 5964 "configure"
+#line 6069 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ipv6_mreq mreq6;
; return 0; }
EOF
-if { (eval echo configure:5971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IPV6_MREQ 1
@@ -5983,16 +6088,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:5987: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:6092: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 5989 "configure"
+#line 6094 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct sockaddr_in6 addr6;
; return 0; }
EOF
-if { (eval echo configure:5996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_INET6 1
@@ -6008,9 +6113,9 @@ fi
rm -f conftest*
echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:6012: checking for socklen_t in sys/socket.h" >&5
+echo "configure:6117: checking for socklen_t in sys/socket.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 6014 "configure"
+#line 6119 "configure"
#include "confdefs.h"
#define _POSIX_PII_SOCKET
#include <sys/types.h>
@@ -6019,7 +6124,7 @@ int main() {
socklen_t x = 5;
; return 0; }
EOF
-if { (eval echo configure:6023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
@@ -6035,16 +6140,16 @@ fi
rm -f conftest*
echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:6039: checking for tm_gmtoff in struct tm" >&5
+echo "configure:6144: checking for tm_gmtoff in struct tm" >&5
cat > conftest.$ac_ext <<EOF
-#line 6041 "configure"
+#line 6146 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm tim; tim.tm_gmtoff = 0;
; return 0; }
EOF
-if { (eval echo configure:6048: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define STRUCT_TM_HAS_GMTOFF 1
@@ -6057,16 +6162,16 @@ else
rm -rf conftest*
echo "$ac_t""no" 1>&6
echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6
-echo "configure:6061: checking for global timezone variable" >&5
+echo "configure:6166: checking for global timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 6063 "configure"
+#line 6168 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
long z2 = timezone;
; return 0; }
EOF
-if { (eval echo configure:6070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_TIMEZONE 1
@@ -6086,19 +6191,19 @@ rm -f conftest*
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:6090: checking for working alloca.h" >&5
+echo "configure:6195: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6095 "configure"
+#line 6200 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:6102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -6119,12 +6224,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:6123: checking for alloca" >&5
+echo "configure:6228: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6128 "configure"
+#line 6233 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -6152,7 +6257,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:6156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -6184,12 +6289,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:6188: checking whether alloca needs Cray hooks" >&5
+echo "configure:6293: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6193 "configure"
+#line 6298 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -6214,12 +6319,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6218: checking for $ac_func" >&5
+echo "configure:6323: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6223 "configure"
+#line 6328 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6242,7 +6347,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6269,7 +6374,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:6273: checking stack direction for C alloca" >&5
+echo "configure:6378: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6277,7 +6382,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 6281 "configure"
+#line 6386 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -6296,7 +6401,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:6300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -6323,7 +6428,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6327: checking for $ac_word" >&5
+echo "configure:6432: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6360,19 +6465,25 @@ case "${host}" in
i?86-*-linux*)
SIGNAL_HANDLER=include/i386-signal.h
;;
- sparc-sun-solaris*)
+ sparc*-sun-solaris*)
SIGNAL_HANDLER=include/sparc-signal.h
;;
# ia64-*)
# SYSDEP_SOURCES=sysdep/ia64.c
# test -d sysdep || mkdir sysdep
# ;;
+ ia64-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
+ ;;
powerpc-*-linux*)
SIGNAL_HANDLER=include/dwarf2-signal.h
;;
alpha*-*-linux*)
SIGNAL_HANDLER=include/dwarf2-signal.h
;;
+sparc*-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
+ ;;
*mingw*)
SIGNAL_HANDLER=include/win32-signal.h
;;
@@ -6401,7 +6512,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:6405: checking for X" >&5
+echo "configure:6513: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -6463,12 +6574,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 6467 "configure"
+#line 6575 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6537,14 +6648,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6541 "configure"
+#line 6649 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:6548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -6650,17 +6761,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:6654: checking whether -R must be followed by a space" >&5
+echo "configure:6762: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 6657 "configure"
+#line 6765 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:6664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -6676,14 +6787,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 6680 "configure"
+#line 6788 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:6687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
@@ -6715,7 +6826,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:6719: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:6827: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6723,7 +6834,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6727 "configure"
+#line 6835 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6734,7 +6845,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:6738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6756,7 +6867,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:6760: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:6868: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6764,7 +6875,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6768 "configure"
+#line 6876 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6775,7 +6886,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:6779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6804,12 +6915,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6808: checking for gethostbyname" >&5
+echo "configure:6916: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6813 "configure"
+#line 6921 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -6832,7 +6943,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:6836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -6853,7 +6964,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:6857: checking for gethostbyname in -lnsl" >&5
+echo "configure:6965: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6861,7 +6972,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6865 "configure"
+#line 6973 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6872,7 +6983,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:6876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6902,12 +7013,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6906: checking for connect" >&5
+echo "configure:7014: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6911 "configure"
+#line 7019 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -6930,7 +7041,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:6934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -6951,7 +7062,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:6955: checking for connect in -lsocket" >&5
+echo "configure:7063: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6959,7 +7070,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6963 "configure"
+#line 7071 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6970,7 +7081,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:6974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6994,12 +7105,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:6998: checking for remove" >&5
+echo "configure:7106: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7003 "configure"
+#line 7111 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -7022,7 +7133,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:7026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@@ -7043,7 +7154,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:7047: checking for remove in -lposix" >&5
+echo "configure:7155: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7051,7 +7162,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7055 "configure"
+#line 7163 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7062,7 +7173,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:7066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7086,12 +7197,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:7090: checking for shmat" >&5
+echo "configure:7198: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7095 "configure"
+#line 7203 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -7114,7 +7225,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:7118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@@ -7135,7 +7246,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:7139: checking for shmat in -lipc" >&5
+echo "configure:7247: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7143,7 +7254,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7147 "configure"
+#line 7255 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7154,7 +7265,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:7158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7187,7 +7298,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:7191: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:7299: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7195,7 +7306,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7199 "configure"
+#line 7307 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7206,7 +7317,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:7210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7444,6 +7555,7 @@ s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@CC@%$CC%g
+s%@glibjava_CXX@%$glibjava_CXX%g
s%@CXX@%$CXX%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
@@ -7498,16 +7610,20 @@ s%@THREADINCS@%$THREADINCS%g
s%@THREADDEPS@%$THREADDEPS%g
s%@THREADOBJS@%$THREADOBJS%g
s%@THREADSPEC@%$THREADSPEC%g
+s%@THREADLDFLAGS@%$THREADLDFLAGS%g
s%@HASH_SYNC_SPEC@%$HASH_SYNC_SPEC%g
s%@USING_GCC_TRUE@%$USING_GCC_TRUE%g
s%@USING_GCC_FALSE@%$USING_GCC_FALSE%g
+s%@tool_include_dir@%$tool_include_dir%g
+s%@gcc_version@%$gcc_version%g
s%@LIBICONV@%$LIBICONV%g
s%@GCJ@%$GCJ%g
s%@GCJFLAGS@%$GCJFLAGS%g
s%@ZLIBS@%$ZLIBS%g
-s%@ZDEPS@%$ZDEPS%g
+s%@SYS_ZLIBS@%$SYS_ZLIBS%g
s%@ZINCS@%$ZINCS%g
s%@DIVIDESPEC@%$DIVIDESPEC%g
+s%@CHECKREFSPEC@%$CHECKREFSPEC%g
s%@EXCEPTIONSPEC@%$EXCEPTIONSPEC%g
s%@CANADIAN_TRUE@%$CANADIAN_TRUE%g
s%@CANADIAN_FALSE@%$CANADIAN_FALSE%g
@@ -7521,6 +7637,7 @@ s%@NEEDS_DATA_START_TRUE@%$NEEDS_DATA_START_TRUE%g
s%@NEEDS_DATA_START_FALSE@%$NEEDS_DATA_START_FALSE%g
s%@GCC_UNWIND_INCLUDE@%$GCC_UNWIND_INCLUDE%g
s%@AM_RUNTESTFLAGS@%$AM_RUNTESTFLAGS%g
+s%@GCJVERSION@%$GCJVERSION%g
s%@ALLOCA@%$ALLOCA%g
s%@PERL@%$PERL%g
s%@SYSDEP_SOURCES@%$SYSDEP_SOURCES%g
@@ -7743,8 +7860,8 @@ fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
-ac_sources="include/$PLATFORMH java/io/natFile${PLATFORM}.cc java/io/natFileDescriptor${PLATFORM}.cc java/lang/${PLATFORM}Process.java java/lang/nat${PLATFORM}Process.cc include/$GCHDR include/$THREADH sysdep/$sysdeps_dir $SIGNAL_HANDLER"
-ac_dests="include/platform.h java/io/natFile.cc java/io/natFileDescriptor.cc java/lang/ConcreteProcess.java java/lang/natConcreteProcess.cc include/java-gc.h include/java-threads.h sysdep include/java-signal.h"
+ac_sources="include/$PLATFORMH java/io/natFile${FILE-${PLATFORM}}.cc java/io/natFileDescriptor${FILE-${PLATFORM}}.cc java/lang/${PLATFORM}Process.java java/lang/nat${PLATFORM}Process.cc include/$GCHDR include/$THREADH sysdep/$sysdeps_dir/locks.h $SIGNAL_HANDLER"
+ac_dests="include/platform.h java/io/natFile.cc java/io/natFileDescriptor.cc java/lang/ConcreteProcess.java java/lang/natConcreteProcess.cc include/java-gc.h include/java-threads.h sysdep/locks.h include/java-signal.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
diff --git a/libjava/configure.host b/libjava/configure.host
index f09ea5f3cc4..16e4cd8baa4 100644
--- a/libjava/configure.host
+++ b/libjava/configure.host
@@ -26,6 +26,8 @@
# sysdeps_dir Directory containing system-dependent headers
# slow_pthread_self The synchronization code should try to avoid
# pthread_self calls by caching thread IDs in a hashtable
+# can_unwind_signal Set to "yes" if the EH unwinder supports throwing
+# from a signal handler.
libgcj_flags=
libgcj_cflags=
@@ -36,6 +38,7 @@ enable_java_net_default=yes
enable_hash_synchronization_default=no
sysdeps_dir=generic
slow_pthread_self=
+can_unwind_signal=no
case "${target_optspace}:${host}" in
yes:*)
@@ -58,7 +61,9 @@ echo "$target"
DIVIDESPEC=-fuse-divide-subroutine
EXCEPTIONSPEC=-fnon-call-exceptions
+CHECKREFSPEC=
+# This case statement supports per-CPU defaults.
case "${host}" in
mips-tx39-*|mipstx39-unknown-*)
libgcj_flags="${libgcj_flags} -G 0"
@@ -66,6 +71,7 @@ case "${host}" in
AM_RUNTESTFLAGS="--target_board=jmr3904-sim"
# Use "Ecos" processes since they are a no-op.
PROCESS=Ecos
+ FILE=Posix
enable_java_net_default=no
enable_getenv_properties_default=no
;;
@@ -85,16 +91,12 @@ case "${host}" in
libgcj_interpreter=yes
enable_hash_synchronization_default=yes
;;
- powerpc*-linux*)
+ powerpc*-*)
sysdeps_dir=powerpc
libgcj_interpreter=yes
enable_hash_synchronization_default=yes
slow_pthread_self=yes
;;
- powerpc*-darwin*)
- sysdeps_dir=powerpc
- libgcj_interpreter=yes
- ;;
sparc-*)
;;
ia64-*)
@@ -106,12 +108,36 @@ case "${host}" in
xscale*-elf)
with_libffi_default=no
PROCESS=Ecos
+ FILE=Posix
+ CHECKREFSPEC=-fcheck-references
+ EXCEPTIONSPEC=
enable_java_net_default=no
enable_getenv_properties_default=no
enable_main_args_default=no
;;
esac
+# This case statement supports generic port properties and may refine
+# the above per-CPU defaults. Note: If your OS implements
+# MD_FALLBACK_FRAME_STATE_FOR, then you want to set can_unwind_signal
+# here.
+case "${host}" in
+ i[34567]86*-linux* | \
+ powerpc*-linux* | \
+ alpha*-linux* | \
+ sparc*-linux* | \
+ ia64-*)
+ can_unwind_signal=yes
+ ;;
+ *-*-darwin*)
+ enable_hash_synchronization_default=no
+ slow_pthread_self=
+ ;;
+ *-*-freebsd*)
+ slow_pthread_self=
+ ;;
+esac
+
libgcj_cflags="${libgcj_cflags} ${libgcj_flags}"
libgcj_cxxflags="${libgcj_cxxflags} ${libgcj_flags}"
libgcj_javaflags="${libgcj_javaflags} ${libgcj_flags}"
diff --git a/libjava/configure.in b/libjava/configure.in
index b8cfddc6e25..14ff72569f1 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -153,6 +153,14 @@ fi
AC_LANG_RESTORE
AC_MSG_RESULT($ac_exception_model_name)
+# If we are non using SJLJ exceptions, and this host does not have support
+# for unwinding from a signal handler, enable checked dereferences and divides.
+if test $can_unwind_signal = no && test $enable_sjlj_exceptions = no; then
+ CHECKREFSPEC=-fcheck-references
+ DIVIDESPEC=-fuse-divide-subroutine
+ EXCEPTIONSPEC=
+fi
+
dnl See if the user wants to disable java.net. This is the mildly
dnl ugly way that we admit that target-side configuration sucks.
AC_ARG_ENABLE(java-net,
@@ -176,7 +184,7 @@ LIBFFI=
LIBFFIINCS=
if test "$with_libffi" != no; then
AC_DEFINE(USE_LIBFFI)
- LIBFFI=../libffi/libfficonvenience.la
+ LIBFFI=../libffi/libffi_convenience.la
LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I$(MULTIBUILDTOP)../libffi/include'
fi
AC_SUBST(LIBFFI)
@@ -241,8 +249,8 @@ dnl to create the link will fail.
test -d java || mkdir java
test -d java/io || mkdir java/io
test -d gnu || mkdir gnu
-AC_LINK_FILES(java/io/natFile${PLATFORM}.cc, java/io/natFile.cc)
-AC_LINK_FILES(java/io/natFileDescriptor${PLATFORM}.cc, java/io/natFileDescriptor.cc)
+AC_LINK_FILES(java/io/natFile${FILE-${PLATFORM}}.cc, java/io/natFile.cc)
+AC_LINK_FILES(java/io/natFileDescriptor${FILE-${PLATFORM}}.cc, java/io/natFileDescriptor.cc)
dnl Likewise for ConcreteProcess.java and natConcreteProcess.cc.
test -d java/lang || mkdir java/lang
@@ -290,14 +298,11 @@ GCTESTSPEC=
case "$GC" in
boehm)
AC_MSG_RESULT(boehm)
- GCDEPS='$(top_builddir)/../boehm-gc/libgcjgc.la'
- # We include the path to the boehm-gc build directory.
- # See Makefile.am to understand why.
- GCLIBS="$GCDEPS -L\$(here)/../boehm-gc/$libsubdir"
+ GCLIBS=../boehm-gc/libgcjgc_convenience.la
GCINCS='-I$(top_srcdir)/../boehm-gc/include'
- GCSPEC='-lgcjgc'
JC1GCSPEC='-fuse-boehm-gc'
GCTESTSPEC="-L`pwd`/../boehm-gc/.libs -rpath `pwd`/../boehm-gc/.libs"
+
dnl We also want to pick up some cpp flags required when including
dnl boehm-config.h. Yuck.
GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
@@ -351,6 +356,7 @@ case "$THREADS" in
;;
esac
+THREADLDFLAGS=
THREADLIBS=
THREADINCS=
THREADDEPS=
@@ -369,7 +375,7 @@ changequote([,])
# Before FreeBSD 5, it didn't have -lpthread (or any library which
# merely adds pthread_* functions) but it does have a -pthread switch
# which is required at link-time to select -lc_r *instead* of -lc.
- THREADLIBS=-pthread
+ THREADLDFLAGS=-pthread
# Don't set THREADSPEC here as might be expected since -pthread is
# not processed when found within a spec file, it must come from
# the command line. For now, the user must provide the -pthread
@@ -381,7 +387,7 @@ changequote([,])
# FreeBSD 5 implements a model much closer to other modern UNIX
# which support threads. However, it still does not support
# -lpthread.
- THREADLIBS=-pthread
+ THREADLDFLAGS=-pthread
THREADSPEC=-lc_r
;;
*)
@@ -420,8 +426,10 @@ AC_SUBST(THREADINCS)
AC_SUBST(THREADDEPS)
AC_SUBST(THREADOBJS)
AC_SUBST(THREADSPEC)
+AC_SUBST(THREADLDFLAGS)
-AC_LINK_FILES(sysdep/$sysdeps_dir, sysdep)
+if test -d sysdep; then true; else mkdir sysdep; fi
+AC_LINK_FILES(sysdep/$sysdeps_dir/locks.h, sysdep/locks.h)
HASH_SYNC_SPEC=
# Hash synchronization is only useful with posix threads right now.
@@ -441,6 +449,16 @@ NATIVE=yes
# We're in the tree with gcc, and need to include some of its headers.
GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
+# Figure out where generated headers like libgcj-config.h get installed.
+changequote(,)dnl
+gcc_version_trigger=${libgcj_basedir}/../gcc/version.c
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+tool_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include
+changequote([,])dnl
+AC_SUBST(tool_include_dir)
+AC_SUBST(gcc_version)
+
if test -n "${with_cross_host}"; then
# We are being configured with a cross compiler. AC_REPLACE_FUNCS
# may not work correctly, because the compiler may not be able to
@@ -451,6 +469,7 @@ if test -n "${with_cross_host}"; then
AC_DEFINE(HAVE_MEMMOVE)
AC_DEFINE(HAVE_MEMCPY)
AC_DEFINE(HAVE_STRERROR)
+ AC_DEFINE(HAVE_TIME)
AC_DEFINE(HAVE_GMTIME_R)
AC_DEFINE(HAVE_LOCALTIME_R)
dnl This is only for POSIX threads.
@@ -461,9 +480,6 @@ if test -n "${with_cross_host}"; then
dnl Assume we do not have getuid and friends.
AC_DEFINE(NO_GETUID)
- ZLIBSPEC=-lzgcj
- ZLIBTESTSPEC="-L`pwd`/../zlib/.libs -rpath `pwd`/../zlib/.libs"
-
# If Canadian cross, then don't pick up tools from the build
# directory.
if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
@@ -479,8 +495,19 @@ else
AC_CHECK_FUNCS(nl_langinfo setlocale)
AC_CHECK_FUNCS(inet_aton inet_addr, break)
AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
- AC_CHECK_FUNCS(backtrace fork execvp pipe sigaction)
+ AC_CHECK_FUNCS(fork execvp pipe sigaction)
AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h)
+ AC_CHECK_FUNC(backtrace, [
+ case "$host" in
+ ia64-*-linux*)
+ # Has broken backtrace()
+ ;;
+ *)
+ AC_DEFINE(HAVE_BACKTRACE)
+ ;;
+ esac
+ ])
+
AC_CHECK_LIB(dl, dladdr, [
AC_DEFINE(HAVE_DLADDR)])
AC_CHECK_FILES(/proc/self/exe, [
@@ -660,10 +687,7 @@ else
SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets"
if test "$with_system_zlib" = yes; then
- AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=-lzgcj)
- else
- ZLIBSPEC=-lzgcj
- ZLIBTESTSPEC="-L`pwd`/../zlib/.libs -rpath `pwd`/../zlib/.libs"
+ AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=)
fi
# On Solaris, and maybe other architectures, the Boehm collector
@@ -720,21 +744,22 @@ CPPFLAGS=$GCJ_SAVE_CPPFLAGS
AC_COMPILE_CHECK_SIZEOF(void *)
ZLIBS=
-ZDEPS=
+SYS_ZLIBS=
ZINCS=
-if test "x$ZLIBSPEC" = "x-lzgcj"; then
- # We include the path to the zlib build directory.
- # See Makefile.am to understand why.
- ZDEPS='$(top_builddir)/../zlib/libzgcj.la'
- ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
+
+if test -z "$ZLIBSPEC"; then
+ # Use zlib from the GCC tree.
ZINCS='-I$(top_srcdir)/../zlib'
+ ZLIBS=../zlib/libzgcj_convenience.la
else
- ZLIBS="$ZLIBSPEC"
+ # System's zlib.
+ SYS_ZLIBS="$ZLIBSPEC"
fi
AC_SUBST(ZLIBS)
-AC_SUBST(ZDEPS)
+AC_SUBST(SYS_ZLIBS)
AC_SUBST(ZINCS)
AC_SUBST(DIVIDESPEC)
+AC_SUBST(CHECKREFSPEC)
AC_SUBST(EXCEPTIONSPEC)
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
@@ -746,6 +771,14 @@ AC_SUBST(GCC_UNWIND_INCLUDE)
AC_SUBST(AM_RUNTESTFLAGS)
+# Determine gcj version number.
+changequote(<<,>>)
+gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`
+changequote([,])
+GCJVERSION=$gcjversion
+AC_SUBST(GCJVERSION)
+AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERSION", [Short GCJ version ID])
+
dnl Work around a g++ bug. Reported to gcc-bugs@gcc.gnu.org on Jan 22, 2000.
AC_MSG_CHECKING([for g++ -ffloat-store bug])
save_CFLAGS="$CFLAGS"
@@ -834,19 +867,25 @@ case "${host}" in
i?86-*-linux*)
SIGNAL_HANDLER=include/i386-signal.h
;;
- sparc-sun-solaris*)
+ sparc*-sun-solaris*)
SIGNAL_HANDLER=include/sparc-signal.h
;;
# ia64-*)
# SYSDEP_SOURCES=sysdep/ia64.c
# test -d sysdep || mkdir sysdep
# ;;
+ ia64-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
+ ;;
powerpc-*-linux*)
SIGNAL_HANDLER=include/dwarf2-signal.h
;;
alpha*-*-linux*)
SIGNAL_HANDLER=include/dwarf2-signal.h
;;
+ sparc*-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
+ ;;
*mingw*)
SIGNAL_HANDLER=include/win32-signal.h
;;
diff --git a/libjava/exception.cc b/libjava/exception.cc
index 176e2488d0b..917d6e10a76 100644
--- a/libjava/exception.cc
+++ b/libjava/exception.cc
@@ -23,7 +23,8 @@ details. */
// stdlib.h's abort().
namespace std
{
- __attribute__ ((__noreturn__)) void abort ()
+ static __attribute__ ((__noreturn__)) void
+ abort ()
{
::abort ();
}
diff --git a/libjava/gcj/Makefile.am b/libjava/gcj/Makefile.am
index aa5f6fb16cb..e5b80e678d1 100644
--- a/libjava/gcj/Makefile.am
+++ b/libjava/gcj/Makefile.am
@@ -3,4 +3,7 @@
AUTOMAKE_OPTIONS = foreign
gcjdir = $(includedir)/gcj
-gcj_HEADERS = array.h cni.h field.h javaprims.h method.h libgcj-config.h
+gcj_HEADERS = array.h cni.h field.h javaprims.h method.h
+
+toolgcjdir = @tool_include_dir@/gcj
+toolgcj_HEADERS = libgcj-config.h
diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in
index df256bcd4db..9260947c7a8 100644
--- a/libjava/gcj/Makefile.in
+++ b/libjava/gcj/Makefile.in
@@ -67,6 +67,7 @@ AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
AR = @AR@
AS = @AS@
CC = @CC@
+CHECKREFSPEC = @CHECKREFSPEC@
COMPPATH = @COMPPATH@
CXX = @CXX@
CXXCPP = @CXXCPP@
@@ -80,6 +81,7 @@ GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
+GCJVERSION = @GCJVERSION@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
@@ -109,29 +111,35 @@ RANLIB = @RANLIB@
STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
+SYS_ZLIBS = @SYS_ZLIBS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
+THREADLDFLAGS = @THREADLDFLAGS@
THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
VERSION = @VERSION@
-ZDEPS = @ZDEPS@
ZINCS = @ZINCS@
ZLIBS = @ZLIBS@
ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
+gcc_version = @gcc_version@
glibjava_CXX = @glibjava_CXX@
here = @here@
libgcj_basedir = @libgcj_basedir@
mkinstalldirs = @mkinstalldirs@
+tool_include_dir = @tool_include_dir@
AUTOMAKE_OPTIONS = foreign
gcjdir = $(includedir)/gcj
-gcj_HEADERS = array.h cni.h field.h javaprims.h method.h libgcj-config.h
+gcj_HEADERS = array.h cni.h field.h javaprims.h method.h
+
+toolgcjdir = @tool_include_dir@/gcj
+toolgcj_HEADERS = libgcj-config.h
CONFIG_HEADER = ../include/config.h libgcj-config.h
CONFIG_CLEAN_FILES =
-HEADERS = $(gcj_HEADERS)
+HEADERS = $(gcj_HEADERS) $(toolgcj_HEADERS)
DIST_COMMON = ./stamp-h2.in Makefile.am Makefile.in libgcj-config.h.in
@@ -193,6 +201,21 @@ uninstall-gcjHEADERS:
rm -f $(DESTDIR)$(gcjdir)/$$p; \
done
+install-toolgcjHEADERS: $(toolgcj_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(toolgcjdir)
+ @list='$(toolgcj_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(toolgcjdir)/$$p"; \
+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(toolgcjdir)/$$p; \
+ done
+
+uninstall-toolgcjHEADERS:
+ @$(NORMAL_UNINSTALL)
+ list='$(toolgcj_HEADERS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(toolgcjdir)/$$p; \
+ done
+
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
@@ -256,20 +279,20 @@ all-recursive-am: libgcj-config.h
install-exec-am:
install-exec: install-exec-am
-install-data-am: install-gcjHEADERS
+install-data-am: install-gcjHEADERS install-toolgcjHEADERS
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
-uninstall-am: uninstall-gcjHEADERS
+uninstall-am: uninstall-gcjHEADERS uninstall-toolgcjHEADERS
uninstall: uninstall-am
all-am: Makefile $(HEADERS) libgcj-config.h
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(gcjdir)
+ $(mkinstalldirs) $(DESTDIR)$(gcjdir) $(DESTDIR)$(toolgcjdir)
mostlyclean-generic:
@@ -302,11 +325,12 @@ maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-uninstall-gcjHEADERS install-gcjHEADERS tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
-install-exec-am install-exec install-data-am install-data install-am \
-install uninstall-am uninstall all-redirect all-am all installdirs \
+uninstall-gcjHEADERS install-gcjHEADERS uninstall-toolgcjHEADERS \
+install-toolgcjHEADERS tags mostlyclean-tags distclean-tags clean-tags \
+maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck all-recursive-am install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
diff --git a/libjava/gcj/cni.h b/libjava/gcj/cni.h
index b1254a2e191..08b55c3c7f2 100644
--- a/libjava/gcj/cni.h
+++ b/libjava/gcj/cni.h
@@ -2,7 +2,7 @@
// This file describes the Cygnus Native Interface, CNI.
// It provides a nicer interface to many of the things in gcj/javaprims.h.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2002 Free Software Foundation
This file is part of libgcj.
@@ -131,6 +131,12 @@ JvAttachCurrentThread (jstring name, java::lang::ThreadGroup* group)
return _Jv_AttachCurrentThread (name, group);
}
+extern inline java::lang::Thread*
+JvAttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group)
+{
+ return _Jv_AttachCurrentThreadAsDaemon (name, group);
+}
+
extern inline jint
JvDetachCurrentThread (void)
{
diff --git a/libjava/gcj/javaprims.h b/libjava/gcj/javaprims.h
index c4d86fb126e..4337f56d566 100644
--- a/libjava/gcj/javaprims.h
+++ b/libjava/gcj/javaprims.h
@@ -418,6 +418,8 @@ jint
_Jv_AttachCurrentThread(java::lang::Thread* thread);
extern "C" java::lang::Thread*
_Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group);
+extern "C" java::lang::Thread*
+_Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group);
extern "C" jint _Jv_DetachCurrentThread (void);
extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
diff --git a/libjava/gcj/libgcj-config.h.in b/libjava/gcj/libgcj-config.h.in
index 14ccc946fd7..715c3bc37eb 100644
--- a/libjava/gcj/libgcj-config.h.in
+++ b/libjava/gcj/libgcj-config.h.in
@@ -1,5 +1,10 @@
-/* The header derived from this file is installed, so this file should
- only contain defines which are named safely. */
+/* The header file derived from this file is installed in a target and
+ compiler version specific directory. Do not add definitions which
+ are intended to be different for different multilibs, as we do not
+ currently have a mechanism to support this.
+
+ Also be sure to use safely named macros, as this file will be
+ included in user code. */
/* Define if hash synchronization is in use. */
#undef JV_HASH_SYNCHRONIZATION
diff --git a/libjava/gnu/gcj/convert/Convert.java b/libjava/gnu/gcj/convert/Convert.java
index 820fe14a9f3..d16adc13014 100644
--- a/libjava/gnu/gcj/convert/Convert.java
+++ b/libjava/gnu/gcj/convert/Convert.java
@@ -40,7 +40,7 @@ public class Convert
static void version ()
{
- System.out.println("jv-convert (GNU "
+ System.out.println("jv-convert ("
+ System.getProperty("java.vm.name")
+ ") "
+ System.getProperty("java.vm.version"));
diff --git a/libjava/gnu/gcj/io/shs.h b/libjava/gnu/gcj/io/shs.h
index 9b7bb2462c5..1b435c5df8e 100644
--- a/libjava/gnu/gcj/io/shs.h
+++ b/libjava/gnu/gcj/io/shs.h
@@ -20,6 +20,14 @@
#else
# if HAVE_STDINT_H
# include <stdint.h>
+# else
+typedef unsigned int uint8_t __attribute__((mode(QI)));
+/* This is a blatant hack: on Solaris 2.5, pthread.h defines uint32_t
+ in pthread.h, which we sometimes include. We protect our
+ definition the same way Solaris 2.5 does, to avoid redefining it. */
+# ifndef _UINT32_T
+typedef unsigned int uint32_t __attribute__((mode(SI)));
+# endif
# endif
#endif
diff --git a/libjava/gnu/gcj/natCore.cc b/libjava/gnu/gcj/natCore.cc
index 8e7a0240527..75a7ad05ae1 100644
--- a/libjava/gnu/gcj/natCore.cc
+++ b/libjava/gnu/gcj/natCore.cc
@@ -1,6 +1,6 @@
// natCore -- C++ side of Core
-/* Copyright (C) 2001 Free Software Foundation
+/* Copyright (C) 2001, 2002 Free Software Foundation
This file is part of libgcj.
@@ -40,7 +40,7 @@ void _Jv_RegisterResource (void *vptr)
// These are permanent data structures for now. This routine is
// called from a static constructor, so we shouldn't depend on too
// much existing infrastructure.
- core_chain *cc = (core_chain *) malloc (sizeof (core_chain));
+ core_chain *cc = (core_chain *) _Jv_Malloc (sizeof (core_chain));
cc->name_length = ((int *)rptr)[0];
cc->data_length = ((int *)rptr)[1];
@@ -56,10 +56,18 @@ void _Jv_RegisterResource (void *vptr)
gnu::gcj::Core *
gnu::gcj::Core::create (jstring name)
{
- char buf[name->length() + 1];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (name) + 1);
jsize total = JvGetStringUTFRegion (name, 0, name->length(), buf);
buf[total] = '\0';
+ // Usually requests here end up as an absolute URL. We strip the
+ // initial `/'.
+ if (buf[0] == '/')
+ {
+ ++buf;
+ --total;
+ }
+
core_chain *node = root;
while (node)
diff --git a/libjava/gnu/gcj/protocol/http/Connection.java b/libjava/gnu/gcj/protocol/http/Connection.java
index 5ff1c321ac0..10fbfd66723 100644
--- a/libjava/gnu/gcj/protocol/http/Connection.java
+++ b/libjava/gnu/gcj/protocol/http/Connection.java
@@ -125,7 +125,7 @@ class Connection extends HttpURLConnection
// TODO: public boolean usingProxy()
public boolean usingProxy()
{
- throw new InternalError("HttpURLConnection.usingProxy not implemented");
+ return false;
}
// Override default method in URLConnection.
diff --git a/libjava/gnu/java/beans/BeanInfoEmbryo.java b/libjava/gnu/java/beans/BeanInfoEmbryo.java
index 4aed20b9f86..473aa790cba 100644
--- a/libjava/gnu/java/beans/BeanInfoEmbryo.java
+++ b/libjava/gnu/java/beans/BeanInfoEmbryo.java
@@ -1,5 +1,5 @@
/* gnu.java.beans.BeanInfoEmbryo
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -130,14 +130,15 @@ public class BeanInfoEmbryo {
}
public boolean hasMethod(MethodDescriptor m) {
- for(int i=0;i<methods.size();i++) {
- Method thisMethod = ((MethodDescriptor)methods.elementAt(i)).getMethod();
- if(m.getMethod().getName().equals(thisMethod.getName())
- && ArrayHelper.equalsArray(m.getMethod().getParameterTypes(), thisMethod.getParameterTypes())) {
- return true;
- }
- }
- return false;
+ for(int i=0;i<methods.size();i++) {
+ Method thisMethod = ((MethodDescriptor)methods.elementAt(i)).getMethod();
+ if(m.getMethod().getName().equals(thisMethod.getName())
+ && Arrays.equals(m.getMethod().getParameterTypes(),
+ thisMethod.getParameterTypes())) {
+ return true;
+ }
+ }
+ return false;
}
public void addMethod(MethodDescriptor m) {
methods.addElement(m);
diff --git a/libjava/gnu/java/beans/editors/NativeBooleanEditor.java b/libjava/gnu/java/beans/editors/NativeBooleanEditor.java
index 1ba8beb5ceb..9fb14381bb5 100644
--- a/libjava/gnu/java/beans/editors/NativeBooleanEditor.java
+++ b/libjava/gnu/java/beans/editors/NativeBooleanEditor.java
@@ -1,5 +1,5 @@
/* gnu.java.beans.editors.NativeBooleanEditor
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,12 +54,15 @@ import java.beans.*;
public class NativeBooleanEditor extends PropertyEditorSupport {
String[] tags = {"true","false"};
- /** setAsText for boolean checks for true or false or t or f. "" also means false. **/
+ /**
+ * setAsText for boolean checks for true or false or t or f.
+ * "" also means false.
+ **/
public void setAsText(String val) throws IllegalArgumentException {
if(val.equalsIgnoreCase("true") || val.equalsIgnoreCase("t")) {
- setValue(Boolean.FALSE);
- } else if(val.equalsIgnoreCase("false") || val.equalsIgnoreCase("f") || val.equals("")) {
setValue(Boolean.TRUE);
+ } else if(val.equalsIgnoreCase("false") || val.equalsIgnoreCase("f") || val.equals("")) {
+ setValue(Boolean.FALSE);
} else {
throw new IllegalArgumentException("Value must be true, false, t, f or empty.");
}
diff --git a/libjava/gnu/java/rmi/registry/RegistryImpl.java b/libjava/gnu/java/rmi/registry/RegistryImpl.java
index b38ee5cab15..fdf4506f32d 100644
--- a/libjava/gnu/java/rmi/registry/RegistryImpl.java
+++ b/libjava/gnu/java/rmi/registry/RegistryImpl.java
@@ -1,5 +1,5 @@
/*
- Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -103,9 +103,35 @@ public String[] list() throws RemoteException, AccessException {
return (strings);
}
+public static void version() {
+ System.out.println("rmiregistry ("
+ + System.getProperty("java.vm.name")
+ + ") "
+ + System.getProperty("java.vm.version"));
+ System.out.println("Copyright 2002 Free Software Foundation, Inc.");
+ System.out.println("This is free software; see the source for copying conditions. There is NO");
+ System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
+ System.exit(0);
+}
+
+public static void help() {
+ System.out.println(
+"Usage: rmiregistry [OPTION | PORT]\n" +
+"\n" +
+" --help Print this help, then exit\n" +
+" --version Print version number, then exit\n");
+ System.exit(0);
+}
+
public static void main(String[] args) {
int port = Registry.REGISTRY_PORT;
if (args.length > 0) {
+ if (args[0].equals("--version")) {
+ version();
+ }
+ else if (args[0].equals("--help")) {
+ help();
+ }
try {
port = Integer.parseInt(args[0]);
}
diff --git a/libjava/gnu/java/rmi/rmic/RMIC.java b/libjava/gnu/java/rmi/rmic/RMIC.java
index f3ff128f2a4..ef4473247d6 100644
--- a/libjava/gnu/java/rmi/rmic/RMIC.java
+++ b/libjava/gnu/java/rmi/rmic/RMIC.java
@@ -939,7 +939,7 @@ private void parseOptions() {
usage();
}
else if (arg.equals("-version")) {
- System.out.println("rmic (GNU "
+ System.out.println("rmic ("
+ System.getProperty("java.vm.name")
+ ") "
+ System.getProperty("java.vm.version"));
diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in
index 3039c8c2b87..1d38fcdb4d3 100644
--- a/libjava/include/Makefile.in
+++ b/libjava/include/Makefile.in
@@ -67,6 +67,7 @@ AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
AR = @AR@
AS = @AS@
CC = @CC@
+CHECKREFSPEC = @CHECKREFSPEC@
COMPPATH = @COMPPATH@
CXX = @CXX@
CXXCPP = @CXXCPP@
@@ -80,6 +81,7 @@ GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
+GCJVERSION = @GCJVERSION@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
@@ -109,21 +111,24 @@ RANLIB = @RANLIB@
STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
+SYS_ZLIBS = @SYS_ZLIBS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
+THREADLDFLAGS = @THREADLDFLAGS@
THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
VERSION = @VERSION@
-ZDEPS = @ZDEPS@
ZINCS = @ZINCS@
ZLIBS = @ZLIBS@
ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
+gcc_version = @gcc_version@
glibjava_CXX = @glibjava_CXX@
here = @here@
libgcj_basedir = @libgcj_basedir@
mkinstalldirs = @mkinstalldirs@
+tool_include_dir = @tool_include_dir@
AUTOMAKE_OPTIONS = foreign
diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in
index ad8ab45fcd3..9bbd219168f 100644
--- a/libjava/include/config.h.in
+++ b/libjava/include/config.h.in
@@ -117,6 +117,10 @@
/* Define if global `timezone' exists. */
#undef HAVE_TIMEZONE
+/* Define if if the synchronization code should try to avoid pthread_self
+ calls by caching thread IDs in a hashtable. */
+#undef SLOW_PTHREAD_SELF
+
/* Define if you have the appropriate function. */
#undef HAVE_ACCESS
#undef HAVE_STAT
@@ -410,6 +414,9 @@
/* The number of bytes in type void * */
#undef SIZEOF_VOID_P
+/* Short GCJ version ID */
+#undef GCJVERSION
+
/* Define if <inttypes.h> is available */
#undef HAVE_INTTYPES_H
diff --git a/libjava/include/dwarf2-signal.h b/libjava/include/dwarf2-signal.h
index 3a662aec2d9..b7530b2cbf3 100644
--- a/libjava/include/dwarf2-signal.h
+++ b/libjava/include/dwarf2-signal.h
@@ -21,7 +21,7 @@ details. */
#undef HANDLE_FPE
#define SIGNAL_HANDLER(_name) \
-static void _Jv_##_name (int, siginfo_t *, void *_p)
+static void _Jv_##_name (int, siginfo_t *_sip, void *_p)
class java::lang::Throwable;
@@ -41,6 +41,78 @@ do \
_sc->sc_pc += 4; \
} \
while (0)
+
+#elif defined(__ia64__)
+
+#define MAKE_THROW_FRAME(_exception) \
+do \
+{ \
+ /* IA-64 either leaves PC pointing at a faulting instruction or the \
+ following instruction, depending on the signal. SEGV always does \
+ the former, so we adjust the saved PC to point to the following \
+ instruction; this is what the handler in libgcc expects. */ \
+ /* Note that we are lying to the unwinder here, which expects the \
+ faulting pc, not pc+1. But we claim the unwind information can't \
+ be changed by such a ld or st instruction, so it doesn't matter. */ \
+ struct sigcontext *_sc = (struct sigcontext *)_p; \
+ _sc->sc_ip++; \
+} \
+while (0)
+#elif defined(__sparc__)
+/* We could do the unwind of the signal frame quickly by hand here like
+ sparc-signal.h does under Solaris, but that makes debugging unwind
+ failures almost impossible. */
+#if !defined(__arch64__)
+#define MAKE_THROW_FRAME(_exception) \
+do \
+{ \
+ /* Sparc-32 leaves PC pointing at a faulting instruction \
+ always. \
+ We advance the PC one instruction past the exception causing PC. \
+ This is done because FDEs are found with "context->ra - 1" in the \
+ unwinder. \
+ Also, the dwarf2 unwind machinery is going to add 8 to the \
+ PC it uses on Sparc. So we adjust the PC here. We do it here \
+ because we run once for such an exception, however the Sparc specific\
+ unwind can run multiple times for the same exception and it would \
+ adjust the PC more than once resulting in a bogus value. */ \
+ struct sig_regs { \
+ unsigned int psr, pc, npc, y, u_regs[16]; \
+ } *regp; \
+ unsigned int insn; \
+ __asm__ __volatile__("ld [%%i7 + 8], %0" : "=r" (insn)); \
+ /* mov __NR_sigaction, %g1; Old signal stack layout */ \
+ if (insn == 0x821020d8) \
+ regp = (struct sig_regs *) _sip; \
+ else \
+ /* mov __NR_rt_sigaction, %g1; New signal stack layout */ \
+ regp = (struct sig_regs *) (_sip + 1); \
+ regp->pc = ((regp->pc + 4) - 8); \
+} \
+while (0)
+#else
+#define MAKE_THROW_FRAME(_exception) \
+do \
+{ \
+ /* Sparc-64 leaves PC pointing at a faulting instruction \
+ always. \
+ We advance the PC one instruction past the exception causing PC. \
+ This is done because FDEs are found with "context->ra - 1" in the \
+ unwinder. \
+ Also, the dwarf2 unwind machinery is going to add 8 to the \
+ PC it uses on Sparc. So we adjust the PC here. We do it here \
+ because we run once for such an exception, however the Sparc specific\
+ unwind can run multiple times for the same exception and it would \
+ adjust the PC more than once resulting in a bogus value. */ \
+ struct pt_regs { \
+ unsigned long u_regs[16]; \
+ unsigned long tstate, tpc, tnpc; \
+ unsigned int y, fprs; \
+ } *regp = (struct pt_regs *) (_sip + 1); \
+ regp->tpc = ((regp->tpc + 4) - 8); \
+} \
+while (0)
+#endif
#else
#define MAKE_THROW_FRAME(_exception) \
do \
@@ -50,6 +122,7 @@ do \
while (0)
#endif
+#if !(defined(__ia64__) || defined(__sparc__))
#define INIT_SEGV \
do \
{ \
@@ -82,4 +155,41 @@ while (0)
* go away once all systems have pthreads libraries that are
* compiled with full unwind info. */
+#else /* __ia64__ || __sparc__ */
+
+// FIXME: We shouldn't be using libc_sigaction here, since it should
+// be glibc private. But using syscall here would mean translating to
+// the kernel's struct sigaction and argument sequence, which we
+// shouldn't either. The right solution is to call sigaction and to
+// make sure that we can unwind correctly through the pthread signal
+// wrapper.
+extern "C" int __libc_sigaction (int __sig,
+ __const struct sigaction *__restrict __act,
+ struct sigaction *__restrict __oact) throw ();
+
+#define INIT_SEGV \
+do \
+ { \
+ nullp = new java::lang::NullPointerException (); \
+ struct sigaction act; \
+ act.sa_sigaction = _Jv_catch_segv; \
+ sigemptyset (&act.sa_mask); \
+ act.sa_flags = SA_SIGINFO; \
+ __libc_sigaction (SIGSEGV, &act, NULL); \
+ } \
+while (0)
+
+#define INIT_FPE \
+do \
+ { \
+ arithexception = new java::lang::ArithmeticException \
+ (JvNewStringLatin1 ("/ by zero")); \
+ struct sigaction act; \
+ act.sa_sigaction = _Jv_catch_fpe; \
+ sigemptyset (&act.sa_mask); \
+ act.sa_flags = SA_SIGINFO; \
+ __libc_sigaction (SIGFPE, &act, NULL); \
+ } \
+while (0)
+#endif /* __ia64__ || __sparc__ */
#endif /* JAVA_SIGNAL_H */
diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h
index 737b3689d97..6ad496c47a4 100644
--- a/libjava/include/i386-signal.h
+++ b/libjava/include/i386-signal.h
@@ -1,6 +1,7 @@
-// i386-signal.h - Catch runtime signals and turn them into exceptions.
+// i386-signal.h - Catch runtime signals and turn them into exceptions
+// on an i386 based Linux system.
-/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation
This file is part of libgcj.
@@ -8,10 +9,6 @@ This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
-/* This technique should work for all i386 based Unices which conform
- * to iBCS2. This includes all versions of Linux more recent than 1.3
- */
-
#ifndef JAVA_SIGNAL_H
#define JAVA_SIGNAL_H 1
@@ -99,28 +96,40 @@ do \
} \
while (0)
-#define INIT_SEGV \
-do \
- { \
- nullp = new java::lang::NullPointerException (); \
- struct sigaction act; \
- act.sa_handler = catch_segv; \
- sigemptyset (&act.sa_mask); \
- act.sa_flags = 0; \
- syscall (SYS_sigaction, SIGSEGV, &act, NULL); \
- } \
+/* We use old_kernel_sigaction here because we're calling the kernel
+ directly rather than via glibc. The sigaction structure that the
+ syscall uses is a different shape from the one in userland and not
+ visible to us in a header file so we define it here. */
+
+struct old_i386_kernel_sigaction {
+ void (*k_sa_handler) (int);
+ unsigned long k_sa_mask;
+ unsigned long k_sa_flags;
+ void (*sa_restorer) (void);
+};
+
+#define INIT_SEGV \
+do \
+ { \
+ nullp = new java::lang::NullPointerException (); \
+ struct old_i386_kernel_sigaction kact; \
+ kact.k_sa_handler = catch_segv; \
+ kact.k_sa_mask = 0; \
+ kact.k_sa_flags = 0; \
+ syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \
+ } \
while (0)
#define INIT_FPE \
do \
- { \
- arithexception = new java::lang::ArithmeticException \
+ { \
+ arithexception = new java::lang::ArithmeticException \
(JvNewStringLatin1 ("/ by zero")); \
- struct sigaction act; \
- act.sa_handler = catch_fpe; \
- sigemptyset (&act.sa_mask); \
- act.sa_flags = 0; \
- syscall (SYS_sigaction, SIGFPE, &act, NULL); \
+ struct old_i386_kernel_sigaction kact; \
+ kact.k_sa_handler = catch_fpe; \
+ kact.k_sa_mask = 0; \
+ kact.k_sa_flags = 0; \
+ syscall (SYS_sigaction, SIGFPE, &kact, NULL); \
} \
while (0)
@@ -133,9 +142,15 @@ while (0)
* when returning from a signal handler. If we return from our divide
* handler to a linuxthreads wrapper, we will lose the PC adjustment
* we made and return to the faulting instruction again. Using
- * syscall(SYS_sigaction) causes our handler to be called directly by
- * the kernel, bypassing any wrappers. This is a kludge, and a future
- * version of this handler will do something better. */
+ * syscall(SYS_sigaction) causes our handler to be called directly
+ * by the kernel, bypassing any wrappers.
+
+ * Also, there is at the present time no unwind info in the
+ * linuxthreads library's signal handlers and so we can't unwind
+ * through them anyway.
+
+ * Finally, the code that glibc uses to return from a signal handler
+ * is subject to change. */
#endif /* JAVA_SIGNAL_H */
diff --git a/libjava/include/java-insns.h b/libjava/include/java-insns.h
index 327fcd373b0..a065987fc51 100644
--- a/libjava/include/java-insns.h
+++ b/libjava/include/java-insns.h
@@ -1,6 +1,6 @@
// java-insns.h - Instruction encodings. This is -*- c++ -*-
-/* Copyright (C) 1999, 2001 Free Software Foundation
+/* Copyright (C) 1999, 2001, 2002 Free Software Foundation
This file is part of libgcj.
@@ -199,7 +199,9 @@ enum java_opcode
op_invokespecial = 0xb7,
op_invokestatic = 0xb8,
op_invokeinterface = 0xb9,
- op_xxxunusedxxx1 = 0xba,
+
+ // 0xba is unused.
+
op_new = 0xbb,
op_newarray = 0xbc,
op_anewarray = 0xbd,
diff --git a/libjava/include/jni.h b/libjava/include/jni.h
index d41a6a2d234..b5ce334b895 100644
--- a/libjava/include/jni.h
+++ b/libjava/include/jni.h
@@ -16,7 +16,7 @@ details. */
#include <gcj/libgcj-config.h>
-// We include <stdio.h> for compatibility with Sun's <jni.h>.
+/* We include <stdio.h> for compatibility with Sun's <jni.h>. */
#include <stdio.h>
#include <stdarg.h>
@@ -161,6 +161,7 @@ typedef void *jmethodID;
/* Version numbers. */
#define JNI_VERSION_1_1 0x00010001
#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
/* Used when releasing array elements. */
#define JNI_COMMIT 1
@@ -172,6 +173,12 @@ typedef void *jmethodID;
#define JNI_EDETACHED -2
#define JNI_EVERSION -3
+/* Linkage and calling conventions. This will need updating when we
+ support Windows DLLs. */
+#define JNIIMPORT
+#define JNIEXPORT
+#define JNICALL
+
#ifdef __cplusplus
extern "C"
{
@@ -635,6 +642,10 @@ struct JNINativeInterface
void (*DeleteWeakGlobalRef) (JNIEnv *, jweak);
jboolean (*ExceptionCheck) (JNIEnv *);
+
+ jobject (*NewDirectByteBuffer) (JNIEnv *, void *, jlong);
+ void * (*GetDirectBufferAddress) (JNIEnv *, jobject);
+ jlong (*GetDirectBufferCapacity) (JNIEnv *, jobject);
};
#ifdef __cplusplus
@@ -1516,6 +1527,15 @@ public:
jboolean ExceptionCheck ()
{ return p->ExceptionCheck (this); }
+
+ jobject NewDirectByteBuffer (void *addr, jlong capacity)
+ { return p->NewDirectByteBuffer (this, addr, capacity); }
+
+ void *GetDirectBufferAddress (jobject buf)
+ { return p->GetDirectBufferAddress (this, buf); }
+
+ jlong GetDirectBufferCapacity (jobject buf)
+ { return p->GetDirectBufferCapacity (this, buf); }
};
#endif /* __cplusplus */
@@ -1533,6 +1553,7 @@ struct JNIInvokeInterface
jint (*AttachCurrentThread) (JavaVM *, void **, void *);
jint (*DetachCurrentThread) (JavaVM *);
jint (*GetEnv) (JavaVM *, void **, jint);
+ jint (*AttachCurrentThreadAsDaemon) (JavaVM *, void **, void *);
};
#ifdef __cplusplus
@@ -1557,6 +1578,9 @@ public:
jint GetEnv (void **penv, jint version)
{ return functions->GetEnv (this, penv, version); }
+
+ jint AttachCurrentThreadAsDaemon (void **penv, void *args)
+ { return functions->AttachCurrentThreadAsDaemon (this, penv, args); }
};
#endif /* __cplusplus */
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index c505a72e6d0..fc3a7f73ecf 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -1,6 +1,6 @@
// jvm.h - Header file for private implementation information. -*- c++ -*-
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
This file is part of libgcj.
@@ -283,8 +283,10 @@ _Jv_GetArrayElementFromElementType (jobject array,
return elts;
}
-extern "C" void _Jv_ThrowBadArrayIndex (jint bad_index);
-extern "C" void _Jv_ThrowNullPointerException (void);
+extern "C" void _Jv_ThrowBadArrayIndex (jint bad_index)
+ __attribute__((noreturn));
+extern "C" void _Jv_ThrowNullPointerException (void)
+ __attribute__((noreturn));
extern "C" jobject _Jv_NewArray (jint type, jint size)
__attribute__((__malloc__));
extern "C" jobject _Jv_NewMultiArray (jclass klass, jint dims, ...)
diff --git a/libjava/include/name-finder.h b/libjava/include/name-finder.h
index 46ae20a3293..805725b4b69 100644
--- a/libjava/include/name-finder.h
+++ b/libjava/include/name-finder.h
@@ -40,12 +40,19 @@ public:
~_Jv_name_finder ()
{
#if defined (HAVE_PIPE) && defined (HAVE_FORK)
- close (f_pipe[1]);
- fclose (b_pipe_fd);
-
- int wstat;
- // We don't care about errors here.
- waitpid (pid, &wstat, 0);
+ myclose (f_pipe[0]);
+ myclose (f_pipe[1]);
+ myclose (b_pipe[0]);
+ myclose (b_pipe[1]);
+ if (b_pipe_fd != NULL)
+ fclose (b_pipe_fd);
+
+ if (pid >= 0)
+ {
+ int wstat;
+ // We don't care about errors here.
+ waitpid (pid, &wstat, 0);
+ }
#endif
}
@@ -72,5 +79,13 @@ private:
int f_pipe[2], b_pipe[2];
FILE *b_pipe_fd;
int error;
+
+ // Close a descriptor only if it has not been closed.
+ void myclose (int fd)
+ {
+ if (fd != -1)
+ close (fd);
+ }
+
#endif
};
diff --git a/libjava/include/posix-threads.h b/libjava/include/posix-threads.h
index 79961c23d83..e28da0b5aaf 100644
--- a/libjava/include/posix-threads.h
+++ b/libjava/include/posix-threads.h
@@ -244,15 +244,20 @@ _Jv_ThreadSelf (void)
#ifdef __alpha__
+#ifdef __FreeBSD__
+#include <machine/pal.h>
+#define PAL_rduniq PAL_rdunique
+#else
#include <asm/pal.h>
+#endif
typedef unsigned long _Jv_ThreadId_t;
inline _Jv_ThreadId_t
_Jv_ThreadSelf (void)
{
- unsigned long id;
- __asm__ ("call_pal %1\n\tmov $0, %0" : "=r"(id) : "i"(PAL_rduniq) : "$0");
+ register unsigned long id __asm__("$0");
+ __asm__ ("call_pal %1" : "=r"(id) : "i"(PAL_rduniq));
return id;
}
diff --git a/libjava/include/posix.h b/libjava/include/posix.h
index 7e9aaf54d92..8fa782fc662 100644
--- a/libjava/include/posix.h
+++ b/libjava/include/posix.h
@@ -34,10 +34,12 @@ details. */
#include <fcntl.h>
#include <gcj/cni.h>
+#include <java/util/Properties.h>
extern int _Jv_select (int n, fd_set *, fd_set *, fd_set *, struct timeval *);
extern jlong _Jv_platform_gettimeofday ();
extern void _Jv_platform_initialize (void);
+extern void _Jv_platform_initProperties (java::util::Properties*);
inline void
_Jv_platform_close_on_exec (jint fd)
diff --git a/libjava/include/sparc-signal.h b/libjava/include/sparc-signal.h
index 03538eccf20..8694fc598ed 100644
--- a/libjava/include/sparc-signal.h
+++ b/libjava/include/sparc-signal.h
@@ -20,8 +20,13 @@ details. */
#define SIGNAL_HANDLER(_name) \
static void _name (int _dummy, siginfo_t *_info, void *arg)
+#ifdef __arch64__
+#define FLUSH_REGISTER_WINDOWS \
+ asm volatile ("flushw");
+#else
#define FLUSH_REGISTER_WINDOWS \
asm volatile ("ta 3");
+#endif
#define MAKE_THROW_FRAME(_exception) \
do \
@@ -29,8 +34,8 @@ do \
ucontext_t *_context = (ucontext_t *) arg; \
(void)_dummy; \
(void)_info; \
- register int sp = _context->uc_mcontext.gregs[REG_SP]; \
- register int retaddr = _context->uc_mcontext.gregs[REG_O7]; \
+ register long sp = _context->uc_mcontext.gregs[REG_SP]; \
+ register long retaddr = _context->uc_mcontext.gregs[REG_O7]; \
FLUSH_REGISTER_WINDOWS; \
asm volatile ("mov %0, %%i6; mov %1, %%i7" \
: : "r"(sp), "r"(retaddr)); \
diff --git a/libjava/include/win32.h b/libjava/include/win32.h
index 73eb0c819d6..8fbe39335d0 100644
--- a/libjava/include/win32.h
+++ b/libjava/include/win32.h
@@ -17,13 +17,22 @@ details. */
#undef __INSIDE_CYGWIN__
#include <winsock.h>
#include <gcj/cni.h>
+#include <java/util/Properties.h>
extern void _Jv_platform_initialize (void);
+extern void _Jv_platform_initProperties (java::util::Properties*);
extern jlong _Jv_platform_gettimeofday ();
-void _Jv_platform_close_on_exec (jint)
+inline void
+_Jv_platform_close_on_exec (jint)
{
// Ignore.
}
+#define HAVE_BACKTRACE
+
+/* Store up to SIZE return address of the current program state in
+ ARRAY and return the exact number of values stored. */
+extern int backtrace (void **__array, int __size);
+
#endif /* __JV_WIN32_H__ */
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 198ec45eb16..4db9dca08ec 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -628,7 +628,7 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv)
INSN_LABEL(invokespecial),
INSN_LABEL(invokestatic),
INSN_LABEL(invokeinterface),
- 0, /* op_xxxunusedxxx1, */
+ 0, /* Unused. */
INSN_LABEL(new),
INSN_LABEL(newarray),
INSN_LABEL(anewarray),
diff --git a/libjava/java/awt/Button.java b/libjava/java/awt/Button.java
index ccc7821d578..139890f7315 100644
--- a/libjava/java/awt/Button.java
+++ b/libjava/java/awt/Button.java
@@ -261,13 +261,13 @@ processActionEvent(ActionEvent event)
void
dispatchEventImpl(AWTEvent e)
{
- super.dispatchEventImpl(e);
-
if (e.id <= ActionEvent.ACTION_LAST
&& e.id >= ActionEvent.ACTION_FIRST
&& (action_listeners != null
|| (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
processEvent(e);
+ else
+ super.dispatchEventImpl(e);
}
/*************************************************************************/
diff --git a/libjava/java/awt/Checkbox.java b/libjava/java/awt/Checkbox.java
index 4212da95935..1268fe86eca 100644
--- a/libjava/java/awt/Checkbox.java
+++ b/libjava/java/awt/Checkbox.java
@@ -365,6 +365,18 @@ processItemEvent(ItemEvent event)
item_listeners.itemStateChanged(event);
}
+void
+dispatchEventImpl(AWTEvent e)
+{
+ if (e.id <= ItemEvent.ITEM_LAST
+ && e.id >= ItemEvent.ITEM_FIRST
+ && (item_listeners != null
+ || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+}
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/CheckboxMenuItem.java b/libjava/java/awt/CheckboxMenuItem.java
index b75f6172756..2f7ecd79fc5 100644
--- a/libjava/java/awt/CheckboxMenuItem.java
+++ b/libjava/java/awt/CheckboxMenuItem.java
@@ -258,6 +258,18 @@ processItemEvent(ItemEvent event)
item_listeners.itemStateChanged(event);
}
+void
+dispatchEventImpl(AWTEvent e)
+{
+ if (e.id <= ItemEvent.ITEM_LAST
+ && e.id >= ItemEvent.ITEM_FIRST
+ && (item_listeners != null
+ || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+}
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/Choice.java b/libjava/java/awt/Choice.java
index 5feeed04341..e90346cc30a 100644
--- a/libjava/java/awt/Choice.java
+++ b/libjava/java/awt/Choice.java
@@ -431,6 +431,18 @@ processItemEvent(ItemEvent event)
item_listeners.itemStateChanged(event);
}
+void
+dispatchEventImpl(AWTEvent e)
+{
+ if (e.id <= ItemEvent.ITEM_LAST
+ && e.id >= ItemEvent.ITEM_FIRST
+ && (item_listeners != null
+ || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+}
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java
index 034390cb6c4..9ea43edb1f1 100644
--- a/libjava/java/awt/Component.java
+++ b/libjava/java/awt/Component.java
@@ -1858,12 +1858,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
else
processMouseEvent((MouseEvent) e);
}
- else if (e instanceof ComponentEvent)
- processComponentEvent((ComponentEvent) e);
else if (e instanceof KeyEvent)
processKeyEvent((KeyEvent) e);
else if (e instanceof InputMethodEvent)
processInputMethodEvent((InputMethodEvent) e);
+ else if (e instanceof ComponentEvent)
+ processComponentEvent((ComponentEvent) e);
else if (e instanceof HierarchyEvent)
{
if (e.id == HierarchyEvent.HIERARCHY_CHANGED)
diff --git a/libjava/java/awt/List.java b/libjava/java/awt/List.java
index 955d08fb1dc..c171b8f285e 100644
--- a/libjava/java/awt/List.java
+++ b/libjava/java/awt/List.java
@@ -989,6 +989,23 @@ processItemEvent(ItemEvent event)
item_listeners.itemStateChanged(event);
}
+void
+dispatchEventImpl(AWTEvent e)
+{
+ if (e.id <= ItemEvent.ITEM_LAST
+ && e.id >= ItemEvent.ITEM_FIRST
+ && (item_listeners != null
+ || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
+ processEvent(e);
+ else if (e.id <= ActionEvent.ACTION_LAST
+ && e.id >= ActionEvent.ACTION_FIRST
+ && (action_listeners != null
+ || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+}
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/MenuItem.java b/libjava/java/awt/MenuItem.java
index 25191d488d9..ea92f9ab8e4 100644
--- a/libjava/java/awt/MenuItem.java
+++ b/libjava/java/awt/MenuItem.java
@@ -80,7 +80,7 @@ private boolean enabled;
/**
* @serial The mask of events that are enabled for this menu item.
*/
-private long eventMask;
+long eventMask;
/**
* @serial This menu item's label
diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java
index d8915b7f842..1f1875955bf 100644
--- a/libjava/java/awt/Scrollbar.java
+++ b/libjava/java/awt/Scrollbar.java
@@ -660,6 +660,18 @@ processAdjustmentEvent(AdjustmentEvent event)
adjustment_listeners.adjustmentValueChanged(event);
}
+void
+dispatchEventImpl(AWTEvent e)
+{
+ if (e.id <= AdjustmentEvent.ADJUSTMENT_LAST
+ && e.id >= AdjustmentEvent.ADJUSTMENT_FIRST
+ && (adjustment_listeners != null
+ || (eventMask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0))
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+}
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/TextComponent.java b/libjava/java/awt/TextComponent.java
index a90cb80e52d..5ba80edc1da 100644
--- a/libjava/java/awt/TextComponent.java
+++ b/libjava/java/awt/TextComponent.java
@@ -1,5 +1,5 @@
/* TextComponent.java -- Widgets for entering text
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -97,6 +97,7 @@ protected transient TextListener textListener;
TextComponent(String text)
{
this.text = text;
+ this.editable = true;
}
/*************************************************************************/
@@ -408,6 +409,18 @@ processTextEvent(TextEvent event)
textListener.textValueChanged(event);
}
+void
+dispatchEventImpl(AWTEvent e)
+{
+ if (e.id <= TextEvent.TEXT_LAST
+ && e.id >= TextEvent.TEXT_FIRST
+ && (textListener != null
+ || (eventMask & AWTEvent.TEXT_EVENT_MASK) != 0))
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+}
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/TextField.java b/libjava/java/awt/TextField.java
index 5499305f875..28d444ce95f 100644
--- a/libjava/java/awt/TextField.java
+++ b/libjava/java/awt/TextField.java
@@ -1,5 +1,5 @@
/* TextField.java -- A one line text entry field
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -452,6 +452,18 @@ processActionEvent(ActionEvent event)
action_listeners.actionPerformed(event);
}
+void
+dispatchEventImpl(AWTEvent e)
+{
+ if (e.id <= ActionEvent.ACTION_LAST
+ && e.id >= ActionEvent.ACTION_FIRST
+ && (action_listeners != null
+ || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+}
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/geom/Point2D.java b/libjava/java/awt/geom/Point2D.java
index 135e9afb663..598402b00c0 100644
--- a/libjava/java/awt/geom/Point2D.java
+++ b/libjava/java/awt/geom/Point2D.java
@@ -69,7 +69,7 @@ public abstract class Point2D implements Cloneable
static public double distance (double X1, double Y1, double X2, double Y2)
{
- return Math.sqrt(distance(X1, Y1, X2, Y2));
+ return Math.sqrt(distanceSq(X1, Y1, X2, Y2));
}
public double distanceSq (double PX, double PY)
diff --git a/libjava/java/beans/IntrospectionException.java b/libjava/java/beans/IntrospectionException.java
index 6b9aab69066..9883c9ab459 100644
--- a/libjava/java/beans/IntrospectionException.java
+++ b/libjava/java/beans/IntrospectionException.java
@@ -1,5 +1,5 @@
-/* java.beans.IntrospectionException
- Copyright (C) 1998 Free Software Foundation, Inc.
+/* IntrospectionException -- thrown when an exception occurs in introspection
+ Copyright (C) 1998, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -39,19 +39,29 @@ exception statement from your version. */
package java.beans;
/**
- ** IntrospectionException is thrown when the Introspector fails. Surprise, surprise.
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 31 May 1998
- ** @see java.beans.Introspector
- **/
-
-public class IntrospectionException extends Exception {
- /** Instantiate this exception with the given message.
- ** @param msg the message for the exception.
- **/
- public IntrospectionException(String msg) {
- super(msg);
- }
+ * IntrospectionException is thrown when the Introspector fails. Typical
+ * causes are the inability to map a name to its Class, or specifying a
+ * wrong type signature.
+ *
+ * @author John Keiser
+ * @see Introspector
+ * @since 1.1
+ * @status updated to 1.4
+ */
+public class IntrospectionException extends Exception
+{
+ /**
+ * Compatible with JDK 1.1+.
+ */
+ private static final long serialVersionUID = -3728150539969542619L;
+
+ /**
+ * Instantiate this exception with the given message.
+ *
+ * @param msg the message for the exception
+ */
+ public IntrospectionException(String msg)
+ {
+ super(msg);
+ }
}
diff --git a/libjava/java/beans/Introspector.java b/libjava/java/beans/Introspector.java
index 99c05c6bf49..fa98c69ae9d 100644
--- a/libjava/java/beans/Introspector.java
+++ b/libjava/java/beans/Introspector.java
@@ -44,395 +44,488 @@ import java.lang.reflect.*;
import gnu.java.lang.*;
/**
- ** Introspector is the class that does the bulk of the
- ** design-time work in Java Beans. Every class must have
- ** a BeanInfo in order for an RAD tool to use it; but, as
- ** promised, you don't have to write the BeanInfo class
- ** yourself if you don't want to. All you have to do is
- ** call getBeanInfo() in the Introspector and it will use
- ** standard JavaBeans-defined method signatures to
- ** determine the information about your class.<P>
- **
- ** Don't worry about it too much, though: you can provide
- ** JavaBeans with as much customized information as you
- ** want, or as little as you want, using the BeanInfo
- ** interface (see BeanInfo for details).<P>
- **
- ** <STRONG>Order of Operations</STRONG><P>
- **
- ** When you call getBeanInfo(class c), the Introspector
- ** first searches for BeanInfo class to see if you
- ** provided any explicit information. It searches for a
- ** class named <bean class name>BeanInfo in different
- ** packages, first searching the bean class's package
- ** and then moving on to search the beanInfoSearchPath.<P>
- **
- ** If it does not find a BeanInfo class, it acts as though
- ** it had found a BeanInfo class returning null from all
- ** methods (meaning it should discover everything through
- ** Introspection). If it does, then it takes the
- ** information it finds in the BeanInfo class to be
- ** canonical (that is, the information speaks for its
- ** class as well as all superclasses).<P>
- **
- ** When it has introspected the class, calls
- ** getBeanInfo(c.getSuperclass) and adds that information
- ** to the information it has, not adding to any information
- ** it already has that is canonical.<P>
- **
- ** <STRONG>Introspection Design Patterns</STRONG><P>
- **
- ** When the Introspector goes in to read the class, it
- ** follows a well-defined order in order to not leave any
- ** methods unaccounted for. Its job is to step over all
- ** of the public methods in a class and determine whether
- ** they are part of a property, an event, or a method (in
- ** that order).
- **
- **
- ** <STRONG>Properties:</STRONG><P>
- **
- ** <OL>
- ** <LI>If there is a <CODE>public boolean isXXX()</CODE>
- ** method, then XXX is a read-only boolean property.
- ** <CODE>boolean getXXX()</CODE> may be supplied in
- ** addition to this method, although isXXX() is the
- ** one that will be used in this case and getXXX()
- ** will be ignored. If there is a
- ** <CODE>public void setXXX(boolean)</CODE> method,
- ** it is part of this group and makes it a read-write
- ** property.</LI>
- ** <LI>If there is a
- ** <CODE>public &lt;type&gt; getXXX(int)</CODE>
- ** method, then XXX is a read-only indexed property of
- ** type &lt;type&gt;. If there is a
- ** <CODE>public void setXXX(int,&lt;type&gt;)</CODE>
- ** method, then it is a read-write indexed property of
- ** type &lt;type&gt;. There may also be a
- ** <CODE>public &lt;type&gt;[] getXXX()</CODE> and a
- ** <CODE>public void setXXX(&lt;type&gt;)</CODE>
- ** method as well.</CODE></LI>
- ** <LI>If there is a
- ** <CODE>public void setXXX(int,&lt;type&gt;)</CODE>
- ** method, then it is a write-only indexed property of
- ** type &lt;type&gt;. There may also be a
- ** <CODE>public &lt;type&gt;[] getXXX()</CODE> and a
- ** <CODE>public void setXXX(&lt;type&gt;)</CODE>
- ** method as well.</CODE></LI>
- ** <LI>If there is a
- ** <CODE>public &lt;type&gt; getXXX()</CODE> method,
- ** then XXX is a read-only property of type
- ** &lt;type&gt;. If there is a
- ** <CODE>public void setXXX(&lt;type&gt;)</CODE>
- ** method, then it will be used for the property and
- ** the property will be considered read-write.</LI>
- ** <LI>If there is a
- ** <CODE>public void setXXX(&lt;type&gt;)</CODE>
- ** method, then as long as XXX is not already used as
- ** the name of a property, XXX is assumed to be a
- ** write-only property of type &lt;type&gt;.</LI>
- ** <LI>In all of the above cases, if the setXXX() method
- ** throws <CODE>PropertyVetoException</CODE>, then the
- ** property in question is assumed to be constrained.
- ** No properties are ever assumed to be bound
- ** (<STRONG>Spec Note:</STRONG> this is not in the
- ** spec, it just makes sense). See PropertyDescriptor
- ** for a description of bound and constrained
- ** properties.</LI>
- ** </OL>
- **
- ** <STRONG>Events:</STRONG><P>
- **
- ** If there is a pair of methods,
- ** <CODE>public void addXXX(&lt;type&gt;)</CODE> and
- ** <CODE>public void removeXXX(&lt;type&gt;)</CODE>, where
- ** &lt;type&gt; is a descendant of
- ** <CODE>java.util.EventListener</CODE>, then the pair of
- ** methods imply that this Bean will fire events to
- ** listeners of type &lt;type&gt;.<P>
- **
- ** If the addXXX() method throws
- ** <CODE>java.util.TooManyListenersException</CODE>, then
- ** the event set is assumed to be <EM>unicast</EM>. See
- ** EventSetDescriptor for a discussion of unicast event
- ** sets.<P>
- **
- ** <STRONG>Spec Note:</STRONG> the spec seems to say that
- ** the listener type's classname must be equal to the XXX
- ** part of addXXX() and removeXXX(), but that is not the
- ** case in Sun's implementation, so I am assuming it is
- ** not the case in general.<P>
- **
- ** <STRONG>Methods:</STRONG><P>
- **
- ** Any public methods (including those which were used
- ** for Properties or Events) are used as Methods.
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 29 Jul 1998
- ** @see java.beans.BeanInfo
- **/
-
+ * Introspector is the class that does the bulk of the
+ * design-time work in Java Beans. Every class must have
+ * a BeanInfo in order for an RAD tool to use it; but, as
+ * promised, you don't have to write the BeanInfo class
+ * yourself if you don't want to. All you have to do is
+ * call getBeanInfo() in the Introspector and it will use
+ * standard JavaBeans-defined method signatures to
+ * determine the information about your class.<P>
+ *
+ * Don't worry about it too much, though: you can provide
+ * JavaBeans with as much customized information as you
+ * want, or as little as you want, using the BeanInfo
+ * interface (see BeanInfo for details).<P>
+ *
+ * <STRONG>Order of Operations</STRONG><P>
+ *
+ * When you call getBeanInfo(class c), the Introspector
+ * first searches for BeanInfo class to see if you
+ * provided any explicit information. It searches for a
+ * class named <bean class name>BeanInfo in different
+ * packages, first searching the bean class's package
+ * and then moving on to search the beanInfoSearchPath.<P>
+ *
+ * If it does not find a BeanInfo class, it acts as though
+ * it had found a BeanInfo class returning null from all
+ * methods (meaning it should discover everything through
+ * Introspection). If it does, then it takes the
+ * information it finds in the BeanInfo class to be
+ * canonical (that is, the information speaks for its
+ * class as well as all superclasses).<P>
+ *
+ * When it has introspected the class, calls
+ * getBeanInfo(c.getSuperclass) and adds that information
+ * to the information it has, not adding to any information
+ * it already has that is canonical.<P>
+ *
+ * <STRONG>Introspection Design Patterns</STRONG><P>
+ *
+ * When the Introspector goes in to read the class, it
+ * follows a well-defined order in order to not leave any
+ * methods unaccounted for. Its job is to step over all
+ * of the public methods in a class and determine whether
+ * they are part of a property, an event, or a method (in
+ * that order).
+ *
+ *
+ * <STRONG>Properties:</STRONG><P>
+ *
+ * <OL>
+ * <LI>If there is a <CODE>public boolean isXXX()</CODE>
+ * method, then XXX is a read-only boolean property.
+ * <CODE>boolean getXXX()</CODE> may be supplied in
+ * addition to this method, although isXXX() is the
+ * one that will be used in this case and getXXX()
+ * will be ignored. If there is a
+ * <CODE>public void setXXX(boolean)</CODE> method,
+ * it is part of this group and makes it a read-write
+ * property.</LI>
+ * <LI>If there is a
+ * <CODE>public &lt;type&gt; getXXX(int)</CODE>
+ * method, then XXX is a read-only indexed property of
+ * type &lt;type&gt;. If there is a
+ * <CODE>public void setXXX(int,&lt;type&gt;)</CODE>
+ * method, then it is a read-write indexed property of
+ * type &lt;type&gt;. There may also be a
+ * <CODE>public &lt;type&gt;[] getXXX()</CODE> and a
+ * <CODE>public void setXXX(&lt;type&gt;)</CODE>
+ * method as well.</CODE></LI>
+ * <LI>If there is a
+ * <CODE>public void setXXX(int,&lt;type&gt;)</CODE>
+ * method, then it is a write-only indexed property of
+ * type &lt;type&gt;. There may also be a
+ * <CODE>public &lt;type&gt;[] getXXX()</CODE> and a
+ * <CODE>public void setXXX(&lt;type&gt;)</CODE>
+ * method as well.</CODE></LI>
+ * <LI>If there is a
+ * <CODE>public &lt;type&gt; getXXX()</CODE> method,
+ * then XXX is a read-only property of type
+ * &lt;type&gt;. If there is a
+ * <CODE>public void setXXX(&lt;type&gt;)</CODE>
+ * method, then it will be used for the property and
+ * the property will be considered read-write.</LI>
+ * <LI>If there is a
+ * <CODE>public void setXXX(&lt;type&gt;)</CODE>
+ * method, then as long as XXX is not already used as
+ * the name of a property, XXX is assumed to be a
+ * write-only property of type &lt;type&gt;.</LI>
+ * <LI>In all of the above cases, if the setXXX() method
+ * throws <CODE>PropertyVetoException</CODE>, then the
+ * property in question is assumed to be constrained.
+ * No properties are ever assumed to be bound
+ * (<STRONG>Spec Note:</STRONG> this is not in the
+ * spec, it just makes sense). See PropertyDescriptor
+ * for a description of bound and constrained
+ * properties.</LI>
+ * </OL>
+ *
+ * <STRONG>Events:</STRONG><P>
+ *
+ * If there is a pair of methods,
+ * <CODE>public void addXXX(&lt;type&gt;)</CODE> and
+ * <CODE>public void removeXXX(&lt;type&gt;)</CODE>, where
+ * &lt;type&gt; is a descendant of
+ * <CODE>java.util.EventListener</CODE>, then the pair of
+ * methods imply that this Bean will fire events to
+ * listeners of type &lt;type&gt;.<P>
+ *
+ * If the addXXX() method throws
+ * <CODE>java.util.TooManyListenersException</CODE>, then
+ * the event set is assumed to be <EM>unicast</EM>. See
+ * EventSetDescriptor for a discussion of unicast event
+ * sets.<P>
+ *
+ * <STRONG>Spec Note:</STRONG> the spec seems to say that
+ * the listener type's classname must be equal to the XXX
+ * part of addXXX() and removeXXX(), but that is not the
+ * case in Sun's implementation, so I am assuming it is
+ * not the case in general.<P>
+ *
+ * <STRONG>Methods:</STRONG><P>
+ *
+ * Any public methods (including those which were used
+ * for Properties or Events) are used as Methods.
+ *
+ * @author John Keiser
+ * @since JDK1.1
+ * @see java.beans.BeanInfo
+ */
public class Introspector {
- static String[] beanInfoSearchPath = {"gnu.java.beans.info", "sun.beans.infos"};
- static Hashtable beanInfoCache = new Hashtable();
-
- private Introspector() {}
-
- /** Get the BeanInfo for class <CODE>beanClass</CODE>,
- ** first by looking for explicit information, next by
- ** using standard design patterns to determine
- ** information about the class.
- ** @param beanClass the class to get BeanInfo about.
- ** @return the BeanInfo object representing the class.
- **/
- public static BeanInfo getBeanInfo(Class beanClass) throws IntrospectionException {
- BeanInfo cachedInfo;
- synchronized(beanClass) {
- cachedInfo = (BeanInfo)beanInfoCache.get(beanClass);
- if(cachedInfo != null) {
- return cachedInfo;
- }
- cachedInfo = getBeanInfo(beanClass,null);
- beanInfoCache.put(beanClass,cachedInfo);
- return cachedInfo;
- }
- }
-
- /** Get the BeanInfo for class <CODE>beanClass</CODE>,
- ** first by looking for explicit information, next by
- ** using standard design patterns to determine
- ** information about the class. It crawls up the
- ** inheritance tree until it hits <CODE>topClass</CODE>.
- ** @param beanClass the Bean class.
- ** @param stopClass the class to stop at.
- ** @return the BeanInfo object representing the class.
- **/
- public static BeanInfo getBeanInfo(Class beanClass, Class stopClass) throws IntrospectionException {
- ExplicitInfo explicit = new ExplicitInfo(beanClass,stopClass);
-
- IntrospectionIncubator ii = new IntrospectionIncubator();
- ii.setPropertyStopClass(explicit.propertyStopClass);
- ii.setEventStopClass(explicit.eventStopClass);
- ii.setMethodStopClass(explicit.methodStopClass);
- ii.addMethods(beanClass.getMethods());
-
- BeanInfoEmbryo currentInfo = ii.getBeanInfoEmbryo();
- PropertyDescriptor[] p = explicit.explicitPropertyDescriptors;
- if(p!=null) {
- for(int i=0;i<p.length;i++) {
- if(!currentInfo.hasProperty(p[i])) {
- currentInfo.addProperty(p[i]);
- }
- }
- if(explicit.defaultProperty != -1) {
- currentInfo.setDefaultPropertyName(p[explicit.defaultProperty].getName());
- }
- }
- EventSetDescriptor[] e = explicit.explicitEventSetDescriptors;
- if(e!=null) {
- for(int i=0;i<e.length;i++) {
- if(!currentInfo.hasEvent(e[i])) {
- currentInfo.addEvent(e[i]);
- }
- }
- if(explicit.defaultEvent != -1) {
- currentInfo.setDefaultEventName(e[explicit.defaultEvent].getName());
- }
- }
- MethodDescriptor[] m = explicit.explicitMethodDescriptors;
- if(m!=null) {
- for(int i=0;i<m.length;i++) {
- if(!currentInfo.hasMethod(m[i])) {
- currentInfo.addMethod(m[i]);
- }
- }
- }
-
- if(explicit.explicitBeanDescriptor != null) {
- currentInfo.setBeanDescriptor(new BeanDescriptor(beanClass,explicit.explicitBeanDescriptor.getCustomizerClass()));
- } else {
- currentInfo.setBeanDescriptor(new BeanDescriptor(beanClass,null));
- }
-
- currentInfo.setAdditionalBeanInfo(explicit.explicitBeanInfo);
- currentInfo.setIcons(explicit.im);
-
- return currentInfo.getBeanInfo();
- }
-
- /** Get the search path for BeanInfo classes.
- ** @return the BeanInfo search path.
- **/
- public static String[] getBeanInfoSearchPath() {
- return beanInfoSearchPath;
- }
-
- /** Set the search path for BeanInfo classes.
- ** @param beanInfoSearchPath the new BeanInfo search
- ** path.
- **/
- public static void setBeanInfoSearchPath(String[] beanInfoSearchPath) {
- Introspector.beanInfoSearchPath = beanInfoSearchPath;
- }
+
+ public static final int USE_ALL_BEANINFO = 1;
+ public static final int IGNORE_IMMEDIATE_BEANINFO = 2;
+ public static final int IGNORE_ALL_BEANINFO = 3;
- /** A helper method to convert a name to standard Java
- ** naming conventions: anything with two capitals as the
- ** first two letters remains the same, otherwise the
- ** first letter is decapitalized. URL = URL, I = i,
- ** MyMethod = myMethod.
- ** @param name the name to decapitalize.
- ** @return the decapitalized name.
- **/
- public static String decapitalize(String name) {
- try {
- if(!Character.isUpperCase(name.charAt(0))) {
- return name;
- } else {
- try {
- if(Character.isUpperCase(name.charAt(1))) {
- return name;
- } else {
- char[] c = name.toCharArray();
- c[0] = Character.toLowerCase(c[0]);
- return new String(c);
- }
- } catch(StringIndexOutOfBoundsException E) {
- char[] c = new char[1];
- c[0] = Character.toLowerCase(name.charAt(0));
- return new String(c);
- }
- }
- } catch(StringIndexOutOfBoundsException E) {
- return name;
- } catch(NullPointerException E) {
- return null;
- }
- }
+ static String[] beanInfoSearchPath = {"gnu.java.beans.info"};
+ static Hashtable beanInfoCache = new Hashtable();
+
+ private Introspector() {}
+
+ /**
+ * Get the BeanInfo for class <CODE>beanClass</CODE>,
+ * first by looking for explicit information, next by
+ * using standard design patterns to determine
+ * information about the class.
+ *
+ * @param beanClass the class to get BeanInfo about.
+ * @return the BeanInfo object representing the class.
+ */
+ public static BeanInfo getBeanInfo(Class beanClass)
+ throws IntrospectionException
+ {
+ BeanInfo cachedInfo;
+ synchronized(beanClass)
+ {
+ cachedInfo = (BeanInfo)beanInfoCache.get(beanClass);
+ if(cachedInfo != null)
+ {
+ return cachedInfo;
+ }
+ cachedInfo = getBeanInfo(beanClass,null);
+ beanInfoCache.put(beanClass,cachedInfo);
+ return cachedInfo;
+ }
+ }
- static BeanInfo copyBeanInfo(BeanInfo b) {
- java.awt.Image[] icons = new java.awt.Image[4];
- for(int i=1;i<=4;i++) {
- icons[i-1] = b.getIcon(i);
- }
- return new ExplicitBeanInfo(b.getBeanDescriptor(),b.getAdditionalBeanInfo(),
- b.getPropertyDescriptors(),b.getDefaultPropertyIndex(),
- b.getEventSetDescriptors(),b.getDefaultEventIndex(),
- b.getMethodDescriptors(),icons);
+ /**
+ * Get the BeanInfo for class <CODE>beanClass</CODE>,
+ * first by looking for explicit information, next by
+ * using standard design patterns to determine
+ * information about the class. It crawls up the
+ * inheritance tree until it hits <CODE>topClass</CODE>.
+ *
+ * @param beanClass the Bean class.
+ * @param stopClass the class to stop at.
+ * @return the BeanInfo object representing the class.
+ */
+ public static BeanInfo getBeanInfo(Class beanClass, Class stopClass)
+ throws IntrospectionException
+ {
+ ExplicitInfo explicit = new ExplicitInfo(beanClass,stopClass);
+
+ IntrospectionIncubator ii = new IntrospectionIncubator();
+ ii.setPropertyStopClass(explicit.propertyStopClass);
+ ii.setEventStopClass(explicit.eventStopClass);
+ ii.setMethodStopClass(explicit.methodStopClass);
+ ii.addMethods(beanClass.getMethods());
+
+ BeanInfoEmbryo currentInfo = ii.getBeanInfoEmbryo();
+ PropertyDescriptor[] p = explicit.explicitPropertyDescriptors;
+ if(p!=null)
+ {
+ for(int i=0;i<p.length;i++)
+ {
+ if(!currentInfo.hasProperty(p[i]))
+ {
+ currentInfo.addProperty(p[i]);
+ }
+ }
+ if(explicit.defaultProperty != -1)
+ {
+ currentInfo.setDefaultPropertyName(p[explicit.defaultProperty].getName());
+ }
+ }
+ EventSetDescriptor[] e = explicit.explicitEventSetDescriptors;
+ if(e!=null)
+ {
+ for(int i=0;i<e.length;i++)
+ {
+ if(!currentInfo.hasEvent(e[i]))
+ {
+ currentInfo.addEvent(e[i]);
+ }
+ }
+ if(explicit.defaultEvent != -1)
+ {
+ currentInfo.setDefaultEventName(e[explicit.defaultEvent].getName());
+ }
+ }
+ MethodDescriptor[] m = explicit.explicitMethodDescriptors;
+ if(m!=null)
+ {
+ for(int i=0;i<m.length;i++)
+ {
+ if(!currentInfo.hasMethod(m[i]))
+ {
+ currentInfo.addMethod(m[i]);
+ }
+ }
+ }
+
+ if(explicit.explicitBeanDescriptor != null)
+ {
+ currentInfo.setBeanDescriptor(new BeanDescriptor(beanClass,explicit.explicitBeanDescriptor.getCustomizerClass()));
+ }
+ else
+ {
+ currentInfo.setBeanDescriptor(new BeanDescriptor(beanClass,null));
+ }
+
+ currentInfo.setAdditionalBeanInfo(explicit.explicitBeanInfo);
+ currentInfo.setIcons(explicit.im);
+
+ return currentInfo.getBeanInfo();
+ }
+
+ /**
+ * Get the search path for BeanInfo classes.
+ *
+ * @return the BeanInfo search path.
+ */
+ public static String[] getBeanInfoSearchPath()
+ {
+ return beanInfoSearchPath;
+ }
+
+ /**
+ * Set the search path for BeanInfo classes.
+ * @param beanInfoSearchPath the new BeanInfo search
+ * path.
+ */
+ public static void setBeanInfoSearchPath(String[] beanInfoSearchPath)
+ {
+ Introspector.beanInfoSearchPath = beanInfoSearchPath;
+ }
+
+ /**
+ * A helper method to convert a name to standard Java
+ * naming conventions: anything with two capitals as the
+ * first two letters remains the same, otherwise the
+ * first letter is decapitalized. URL = URL, I = i,
+ * MyMethod = myMethod.
+ *
+ * @param name the name to decapitalize.
+ * @return the decapitalized name.
+ */
+ public static String decapitalize(String name)
+ {
+ try
+ {
+ if(!Character.isUpperCase(name.charAt(0)))
+ {
+ return name;
+ }
+ else
+ {
+ try
+ {
+ if(Character.isUpperCase(name.charAt(1)))
+ {
+ return name;
+ }
+ else
+ {
+ char[] c = name.toCharArray();
+ c[0] = Character.toLowerCase(c[0]);
+ return new String(c);
+ }
+ }
+ catch(StringIndexOutOfBoundsException E)
+ {
+ char[] c = new char[1];
+ c[0] = Character.toLowerCase(name.charAt(0));
+ return new String(c);
+ }
}
+ }
+ catch(StringIndexOutOfBoundsException E)
+ {
+ return name;
+ }
+ catch(NullPointerException E)
+ {
+ return null;
+ }
+ }
+
+ static BeanInfo copyBeanInfo(BeanInfo b)
+ {
+ java.awt.Image[] icons = new java.awt.Image[4];
+ for(int i=1;i<=4;i++)
+ {
+ icons[i-1] = b.getIcon(i);
+ }
+ return new ExplicitBeanInfo(b.getBeanDescriptor(),
+ b.getAdditionalBeanInfo(),
+ b.getPropertyDescriptors(),
+ b.getDefaultPropertyIndex(),
+ b.getEventSetDescriptors(),
+ b.getDefaultEventIndex(),
+ b.getMethodDescriptors(),icons);
+ }
}
-class ExplicitInfo {
- BeanDescriptor explicitBeanDescriptor;
- BeanInfo[] explicitBeanInfo;
-
- PropertyDescriptor[] explicitPropertyDescriptors;
- EventSetDescriptor[] explicitEventSetDescriptors;
- MethodDescriptor[] explicitMethodDescriptors;
-
- int defaultProperty;
- int defaultEvent;
-
- java.awt.Image[] im = new java.awt.Image[4];
-
- Class propertyStopClass;
- Class eventStopClass;
- Class methodStopClass;
-
- ExplicitInfo(Class beanClass, Class stopClass) {
- while(beanClass != null && !beanClass.equals(stopClass)) {
- BeanInfo explicit = findExplicitBeanInfo(beanClass);
- if(explicit != null) {
- if(explicitBeanDescriptor == null) {
- explicitBeanDescriptor = explicit.getBeanDescriptor();
- }
- if(explicitBeanInfo == null) {
- explicitBeanInfo = explicit.getAdditionalBeanInfo();
- }
- if(explicitPropertyDescriptors == null) {
- if(explicit.getPropertyDescriptors() != null) {
- explicitPropertyDescriptors = explicit.getPropertyDescriptors();
- defaultProperty = explicit.getDefaultPropertyIndex();
- propertyStopClass = beanClass;
- }
- }
- if(explicitEventSetDescriptors == null) {
- if(explicit.getEventSetDescriptors() != null) {
- explicitEventSetDescriptors = explicit.getEventSetDescriptors();
- defaultEvent = explicit.getDefaultEventIndex();
- eventStopClass = beanClass;
- }
- }
- if(explicitMethodDescriptors == null) {
- if(explicit.getMethodDescriptors() != null) {
- explicitMethodDescriptors = explicit.getMethodDescriptors();
- methodStopClass = beanClass;
- }
- }
- if(im[0] == null
- && im[1] == null
- && im[2] == null
- && im[3] == null) {
- im[0] = explicit.getIcon(0);
- im[1] = explicit.getIcon(1);
- im[2] = explicit.getIcon(2);
- im[3] = explicit.getIcon(3);
- }
- }
- beanClass = beanClass.getSuperclass();
- }
- if(propertyStopClass == null) {
- propertyStopClass = stopClass;
- }
- if(eventStopClass == null) {
- eventStopClass = stopClass;
- }
- if(methodStopClass == null) {
- methodStopClass = stopClass;
- }
- }
-
- static Hashtable explicitBeanInfos = new Hashtable();
- static Vector emptyBeanInfos = new Vector();
-
- static BeanInfo findExplicitBeanInfo(Class beanClass) {
- BeanInfo retval = (BeanInfo)explicitBeanInfos.get(beanClass);
- if(retval != null) {
- return retval;
- } else if(emptyBeanInfos.indexOf(beanClass) != -1) {
- return null;
- } else {
- retval = reallyFindExplicitBeanInfo(beanClass);
- if(retval != null) {
- explicitBeanInfos.put(beanClass,retval);
- } else {
- emptyBeanInfos.addElement(beanClass);
- }
- return retval;
- }
+class ExplicitInfo
+{
+ BeanDescriptor explicitBeanDescriptor;
+ BeanInfo[] explicitBeanInfo;
+
+ PropertyDescriptor[] explicitPropertyDescriptors;
+ EventSetDescriptor[] explicitEventSetDescriptors;
+ MethodDescriptor[] explicitMethodDescriptors;
+
+ int defaultProperty;
+ int defaultEvent;
+
+ java.awt.Image[] im = new java.awt.Image[4];
+
+ Class propertyStopClass;
+ Class eventStopClass;
+ Class methodStopClass;
+
+ ExplicitInfo(Class beanClass, Class stopClass)
+ {
+ while(beanClass != null && !beanClass.equals(stopClass))
+ {
+ BeanInfo explicit = findExplicitBeanInfo(beanClass);
+ if(explicit != null)
+ {
+ if(explicitBeanDescriptor == null)
+ {
+ explicitBeanDescriptor = explicit.getBeanDescriptor();
+ }
+ if(explicitBeanInfo == null)
+ {
+ explicitBeanInfo = explicit.getAdditionalBeanInfo();
+ }
+ if(explicitPropertyDescriptors == null)
+ {
+ if(explicit.getPropertyDescriptors() != null)
+ {
+ explicitPropertyDescriptors = explicit.getPropertyDescriptors();
+ defaultProperty = explicit.getDefaultPropertyIndex();
+ propertyStopClass = beanClass;
+ }
+ }
+ if(explicitEventSetDescriptors == null)
+ {
+ if(explicit.getEventSetDescriptors() != null)
+ {
+ explicitEventSetDescriptors = explicit.getEventSetDescriptors();
+ defaultEvent = explicit.getDefaultEventIndex();
+ eventStopClass = beanClass;
+ }
+ }
+ if(explicitMethodDescriptors == null)
+ {
+ if(explicit.getMethodDescriptors() != null)
+ {
+ explicitMethodDescriptors = explicit.getMethodDescriptors();
+ methodStopClass = beanClass;
+ }
+ }
+ if(im[0] == null && im[1] == null
+ && im[2] == null && im[3] == null)
+ {
+ im[0] = explicit.getIcon(0);
+ im[1] = explicit.getIcon(1);
+ im[2] = explicit.getIcon(2);
+ im[3] = explicit.getIcon(3);
+ }
+ }
+ beanClass = beanClass.getSuperclass();
+ }
+ if(propertyStopClass == null)
+ {
+ propertyStopClass = stopClass;
+ }
+ if(eventStopClass == null)
+ {
+ eventStopClass = stopClass;
+ }
+ if(methodStopClass == null)
+ {
+ methodStopClass = stopClass;
+ }
+ }
+
+ static Hashtable explicitBeanInfos = new Hashtable();
+ static Vector emptyBeanInfos = new Vector();
+
+ static BeanInfo findExplicitBeanInfo(Class beanClass)
+ {
+ BeanInfo retval = (BeanInfo)explicitBeanInfos.get(beanClass);
+ if(retval != null)
+ {
+ return retval;
+ }
+ else if(emptyBeanInfos.indexOf(beanClass) != -1)
+ {
+ return null;
+ }
+ else
+ {
+ retval = reallyFindExplicitBeanInfo(beanClass);
+ if(retval != null)
+ {
+ explicitBeanInfos.put(beanClass,retval);
+ }
+ else
+ {
+ emptyBeanInfos.addElement(beanClass);
+ }
+ return retval;
+ }
+ }
+
+ static BeanInfo reallyFindExplicitBeanInfo(Class beanClass)
+ {
+ try
+ {
+ try
+ {
+ return (BeanInfo)Class.forName(beanClass.getName()+"BeanInfo").newInstance();
+ }
+ catch(ClassNotFoundException E)
+ {
}
-
- static BeanInfo reallyFindExplicitBeanInfo(Class beanClass) {
- try {
- try {
- return (BeanInfo)Class.forName(beanClass.getName()+"BeanInfo").newInstance();
- } catch(ClassNotFoundException E) {
- }
- String newName = ClassHelper.getTruncatedClassName(beanClass) + "BeanInfo";
- for(int i=0;i<Introspector.beanInfoSearchPath.length;i++) {
- try {
- if(Introspector.beanInfoSearchPath[i].equals("")) {
- return (BeanInfo)Class.forName(newName).newInstance();
- } else {
- return (BeanInfo)Class.forName(Introspector.beanInfoSearchPath[i] + "." + newName).newInstance();
- }
- } catch(ClassNotFoundException E) {
- }
- }
- } catch(IllegalAccessException E) {
- } catch(InstantiationException E) {
+ String newName = ClassHelper.getTruncatedClassName(beanClass) + "BeanInfo";
+ for(int i=0;i<Introspector.beanInfoSearchPath.length;i++)
+ {
+ try
+ {
+ if(Introspector.beanInfoSearchPath[i].equals(""))
+ {
+ return (BeanInfo)Class.forName(newName).newInstance();
+ }
+ else
+ {
+ return (BeanInfo)Class.forName(Introspector.beanInfoSearchPath[i] + "." + newName).newInstance();
}
- return null;
+ }
+ catch(ClassNotFoundException E)
+ {
+ }
}
+ }
+ catch(IllegalAccessException E)
+ {
+ }
+ catch(InstantiationException E)
+ {
+ }
+ return null;
+ }
}
diff --git a/libjava/java/beans/PropertyVetoException.java b/libjava/java/beans/PropertyVetoException.java
index 9c82c3636e8..31f01d8b16e 100644
--- a/libjava/java/beans/PropertyVetoException.java
+++ b/libjava/java/beans/PropertyVetoException.java
@@ -1,5 +1,5 @@
-/* java.beans.PropertyVetoException
- Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* PropertyVetoException.java -- thrown to veto a proposed property change
+ Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -39,30 +39,47 @@ exception statement from your version. */
package java.beans;
/**
- ** PropertyVetoException is thrown when a VetoableChangeListener doesn't like the proposed change.
- **
- ** @author John Keiser
- ** @since JDK1.1
- ** @version 1.1.0, 31 May 1998
- ** @see java.beans.VetoableChangeListener
- **/
-
-public class PropertyVetoException extends Exception {
- PropertyChangeEvent evt;
+ * PropertyVetoException is thrown when a VetoableChangeListener doesn't
+ * like the proposed change.
+ *
+ * @author John Keiser
+ * @see VetoableChangeListener
+ * @since 1.1
+ * @status updated to 1.4
+ */
+public class PropertyVetoException extends Exception
+{
+ /**
+ * Compatible with JDK 1.1+.
+ */
+ private static final long serialVersionUID = 129596057694162164L;
- private static final long serialVersionUID = 129596057694162164L;
+ /**
+ * The vetoed change.
+ *
+ * @serial the event that was vetoed
+ */
+ private final PropertyChangeEvent evt;
- /** Instantiate this exception with the given message and property change.
- ** @param msg the reason for the veto.
- ** @param changeEvent the PropertyChangeEvent that was thrown.
- **/
- public PropertyVetoException(String msg, PropertyChangeEvent changeEvent) {
- super(msg);
- evt = changeEvent;
- }
+ /**
+ * Instantiate this exception with the given message and property change.
+ *
+ * @param msg the reason for the veto
+ * @param changeEvent the PropertyChangeEvent that was thrown
+ */
+ public PropertyVetoException(String msg, PropertyChangeEvent changeEvent)
+ {
+ super(msg);
+ evt = changeEvent;
+ }
- /** Get the PropertyChange event that was vetoed. **/
- public PropertyChangeEvent getPropertyChangeEvent() {
- return evt;
- }
+ /**
+ * Get the PropertyChange event that was vetoed.
+ *
+ * @return the vetoed change
+ */
+ public PropertyChangeEvent getPropertyChangeEvent()
+ {
+ return evt;
+ }
}
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java
index a268278fd3e..2086f1057aa 100644
--- a/libjava/java/io/File.java
+++ b/libjava/java/io/File.java
@@ -82,6 +82,11 @@ public class File implements Serializable, Comparable
// Remove duplicate and redundant separator characters.
private String normalizePath(String p)
{
+ // On Windows, convert any '/' to '\'. This appears to be the same logic
+ // that Sun's Win32 Java performs.
+ if (separatorChar == '\\')
+ p = p.replace ('/', '\\');
+
int dupIndex = p.indexOf(dupSeparator);
int plen = p.length();
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java
index 9d0d0133b9c..6a02d2ba862 100644
--- a/libjava/java/io/FileInputStream.java
+++ b/libjava/java/io/FileInputStream.java
@@ -88,6 +88,8 @@ public class FileInputStream extends InputStream
public long skip(long n) throws IOException
{
- return n <= 0 ? 0 : fd.seek(n, FileDescriptor.CUR, true);
+ long startPos = fd.getFilePointer();
+ long endPos = fd.seek(n, FileDescriptor.CUR, true);
+ return endPos - startPos;
}
}
diff --git a/libjava/java/io/PushbackInputStream.java b/libjava/java/io/PushbackInputStream.java
index 7afd3d5e5cd..ebf0e38616a 100644
--- a/libjava/java/io/PushbackInputStream.java
+++ b/libjava/java/io/PushbackInputStream.java
@@ -1,5 +1,5 @@
/* PushbackInputStream.java -- An input stream that can unread bytes
- Copyright (C) 1998, 1999, 2001, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -116,7 +116,7 @@ public class PushbackInputStream extends FilterInputStream
*/
public int available() throws IOException
{
- return pos + super.available();
+ return (buf.length - pos) + super.available();
}
/**
@@ -200,18 +200,23 @@ public class PushbackInputStream extends FilterInputStream
*/
public synchronized int read(byte[] b, int off, int len) throws IOException
{
- if (off < 0 || len < 0 || off + len > b.length)
- throw new ArrayIndexOutOfBoundsException();
-
int numBytes = Math.min(buf.length - pos, len);
if (numBytes > 0)
{
System.arraycopy (buf, pos, b, off, numBytes);
pos += numBytes;
- return numBytes;
+ len -= numBytes;
+ off += numBytes;
}
- return super.read(b, off, len);
+ if (len > 0)
+ {
+ len = super.read(b, off, len);
+ if (len == -1) // EOF
+ return numBytes > 0 ? numBytes : -1;
+ numBytes += len;
+ }
+ return numBytes;
}
/**
diff --git a/libjava/java/io/PushbackReader.java b/libjava/java/io/PushbackReader.java
index d3134c1c394..80e949a170a 100644
--- a/libjava/java/io/PushbackReader.java
+++ b/libjava/java/io/PushbackReader.java
@@ -39,402 +39,342 @@ exception statement from your version. */
package java.io;
/**
- * This subclass of <code>FilterReader</code> provides the ability to
- * unread data from a stream. It maintains an internal buffer of unread
- * data that is supplied to the next read operation. This is conceptually
- * similar to mark/reset functionality, except that in this case the
- * position to reset the stream to does not need to be known in advance.
- * <p>
- * The default pushback buffer size one char, but this can be overridden
- * by the creator of the stream.
- *
- * @version 0.0
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
- */
-public class PushbackReader extends FilterReader
-{
-
-/*************************************************************************/
-
-/*
- * Class Variables
- */
-
-/**
- * This is the default buffer size
- */
-private static final int DEFAULT_BUFFER_SIZE = 1;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * This is the buffer that is used to store the pushed back data
- */
-private char[] buf;
-
-/**
- * This is the position in the buffer from which the next char will be
- * read. Bytes are stored in reverse order in the buffer, starting from
- * <code>buf[buf.length - 1]</code> to <code>buf[0]</code>. Thus when
- * <code>pos</code> is 0 the buffer is full and <code>buf.length</code> when
- * it is empty
- */
-private int pos;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * This method initializes a <code>PushbackReader</code> to read from the
- * specified subordinate <code>Reader</code> with a default pushback buffer
- * size of 1.
- *
- * @code in The subordinate stream to read from
- */
-public
-PushbackReader(Reader in)
-{
- this(in, DEFAULT_BUFFER_SIZE);
-}
-
-/*************************************************************************/
-
-/**
- * This method initializes a <code>PushbackReader</code> to read from the
- * specified subordinate <code>Reader</code> with the specified buffer
- * size
- *
- * @param in The subordinate <code>Reader</code> to read from
- * @param bufsize The pushback buffer size to use
- */
-public
-PushbackReader(Reader in, int bufsize)
-{
- super(in);
-
- if (bufsize < 0)
- throw new IllegalArgumentException("buffer size must be positive");
-
- buf = new char[bufsize];
- pos = bufsize;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
+ * This subclass of <code>FilterReader</code> provides the ability to
+ * unread data from a stream. It maintains an internal buffer of unread
+ * data that is supplied to the next read operation. This is conceptually
+ * similar to mark/reset functionality, except that in this case the
+ * position to reset the stream to does not need to be known in advance.
+ * <p>
+ * The default pushback buffer size one char, but this can be overridden
+ * by the creator of the stream.
+ *
+ * @version 0.0
+ *
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Warren Levy <warrenl@cygnus.com>
*/
-
-/**
- * This method closes the stream and frees any associated resources.
- *
- * @exception IOException If an error occurs.
- */
-public void
-close() throws IOException
-{
- synchronized (lock)
- {
- buf = null;
- super.close();
- }
-}
-
-/*************************************************************************/
-
-/**
- * This method throws an exception when called since this class does
- * not support mark/reset.
- *
- * @param read_limit Not used.
- *
- * @exception IOException Always thrown to indicate mark/reset not supported.
- */
-public void
-mark(int read_limit) throws IOException
-{
- throw new IOException("mark not supported in this class");
-}
-
-/*************************************************************************/
-
-/**
- * This method returns <code>false</code> to indicate that it does not support
- * mark/reset functionality.
- *
- * @return This method returns <code>false</code> to indicate that this class does not support mark/reset functionality
- *
- */
-public boolean
-markSupported()
-{
- return(false);
-}
-
-/*************************************************************************/
-
-/**
- * This method always throws an IOException in this class because
- * mark/reset functionality is not supported.
- *
- * @exception IOException Always thrown for this class
- */
-public void
-reset() throws IOException
-{
- throw new IOException("reset not supported in this class");
-}
-
-/*************************************************************************/
-
-/**
- * This method determines whether or not this stream is ready to be read.
- * If it returns <code>false</code> to indicate that the stream is not
- * ready, any attempt to read from the stream could (but is not
- * guaranteed to) block.
- * <p>
- * This stream is ready to read if there are either chars waiting to be
- * read in the pushback buffer or if the underlying stream is ready to
- * be read.
- *
- * @return <code>true</code> if this stream is ready to be read, <code>false</code> otherwise
- *
- * @exception IOException If an error occurs
- */
-public boolean
-ready() throws IOException
-{
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException ("stream closed");
-
- if (((buf.length - pos) > 0) || super.ready())
- return(true);
- else
- return(false);
- }
-}
-
-/*************************************************************************/
-
-// Don't delete this method just because the spec says it shouldn't be there!
-// See the CVS log for details.
-/**
- * This method skips the specified number of chars in the stream. It
- * returns the actual number of chars skipped, which may be less than the
- * requested amount.
- * <p>
- * This method first discards chars from the buffer, then calls the
- * <code>skip</code> method on the underlying <code>Reader</code> to
- * skip additional chars if necessary.
- *
- * @param num_chars The requested number of chars to skip
- *
- * @return The actual number of chars skipped.
- *
- * @exception IOException If an error occurs
- */
-public long
-skip(long num_chars) throws IOException
-{
- synchronized (lock)
- {
- if (num_chars <= 0)
- return(0);
-
- if ((buf.length - pos) >= num_chars)
- {
- pos += num_chars;
- return(num_chars);
- }
-
- int chars_discarded = buf.length - pos;
- pos = buf.length;
-
- long chars_skipped = in.skip(num_chars - chars_discarded);
-
- return(chars_discarded + chars_skipped);
- } // synchronized
-}
-
-/*************************************************************************/
-
-/**
- * This method reads an unsigned char from the input stream and returns it
- * as an int in the range of 0-65535. This method also will return -1 if
- * the end of the stream has been reached. The char returned will be read
- * from the pushback buffer, unless the buffer is empty, in which case
- * the char will be read from the underlying stream.
- * <p>
- * This method will block until the char can be read.
- *
- * @return The char read or -1 if end of stream
- *
- * @exception IOException If an error occurs
- */
-public int
-read() throws IOException
-{
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("stream closed");
-
- if (pos == buf.length)
- return(super.read());
-
- ++pos;
- return((buf[pos - 1] & 0xFFFF));
- }
-}
-
-/*************************************************************************/
-
-/**
- * This method read chars from a stream and stores them into a caller
- * supplied buffer. It starts storing the data at index <code>offset</code> into
- * the buffer and attempts to read <code>len</code> chars. This method can
- * return before reading the number of chars requested. The actual number
- * of chars read is returned as an int. A -1 is returned to indicate the
- * end of the stream.
- * <p>
- * This method will block until some data can be read.
- * <p>
- * This method first reads chars from the pushback buffer in order to
- * satisfy the read request. If the pushback buffer cannot provide all
- * of the chars requested, the remaining chars are read from the
- * underlying stream.
- *
- * @param buf The array into which the chars read should be stored
- * @param offset The offset into the array to start storing chars
- * @param len The requested number of chars to read
- *
- * @return The actual number of chars read, or -1 if end of stream.
- *
- * @exception IOException If an error occurs.
- */
-public synchronized int
-read(char[] b, int offset, int len) throws IOException
-{
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("stream closed");
-
- if (offset < 0 || len < 0 || offset + len > b.length)
- throw new ArrayIndexOutOfBoundsException();
-
- int numBytes = Math.min(buf.length - pos, len);
- if (numBytes > 0)
- {
- System.arraycopy (buf, pos, b, offset, numBytes);
- pos += numBytes;
- return numBytes;
- }
-
- return super.read(b, offset, len);
- }
-}
-
-/*************************************************************************/
-
-/**
- * This method pushes a single char of data into the pushback buffer.
- * The char pushed back is the one that will be returned as the first char
- * of the next read.
- * <p>
- * If the pushback buffer is full, this method throws an exception.
- * <p>
- * The argument to this method is an <code>int</code>. Only the low eight bits
- * of this value are pushed back.
- *
- * @param b The char to be pushed back, passed as an int
- *
- * @exception IOException If the pushback buffer is full.
- */
-public void
-unread(int b) throws IOException
-{
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("stream closed");
- if (pos == 0)
- throw new IOException("Pushback buffer is full");
-
- --pos;
- buf[pos] = (char)(b & 0xFFFF);
- } // synchronized
-}
-
-/*************************************************************************/
-
-/**
- * This method pushes all of the chars in the passed char array into
- * the pushback buffer. These chars are pushed in reverse order so that
- * the next char read from the stream after this operation will be
- * <code>buf[0]</code> followed by <code>buf[1]</code>, etc.
- * <p>
- * If the pushback buffer cannot hold all of the requested chars, an
- * exception is thrown.
- *
- * @param buf The char array to be pushed back
- *
- * @exception IOException If the pushback buffer is full
- */
-public synchronized void
-unread(char[] buf) throws IOException
-{
- unread(buf, 0, buf.length);
-}
-
-/*************************************************************************/
-
-/**
- * This method pushed back chars from the passed in array into the pushback
- * buffer. The chars from <code>buf[offset]</code> to <code>buf[offset + len]</code>
- * are pushed in reverse order so that the next char read from the stream
- * after this operation will be <code>buf[offset]</code> followed by
- * <code>buf[offset + 1]</code>, etc.
- * <p>
- * If the pushback buffer cannot hold all of the requested chars, an
- * exception is thrown.
- *
- * @param buf The char array to be pushed back
- * @param offset The index into the array where the chars to be push start
- * @param len The number of chars to be pushed.
- *
- * @exception IOException If the pushback buffer is full
- */
-public synchronized void
-unread(char[] b, int offset, int len) throws IOException
+public class PushbackReader extends FilterReader
{
- synchronized (lock)
- {
- if (buf == null)
- throw new IOException("stream closed");
- if (pos < len)
- throw new IOException("Pushback buffer is full");
-
- // Note the order that these chars are being added is the opposite
- // of what would be done if they were added to the buffer one at a time.
- // See the Java Class Libraries book p. 1397.
- System.arraycopy(b, offset, buf, pos - len, len);
-
- // Don't put this into the arraycopy above, an exception might be thrown
- // and in that case we don't want to modify pos.
- pos -= len;
- }
+ /**
+ * This is the default buffer size
+ */
+ private static final int DEFAULT_BUFFER_SIZE = 1;
+
+ /**
+ * This is the buffer that is used to store the pushed back data
+ */
+ private char[] buf;
+
+ /**
+ * This is the position in the buffer from which the next char will be
+ * read. Bytes are stored in reverse order in the buffer, starting from
+ * <code>buf[buf.length - 1]</code> to <code>buf[0]</code>. Thus when
+ * <code>pos</code> is 0 the buffer is full and <code>buf.length</code> when
+ * it is empty
+ */
+ private int pos;
+
+ /**
+ * This method initializes a <code>PushbackReader</code> to read from the
+ * specified subordinate <code>Reader</code> with a default pushback buffer
+ * size of 1.
+ *
+ * @code in The subordinate stream to read from
+ */
+ public PushbackReader(Reader in)
+ {
+ this(in, DEFAULT_BUFFER_SIZE);
+ }
+
+ /**
+ * This method initializes a <code>PushbackReader</code> to read from the
+ * specified subordinate <code>Reader</code> with the specified buffer
+ * size
+ *
+ * @param in The subordinate <code>Reader</code> to read from
+ * @param bufsize The pushback buffer size to use
+ */
+ public PushbackReader(Reader in, int bufsize)
+ {
+ super(in);
+
+ if (bufsize < 0)
+ throw new IllegalArgumentException("buffer size must be positive");
+
+ buf = new char[bufsize];
+ pos = bufsize;
+ }
+
+ /**
+ * This method closes the stream and frees any associated resources.
+ *
+ * @exception IOException If an error occurs.
+ */
+ public void close() throws IOException
+ {
+ synchronized (lock)
+ {
+ buf = null;
+ super.close();
+ }
+ }
+
+ /**
+ * This method throws an exception when called since this class does
+ * not support mark/reset.
+ *
+ * @param read_limit Not used.
+ *
+ * @exception IOException Always thrown to indicate mark/reset not supported.
+ */
+ public void mark(int read_limit) throws IOException
+ {
+ throw new IOException("mark not supported in this class");
+ }
+
+ /**
+ * This method returns <code>false</code> to indicate that it does not support
+ * mark/reset functionality.
+ *
+ * @return This method returns <code>false</code> to indicate that this class does not support mark/reset functionality
+ *
+ */
+ public boolean markSupported()
+ {
+ return(false);
+ }
+
+ /**
+ * This method always throws an IOException in this class because
+ * mark/reset functionality is not supported.
+ *
+ * @exception IOException Always thrown for this class
+ */
+ public void reset() throws IOException
+ {
+ throw new IOException("reset not supported in this class");
+ }
+
+ /**
+ * This method determines whether or not this stream is ready to be read.
+ * If it returns <code>false</code> to indicate that the stream is not
+ * ready, any attempt to read from the stream could (but is not
+ * guaranteed to) block.
+ * <p>
+ * This stream is ready to read if there are either chars waiting to be
+ * read in the pushback buffer or if the underlying stream is ready to
+ * be read.
+ *
+ * @return <code>true</code> if this stream is ready to be read, <code>false</code> otherwise
+ *
+ * @exception IOException If an error occurs
+ */
+ public boolean ready() throws IOException
+ {
+ synchronized (lock)
+ {
+ if (buf == null)
+ throw new IOException ("stream closed");
+
+ if (((buf.length - pos) > 0) || super.ready())
+ return(true);
+ else
+ return(false);
+ }
+ }
+
+ // Don't delete this method just because the spec says it shouldn't be there!
+ // See the CVS log for details.
+ /**
+ * This method skips the specified number of chars in the stream. It
+ * returns the actual number of chars skipped, which may be less than the
+ * requested amount.
+ * <p>
+ * This method first discards chars from the buffer, then calls the
+ * <code>skip</code> method on the underlying <code>Reader</code> to
+ * skip additional chars if necessary.
+ *
+ * @param num_chars The requested number of chars to skip
+ *
+ * @return The actual number of chars skipped.
+ *
+ * @exception IOException If an error occurs
+ */
+ public long skip(long num_chars) throws IOException
+ {
+ synchronized (lock)
+ {
+ if (num_chars <= 0)
+ return(0);
+
+ if ((buf.length - pos) >= num_chars)
+ {
+ pos += num_chars;
+ return(num_chars);
+ }
+
+ int chars_discarded = buf.length - pos;
+ pos = buf.length;
+
+ long chars_skipped = in.skip(num_chars - chars_discarded);
+
+ return(chars_discarded + chars_skipped);
+ }
+ }
+
+ /**
+ * This method reads an unsigned char from the input stream and returns it
+ * as an int in the range of 0-65535. This method also will return -1 if
+ * the end of the stream has been reached. The char returned will be read
+ * from the pushback buffer, unless the buffer is empty, in which case
+ * the char will be read from the underlying stream.
+ * <p>
+ * This method will block until the char can be read.
+ *
+ * @return The char read or -1 if end of stream
+ *
+ * @exception IOException If an error occurs
+ */
+ public int read() throws IOException
+ {
+ synchronized (lock)
+ {
+ if (buf == null)
+ throw new IOException("stream closed");
+
+ if (pos == buf.length)
+ return(super.read());
+
+ ++pos;
+ return((buf[pos - 1] & 0xFFFF));
+ }
+ }
+
+ /**
+ * This method read chars from a stream and stores them into a caller
+ * supplied buffer. It starts storing the data at index <code>offset</code> into
+ * the buffer and attempts to read <code>len</code> chars. This method can
+ * return before reading the number of chars requested. The actual number
+ * of chars read is returned as an int. A -1 is returned to indicate the
+ * end of the stream.
+ * <p>
+ * This method will block until some data can be read.
+ * <p>
+ * This method first reads chars from the pushback buffer in order to
+ * satisfy the read request. If the pushback buffer cannot provide all
+ * of the chars requested, the remaining chars are read from the
+ * underlying stream.
+ *
+ * @param buf The array into which the chars read should be stored
+ * @param offset The offset into the array to start storing chars
+ * @param len The requested number of chars to read
+ *
+ * @return The actual number of chars read, or -1 if end of stream.
+ *
+ * @exception IOException If an error occurs.
+ */
+ public synchronized int read(char[] b, int offset, int len) throws IOException
+ {
+ synchronized (lock)
+ {
+ if (buf == null)
+ throw new IOException("stream closed");
+
+ if (offset < 0 || len < 0 || offset + len > b.length)
+ throw new ArrayIndexOutOfBoundsException();
+
+ int numBytes = Math.min(buf.length - pos, len);
+ if (numBytes > 0)
+ {
+ System.arraycopy (buf, pos, b, offset, numBytes);
+ pos += numBytes;
+ return numBytes;
+ }
+
+ return super.read(b, offset, len);
+ }
+ }
+
+ /**
+ * This method pushes a single char of data into the pushback buffer.
+ * The char pushed back is the one that will be returned as the first char
+ * of the next read.
+ * <p>
+ * If the pushback buffer is full, this method throws an exception.
+ * <p>
+ * The argument to this method is an <code>int</code>. Only the low eight bits
+ * of this value are pushed back.
+ *
+ * @param b The char to be pushed back, passed as an int
+ *
+ * @exception IOException If the pushback buffer is full.
+ */
+ public void unread(int b) throws IOException
+ {
+ synchronized (lock)
+ {
+ if (buf == null)
+ throw new IOException("stream closed");
+ if (pos == 0)
+ throw new IOException("Pushback buffer is full");
+
+ --pos;
+ buf[pos] = (char)(b & 0xFFFF);
+ }
+ }
+
+ /**
+ * This method pushes all of the chars in the passed char array into
+ * the pushback buffer. These chars are pushed in reverse order so that
+ * the next char read from the stream after this operation will be
+ * <code>buf[0]</code> followed by <code>buf[1]</code>, etc.
+ * <p>
+ * If the pushback buffer cannot hold all of the requested chars, an
+ * exception is thrown.
+ *
+ * @param buf The char array to be pushed back
+ *
+ * @exception IOException If the pushback buffer is full
+ */
+ public synchronized void unread(char[] buf) throws IOException
+ {
+ unread(buf, 0, buf.length);
+ }
+
+ /**
+ * This method pushed back chars from the passed in array into the pushback
+ * buffer. The chars from <code>buf[offset]</code> to <code>buf[offset + len]</code>
+ * are pushed in reverse order so that the next char read from the stream
+ * after this operation will be <code>buf[offset]</code> followed by
+ * <code>buf[offset + 1]</code>, etc.
+ * <p>
+ * If the pushback buffer cannot hold all of the requested chars, an
+ * exception is thrown.
+ *
+ * @param buf The char array to be pushed back
+ * @param offset The index into the array where the chars to be push start
+ * @param len The number of chars to be pushed.
+ *
+ * @exception IOException If the pushback buffer is full
+ */
+ public synchronized void unread(char[] b, int offset, int len)
+ throws IOException
+ {
+ synchronized (lock)
+ {
+ if (buf == null)
+ throw new IOException("stream closed");
+ if (pos < len)
+ throw new IOException("Pushback buffer is full");
+
+ // Note the order that these chars are being added is the opposite
+ // of what would be done if they were added to the buffer one at a time.
+ // See the Java Class Libraries book p. 1397.
+ System.arraycopy(b, offset, buf, pos - len, len);
+
+ // Don't put this into the arraycopy above, an exception might be thrown
+ // and in that case we don't want to modify pos.
+ pos -= len;
+ }
+ }
}
-
-} // class PushbackReader
diff --git a/libjava/java/io/natFileDescriptorWin32.cc b/libjava/java/io/natFileDescriptorWin32.cc
index 694272a67bd..bc9cbc85bc9 100644
--- a/libjava/java/io/natFileDescriptorWin32.cc
+++ b/libjava/java/io/natFileDescriptorWin32.cc
@@ -124,6 +124,13 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
throw new FileNotFoundException (JvNewStringLatin1 (msg));
}
+ // For APPEND mode, move the file pointer to the end of the file.
+ if (jflags & APPEND)
+ {
+ DWORD low = SetFilePointer (handle, 0, NULL, FILE_END);
+ if ((low == 0xffffffff) && (GetLastError () != NO_ERROR))
+ throw new FileNotFoundException (JvNewStringLatin1 (winerr ()));
+ }
return (jint)handle;
}
diff --git a/libjava/java/io/natFileWin32.cc b/libjava/java/io/natFileWin32.cc
index 38927ca2481..af955016c4f 100644
--- a/libjava/java/io/natFileWin32.cc
+++ b/libjava/java/io/natFileWin32.cc
@@ -1,6 +1,6 @@
// natFileWin32.cc - Native part of File class.
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2002 Red Hat, Inc.
This file is part of libgcj.
@@ -32,9 +32,8 @@ java::io::File::_access (jint query)
jstring canon = getCanonicalPath();
if (! canon)
return false;
- char buf[MAX_PATH];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
- // FIXME?
buf[total] = '\0';
JvAssert (query == READ || query == WRITE || query == EXISTS);
@@ -56,9 +55,8 @@ java::io::File::_stat (jint query)
jstring canon = getCanonicalPath();
if (! canon)
return false;
- char buf[MAX_PATH];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
- // FIXME?
buf[total] = '\0';
JvAssert (query == DIRECTORY || query == ISFILE);
@@ -79,9 +77,8 @@ java::io::File::attr (jint query)
jstring canon = getCanonicalPath();
if (! canon)
return false;
- char buf[MAX_PATH];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
- // FIXME?
buf[total] = '\0';
JvAssert (query == MODIFIED || query == LENGTH);
@@ -102,14 +99,14 @@ java::io::File::attr (jint query)
jstring
java::io::File::getCanonicalPath (void)
{
- char buf[MAX_PATH], buf2[MAX_PATH];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1);
jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
- // FIXME?
buf[total] = '\0';
LPTSTR unused;
+ char buf2[MAX_PATH];
if(!GetFullPathName(buf, MAX_PATH, buf2, &unused))
- _Jv_Throw (new IOException (JvNewStringLatin1 ("GetFullPathName failed")));
+ throw new IOException (JvNewStringLatin1 ("GetFullPathName failed"));
// FIXME: what encoding to assume for file names? This affects many
// calls.
@@ -143,7 +140,7 @@ java::io::File::performList (java::io::FilenameFilter *filter,
jstring canon = getCanonicalPath();
if (! canon)
return NULL;
- char buf[MAX_PATH];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 5);
jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
// FIXME?
strcpy(&buf[total], "\\*.*");
@@ -161,13 +158,17 @@ java::io::File::performList (java::io::FilenameFilter *filter,
{
jstring name = JvNewStringUTF (data.cFileName);
- if (filter && !filter->accept(this, name)) continue;
- if (clazz == &java::io::File::class$) {
+ if (filter && !filter->accept(this, name))
+ continue;
+ if (clazz == &java::io::File::class$)
+ {
java::io::File *file = new java::io::File (this, name);
- if (fileFilter && !fileFilter->accept(file)) continue;
- }
- vec->addElement (name);
-
+ if (fileFilter && !fileFilter->accept(file))
+ continue;
+ vec->addElement (file);
+ }
+ else
+ vec->addElement (name);
}
}
while (FindNextFile (handle, &data));
@@ -177,13 +178,8 @@ java::io::File::performList (java::io::FilenameFilter *filter,
FindClose (handle);
- jobjectArray ret = JvNewObjectArray (vec->size(), canon->getClass(), NULL);
+ jobjectArray ret = JvNewObjectArray (vec->size(), clazz, NULL);
vec->copyInto (ret);
- if (clazz == &java::io::File::class$) {
- jobject *ret_elements = elements(ret);
- for(int i=0; i<ret->length; i++)
- ret_elements[i] = new File((jstring)(ret_elements[i]));
- }
return ret;
}
@@ -191,9 +187,8 @@ java::io::File::performList (java::io::FilenameFilter *filter,
jboolean
java::io::File::performMkdir (void)
{
- char buf[MAX_PATH];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1);
jsize total = JvGetStringUTFRegion(path, 0, path->length(), buf);
- // FIXME?
buf[total] = '\0';
return (CreateDirectory(buf, NULL)) ? true : false;
@@ -202,13 +197,12 @@ java::io::File::performMkdir (void)
jboolean
java::io::File::performRenameTo (File *dest)
{
- char buf[MAX_PATH];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1);
jsize total = JvGetStringUTFRegion(path, 0, path->length(), buf);
- // FIXME?
buf[total] = '\0';
- char buf2[MAX_PATH];
+ char *buf2 = (char *) __builtin_alloca (JvGetStringUTFLength (dest->path)
+ + 1);
total = JvGetStringUTFRegion(dest->path, 0, dest->path->length(), buf2);
- // FIXME?
buf2[total] = '\0';
return (MoveFile(buf, buf2)) ? true : false;
@@ -218,9 +212,8 @@ jboolean
java::io::File::performDelete ()
{
jstring canon = getCanonicalPath();
- char buf[MAX_PATH];
+ char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
jsize total = JvGetStringUTFRegion(canon, 0, canon->length(), buf);
- // FIXME?
buf[total] = '\0';
DWORD attributes = GetFileAttributes (buf);
diff --git a/libjava/java/lang/Character.java b/libjava/java/lang/Character.java
index 611700ba7e7..405232ed41d 100644
--- a/libjava/java/lang/Character.java
+++ b/libjava/java/lang/Character.java
@@ -1583,7 +1583,7 @@ public final class Character implements Serializable, Comparable
*/
public static boolean isDefined(char ch)
{
- return getType(ch) == UNASSIGNED;
+ return getType(ch) != UNASSIGNED;
}
/**
diff --git a/libjava/java/lang/ieeefp.h b/libjava/java/lang/ieeefp.h
index 32ff11fdc4b..8615c7d60ec 100644
--- a/libjava/java/lang/ieeefp.h
+++ b/libjava/java/lang/ieeefp.h
@@ -5,11 +5,13 @@
#define __IEEE_LITTLE_ENDIAN
#endif
-#ifdef __arm__
+#if defined(__arm__) || defined(__thumb__)
/* ARM always has big-endian words. Within those words the byte ordering
- appears to be big or little endian. Newlib doesn't seem to care about
- the byte ordering within words. */
+ will be big or little endian depending upon the target. */
#define __IEEE_BIG_ENDIAN
+#ifdef __ARMEL__
+#define __IEEE_BYTES_LITTLE_ENDIAN
+#endif
#endif
#ifdef __hppa__
@@ -124,6 +126,10 @@
#endif
#endif
+#ifdef __s390__
+#define __IEEE_BIG_ENDIAN
+#endif
+
#ifndef __IEEE_BIG_ENDIAN
#ifndef __IEEE_LITTLE_ENDIAN
#error Endianess not declared!!
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc
index 75d9e32ff2e..b98e96541b2 100644
--- a/libjava/java/lang/natClassLoader.cc
+++ b/libjava/java/lang/natClassLoader.cc
@@ -1,6 +1,6 @@
// natClassLoader.cc - Implementation of java.lang.ClassLoader native methods.
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
This file is part of libgcj.
@@ -203,7 +203,8 @@ gnu::gcj::runtime::VMClassLoader::findClass (jstring name)
java::lang::StringBuffer *sb = new java::lang::StringBuffer (JvNewStringLatin1("lib-"));
jstring so_base_name = (sb->append (name)->toString ())->replace ('.', '-');
- while (! klass && so_base_name && so_base_name->length() > 0)
+ // Compare against `3' because that is the length of "lib".
+ while (! klass && so_base_name && so_base_name->length() > 3)
{
using namespace ::java::lang;
Runtime *rt = Runtime::getRuntime();
diff --git a/libjava/java/lang/natDouble.cc b/libjava/java/lang/natDouble.cc
index b0b24a7547c..329795d3e21 100644
--- a/libjava/java/lang/natDouble.cc
+++ b/libjava/java/lang/natDouble.cc
@@ -161,9 +161,19 @@ jdouble
java::lang::Double::parseDouble(jstring str)
{
int length = str->length();
+
while (length > 0
&& Character::isWhitespace(str->charAt(length - 1)))
length--;
+
+ // The String could end with a f/F/d/D which is valid but we don't need.
+ if (length > 0)
+ {
+ jchar last = str->charAt(length-1);
+ if (last == 'f' || last == 'F' || last == 'd' || last == 'D')
+ length--;
+ }
+
jsize start = 0;
while (length > 0
&& Character::isWhitespace(str->charAt(start)))
@@ -184,7 +194,7 @@ java::lang::Double::parseDouble(jstring str)
if (endptr == data + blength)
return val;
}
- throw new NumberFormatException;
+ throw new NumberFormatException(str);
}
void
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index 18bc3cb9bf9..a566bf4d999 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -1,6 +1,6 @@
// natRuntime.cc - Implementation of native side of Runtime class.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
This file is part of libgcj.
@@ -167,7 +167,8 @@ java::lang::Runtime::_load (jstring path, jboolean do_search)
return;
}
jint vers = ((jint (*) (JavaVM *, void *)) onload) (vm, NULL);
- if (vers != JNI_VERSION_1_1 && vers != JNI_VERSION_1_2)
+ if (vers != JNI_VERSION_1_1 && vers != JNI_VERSION_1_2
+ && vers != JNI_VERSION_1_4)
{
// FIXME: unload the library.
throw new UnsatisfiedLinkError (JvNewStringLatin1 ("unrecognized version from JNI_OnLoad"));
diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc
index e8c0572a68d..b8467f2077b 100644
--- a/libjava/java/lang/natSystem.cc
+++ b/libjava/java/lang/natSystem.cc
@@ -301,20 +301,30 @@ java::lang::System::init_properties (void)
// A mixture of the Java Product Versioning Specification
// (introduced in 1.2), and earlier versioning properties.
- SET ("java.version", VERSION);
+ SET ("java.version", GCJVERSION);
SET ("java.vendor", "Free Software Foundation, Inc.");
SET ("java.vendor.url", "http://gcc.gnu.org/java/");
- SET ("java.class.version", __VERSION__);
- SET ("java.vm.specification.version", "1.1");
+ SET ("java.class.version", "46.0");
+ SET ("java.vm.specification.version", "1.0");
SET ("java.vm.specification.name", "Java(tm) Virtual Machine Specification");
SET ("java.vm.specification.vendor", "Sun Microsystems Inc.");
SET ("java.vm.version", __VERSION__);
SET ("java.vm.vendor", "Free Software Foundation, Inc.");
- SET ("java.vm.name", "libgcj");
- SET ("java.specification.version", "1.1");
- SET ("java.specification.name", "Java(tm) Language Specification");
+ SET ("java.vm.name", "GNU libgcj");
+ SET ("java.specification.version", "1.3");
+ SET ("java.specification.name", "Java(tm) Platform API Specification");
SET ("java.specification.vendor", "Sun Microsystems Inc.");
+ char value[100];
+#define NAME "GNU libgcj "
+ strcpy (value, NAME);
+ strncpy (value + sizeof (NAME) - 1, __VERSION__,
+ sizeof(value) - sizeof(NAME));
+ value[sizeof (value) - 1] = '\0';
+ jstring version = JvNewStringLatin1 (value);
+ newprops->put (JvNewStringLatin1 ("java.fullversion"), version);
+ newprops->put (JvNewStringLatin1 ("java.vm.info"), version);
+
// This definition is rather arbitrary: we choose $(prefix). In
// part we do this because most people specify only --prefix and
// nothing else when installing gcj. Plus, people are free to
@@ -323,22 +333,6 @@ java::lang::System::init_properties (void)
SET ("file.encoding", default_file_encoding);
-#ifdef WIN32
- SET ("file.separator", "\\");
- SET ("path.separator", ";");
- SET ("line.separator", "\r\n");
- SET ("java.io.tmpdir", "C:\\temp");
-#else
- // Unix.
- SET ("file.separator", "/");
- SET ("path.separator", ":");
- SET ("line.separator", "\n");
- char *tmpdir = ::getenv("TMPDIR");
- if (! tmpdir)
- tmpdir = "/tmp";
- SET ("java.io.tmpdir", tmpdir);
-#endif
-
#ifdef HAVE_UNAME
struct utsname u;
if (! uname (&u))
@@ -505,6 +499,10 @@ java::lang::System::init_properties (void)
newprops->put(JvNewStringLatin1 ("java.class.path"),
sb->toString ());
}
+
+ // Allow platform specific settings and overrides.
+ _Jv_platform_initProperties (newprops);
+
// Finally, set the field. This ensures that concurrent getProperty()
// calls will return initialized values without requiring them to be
// synchronized in the common case.
diff --git a/libjava/java/lang/natThread.cc b/libjava/java/lang/natThread.cc
index 4c0d978767d..7fe8fb0db46 100644
--- a/libjava/java/lang/natThread.cc
+++ b/libjava/java/lang/natThread.cc
@@ -1,6 +1,6 @@
// natThread.cc - Native part of Thread class.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
This file is part of libgcj.
@@ -410,6 +410,21 @@ _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group)
return thread;
}
+java::lang::Thread*
+_Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group)
+{
+ java::lang::Thread *thread = _Jv_ThreadCurrent ();
+ if (thread != NULL)
+ return thread;
+ if (name == NULL)
+ name = java::lang::Thread::gen_name ();
+ thread = new java::lang::Thread (NULL, group, NULL, name);
+ thread->setDaemon (true);
+ _Jv_AttachCurrentThread (thread);
+ _Jv_NotifyThreadStart (thread);
+ return thread;
+}
+
jint
_Jv_DetachCurrentThread (void)
{
diff --git a/libjava/java/lang/reflect/Modifier.java b/libjava/java/lang/reflect/Modifier.java
index 3e36d370d4e..75d0c9b47f5 100644
--- a/libjava/java/lang/reflect/Modifier.java
+++ b/libjava/java/lang/reflect/Modifier.java
@@ -280,8 +280,8 @@ public class Modifier
/**
* Get a string representation of all the modifiers represented by the
* given int. The keywords are printed in this order:
- * <code>&lt;public|private|protected&gt; abstract static final transient
- * volatile native synchronized interface strictfp</code>.
+ * <code>&lt;public|protected|private&gt; abstract static final transient
+ * volatile synchronized native strictfp interface</code>.
*
* @param mod the modifier.
* @return the String representing the modifiers.
@@ -301,10 +301,10 @@ public class Modifier
{
if (isPublic(mod))
r.append("public ");
- if (isPrivate(mod))
- r.append("private ");
if (isProtected(mod))
r.append("protected ");
+ if (isPrivate(mod))
+ r.append("private ");
if (isAbstract(mod))
r.append("abstract ");
if (isStatic(mod))
@@ -315,14 +315,14 @@ public class Modifier
r.append("transient ");
if (isVolatile(mod))
r.append("volatile ");
- if (isNative(mod))
- r.append("native ");
if (isSynchronized(mod))
r.append("synchronized ");
- if (isInterface(mod))
- r.append("interface ");
+ if (isNative(mod))
+ r.append("native ");
if (isStrict(mod))
r.append("strictfp ");
+ if (isInterface(mod))
+ r.append("interface ");
// Trim trailing space.
if ((mod & ALL_FLAGS) != 0)
diff --git a/libjava/java/net/PlainDatagramSocketImpl.java b/libjava/java/net/PlainDatagramSocketImpl.java
index 7076ccf31b1..55ea468dadc 100644
--- a/libjava/java/net/PlainDatagramSocketImpl.java
+++ b/libjava/java/net/PlainDatagramSocketImpl.java
@@ -67,27 +67,7 @@ class PlainDatagramSocketImpl extends DatagramSocketImpl
public native Object getOption(int optID) throws SocketException;
private native void mcastGrp(InetAddress inetaddr, boolean join)
throws IOException;
-
- protected void close()
- {
- // FIXME: The close method in each of the DatagramSocket* classes does
- // not throw an IOException. The issue is that FileDescriptor.close()
- // in natFileDescriptorPosix.cc can throw one, so we have to catch
- // it here. It seems that FileDescriptor.close is properly throwing
- // the IOException on errors since many of the java.io classes depend
- // on that. This probably requires a bit more research but for now,
- // we'll catch the IOException here.
- try
- {
- if (fd.valid())
- fd.close();
- }
- catch (IOException e)
- {
- System.err.println("PlainDatagramSocketImpl.close: Error closing - " +
- e.getMessage());
- }
- }
+ protected native void close();
// Deprecated in JDK 1.2.
protected byte getTTL() throws IOException
@@ -110,4 +90,14 @@ class PlainDatagramSocketImpl extends DatagramSocketImpl
{
mcastGrp(inetaddr, false);
}
+
+ protected void finalize() throws Throwable
+ {
+ synchronized (this)
+ {
+ if (fnum != -1)
+ close();
+ }
+ super.finalize();
+ }
}
diff --git a/libjava/java/net/PlainSocketImpl.java b/libjava/java/net/PlainSocketImpl.java
index 81df4873850..354d652a5bf 100644
--- a/libjava/java/net/PlainSocketImpl.java
+++ b/libjava/java/net/PlainSocketImpl.java
@@ -39,11 +39,6 @@ class PlainSocketImpl extends SocketImpl
* This is used for reads and writes to/from the socket and
* to close it.
*
- * {@link SocketImpl#fd} is created from this like so:
- * <pre>
- * fd = new FileDescriptor (fnum);
- * </pre>
- *
* When the socket is closed this is reset to -1.
*/
int fnum = -1;
@@ -108,6 +103,22 @@ class PlainSocketImpl extends SocketImpl
private native void write(byte[] buffer, int offset, int count)
throws IOException;
+ protected void finalize() throws Throwable
+ {
+ synchronized (this)
+ {
+ if (fnum != -1)
+ try
+ {
+ close();
+ }
+ catch (IOException ex)
+ {
+ // ignore
+ }
+ }
+ super.finalize();
+ }
/** @return the input stream attached to the socket.
*/
diff --git a/libjava/java/net/natPlainDatagramSocketImpl.cc b/libjava/java/net/natPlainDatagramSocketImpl.cc
index 81e17cc52a7..3c318d7667c 100644
--- a/libjava/java/net/natPlainDatagramSocketImpl.cc
+++ b/libjava/java/net/natPlainDatagramSocketImpl.cc
@@ -8,7 +8,7 @@ details. */
#include <config.h>
-#include<platform.h>
+#include <platform.h>
#ifdef WIN32
#include <errno.h>
@@ -16,6 +16,13 @@ details. */
#ifndef ENOPROTOOPT
#define ENOPROTOOPT 109
#endif
+
+static inline int
+close(int s)
+{
+ return closesocket(s);
+}
+
#else /* WIN32 */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -51,7 +58,6 @@ _Jv_bind (int fd, struct sockaddr *addr, int addrlen)
#include <gcj/cni.h>
#include <java/io/IOException.h>
-#include <java/io/FileDescriptor.h>
#include <java/io/InterruptedIOException.h>
#include <java/net/BindException.h>
#include <java/net/SocketException.h>
@@ -91,6 +97,13 @@ java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *)
}
void
+java::net::PlainDatagramSocketImpl::close ()
+{
+ throw new java::io::IOException (
+ JvNewStringLatin1 ("DatagramSocketImpl.close: unimplemented"));
+}
+
+void
java::net::PlainDatagramSocketImpl::send (java::net::DatagramPacket *)
{
throw new java::io::IOException (
@@ -188,8 +201,9 @@ java::net::PlainDatagramSocketImpl::create ()
_Jv_platform_close_on_exec (sock);
+ // We use fnum in place of fd here. From leaving fd null we avoid
+ // the double close problem in FileDescriptor.finalize.
fnum = sock;
- fd = new java::io::FileDescriptor (sock);
}
void
@@ -284,6 +298,20 @@ java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *i)
throw new java::io::IOException (JvNewStringUTF (strerr));
}
+// Close(shutdown) the socket.
+void
+java::net::PlainDatagramSocketImpl::close ()
+{
+ // Avoid races from asynchronous finalization.
+ JvSynchronize sync (this);
+
+ // The method isn't declared to throw anything, so we disregard
+ // the return value.
+ ::close (fnum);
+ fnum = -1;
+ timeout = 0;
+}
+
void
java::net::PlainDatagramSocketImpl::send (java::net::DatagramPacket *p)
{
diff --git a/libjava/java/net/natPlainSocketImpl.cc b/libjava/java/net/natPlainSocketImpl.cc
index aecbd4e2ee7..2c6a2415cfb 100644
--- a/libjava/java/net/natPlainSocketImpl.cc
+++ b/libjava/java/net/natPlainSocketImpl.cc
@@ -22,7 +22,8 @@ details. */
// These functions make the Win32 socket API look more POSIXy
static inline int
-close(int s) {
+close(int s)
+{
return closesocket(s);
}
@@ -102,7 +103,6 @@ _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
#include <gcj/cni.h>
#include <gcj/javaprims.h>
#include <java/io/IOException.h>
-#include <java/io/FileDescriptor.h>
#include <java/io/InterruptedIOException.h>
#include <java/net/BindException.h>
#include <java/net/ConnectException.h>
@@ -234,8 +234,9 @@ java::net::PlainSocketImpl::create (jboolean stream)
_Jv_platform_close_on_exec (sock);
+ // We use fnum in place of fd here. From leaving fd null we avoid
+ // the double close problem in FileDescriptor.finalize.
fnum = sock;
- fd = new java::io::FileDescriptor (sock);
}
void
@@ -402,7 +403,6 @@ java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *s)
s->localport = localport;
s->address = new InetAddress (raddr, NULL);
s->port = rport;
- s->fd = new java::io::FileDescriptor (new_socket);
return;
error:
char* strerr = strerror (errno);
@@ -413,6 +413,9 @@ java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *s)
void
java::net::PlainSocketImpl::close()
{
+ // Avoid races from asynchronous finalization.
+ JvSynchronize sync (this);
+
// should we use shutdown here? how would that effect so_linger?
int res = ::close (fnum);
@@ -425,6 +428,7 @@ java::net::PlainSocketImpl::close()
}
// Safe place to reset the file pointer.
fnum = -1;
+ timeout = 0;
}
// Write a byte to the socket.
@@ -450,6 +454,7 @@ java::net::PlainSocketImpl::write(jint b)
// Some errors should not cause exceptions.
if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF)
throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
+ break;
}
}
}
@@ -481,6 +486,7 @@ java::net::PlainSocketImpl::write(jbyteArray b, jint offset, jint len)
// Some errors should not cause exceptions.
if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF)
throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
+ break;
}
written += r;
len -= r;
diff --git a/libjava/java/util/AbstractMap.java b/libjava/java/util/AbstractMap.java
index 393d3c7754d..555d055394d 100644
--- a/libjava/java/util/AbstractMap.java
+++ b/libjava/java/util/AbstractMap.java
@@ -353,7 +353,7 @@ public abstract class AbstractMap implements Map
public void putAll(Map m)
{
Iterator entries = m.entrySet().iterator();
- int pos = size();
+ int pos = m.size();
while (--pos >= 0)
{
Map.Entry entry = (Map.Entry) entries.next();
@@ -425,10 +425,10 @@ public abstract class AbstractMap implements Map
StringBuffer r = new StringBuffer("{");
for (int pos = size(); pos > 0; pos--)
{
- // Append the toString value of the entries rather than calling
- // getKey/getValue. This is more efficient and it matches the JDK
- // behaviour.
- r.append(entries.next());
+ Map.Entry entry = (Map.Entry) entries.next();
+ r.append(entry.getKey());
+ r.append('=');
+ r.append(entry.getValue());
if (pos > 1)
r.append(", ");
}
diff --git a/libjava/java/util/ArrayList.java b/libjava/java/util/ArrayList.java
index 34dc48ac179..99745d0f648 100644
--- a/libjava/java/util/ArrayList.java
+++ b/libjava/java/util/ArrayList.java
@@ -427,8 +427,8 @@ public class ArrayList extends AbstractList
if (csize + size > data.length)
ensureCapacity(size + csize);
int end = index + csize;
- if (index != size)
- System.arraycopy(data, index, data, end, csize);
+ if (size > 0 && index != size)
+ System.arraycopy(data, index, data, end, size - index);
size += csize;
for ( ; index < end; index++)
data[index] = itr.next();
@@ -437,19 +437,23 @@ public class ArrayList extends AbstractList
/**
* Removes all elements in the half-open interval [fromIndex, toIndex).
- * You asked for it if you call this with invalid arguments.
+ * Does nothing when toIndex is equal to fromIndex.
*
* @param fromIndex the first index which will be removed
* @param toIndex one greater than the last index which will be removed
+ * @throws IndexOutOfBoundsException if fromIndex &gt; toIndex
*/
protected void removeRange(int fromIndex, int toIndex)
{
- if (fromIndex != toIndex)
+ int change = toIndex - fromIndex;
+ if (change > 0)
{
modCount++;
System.arraycopy(data, toIndex, data, fromIndex, size - toIndex);
- size -= toIndex - fromIndex;
+ size -= change;
}
+ else if (change < 0)
+ throw new IndexOutOfBoundsException();
}
/**
diff --git a/libjava/java/util/Arrays.java b/libjava/java/util/Arrays.java
index 13f9be0c93c..8126cf26410 100644
--- a/libjava/java/util/Arrays.java
+++ b/libjava/java/util/Arrays.java
@@ -1078,9 +1078,9 @@ public class Arrays
if (count > 40)
{ // big arrays, pseudomedian of 9
int s = count / 8;
- lo = med3(lo, lo + s, lo + s + s, array);
+ lo = med3(lo, lo + s, lo + 2 * s, array);
mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - s - s, hi - s, hi, array);
+ hi = med3(hi - 2 * s, hi - s, hi, array);
}
mid = med3(lo, mid, hi, array);
@@ -1089,8 +1089,8 @@ public class Arrays
// Pull the median element out of the fray, and use it as a pivot.
swap(from, mid, array);
- a = b = from + 1;
- c = d = hi;
+ a = b = from;
+ c = d = from + count - 1;
// Repeatedly move b and c to each other, swapping elements so
// that all elements before index b are less than the pivot, and all
@@ -1124,12 +1124,13 @@ public class Arrays
}
// Swap pivot(s) back in place, the recurse on left and right sections.
+ hi = from + count;
int span;
span = Math.min(a - from, b - a);
vecswap(from, b - span, span, array);
span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span + 1, span, array);
+ vecswap(b, hi - span, span, array);
span = b - a;
if (span > 1)
@@ -1137,7 +1138,7 @@ public class Arrays
span = d - c;
if (span > 1)
- qsort(array, hi - span + 1, span);
+ qsort(array, hi - span, span);
}
/**
@@ -1239,9 +1240,9 @@ public class Arrays
if (count > 40)
{ // big arrays, pseudomedian of 9
int s = count / 8;
- lo = med3(lo, lo + s, lo + s + s, array);
+ lo = med3(lo, lo + s, lo + 2 * s, array);
mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - s - s, hi - s, hi, array);
+ hi = med3(hi - 2 * s, hi - s, hi, array);
}
mid = med3(lo, mid, hi, array);
@@ -1250,8 +1251,8 @@ public class Arrays
// Pull the median element out of the fray, and use it as a pivot.
swap(from, mid, array);
- a = b = from + 1;
- c = d = hi;
+ a = b = from;
+ c = d = from + count - 1;
// Repeatedly move b and c to each other, swapping elements so
// that all elements before index b are less than the pivot, and all
@@ -1285,12 +1286,13 @@ public class Arrays
}
// Swap pivot(s) back in place, the recurse on left and right sections.
+ hi = from + count;
int span;
span = Math.min(a - from, b - a);
vecswap(from, b - span, span, array);
span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span + 1, span, array);
+ vecswap(b, hi - span, span, array);
span = b - a;
if (span > 1)
@@ -1298,7 +1300,7 @@ public class Arrays
span = d - c;
if (span > 1)
- qsort(array, hi - span + 1, span);
+ qsort(array, hi - span, span);
}
/**
@@ -1400,9 +1402,9 @@ public class Arrays
if (count > 40)
{ // big arrays, pseudomedian of 9
int s = count / 8;
- lo = med3(lo, lo + s, lo + s + s, array);
+ lo = med3(lo, lo + s, lo + 2 * s, array);
mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - s - s, hi - s, hi, array);
+ hi = med3(hi - 2 * s, hi - s, hi, array);
}
mid = med3(lo, mid, hi, array);
@@ -1411,8 +1413,8 @@ public class Arrays
// Pull the median element out of the fray, and use it as a pivot.
swap(from, mid, array);
- a = b = from + 1;
- c = d = hi;
+ a = b = from;
+ c = d = from + count - 1;
// Repeatedly move b and c to each other, swapping elements so
// that all elements before index b are less than the pivot, and all
@@ -1446,12 +1448,13 @@ public class Arrays
}
// Swap pivot(s) back in place, the recurse on left and right sections.
+ hi = from + count;
int span;
span = Math.min(a - from, b - a);
vecswap(from, b - span, span, array);
span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span + 1, span, array);
+ vecswap(b, hi - span, span, array);
span = b - a;
if (span > 1)
@@ -1459,7 +1462,7 @@ public class Arrays
span = d - c;
if (span > 1)
- qsort(array, hi - span + 1, span);
+ qsort(array, hi - span, span);
}
/**
@@ -1573,9 +1576,9 @@ public class Arrays
if (count > 40)
{ // big arrays, pseudomedian of 9
int s = count / 8;
- lo = med3(lo, lo + s, lo + s + s, array);
+ lo = med3(lo, lo + s, lo + 2 * s, array);
mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - s - s, hi - s, hi, array);
+ hi = med3(hi - 2 * s, hi - s, hi, array);
}
mid = med3(lo, mid, hi, array);
@@ -1584,8 +1587,8 @@ public class Arrays
// Pull the median element out of the fray, and use it as a pivot.
swap(from, mid, array);
- a = b = from + 1;
- c = d = hi;
+ a = b = from;
+ c = d = from + count - 1;
// Repeatedly move b and c to each other, swapping elements so
// that all elements before index b are less than the pivot, and all
@@ -1619,12 +1622,13 @@ public class Arrays
}
// Swap pivot(s) back in place, the recurse on left and right sections.
+ hi = from + count;
int span;
span = Math.min(a - from, b - a);
vecswap(from, b - span, span, array);
span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span + 1, span, array);
+ vecswap(b, hi - span, span, array);
span = b - a;
if (span > 1)
@@ -1632,7 +1636,7 @@ public class Arrays
span = d - c;
if (span > 1)
- qsort(array, hi - span + 1, span);
+ qsort(array, hi - span, span);
}
/**
@@ -1746,9 +1750,9 @@ public class Arrays
if (count > 40)
{ // big arrays, pseudomedian of 9
int s = count / 8;
- lo = med3(lo, lo + s, lo + s + s, array);
+ lo = med3(lo, lo + s, lo + 2 * s, array);
mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - s - s, hi - s, hi, array);
+ hi = med3(hi - 2 * s, hi - s, hi, array);
}
mid = med3(lo, mid, hi, array);
@@ -1757,8 +1761,8 @@ public class Arrays
// Pull the median element out of the fray, and use it as a pivot.
swap(from, mid, array);
- a = b = from + 1;
- c = d = hi;
+ a = b = from;
+ c = d = from + count - 1;
// Repeatedly move b and c to each other, swapping elements so
// that all elements before index b are less than the pivot, and all
@@ -1792,12 +1796,13 @@ public class Arrays
}
// Swap pivot(s) back in place, the recurse on left and right sections.
+ hi = from + count;
int span;
span = Math.min(a - from, b - a);
vecswap(from, b - span, span, array);
span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span + 1, span, array);
+ vecswap(b, hi - span, span, array);
span = b - a;
if (span > 1)
@@ -1805,7 +1810,7 @@ public class Arrays
span = d - c;
if (span > 1)
- qsort(array, hi - span + 1, span);
+ qsort(array, hi - span, span);
}
/**
@@ -1913,9 +1918,9 @@ public class Arrays
if (count > 40)
{ // big arrays, pseudomedian of 9
int s = count / 8;
- lo = med3(lo, lo + s, lo + s + s, array);
+ lo = med3(lo, lo + s, lo + 2 * s, array);
mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - s - s, hi - s, hi, array);
+ hi = med3(hi - 2 * s, hi - s, hi, array);
}
mid = med3(lo, mid, hi, array);
@@ -1924,8 +1929,8 @@ public class Arrays
// Pull the median element out of the fray, and use it as a pivot.
swap(from, mid, array);
- a = b = from + 1;
- c = d = hi;
+ a = b = from;
+ c = d = from + count - 1;
// Repeatedly move b and c to each other, swapping elements so
// that all elements before index b are less than the pivot, and all
@@ -1959,12 +1964,13 @@ public class Arrays
}
// Swap pivot(s) back in place, the recurse on left and right sections.
+ hi = from + count;
int span;
span = Math.min(a - from, b - a);
vecswap(from, b - span, span, array);
span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span + 1, span, array);
+ vecswap(b, hi - span, span, array);
span = b - a;
if (span > 1)
@@ -1972,7 +1978,7 @@ public class Arrays
span = d - c;
if (span > 1)
- qsort(array, hi - span + 1, span);
+ qsort(array, hi - span, span);
}
/**
@@ -2080,9 +2086,9 @@ public class Arrays
if (count > 40)
{ // big arrays, pseudomedian of 9
int s = count / 8;
- lo = med3(lo, lo + s, lo + s + s, array);
+ lo = med3(lo, lo + s, lo + 2 * s, array);
mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - s - s, hi - s, hi, array);
+ hi = med3(hi - 2 * s, hi - s, hi, array);
}
mid = med3(lo, mid, hi, array);
@@ -2091,8 +2097,8 @@ public class Arrays
// Pull the median element out of the fray, and use it as a pivot.
swap(from, mid, array);
- a = b = from + 1;
- c = d = hi;
+ a = b = from;
+ c = d = from + count - 1;
// Repeatedly move b and c to each other, swapping elements so
// that all elements before index b are less than the pivot, and all
@@ -2126,12 +2132,13 @@ public class Arrays
}
// Swap pivot(s) back in place, the recurse on left and right sections.
+ hi = from + count;
int span;
span = Math.min(a - from, b - a);
vecswap(from, b - span, span, array);
span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span + 1, span, array);
+ vecswap(b, hi - span, span, array);
span = b - a;
if (span > 1)
@@ -2139,7 +2146,7 @@ public class Arrays
span = d - c;
if (span > 1)
- qsort(array, hi - span + 1, span);
+ qsort(array, hi - span, span);
}
/**
diff --git a/libjava/java/util/BitSet.java b/libjava/java/util/BitSet.java
index a85b73721c0..38a9be08994 100644
--- a/libjava/java/util/BitSet.java
+++ b/libjava/java/util/BitSet.java
@@ -102,6 +102,9 @@ public class BitSet implements Cloneable, Serializable
*/
public BitSet(int nbits)
{
+ if (nbits < 0)
+ throw new NegativeArraySizeException();
+
int length = nbits >>> 6;
if ((nbits & LONG_MASK) != 0)
++length;
@@ -195,7 +198,7 @@ public class BitSet implements Cloneable, Serializable
*/
public void clear(int pos)
{
- int offset = pos >>> 6;
+ int offset = pos >> 6;
ensure(offset);
// ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
// so we'll just let that be our exception.
@@ -289,7 +292,7 @@ public class BitSet implements Cloneable, Serializable
*/
public void flip(int index)
{
- int offset = index >>> 6;
+ int offset = index >> 6;
ensure(offset);
// ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
// so we'll just let that be our exception.
@@ -335,7 +338,7 @@ public class BitSet implements Cloneable, Serializable
*/
public boolean get(int pos)
{
- int offset = pos >>> 6;
+ int offset = pos >> 6;
if (offset >= bits.length)
return false;
// ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
@@ -498,7 +501,7 @@ public class BitSet implements Cloneable, Serializable
*/
public int nextClearBit(int from)
{
- int offset = from >>> 6;
+ int offset = from >> 6;
long mask = 1L << from;
while (offset < bits.length)
{
@@ -535,7 +538,7 @@ public class BitSet implements Cloneable, Serializable
*/
public int nextSetBit(int from)
{
- int offset = from >>> 6;
+ int offset = from >> 6;
long mask = 1L << from;
while (offset < bits.length)
{
@@ -583,7 +586,7 @@ public class BitSet implements Cloneable, Serializable
*/
public void set(int pos)
{
- int offset = pos >>> 6;
+ int offset = pos >> 6;
ensure(offset);
// ArrayIndexOutOfBoundsException subclasses IndexOutOfBoundsException,
// so we'll just let that be our exception.
diff --git a/libjava/java/util/GregorianCalendar.java b/libjava/java/util/GregorianCalendar.java
index d019ec170d6..b01d971edca 100644
--- a/libjava/java/util/GregorianCalendar.java
+++ b/libjava/java/util/GregorianCalendar.java
@@ -1,5 +1,5 @@
/* java.util.GregorianCalendar
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -917,11 +917,11 @@ public class GregorianCalendar extends Calendar
}
private static final int[] minimums =
- { BC, 1, 1, 0, 1, 1, 1, SUNDAY, 1,
+ { BC, 1, 0, 0, 1, 1, 1, SUNDAY, 1,
AM, 1, 0, 1, 1, 1, -(12*60*60*1000), 0 };
private static final int[] maximums =
- { AD, 5000000, 12, 53, 5, 31, 366, SATURDAY, 5,
+ { AD, 5000000, 11, 53, 5, 31, 366, SATURDAY, 5,
PM, 12, 23, 59, 59, 999, +(12*60*60*1000), (12*60*60*1000) };
/**
diff --git a/libjava/java/util/Hashtable.java b/libjava/java/util/Hashtable.java
index 65759e7f112..71ec4b809c7 100644
--- a/libjava/java/util/Hashtable.java
+++ b/libjava/java/util/Hashtable.java
@@ -322,10 +322,6 @@ public class Hashtable extends Dictionary
* <code>containsValue()</code>, and is O(n).
* <p>
*
- * Note: this is one of the <i>old</i> Hashtable methods which does
- * not like null values; it throws NullPointerException if the
- * supplied parameter is null.
- *
* @param value the value to search for in this Hashtable
* @return true if at least one key maps to the value
* @throws NullPointerException if <code>value</code> is null
@@ -334,19 +330,17 @@ public class Hashtable extends Dictionary
*/
public synchronized boolean contains(Object value)
{
- // Check if value is null.
- if (value == null)
- throw new NullPointerException();
return containsValue(value);
}
/**
* Returns true if this Hashtable contains a value <code>o</code>, such that
* <code>o.equals(value)</code>. This is the new API for the old
- * <code>contains()</code>, except that it is forgiving of null.
+ * <code>contains()</code>.
*
* @param value the value to search for in this Hashtable
* @return true if at least one key maps to the value
+ * @throws NullPointerException if <code>value</code> is null
* @see #contains(Object)
* @see #containsKey(Object)
* @since 1.2
@@ -358,11 +352,16 @@ public class Hashtable extends Dictionary
HashEntry e = buckets[i];
while (e != null)
{
- if (AbstractCollection.equals(value, e.value))
+ if (value.equals(e.value))
return true;
e = e.next;
}
}
+
+ // Must throw on null argument even if the table is empty
+ if (value == null)
+ throw new NullPointerException();
+
return false;
}
@@ -468,17 +467,12 @@ public class Hashtable extends Dictionary
* Removes from the table and returns the value which is mapped by the
* supplied key. If the key maps to nothing, then the table remains
* unchanged, and <code>null</code> is returned.
- * <b>NOTE:</b>Map.remove and Dictionary.remove disagree whether null
- * is a valid parameter; at the moment, this implementation obeys Map.remove,
- * and silently ignores null.
*
* @param key the key used to locate the value to remove
* @return whatever the key mapped to, if present
*/
public synchronized Object remove(Object key)
{
- if (key == null)
- return null;
int idx = hash(key);
HashEntry e = buckets[idx];
HashEntry last = null;
diff --git a/libjava/java/util/IdentityHashMap.java b/libjava/java/util/IdentityHashMap.java
index e6cd8c6d249..4609f015f8d 100644
--- a/libjava/java/util/IdentityHashMap.java
+++ b/libjava/java/util/IdentityHashMap.java
@@ -490,7 +490,7 @@ public class IdentityHashMap extends AbstractMap
table = new Object[old.length * 2 + 2];
Arrays.fill(table, emptyslot);
size = 0;
- threshold = table.length / 4 * 3;
+ threshold = (table.length / 2) / 4 * 3;
for (int i = old.length - 2; i >= 0; i -= 2)
{
diff --git a/libjava/java/util/Vector.java b/libjava/java/util/Vector.java
index e8d1c96ad01..9cf8639fc3b 100644
--- a/libjava/java/util/Vector.java
+++ b/libjava/java/util/Vector.java
@@ -716,6 +716,9 @@ public class Vector extends AbstractList
*/
public synchronized boolean removeAll(Collection c)
{
+ if (c == null)
+ throw new NullPointerException();
+
int i;
int j;
for (i = 0; i < elementCount; i++)
@@ -742,6 +745,9 @@ public class Vector extends AbstractList
*/
public synchronized boolean retainAll(Collection c)
{
+ if (c == null)
+ throw new NullPointerException();
+
int i;
int j;
for (i = 0; i < elementCount; i++)
@@ -779,7 +785,8 @@ public class Vector extends AbstractList
ensureCapacity(elementCount + csize);
int end = index + csize;
if (elementCount > 0 && index != elementCount)
- System.arraycopy(elementData, index, elementData, end, csize);
+ System.arraycopy(elementData, index,
+ elementData, end, elementCount - index);
elementCount += csize;
for ( ; index < end; index++)
elementData[index] = itr.next();
@@ -852,23 +859,28 @@ public class Vector extends AbstractList
/**
* Removes a range of elements from this list.
+ * Does nothing when toIndex is equal to fromIndex.
*
* @param fromIndex the index to start deleting from (inclusive)
* @param toIndex the index to delete up to (exclusive)
+ * @throws IndexOutOfBoundsException if fromIndex &gt; toIndex
*/
// This does not need to be synchronized, because it is only called through
// clear() of a sublist, and clear() had already synchronized.
protected void removeRange(int fromIndex, int toIndex)
{
- if (fromIndex != toIndex)
+ int change = toIndex - fromIndex;
+ if (change > 0)
{
modCount++;
System.arraycopy(elementData, toIndex, elementData, fromIndex,
elementCount - toIndex);
int save = elementCount;
- elementCount -= toIndex - fromIndex;
+ elementCount -= change;
Arrays.fill(elementData, elementCount, save, null);
}
+ else if (change < 0)
+ throw new IndexOutOfBoundsException();
}
/**
diff --git a/libjava/jni.cc b/libjava/jni.cc
index 1abd2d2497a..bb504209cf5 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -424,7 +424,7 @@ wrap_value (JNIEnv *env, T *value)
static jint
_Jv_JNI_GetVersion (JNIEnv *)
{
- return JNI_VERSION_1_2;
+ return JNI_VERSION_1_4;
}
static jclass
@@ -1672,6 +1672,31 @@ _Jv_JNI_DeleteWeakGlobalRef (JNIEnv *, jweak obj)
+// Direct byte buffers.
+
+static jobject
+_Jv_JNI_NewDirectByteBuffer (JNIEnv *, void *, jlong)
+{
+ // For now we don't support this.
+ return NULL;
+}
+
+static void *
+_Jv_JNI_GetDirectBufferAddress (JNIEnv *, jobject)
+{
+ // For now we don't support this.
+ return NULL;
+}
+
+static jlong
+_Jv_JNI_GetDirectBufferCapacity (JNIEnv *, jobject)
+{
+ // For now we don't support this.
+ return -1;
+}
+
+
+
// Hash table of native methods.
static JNINativeMethod *nathash;
// Number of slots used.
@@ -2096,7 +2121,8 @@ _Jv_JNIMethod::call (ffi_cif *, void *ret, ffi_raw *args, void *__this)
// An internal helper function.
static jint
-_Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv, void *args)
+_Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv,
+ void *args, jboolean is_daemon)
{
JavaVMAttachArgs *attach = reinterpret_cast<JavaVMAttachArgs *> (args);
java::lang::ThreadGroup *group = NULL;
@@ -2104,7 +2130,8 @@ _Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv, void *args)
if (attach)
{
// FIXME: do we really want to support 1.1?
- if (attach->version != JNI_VERSION_1_2
+ if (attach->version != JNI_VERSION_1_4
+ && attach->version != JNI_VERSION_1_2
&& attach->version != JNI_VERSION_1_1)
return JNI_EVERSION;
@@ -2147,7 +2174,10 @@ _Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv, void *args)
{
try
{
- _Jv_AttachCurrentThread (name, group);
+ if (is_daemon)
+ _Jv_AttachCurrentThreadAsDaemon (name, group);
+ else
+ _Jv_AttachCurrentThread (name, group);
}
catch (jthrowable t)
{
@@ -2163,7 +2193,13 @@ _Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv, void *args)
static jint
_Jv_JNI_AttachCurrentThread (JavaVM *vm, void **penv, void *args)
{
- return _Jv_JNI_AttachCurrentThread (vm, NULL, penv, args);
+ return _Jv_JNI_AttachCurrentThread (vm, NULL, penv, args, false);
+}
+
+static jint
+_Jv_JNI_AttachCurrentThreadAsDaemon (JavaVM *vm, void **penv, void *args)
+{
+ return _Jv_JNI_AttachCurrentThread (vm, NULL, penv, args, true);
}
static jint
@@ -2185,10 +2221,9 @@ _Jv_JNI_DestroyJavaVM (JavaVM *vm)
return JNI_ERR;
}
- jint r = _Jv_JNI_AttachCurrentThread (vm,
- main_name,
+ jint r = _Jv_JNI_AttachCurrentThread (vm, main_name,
reinterpret_cast<void **> (&env),
- NULL);
+ NULL, false);
if (r < 0)
return r;
}
@@ -2227,7 +2262,8 @@ _Jv_JNI_GetEnv (JavaVM *, void **penv, jint version)
#endif
// FIXME: do we really want to support 1.1?
- if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_1)
+ if (version != JNI_VERSION_1_4 && version != JNI_VERSION_1_2
+ && version != JNI_VERSION_1_1)
{
*penv = NULL;
return JNI_EVERSION;
@@ -2241,12 +2277,12 @@ jint
JNI_GetDefaultJavaVMInitArgs (void *args)
{
jint version = * (jint *) args;
- // Here we only support 1.2.
- if (version != JNI_VERSION_1_2)
+ // Here we only support 1.2 and 1.4.
+ if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_4)
return JNI_EVERSION;
JavaVMInitArgs *ia = reinterpret_cast<JavaVMInitArgs *> (args);
- ia->version = JNI_VERSION_1_2;
+ ia->version = JNI_VERSION_1_4;
ia->nOptions = 0;
ia->options = NULL;
ia->ignoreUnrecognized = true;
@@ -2271,8 +2307,8 @@ JNI_CreateJavaVM (JavaVM **vm, void **penv, void *args)
if (args != NULL)
{
jint version = * (jint *) args;
- // We only support 1.2.
- if (version != JNI_VERSION_1_2)
+ // We only support 1.2 and 1.4.
+ if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_4)
return JNI_EVERSION;
JavaVMInitArgs *ia = reinterpret_cast<JavaVMInitArgs *> (args);
for (int i = 0; i < ia->nOptions; ++i)
@@ -2614,7 +2650,11 @@ struct JNINativeInterface _Jv_JNIFunctions =
_Jv_JNI_NewWeakGlobalRef, // NewWeakGlobalRef
_Jv_JNI_DeleteWeakGlobalRef, // DeleteWeakGlobalRef
- _Jv_JNI_ExceptionCheck
+ _Jv_JNI_ExceptionCheck, // ExceptionCheck
+
+ _Jv_JNI_NewDirectByteBuffer, // NewDirectByteBuffer
+ _Jv_JNI_GetDirectBufferAddress, // GetDirectBufferAddress
+ _Jv_JNI_GetDirectBufferCapacity // GetDirectBufferCapacity
};
struct JNIInvokeInterface _Jv_JNI_InvokeFunctions =
@@ -2626,5 +2666,6 @@ struct JNIInvokeInterface _Jv_JNI_InvokeFunctions =
_Jv_JNI_DestroyJavaVM,
_Jv_JNI_AttachCurrentThread,
_Jv_JNI_DetachCurrentThread,
- _Jv_JNI_GetEnv
+ _Jv_JNI_GetEnv,
+ _Jv_JNI_AttachCurrentThreadAsDaemon
};
diff --git a/libjava/libgcj.spec.in b/libjava/libgcj.spec.in
index c0fe76dc4bc..e1b3526f9cb 100644
--- a/libjava/libgcj.spec.in
+++ b/libjava/libgcj.spec.in
@@ -6,4 +6,4 @@
%rename lib liborig
*lib: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
-*jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ -fkeep-inline-functions
+*jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ -fkeep-inline-functions
diff --git a/libjava/libltdl/.cvsignore b/libjava/libltdl/.cvsignore
index faf2876a55e..5e58a6261db 100644
--- a/libjava/libltdl/.cvsignore
+++ b/libjava/libltdl/.cvsignore
@@ -1,13 +1,3 @@
-.deps
-.libs
-Makefile
-Makefile.in
-acinclude.m4
-aclocal.m4
-configure
-config.*
-conftest*
-libtool
-*.lo
-*.la
-stamp-h*
+config.status
+config.log
+stamp-h
diff --git a/libjava/libltdl/ChangeLog b/libjava/libltdl/ChangeLog
index 94690c9675d..e84f3c7591b 100644
--- a/libjava/libltdl/ChangeLog
+++ b/libjava/libltdl/ChangeLog
@@ -1,3 +1,7 @@
+2002-04-28 Mark Mitchell <mark@codesourcery.com>
+
+ * .cvsignore: Remove files that are present in CVS.
+
2001-07-02 Tom Tromey <tromey@redhat.com>
* configure: Rebuilt.
diff --git a/libjava/libtool-version b/libjava/libtool-version
index 81ae9a1783c..318fd04b258 100644
--- a/libjava/libtool-version
+++ b/libjava/libtool-version
@@ -3,4 +3,4 @@
# a separate file so that version updates don't involve re-running
# automake.
# CURRENT:REVISION:AGE
-2:0:0
+3:0:0
diff --git a/libjava/mauve-libgcj b/libjava/mauve-libgcj
index a80405cf2df..165f0b6f5ee 100644
--- a/libjava/mauve-libgcj
+++ b/libjava/mauve-libgcj
@@ -1,35 +1,33 @@
-# Config file that tells mauve about the `libjava' tag.
+# Config file that tells mauve about the `libgcj' tag.
JDK1.0
JDK1.1
JDK1.2
+JDK1.3
+JDK1.4
+JLS1.0
+JLS1.1
+JLS1.2
JDBC2.0
-!java.applet
-!java.awt
-java.beans
-!java.beans.DescriptorTest
-!java.beans.IntrospectorTest
-java.lang.Character.classify12
-java.lang.String.hash
-# We support 1.2 for these 3 tests.
-java.lang.reflect.Modifier.toString12
-java.io.ObjectInputOutput.InputTest
-java.io.ObjectInputOutput.OutputTest
-java.io.ObjectStreamClass.Test
-java.math
-!java.rmi
+
# These 2 are tests that fail with JDBC2.0 but the tags don't seem to
# have the right effect.
!java.sql.Connection.TestJdbc10
!java.sql.DatabaseMetaData.TestJdbc10
-java.text.FieldPosition.Test
-java.text.ParsePosition.Test
-java.text.SimpleDateFormat.getAndSet2DigitYearStart
-java.text.StringCharacterIterator.iter
+
+# Cannot be compiled
!java.text.ACIAttribute
-!java.text.Annotation
-!java.text.AttributedCharacterIterator
-!java.text.AttributedString
-!java.text.DecimalFormatSymbols.DumpDefault12
-!java.text.DecimalFormatSymbols.GetSet12
-!java.text.resources
-!java.lang.Math
+
+# The following tests seem to (sometimes) hang or crash the testsuite
+!java.io.ObjectInputOutput
+!java.lang.reflect.Array.newInstance
+!java.util.ResourceBundle.getBundle
+!java.util.zip.GZIPInputStream.basic
+!java.net.DatagramSocket.DatagramSocketTest2
+
+# Character.unicode seems to be very broken (the test)
+# Does not give meaningfull test results at the moment.
+!java.lang.Character.unicode
+
+# These are almost certainly buggy test cases.
+# The behaviour of the garbarge collector cannot be predicted.
+!java.lang.ref
diff --git a/libjava/name-finder.cc b/libjava/name-finder.cc
index 3cf1043d84b..a09ff0b267e 100644
--- a/libjava/name-finder.cc
+++ b/libjava/name-finder.cc
@@ -1,6 +1,6 @@
// name-finder.cc - Convert addresses to names
-/* Copyright (C) 2000 Free Software Foundation, Inc
+/* Copyright (C) 2000, 2002 Free Software Foundation, Inc
This file is part of libgcj.
@@ -61,6 +61,13 @@ _Jv_name_finder::_Jv_name_finder (char *executable)
#if defined (HAVE_PIPE) && defined (HAVE_FORK) && defined (HAVE_EXECVP)
error = 0;
+ // Initialize file descriptors so that shutdown works properly.
+ f_pipe[0] = -1;
+ f_pipe[1] = -1;
+ b_pipe[0] = -1;
+ b_pipe[1] = -1;
+ b_pipe_fd = NULL;
+
char *argv[6];
{
int arg = 0;
@@ -93,8 +100,12 @@ _Jv_name_finder::_Jv_name_finder (char *executable)
_exit (127);
}
+ // Close child end of pipes. Set local descriptors to -1 so we
+ // don't try to close the fd again.
close (f_pipe [0]);
+ f_pipe[0] = -1;
close (b_pipe [1]);
+ b_pipe[1] = -1;
if (pid < 0)
{
@@ -104,6 +115,12 @@ _Jv_name_finder::_Jv_name_finder (char *executable)
b_pipe_fd = fdopen (b_pipe[0], "r");
error |= !b_pipe_fd;
+
+ if (! error)
+ {
+ // Don't try to close the fd twice.
+ b_pipe[0] = -1;
+ }
#endif
}
diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc
index 6442eaffb2f..e92348bcc2c 100644
--- a/libjava/posix-threads.cc
+++ b/libjava/posix-threads.cc
@@ -448,7 +448,8 @@ _Jv_ThreadSelf_out_of_line(volatile self_cache_entry *sce, size_t high_sp_bits)
{
pthread_t self = pthread_self();
sce -> high_sp_bits = high_sp_bits;
- release_set ((obj_addr_t *) &(sce -> self), self);
+ write_barrier();
+ sce -> self = self;
return self;
}
diff --git a/libjava/posix.cc b/libjava/posix.cc
index 6b0ea8cad3c..ebff1c9ec79 100644
--- a/libjava/posix.cc
+++ b/libjava/posix.cc
@@ -12,12 +12,14 @@ details. */
#include "posix.h"
+#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <jvm.h>
#include <java/lang/Thread.h>
#include <java/io/InterruptedIOException.h>
+#include <java/util/Properties.h>
#if defined (ECOS)
extern "C" unsigned long long _clock (void);
@@ -62,6 +64,23 @@ _Jv_platform_initialize (void)
#endif
}
+// Set platform-specific System properties.
+void
+_Jv_platform_initProperties (java::util::Properties* newprops)
+{
+ // A convenience define.
+#define SET(Prop,Val) \
+ newprops->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val))
+
+ SET ("file.separator", "/");
+ SET ("path.separator", ":");
+ SET ("line.separator", "\n");
+ char *tmpdir = ::getenv("TMPDIR");
+ if (! tmpdir)
+ tmpdir = "/tmp";
+ SET ("java.io.tmpdir", tmpdir);
+}
+
static inline void
internal_gettimeofday (struct timeval *result)
{
diff --git a/libjava/sysdep/i386/locks.h b/libjava/sysdep/i386/locks.h
index 0c029ac939a..a9501ae99b2 100644
--- a/libjava/sysdep/i386/locks.h
+++ b/libjava/sysdep/i386/locks.h
@@ -62,4 +62,12 @@ read_barrier()
{
}
+// Ensure that prior stores to memory are completed with respect to other
+// processors.
+inline static void
+write_barrier()
+{
+ // X86 does not reorder writes. We just need to ensure that gcc also doesn't.
+ __asm__ __volatile__(" " : : : "memory");
+}
#endif
diff --git a/libjava/sysdep/powerpc/locks.h b/libjava/sysdep/powerpc/locks.h
index 414b5dcb7f8..4d4532b1f83 100644
--- a/libjava/sysdep/powerpc/locks.h
+++ b/libjava/sysdep/powerpc/locks.h
@@ -75,4 +75,12 @@ read_barrier()
__asm__ __volatile__ ("isync" : : : "memory");
}
+// Ensure that prior stores to memory are completed with respect to other
+// processors.
+inline static void
+write_barrier()
+{
+ __asm__ __volatile__ ("sync" : : : "memory");
+}
+
#endif
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 315677ce60b..c6af713af17 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,103 @@
+2002-04-21 Mark Wielaard <mark@klomp.org>
+
+ * libjava.mauve/xfail: Expect failures for PR java/6391 and
+ libgcj/6389.
+
+2002-04-16 Mark Wielaard <mark@klomp.org>
+
+ * libjava.lang/negzero.java: New.
+ * libjava.lang/negzero.out: New.
+
+2002-04-14 Mark Wielaard <mark@klomp.org>
+
+ * libjava.mauve/xfails: Expect failures for PR libgcj/6302 and
+ libgcj/6298.
+
+2002-04-14 Mark Wielaard <mark@klomp.org>
+
+ * libjava.mauve/xfails: Expect failures for PR libgcj/6293,
+ libgcj/6295, libgcj/6296 and libgcj/6297.
+
+2002-04-12 Anthony Green <green@redhat.com>
+
+ * lib/libjava.exp: Use libgcj-VERSION.jar, not libgcj.jar.
+
+2002-04-12 Loren J. Rittle <ljrittle@acm.org>
+
+ * libjava.lang/SyncGlobal.java, libjava.lang/SyncGlobal.out:
+ New test case.
+
+2002-04-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * libjava.lang/PR6204.java, libjava.lang/PR6204.out: New test case.
+ * libjava.lang/PR6085.java, libjava.lang/PR6085.out: Likewise.
+
+2002-04-07 Mark Wielaard <mark@klomp.org>
+
+ * libjava.mauve/xfails: Add CASE_INSENSITIVE_ORDER, result was
+ unspecified and test should be updated to match latest spec.
+ Add AcuniaPropertiesTest, known bug #6219. Add test_getClassLoader,
+ what we do seems to be not really right or wrong.
+
+2002-04-06 Mark Wielaard <mark@klomp.org>
+
+ * libjava.mauve/mauve.exp: Use libgcj.jar not libgcj.zip.
+ * libjava.mauve/xfails: add Character.classify12 (number 1),
+ Character.getType (number 11), Character.getType (number 20) and
+ Character.getType (number 22). We implement 1.4 Character.
+
+2002-03-28 Andrew Haley <aph@redhat.com>
+
+ * libjava.lang/Throw_2.java: New.
+ * libjava.lang/Throw_2.out: New.
+
+2002-03-27 Anthony Green <green@redhat.com>
+
+ * libjava.lang/InvokeReturn.java: Modify test for targets
+ which do not yet support reflection.
+
+2002-03-27 Anthony Green <green@redhat.com>
+
+ * libjava.jni/jni.exp (gcj_jni_run): Fix cross build test.
+
+2002-03-27 Anthony Green <green@redhat.com>
+
+ * lib/libjava.exp: Add the wrapper link options only when we're
+ linking.
+
+2002-03-26 Tom Tromey <tromey@redhat.com>
+
+ * libjava.mauve/mauve.exp (test_mauve): Use correct stderr
+ redirection code.
+
+2002-03-22 Eric Blake <ebb9@email.byu.edu>
+
+ For PR java/6026:
+ * libjava.compile/PR6026.java: New file.
+
+2002-03-21 Andrew Haley <aph@redhat.com>
+
+ * libjava.lang/Thread_Interrupt.java (Looper.calibrate): New.
+ (yields): New.
+
+2002-03-18 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jni/jni.exp (gcj_jni_test_one): Find libstdc++ in build
+ tree.
+ (gcj_invoke): Added ld_library_additions argument.
+
+2002-03-17 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jni/jni.exp (gcj_jni_build_header): Use local_exec, not
+ target_compile. Fixes PR other/5874.
+
+2002-03-15 Eric Blake <ebb9@email.byu.edu>
+
+ For PR java/5902:
+ * libjava.compile/PR5902.java: Does not need to execute.
+ For PR java/5913:
+ * libjava.compile/PR5913.java: Ditto.
+
2002-03-12 Tom Tromey <tromey@redhat.com>
Test for PR java/5848:
diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in
index 15bbdaa8e59..4a7781bec25 100644
--- a/libjava/testsuite/Makefile.in
+++ b/libjava/testsuite/Makefile.in
@@ -67,6 +67,7 @@ AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
AR = @AR@
AS = @AS@
CC = @CC@
+CHECKREFSPEC = @CHECKREFSPEC@
COMPPATH = @COMPPATH@
CXX = @CXX@
CXXCPP = @CXXCPP@
@@ -80,6 +81,7 @@ GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
+GCJVERSION = @GCJVERSION@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
@@ -109,21 +111,24 @@ RANLIB = @RANLIB@
STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
+SYS_ZLIBS = @SYS_ZLIBS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
+THREADLDFLAGS = @THREADLDFLAGS@
THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
VERSION = @VERSION@
-ZDEPS = @ZDEPS@
ZINCS = @ZINCS@
ZLIBS = @ZLIBS@
ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
+gcc_version = @gcc_version@
glibjava_CXX = @glibjava_CXX@
here = @here@
libgcj_basedir = @libgcj_basedir@
mkinstalldirs = @mkinstalldirs@
+tool_include_dir = @tool_include_dir@
AUTOMAKE_OPTIONS = foreign dejagnu
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 50996aa4ad9..050ede5bb2f 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -112,6 +112,7 @@ proc libjava_init { args } {
global TOOL_EXECUTABLE
global original_ld_library_path
global env objdir
+ global env gcc_version
if { $libjava_initialized == 1 } { return; }
@@ -127,6 +128,11 @@ proc libjava_init { args } {
}
}
+ # Determine the version so we can find the libgcj jar file.
+ set text [eval exec "$GCJ_UNDER_TEST --version 2>@ stdout"]
+ regexp -- "gcj \[^ \]+ (\[^ \]+) .*" $text ignore gcc_version
+ verbose "jar file is libgcj-$gcc_version.jar"
+
# The -B is so we find libgcj.spec.
set text [eval exec "$GCJ_UNDER_TEST -B$objdir/../ -v 2>@ stdout"]
regexp -- "Thread model: (\[^\n\]+)\n" $text ignore model
@@ -222,6 +228,7 @@ proc libjava_arguments {{mode compile}} {
global runtests
global env
global tool_root_dir
+ global gcc_version
if [info exists LIBJAVA] {
set libjava $LIBJAVA;
@@ -292,18 +299,20 @@ proc libjava_arguments {{mode compile}} {
verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
# Set the CLASSPATH environment variable
- verbose "CLASSPATH is .:$srcdir/$subdir:$objdir:$objdir/../libgcj.jar"
+ verbose "CLASSPATH is .:$srcdir/$subdir:$objdir:$objdir/../libgcj-$gcc_version.jar"
global env
- set env(CLASSPATH) ".:$srcdir/$subdir:$objdir:$objdir/../libgcj.jar"
-
- global wrapper_file wrap_compile_flags;
- lappend args "additional_flags=$wrap_compile_flags";
- lappend args "libs=$wrapper_file";
- lappend args "libs=$libjava";
- lappend args "libs=$libgc";
- lappend args "libs=$libqthreads"
- lappend args "libs=$libz"
- lappend args debug
+ set env(CLASSPATH) ".:$srcdir/$subdir:$objdir:$objdir/../libgcj-$gcc_version.jar"
+
+ if {$mode == "link"} {
+ global wrapper_file wrap_compile_flags;
+ lappend args "additional_flags=$wrap_compile_flags";
+ lappend args "libs=$wrapper_file";
+ lappend args "libs=$libjava";
+ lappend args "libs=$libgc";
+ lappend args "libs=$libqthreads"
+ lappend args "libs=$libz"
+ lappend args debug
+ }
if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
lappend args "libs=${gluefile}"
diff --git a/libjava/testsuite/libjava.compile/PR5902.java b/libjava/testsuite/libjava.compile/PR5902.java
index 52fdfa868db..1a78a269217 100644
--- a/libjava/testsuite/libjava.compile/PR5902.java
+++ b/libjava/testsuite/libjava.compile/PR5902.java
@@ -1,7 +1,4 @@
class PR5902
{
- public static void main(String[] args)
- {
- System.exit((019f == 19) ? 0 : 1);
- }
+ double d = 019f;
}
diff --git a/libjava/testsuite/libjava.compile/PR5913.java b/libjava/testsuite/libjava.compile/PR5913.java
index 0ae68be215e..4c0c74d8f11 100644
--- a/libjava/testsuite/libjava.compile/PR5913.java
+++ b/libjava/testsuite/libjava.compile/PR5913.java
@@ -1,10 +1,6 @@
class PR5913
{
- public static void main(String[] args)
- {
- boolean test1 = ("" + 1) instanceof String;
- // This also tests literal parsing, as mentioned in PR 5902.
- boolean test2 = "" + 0x1instanceof String;
- System.exit((test1 && test2) ? 0 : 1);
- }
+ boolean test1 = ("" + 1) instanceof String;
+ // This also tests literal parsing, as mentioned in PR 5902.
+ boolean test2 = "" + 0x1instanceof String;
}
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp
index f052766b4f9..724b2545acb 100644
--- a/libjava/testsuite/libjava.jni/jni.exp
+++ b/libjava/testsuite/libjava.jni/jni.exp
@@ -30,11 +30,10 @@ proc gcj_jni_compile_c_to_so {file {options {}}} {
proc gcj_jni_build_header {file} {
set gcjh [find_gcjh]
set file [file rootname $file]
- set options [list "compiler=$gcjh" \
- "additional_flags=-jni"]
- set x [prune_warnings [target_compile $file "" none $options]]
+ set x [string trim [prune_warnings \
+ [lindex [local_exec "$gcjh -jni $file" "" "" 300] 1]]]
if {$x != ""} {
- verbose "target_compile failed: $x" 2
+ verbose "local_exec failed: $x" 2
fail "$file header generation"
return 0
}
@@ -44,11 +43,18 @@ proc gcj_jni_build_header {file} {
}
# Invoke the program and see what happens. Return 0 on failure.
-proc gcj_invoke {program expectFile} {
+proc gcj_invoke {program expectFile ld_library_additions} {
global env
set lib_path $env(LD_LIBRARY_PATH)
- setenv LD_LIBRARY_PATH .:$lib_path
- setenv SHLIB_PATH .:$lib_path
+
+ set newval .
+ if {[llength $ld_library_additions] > 0} {
+ append newval :[join $ld_library_additions :]
+ }
+ append newval :$lib_path
+
+ setenv LD_LIBRARY_PATH $newval
+ setenv SHLIB_PATH $newval
verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
@@ -107,10 +113,27 @@ proc gcj_jni_test_one {file} {
set cfile [file rootname $file].c
set cxxflags ""
+ set cxxldlibflags {}
# If there is no `.c' file, assume there is a `.cc' file.
if {! [file exists $cfile]} {
set cfile [file rootname $file].cc
- set cxxflags "-lstdc++"
+
+ set cxxflaglist {}
+ foreach arg [split [libjava_find_lib libstdc++-v3/src stdc++] " "] {
+ switch -glob -- $arg {
+ "-L*" {
+ set arg [string range $arg 2 end]
+ lappend cxxldlibflags $arg
+ # Strip the `.libs' directory; we link with libtool which
+ # doesn't need it.
+ set arg "-L[file dirname $arg]"
+ }
+ }
+ lappend cxxflaglist $arg
+ }
+
+ lappend cxxflaglist "-lstdc++"
+ set cxxflags [join $cxxflaglist]
}
if {! [gcj_jni_compile_c_to_so $cfile]} {
@@ -126,7 +149,7 @@ proc gcj_jni_test_one {file} {
return 0
}
- if {! [gcj_invoke $main [file rootname $file].out]} {
+ if {! [gcj_invoke $main [file rootname $file].out $cxxldlibflags]} {
# FIXME
return 0
}
@@ -140,10 +163,10 @@ proc gcj_jni_test_one {file} {
# Run the JNI tests.
proc gcj_jni_run {} {
global srcdir subdir
- global target_triplet host_triplet
+ global build_triplet host_triplet
# For now we only test JNI on native builds.
- if {$target_triplet == $host_triplet} {
+ if {$build_triplet == $host_triplet} {
catch "glob -nocomplain ${srcdir}/${subdir}/*.java" srcfiles
foreach x $srcfiles {
diff --git a/libjava/testsuite/libjava.lang/InvokeReturn.java b/libjava/testsuite/libjava.lang/InvokeReturn.java
index 10128b593c1..9263dbe404d 100644
--- a/libjava/testsuite/libjava.lang/InvokeReturn.java
+++ b/libjava/testsuite/libjava.lang/InvokeReturn.java
@@ -69,6 +69,10 @@ public class InvokeReturn {
// test double result
m = o.getClass().getDeclaredMethod("d9", new Class[0]);
System.out.println(m.invoke(o, new Object[0]));
+ } catch (UnsupportedOperationException e) {
+ // We get this on targets which don't support reflection (no
+ // libffi port yet). We might as well fake PASSes.
+ System.out.println("true\nfalse\nc\n5\n6\n7\n8.0\n9.0");
} catch (Throwable t) {
t.printStackTrace();
}
diff --git a/libjava/testsuite/libjava.lang/Thread_Interrupt.java b/libjava/testsuite/libjava.lang/Thread_Interrupt.java
index 5412549e713..cb569c827c4 100644
--- a/libjava/testsuite/libjava.lang/Thread_Interrupt.java
+++ b/libjava/testsuite/libjava.lang/Thread_Interrupt.java
@@ -44,12 +44,33 @@ class Sleeper extends Thread
class Looper extends Thread
{
+ // Return the number of Thread.yield()s we can do in 500ms.
+ static long calibrate ()
+ {
+ long i = 1;
+
+ for (int tries = 0; tries < 40; tries++)
+ {
+ long t = System.currentTimeMillis();
+ for (long n = 0; n < i; n++)
+ Thread.yield();
+ long t_prime = System.currentTimeMillis();
+ if (t_prime - t > 500)
+ return i;
+ i *= 2;
+ }
+ // We have no system clock. Give up.
+ throw new RuntimeException ("We have no system clock.");
+ }
+
+ static long yields = calibrate ();
+
public void run()
{
System.out.println ("Busy waiting");
int count = 0;
- for (int i=0; i < 1000000; i++)
+ for (long i=0; i < yields; i++)
{
Thread.yield();
count += 5;
diff --git a/libjava/testsuite/libjava.mauve/mauve.exp b/libjava/testsuite/libjava.mauve/mauve.exp
index 649e451a928..4a26b27242d 100644
--- a/libjava/testsuite/libjava.mauve/mauve.exp
+++ b/libjava/testsuite/libjava.mauve/mauve.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation.
+# Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation.
# Written by Tom Tromey <tromey@cygnus.com>.
# Incorporate Mauve into libjava's DejaGNU test suite framework.
@@ -89,10 +89,10 @@ proc test_mauve {} {
# Append -B and -I so that libgcj.spec and libgcj.zip are found
# before they're installed.
- set env(GCJ) "$GCJ_UNDER_TEST -B$objdir/../ -I$objdir/../libgcj.zip"
+ set env(GCJ) "$GCJ_UNDER_TEST -B$objdir/../ -I$objdir/../libgcj.jar"
if {[catch {
- system "$env(MAUVEDIR)/configure --with-gcj 2>@ stdout"
+ system "$env(MAUVEDIR)/configure --with-gcj 2>&1"
} msg]} then {
fail "Mauve configure"
verbose "configure failed with $msg"
diff --git a/libjava/testsuite/libjava.mauve/xfails b/libjava/testsuite/libjava.mauve/xfails
index 7ff1a4c0d2f..eff94d69880 100644
--- a/libjava/testsuite/libjava.mauve/xfails
+++ b/libjava/testsuite/libjava.mauve/xfails
@@ -1,5 +1,24 @@
-FAIL: gnu.testlet.java.lang.Double.DoubleTest: Error: test_shortbyteValue failed - 5 (number 1)
-FAIL: gnu.testlet.java.lang.Float.FloatTest: Error: test_shortbyteValue failed - 5 (number 1)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 1)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 2)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 4)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 9)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 10)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 12)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 13)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 14)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 15)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 16)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 17)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 19)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 21)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 22)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 24)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 25)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 27)
+FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 28)
+FAIL: gnu.testlet.java.io.BufferedByteOutputStream.interrupt: single-byte writes (number 3)
+FAIL: gnu.testlet.java.io.BufferedByteOutputStream.interrupt: single-byte writes (number 4)
+FAIL: gnu.testlet.java.io.PipedStream.close (number 1)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Four Byte Range Error (0) (number 1)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Four Byte Range Error (1) (number 1)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Five Bytes (0) (number 1)
@@ -9,17 +28,44 @@ FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Six Bytes (1) (number 1)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Orphan Continuation (1) (number 1)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Orphan Continuation (2) (number 1)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Four Byte Range Error (2) (number 1)
-FAIL: gnu.testlet.java.io.ObjectStreamClass.Test: getSerialVersionUID (number 7)
+FAIL: gnu.testlet.java.lang.Character.classify12 (number 1)
+FAIL: gnu.testlet.java.lang.Character.getType (number 11)
+FAIL: gnu.testlet.java.lang.Character.getType (number 20)
+FAIL: gnu.testlet.java.lang.Character.getType (number 22)
+FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 1 (number 1)
+FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 2 (number 1)
+FAIL: gnu.testlet.java.lang.Double.DoubleTest: Error: test_intValue returned wrong results CYGNUS: Float to int conversions - 1 (number 1)
+FAIL: gnu.testlet.java.lang.Double.DoubleTest: Error: test_longValue returned wrong results CYGNUS: Float to int conversions - 1 (number 1)
+FAIL: gnu.testlet.java.lang.Float.FloatTest: Error: test_intValue returned wrong results - 1 (number 1)
+FAIL: gnu.testlet.java.lang.String.CASE_INSENSITIVE_ORDER: unicode mappings (number 1)
+FAIL: gnu.testlet.java.lang.String.CASE_INSENSITIVE_ORDER: unicode mappings (number 2)
+FAIL: gnu.testlet.java.lang.System.getProperty: '' (number 1)
+FAIL: gnu.testlet.java.text.AttributedString.Test: Attribute key count (number 1)
FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: patterns (number 2)
FAIL: gnu.testlet.java.text.SimpleDateFormat.Test: equals() (number 1)
FAIL: gnu.testlet.java.text.SimpleDateFormat.Test: parse() strict (number 1)
FAIL: gnu.testlet.java.text.SimpleDateFormat.getAndSet2DigitYearStart: get2DigitYearStart() initial (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.regress: CDT (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.regress: EDT (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.regress: EST (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.regress: PDT (number 1)
+FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: invalid locale (number 1)
FAIL: gnu.testlet.java.net.ServerSocket.ServerSocketTest: Error : test_params failed - 5getInetAddress did not return proper values (number 1)
FAIL: gnu.testlet.java.net.Socket.SocketTest: Error : test_BasicServer failed - 11 exception was thrown :Illegal seek (number 1)
FAIL: gnu.testlet.java.net.URLConnection.URLConnectionTest: Error in test_Basics - 2 should not have raised Throwable here (number 1)
+FAIL: gnu.testlet.java.net.URLConnection.URLConnectionTest: Error in test_getHeaderField - 2 4 header field wrong (number 1)
FAIL: gnu.testlet.java.net.URL.URLTest: openStream (number 1)
FAIL: gnu.testlet.java.net.URL.URLTest: sameFile (number 2)
FAIL: gnu.testlet.java.net.URL.URLTest: Error in test_toString - 5 exception should not be thrown here (number 1)
+FAIL: gnu.testlet.java.net.URL.URLTest: new URL(string) (number 16)
+FAIL: gnu.testlet.java.net.URL.URLTest: new URL(string) (number 18)
FAIL: gnu.testlet.java.net.URL.URLTest: new URL(protocol, host, file) (number 26)
FAIL: gnu.testlet.java.net.URL.URLTest: new URL(protocol, host, file) (number 54)
FAIL: gnu.testlet.java.net.MulticastSocket.MulticastSocketTest: joinGroup() twice. (number 1)
+FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: should throw NullPointerException -- 1 (number 1)
+FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: v does not contain:$longvalue=I'mtryingtogiveavaluelongerthen40characters$ (number 1)
+FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: should throw NullPointerException -- 1 (number 1)
+FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: all elements are the same (number 1)
+FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: checkvalue -- got:$ents=$ (number 1)
+FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: checkvalue -- got:$dog=nocat $ (number 1)
+FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: check if all elements were found -- got: [dog=no\cat ] (number 1)
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 2fcfb607cc9..405481977d7 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1525,6 +1525,19 @@ private:
case long_type:
k = JvPrimClass (long);
break;
+
+ // These aren't used here but we call them out to avoid
+ // warnings.
+ case void_type:
+ case unsuitable_type:
+ case return_address_type:
+ case continuation_type:
+ case unused_by_subroutine_type:
+ case reference_type:
+ case null_type:
+ case unresolved_reference_type:
+ case uninitialized_reference_type:
+ case uninitialized_unresolved_reference_type:
default:
verify_fail ("unknown type in construct_primitive_array_type");
}
@@ -1828,6 +1841,30 @@ private:
note_branch_target (compute_jump (get_int ()), last_was_jsr);
break;
+ // These are unused here, but we call them out explicitly
+ // so that -Wswitch-enum doesn't complain.
+ case op_putfield_1:
+ case op_putfield_2:
+ case op_putfield_4:
+ case op_putfield_8:
+ case op_putfield_a:
+ case op_putstatic_1:
+ case op_putstatic_2:
+ case op_putstatic_4:
+ case op_putstatic_8:
+ case op_putstatic_a:
+ case op_getfield_1:
+ case op_getfield_2s:
+ case op_getfield_2u:
+ case op_getfield_4:
+ case op_getfield_8:
+ case op_getfield_a:
+ case op_getstatic_1:
+ case op_getstatic_2s:
+ case op_getstatic_2u:
+ case op_getstatic_4:
+ case op_getstatic_8:
+ case op_getstatic_a:
default:
verify_fail ("unrecognized instruction in branch_prepass",
start_PC);
@@ -2974,6 +3011,30 @@ private:
handle_jsr_insn (get_int ());
break;
+ // These are unused here, but we call them out explicitly
+ // so that -Wswitch-enum doesn't complain.
+ case op_putfield_1:
+ case op_putfield_2:
+ case op_putfield_4:
+ case op_putfield_8:
+ case op_putfield_a:
+ case op_putstatic_1:
+ case op_putstatic_2:
+ case op_putstatic_4:
+ case op_putstatic_8:
+ case op_putstatic_a:
+ case op_getfield_1:
+ case op_getfield_2s:
+ case op_getfield_2u:
+ case op_getfield_4:
+ case op_getfield_8:
+ case op_getfield_a:
+ case op_getstatic_1:
+ case op_getstatic_2s:
+ case op_getstatic_2u:
+ case op_getstatic_4:
+ case op_getstatic_8:
+ case op_getstatic_a:
default:
// Unrecognized opcode.
verify_fail ("unrecognized instruction in verify_instructions_0",
diff --git a/libjava/win32.cc b/libjava/win32.cc
index 57c63789f36..af1163fbfa9 100644
--- a/libjava/win32.cc
+++ b/libjava/win32.cc
@@ -11,9 +11,11 @@ details. */
#include <config.h>
#include <jvm.h>
#include <sys/timeb.h>
+#include <stdlib.h>
#include "platform.h"
#include <java/lang/ArithmeticException.h>
+#include <java/util/Properties.h>
static LONG CALLBACK
win32_exception_handler (LPEXCEPTION_POINTERS e)
@@ -62,3 +64,156 @@ __mingwthr_key_dtor (DWORD, void (*) (void *))
// approximately 24 bytes per thread created.
return 0;
}
+
+// Set platform-specific System properties.
+void
+_Jv_platform_initProperties (java::util::Properties* newprops)
+{
+ // A convenience define.
+#define SET(Prop,Val) \
+ newprops->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val))
+
+ SET ("file.separator", "\\");
+ SET ("path.separator", ";");
+ SET ("line.separator", "\r\n");
+
+ // Use GetCurrentDirectory to set 'user.dir'.
+ DWORD buflen = MAX_PATH;
+ char *buffer = (char *) _Jv_MallocUnchecked (buflen);
+ if (buffer != NULL)
+ {
+ if (GetCurrentDirectory (buflen, buffer))
+ SET ("user.dir", buffer);
+
+ if (GetTempPath (buflen, buffer))
+ SET ("java.io.tmpdir", buffer);
+
+ _Jv_Free (buffer);
+ }
+
+ // Use GetUserName to set 'user.name'.
+ buflen = 257; // UNLEN + 1
+ buffer = (char *) _Jv_MallocUnchecked (buflen);
+ if (buffer != NULL)
+ {
+ if (GetUserName (buffer, &buflen))
+ SET ("user.name", buffer);
+ _Jv_Free (buffer);
+ }
+
+ // According to the api documentation for 'GetWindowsDirectory()', the
+ // environmental variable HOMEPATH always specifies the user's home
+ // directory or a default directory. On the 3 windows machines I checked
+ // only 1 had it set. If it's not set, JDK1.3.1 seems to set it to
+ // the windows directory, so we'll do the same.
+ char *userHome = NULL;
+ if ((userHome = ::getenv ("HOMEPATH")) == NULL )
+ {
+ // Check HOME since it's what I use.
+ if ((userHome = ::getenv ("HOME")) == NULL )
+ {
+ // Not found - use the windows directory like JDK1.3.1 does.
+ char *winHome = (char *) _Jv_MallocUnchecked (MAX_PATH);
+ if (winHome != NULL)
+ {
+ if (GetWindowsDirectory (winHome, MAX_PATH))
+ SET ("user.home", winHome);
+ _Jv_Free (winHome);
+ }
+ }
+ }
+ if (userHome != NULL)
+ SET ("user.home", userHome);
+
+ // Get and set some OS info.
+ OSVERSIONINFO osvi;
+ ZeroMemory (&osvi, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ if (GetVersionEx (&osvi))
+ {
+ char *buffer = (char *) _Jv_MallocUnchecked (30);
+ if (buffer != NULL)
+ {
+ sprintf (buffer, "%d.%d", (int) osvi.dwMajorVersion,
+ (int) osvi.dwMinorVersion);
+ SET ("os.version", buffer);
+ _Jv_Free (buffer);
+ }
+
+ switch (osvi.dwPlatformId)
+ {
+ case VER_PLATFORM_WIN32_WINDOWS:
+ if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
+ SET ("os.name", "Windows 95");
+ else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
+ SET ("os.name", "Windows 98");
+ else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
+ SET ("os.name", "Windows Me");
+ else
+ SET ("os.name", "Windows ??");
+ break;
+
+ case VER_PLATFORM_WIN32_NT:
+ if (osvi.dwMajorVersion <= 4 )
+ SET ("os.name", "Windows NT");
+ else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
+ SET ("os.name", "Windows 2000");
+ else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
+ SET ("os.name", "Windows XP");
+ else
+ SET ("os.name", "Windows NT ??");
+ break;
+
+ default:
+ SET ("os.name", "Windows UNKNOWN");
+ break;
+ }
+ }
+
+ // Set the OS architecture.
+ SYSTEM_INFO si;
+ GetSystemInfo (&si);
+ switch (si.dwProcessorType)
+ {
+ case PROCESSOR_INTEL_386:
+ SET ("os.arch", "i386");
+ break;
+ case PROCESSOR_INTEL_486:
+ SET ("os.arch", "i486");
+ break;
+ case PROCESSOR_INTEL_PENTIUM:
+ SET ("os.arch", "i586");
+ break;
+ case PROCESSOR_MIPS_R4000:
+ SET ("os.arch", "MIPS4000");
+ break;
+ case PROCESSOR_ALPHA_21064:
+ SET ("os.arch", "ALPHA");
+ break;
+ default:
+ SET ("os.arch", "unknown");
+ break;
+ }
+}
+
+/* Store up to SIZE return address of the current program state in
+ ARRAY and return the exact number of values stored. */
+int
+backtrace (void **__array, int __size)
+{
+ register void *_ebp __asm__ ("ebp");
+ register void *_esp __asm__ ("esp");
+ unsigned int *rfp;
+
+ int i=0;
+ for (rfp = *(unsigned int**)_ebp;
+ rfp && i < __size;
+ rfp = *(unsigned int **)rfp)
+ {
+ int diff = *rfp - (unsigned int)rfp;
+ if ((void*)rfp < _esp || diff > 4 * 1024 || diff < 0) break;
+
+ __array[i++] = (void*)(rfp[1]-4);
+ }
+ return i;
+}