aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-20 20:47:10 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-20 20:47:10 +0000
commit446a46d93a4456cd84d83ca616e90a53670536bd (patch)
treefba8a12e1ebd755218dc0ae3ba1a5650a3030515 /libjava
parent416eb2f4d5600aafcbfa9c089c240eca87484af9 (diff)
Mainline merge as of 2003-08-17.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@70615 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog571
-rw-r--r--libjava/Makefile.am12
-rw-r--r--libjava/Makefile.in108
-rw-r--r--libjava/acinclude.m46
-rw-r--r--libjava/aclocal.m411
-rw-r--r--libjava/boehm.cc46
-rwxr-xr-xlibjava/configure789
-rw-r--r--libjava/configure.host7
-rw-r--r--libjava/configure.in93
-rw-r--r--libjava/defineclass.cc37
-rw-r--r--libjava/gij.cc16
-rw-r--r--libjava/gnu/awt/xlib/XGraphicsConfiguration.java2
-rw-r--r--libjava/gnu/gcj/convert/natIconv.cc42
-rw-r--r--libjava/gnu/java/awt/EmbeddedWindow.java52
-rw-r--r--libjava/gnu/java/awt/EmbeddedWindowSupport.java22
-rw-r--r--libjava/gnu/java/awt/natEmbeddedWindow.cc9
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java10
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java16
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java3
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkToolkit.java11
-rw-r--r--libjava/gnu/java/lang/ArrayHelper.java30
-rw-r--r--libjava/include/i386-signal.h43
-rw-r--r--libjava/java/awt/Color.java2
-rw-r--r--libjava/java/awt/Component.java32
-rw-r--r--libjava/java/awt/Container.java23
-rw-r--r--libjava/java/awt/EventQueue.java47
-rw-r--r--libjava/java/awt/Font.java784
-rw-r--r--libjava/java/awt/GridBagLayout.java686
-rw-r--r--libjava/java/awt/MediaTracker.java4
-rw-r--r--libjava/java/awt/Window.java37
-rw-r--r--libjava/java/awt/event/KeyEvent.java72
-rw-r--r--libjava/java/awt/geom/Arc2D.java85
-rw-r--r--libjava/java/io/FilePermission.java8
-rw-r--r--libjava/java/io/ObjectInputStream.java48
-rw-r--r--libjava/java/io/ObjectOutputStream.java71
-rw-r--r--libjava/java/io/PrintStream.java39
-rw-r--r--libjava/java/io/natFileDescriptorPosix.cc60
-rw-r--r--libjava/java/lang/String.java3
-rw-r--r--libjava/java/lang/Thread.java13
-rw-r--r--libjava/java/lang/Win32Process.java8
-rw-r--r--libjava/java/lang/natRuntime.cc8
-rw-r--r--libjava/java/lang/natString.cc7
-rw-r--r--libjava/java/lang/natSystem.cc6
-rw-r--r--libjava/java/lang/natWin32Process.cc4
-rw-r--r--libjava/java/lang/reflect/Constructor.java236
-rw-r--r--libjava/java/lang/reflect/Method.java228
-rw-r--r--libjava/java/lang/reflect/natField.cc11
-rw-r--r--libjava/java/math/BigDecimal.java73
-rw-r--r--libjava/java/net/ServerSocket.java55
-rw-r--r--libjava/java/net/Socket.java99
-rw-r--r--libjava/java/net/SocketImpl.java3
-rw-r--r--libjava/java/net/URL.java43
-rw-r--r--libjava/java/net/URLEncoder.java27
-rw-r--r--libjava/java/net/natPlainSocketImplPosix.cc31
-rw-r--r--libjava/java/nio/ByteBufferImpl.java202
-rw-r--r--libjava/java/nio/DirectByteBufferImpl.java124
-rw-r--r--libjava/java/nio/MappedByteBufferImpl.java59
-rw-r--r--libjava/java/nio/channels/FileChannelImpl.java4
-rw-r--r--libjava/java/text/DecimalFormat.java10
-rw-r--r--libjava/java/text/SimpleDateFormat.java12
-rw-r--r--libjava/java/util/HashMap.java3
-rw-r--r--libjava/java/util/WeakHashMap.java4
-rw-r--r--libjava/javax/swing/border/BevelBorder.java6
-rw-r--r--libjava/javax/swing/border/EtchedBorder.java6
-rw-r--r--libjava/javax/swing/border/LineBorder.java2
-rw-r--r--libjava/javax/swing/border/MatteBorder.java12
-rw-r--r--libjava/javax/swing/border/SoftBevelBorder.java6
-rw-r--r--libjava/javax/swing/plaf/BorderUIResource.java52
-rw-r--r--libjava/javax/swing/plaf/ComponentUI.java2
-rw-r--r--libjava/javax/swing/plaf/TreeUI.java2
-rw-r--r--libjava/javax/swing/plaf/basic/BasicBorders.java55
-rw-r--r--libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java14
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTreeUI.java2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c8
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c7
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c826
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c12
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c13
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c100
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c26
-rw-r--r--libjava/jni/gtk-peer/gtkpeer.h269
-rw-r--r--libjava/libart.m45
-rw-r--r--libjava/libltdl/ChangeLog5
-rwxr-xr-xlibjava/libltdl/configure133
-rw-r--r--libjava/libltdl/configure.in3
-rw-r--r--libjava/testsuite/ChangeLog32
-rw-r--r--libjava/testsuite/lib/libjava.exp47
-rw-r--r--libjava/testsuite/libjava.compile/PR5641.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/abstr.xfail1
-rw-r--r--libjava/testsuite/libjava.jacks/jacks.exp11
-rw-r--r--libjava/testsuite/libjava.jacks/jacks.xfail16
-rw-r--r--libjava/testsuite/libjava.mauve/mauve.exp19
-rw-r--r--libjava/verify.cc542
-rw-r--r--libjava/win32.cc23
97 files changed, 5487 insertions, 1984 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index c6de2971303..633db92d48d 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,574 @@
+2003-08-13 Tom Tromey <tromey@redhat.com>
+
+ * gij.cc (help): Document -? and -X.
+
+2003-08-12 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/Font.java:
+ Stub out more recent API.
+
+2003-08-12 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/Color.java (getAlpha):
+ Prevent sign-extended alpha values.
+
+2003-08-12 Tom Tromey <tromey@redhat.com>
+
+ * gij.cc (main): Handle -? and -X.
+
+2003-08-10 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/awt/Container.java
+ (getPreferredSize): Call preferredSize.
+ (preferredSize): Moved body of getPreferredSize here.
+ (getMinimumSize): Call minimumSize.
+ (minimumSize): Moved body of getMinimumSize here.
+
+2003-08-11 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/EventQueue.java (currentEvent, lastWhen): New fields.
+ (postEvent): Removed FIXME comment.
+ (isDispatchThread): Documented.
+ (getCurrentEvent): New method.
+ (dispatchEvent): Set currentEvent and lastWhen.
+ (getMostRecentEventTime): Rewrote.
+ (invokeLater): Documented.
+
+2003-08-10 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/io/PrintStream.java (print): Always flush if auto_flush is
+ set. Don't check for newline characters.
+ (write (int)): Implement without using a temporary array.
+ (write (byte[], int, int): Always flush if auto_flush is set. Don't
+ check for newline characters.
+ Fixes PR libgcj/11778.
+
+2003-08-08 Andrew Haley <aph@redhat.com>
+
+ * Makefile.am (AM_CXXFLAGS): Define BOOT_CLASS_PATH.
+ * Makefile.in: Rebuild.
+ * java/lang/natRuntime.cc (insertSystemProperties): Add
+ "sun.boot.class.path".
+
+2003-08-07 Andrew Haley <aph@redhat.com>
+
+ * java/io/PrintStream.java: Don't crash on a null string.
+
+2003-08-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Don't initialize GCINCS to boehm-gc/include.
+ * configure: Regenerate.
+
+2003-08-07 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/net/Socket.java (Socket (SocketImpl)): Don't allow null
+ SocketImpl. Update Javadoc.
+ (bind): Call close() not impl.close() in event of exception.
+ (connect): Likewise.
+ Remove superfluous null checks throughout.
+ * java/net/ServerSocket.java (ServerSocket (int, int, InetAddress)):
+ Don't create an extra socket. Fix for PR libgcj/10868.
+ (bind): Clean up exception handling.
+ Remove superfluous null checks throughout.
+
+2003-08-07 Jacob Gladish <gladish@spinnakernet.com>
+ Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/net/natPlainSocketImplPosix.cc (connect): Pass the FD as a
+ ready-to-write argument to _Jv_Select. Reset the socket back to
+ non-blocking state after connecting.
+ (accept): Pass the FD as a ready-to-write argument to _Jv_Select.
+ Throw SocketTimeoutException not InterruptedIOException.
+ (read): Throw SocketTimeoutException not InterruptedIOException.
+
+2003-08-07 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/lang/Thread.java (Thread): Check for null "name" from
+ start of private constructor, not after calling the private
+ constructor.
+
+2003-08-06 Tom Tromey <tromey@redhat.com>
+
+ * java/io/FilePermission.java (equals): Use correct index for
+ last character of path.
+
+2003-08-06 Alan Modra <amodra@bigpond.net.au>
+
+ * acinclude.m4 (LIBGCJ_CONFIGURE): Remove AC_CANONICAL_BUILD.
+ * configure.in: Compare with_cross_host to build_alias, not build.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2003-08-05 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/11779:
+ * java/lang/reflect/natField.cc (getAddr): Skip frames in Field
+ class.
+
+ * java/lang/reflect/Method.java: Updated status comment.
+ Imported javadoc from Classpath and re-ordered methods.
+ * java/lang/reflect/Constructor.java: Reindented. Updated
+ status comment. Imported javadoc from Classpath and re-ordered
+ methods.
+
+2003-08-05 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java (postKeyEvent):
+ Add keyLocation parameter.
+ * java/awt/event/KeyEvent.java (getKeyText): Fix "NumPad-"
+ string.
+ (paramString): Generate keyChar string according to keyChar, not
+ keyCode.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (state_to_awt_mods): Handle ALT key.
+ (keyevent_state_to_awt_mods): New function.
+ (get_first_keyval_from_keymap): New function.
+ (keysym_to_awt_keycode): Get virtual key code from keymap.
+ Handle missing VK_ values.
+ (keysym_to_awt_keylocation): New function.
+ (keyevent_to_awt_keychar): New function.
+ (generates_key_typed_event): Handle non-text-component case.
+ Handle GDK_KP_Delete and GDK_KP_Enter.
+ (awt_event_handler): Call new functions to get postKeyEvent
+ parameters.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c (gtkInit):
+ Update postKeyEvent method signature.
+ * jni/gtk-peer/gtkpeer.h: Add KEY_LOCATION defines. Add missing
+ VK_ defines.
+
+2003-08-05 Matthias Klose <doko@debian.org>
+
+ * aclocal.m4: check for libart-config binary
+ under the name libart2-config as well.
+ * configure: regenerated.
+
+2003-08-04 David P Grove <groved@us.ibm.com>
+
+ * java/text/DecimalFormat.java (format): avoid ArithmeticException
+ when groupingSize is 0.
+ (parse): Likewise.
+
+2003-08-04 Matthias Klose <doko@debian.org>
+
+ * libart.m4: check for libart-config binary
+ under the name libart2-config as well.
+ * configure, aclocal.m4: regenerated.
+
+2003-08-02 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/ByteBufferImpl.java
+ (getChar): Check remaining bytes, fixed comment about endianess.
+ (putChar): Likewise.
+ (getShort): Likewise.
+ (putShort): Likewise.
+ (getInt): Check remaining bytes, fixed conversion, fixed comment about
+ endianess.
+ (putInt): Likewise.
+ (getLong): Likewise.
+ (putLong): Likewise.
+ (getFloat): Likewise.
+ (putFloat): Likewise.
+ (getDouble): Likewise.
+ (putDouble): Likewise.
+ * java/nio/DirectByteBufferImpl.java
+ (getChar): Wrapped code, fixed comment about endianess.
+ (putchar): Likewise.
+ (getShort): Likewise.
+ (putShort): Likewise.
+ (getInt): Fixed conversion, fixed comment about endianess.
+ (putInt): Likewise.
+ (getLong): Likewise.
+ (putLong): Likewise.
+ (getFloat): Likewise.
+ (putFloat): Likewise.
+ (getDouble): Likewise.
+ (putDouble): Likewise.
+ * java/nio/MappedByteBufferImpl.java
+ (compact): Implemented.
+ (getChar): Implemented.
+ (putChar): Implemented.
+ (getDouble): Implemented.
+ (putdouble): Implemented.
+ (getFloat): Implemented.
+ (putFloat): Implemented.
+ (getInt): Implemented.
+ (putInt): Implemented.
+ (getLong): Implemented.
+ (putLong): Implemented.
+ (getShort): Implemented.
+ (putShort): Implemented.
+ * java/nio/channels/FileChannelImpl.java
+ (read): Set position where to access file.
+ (write): Likewise.
+ (transferTo): Flip buffer after read and before write.
+ (transferFrom): Likewise.
+
+2003-08-02 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/lang/ArrayHelper.java
+ (equalsArray): Reformated, added method documentation.
+
+2003-08-02 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URL.java
+ (URL): Added paragraph about the
+ gnu.java.net.nocache_protocol_handlers property.
+ (ph_cache): Renamed from handlers to match classpath's implementation.
+ Reordered it with factory and serialVersionUID member variables.
+ (cache_handlers): New member variable.
+ (static): New static initializer to initialize cache_handlers from
+ gnu.java.net.nocache_protocol_handlers property.
+ (URL): Use ph_cache instead of handlers, reformatted some code to
+ match classpath's implementation.
+
+2003-08-01 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/11241:
+ * java/util/WeakHashMap.java (WeakHashMap(int,float)): If
+ initialCapacity is 0, set it to 1.
+
+2003-08-01 Stephen Crawley <crawley@dstc.edu.au>
+
+ * java/net/SocketImpl.java (toString): Display the remote address
+ of an unconnected server socket as "0.0.0.0/0.0.0.0".
+
+2003-08-01 Sascha Brawer <brawer@dandelis.ch>
+
+ * javax/swing/border/BevelBorder.java,
+ javax/swing/border/EtchedBorder.java,
+ javax/swing/border/LineBorder.java,
+ javax/swing/border/MatteBorder.java,
+ javax/swing/border/SoftBevelBorder.java,
+ javax/swing/plaf/BorderUIResource.java,
+ javax/swing/plaf/ComponentUI.java,
+ javax/swing/plaf/TreeUI.java,
+ javax/swing/plaf/basic/BasicBorders.java,
+ javax/swing/plaf/basic/BasicGraphicsUtils.java,
+ javax/swing/plaf/basic/BasicTreeUI.java:
+ Prepend "doc-files" to all paths to embedded Javadoc images, so
+ that the generated documentation contains the correct URL.
+
+2003-08-01 Tom Tromey <tromey@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in (tool_include_dir): Redefine to match gcc.
+
+2003-08-01 Jerry Quinn <jlquinn@optonline.net>
+ Mark Wielaard <mark@klomp.org>
+
+ * java/math/BigDecimal (divide): Correctly handle
+ ROUND_HALF_EVEN when amount is greater than 0.5.
+ Simplify and optimize code.
+
+2003-07-31 Tom Tromey <tromey@redhat.com>
+
+ More for PR libgcj/11737:
+ * java/io/ObjectInputStream.java (processResolution): Use
+ getMethod.
+ (getMethod): Make method accessible.
+ (getField): Make field accessible.
+ (setBooleanField): Don't call setAccessible here.
+ (setByteField, setCharField, setDoubleField, setFloatField,
+ setIntField, setLongField, setShortField, setObjectField):
+ Likewise.
+ (callReadMethod): Don't check whether method is null. Catch
+ NoSuchMethodException.
+ * java/io/ObjectOutputStream.java (callWriteMethod): Initialize
+ cause on thrown exceptions.
+
+2003-07-31 Stepan Koltsov <yozh@mx1.ru>
+
+ Fix for PR libgcj/11728:
+ * java/util/HashMap.java (readObject): Set size.
+
+2003-07-31 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/11737:
+ * java/io/ObjectOutputStream.java (getMethod): Make method
+ accessible.
+ (getField): Likewise.
+ (writeObject): Use getMethod.
+ Import PrivilegedAction and AccessController.
+ (callWriteMethod): Don't check whether m is null. Catch
+ NoSuchMethodException.
+
+ * java/awt/geom/Arc2D.java (getBounds2D): Implement.
+ (containsAngle): Likewise.
+ (getStartPoint): Rewrote.
+ (getEndPoint): Likewise.
+ (setAngleStart(Point2D)): Likewise.
+
+2003-07-31 Roger Sayle <roger@eyesopen.com>
+ Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Add new THREADCXXFLAGS variable.
+ Handle POSIX threads on alpha*-dec-osf*.
+ * configure: Regenerate.
+ * Makefile.am: Add THREADCXXFLAGS to AM_CXXFLAGS.
+ * Makefile.in: Regenerate.
+
+2003-07-08 Andrew Haley <aph@redhat.com>
+
+ * include/i386-signal.h (RESTORE): New.
+ (INIT_SEGV): Set restorer.
+ (INIT_FPE): Likewise.
+
+2003-07-29 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Call getName rather
+ than getXLFD.
+ * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java: Likewise.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+ (gtkSetFont): Scale size parameter by PANGO_SCALE.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c:
+ Likewise.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:
+ Likewise.
+
+2003-07-29 Tom Tromey <tromey@redhat.com>
+
+ * defineclass.cc (handleField): Throw exception if field name is
+ duplicated.
+ (handleMethod): Throw exception for duplicate method.
+
+2003-07-29 Tom Tromey <tromey@redhat.com>
+
+ * gnu/gcj/convert/natIconv.cc (write): Handle case where
+ output buffer is too small.
+
+2003-07-28 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natString.cc (init(gnu.gcj.runtime.StringBuffer)):
+ New method.
+ Include gnu/gcj/runtime/StringBuffer.h.
+ * java/lang/String.java (init(gnu.gcj.runtime.StringBuffer)): New
+ native method.
+ (String(gnu.gcj.runtime.StringBuffer)): Use it.
+
+2003-07-27 Anthony Green <green@redhat.com>
+
+ * configure.in: Fix newlib check.
+ * configure: Rebuilt.
+
+2003-07-27 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c:
+ Create vbox and layout for GtkPlug.
+
+2003-07-27 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Window.java
+ (Window): Removed now unused constructor. It became oboslete with the
+ new embedded window patch.
+
+2003-07-27 Thomas Fitzsimmons <fitzsim@redhat.com.h>
+ Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/EmbeddedWindow.java
+ (EmbeddedWindow): Extends Frame instead of Window.
+ (window_id): New member variable to store the native window handle.
+ (create): Removed.
+ (EmbeddedWindow): New constructor.
+ (addNotify): New method.
+ (getHandler): Likewise.
+ (setWindowPeer): New native method.
+ * gnu/java/awt/EmbeddedWindowSupport.java
+ (EmbeddedWindowSupport): Fixed documentation.
+ (createEmbeddedWindow): Return EmbeddedWindowPeer instead of
+ WindowPeer, give it an EmbeddedWindow instance instead of the raw
+ window data.
+ * gnu/java/awt/natEmbeddedWindow.cc
+ (create): Removed.
+ (setWindowPeer): New method.
+ * gnu/java/awt/peer/EmbeddedWindowPeer.java,
+ gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java,
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c:
+ New files
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (GtkToolkit): Implements EmbeddedWindowSupport.
+ (createEmbeddedWindow): New method.
+ * java/awt/Window.java
+ (Window): Removed.
+ * Makefile.am
+ (java_source_files): Added EmbeddedWindowPeer.java.
+ (gtk_awt_peer_sources): Added GtkEmbeddedWindowPeer.java.
+ (gtk_c_source_files): Added gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c.
+ * Makefile.in: Regenerated.
+
+2003-07-26 Ranjit Mathew <rmathew@hotmail.com>
+
+ * java/lang/Win32Process.java (ConcreteProcess): Surround
+ a command line element with quotes if it contains an
+ embedded space or tab.
+ * java/lang/natWin32Process.cc (startProcess): Do not
+ surround command line elements with quotes here.
+
+ * configure.host: Use -fcheck-references and
+ -fuse-divide-subroutine for MinGW until we fix
+ win32_exception_handler( ) in win32.cc w.r.t. Win32
+ Structured Exception Handling (SEH).
+
+ * win32.cc (_Jv_platform_initProperties): Use generic names
+ like "x86" for the "os.arch" property to be consistent with
+ what Sun's JDK produces. Use the wProcessorArchitecture
+ member of the Win32 SYSTEM_INFO structure, filled in a call
+ to GetSystemInfo( ), instead of dwProcessorType.
+
+2003-07-26 Mohan Embar <gnustuff@thisiscool.com>
+ Ranjit Mathew <rmathew@hotmail.com>
+
+ * Makefile.am: Use cross-compiling gcjh from the path for
+ a crossed-native build.
+ * Makefile.in: Rebuilt.
+ * configure.in: Include libltdl in non-newlib builds.
+ Moved determination of gcj used to build libraries to
+ its own section. Fixed cross-compilation issues for
+ non-newlib builds.
+ * configure: Rebuilt.
+
+2003-07-25 Tom Tromey <tromey@redhat.com>
+
+ * java/io/natFileDescriptorPosix.cc (write): Try again on EINTR.
+ (write): Likewise.
+ (read): Likewise.
+ (read): Likewise.
+
+2003-07-25 Mark Wielaard <mark@klomp.org>
+
+ * java/lang/natRuntime.cc (_load): Add library name to
+ UnsatisfiedLinkError when thrown.
+
+2003-07-25 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (awt_java_source_files): java/awt/GridBagLayoutInfo.java
+ added.
+ * Makefile.in: Likewise.
+
+2003-07-25 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/awt/Component.java
+ (getPreferredSize): Call preferredSize.
+ (preferredSize): Moved body of getPreferredSize here.
+ (getMinimumSize): Call minimumSize.
+ (minimumSize): Moved body of getMinimumSize here.
+ (prepareImage): Fall back on Toolkit.prepareImage if there is no peer
+ (checkImage(Image,ImageObserver)): Don't call getWidth/getHeight, but
+ pass -1
+ * java/awt/Container.java
+ (validate): Don't validate if there is no peer.
+ (update): Clear background before calling paint.
+ * java/awt/GridBagLayout.java
+ Completed the implementation and fixed several bugs.
+ * java/awt/MediaTracker.java
+ (MediaEntry.imageUpdate): Fixed typo. & instead of | was used to
+ combine flags.
+ * java/awt/Window.java
+ (Window): Don't call setVisible(false). Windows are invisible by
+ default and calling virtual methods from constructor causes
+ compatibility problems (e.g. subclasses may assume that the peer
+ already exists).
+
+2003-07-25 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/GridBagLayout.java:
+ Totally reworked and partly implemented.
+ * java/awt/GridBagLayoutInfo.java:
+ New file.
+
+2003-07-24 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (create):
+ Don't pack label in an event box.
+
+2003-07-24 Tom Tromey <tromey@redhat.com>
+
+ For PR libgcj/7482:
+ * verify.cc (ref_intersection): New class.
+ (type_val): Removed unresolved_reference_type,
+ uninitialized_unresolved_reference_type.
+ (is_assignable_from_slow): Rewrote.
+ (type::data): Removed.
+ (type::klass): New field.
+ (type::type): Added verifier argument.
+ (type::resolve): Removed.
+ (type::set_uninitialized): Updated for change to type_val.
+ (type::set_initialized): Likewise.
+ (type::isinitialized): Likewise.
+ (type::print): Likewise.
+ (construct_primitive_array_type): Likewise.
+ (type::compatible): Updated for change to type_val and to use
+ ref_intersection.
+ (type::isarray): Updated to use ref_intersection.
+ (type::isinterface): Likewise.
+ (type::element_type): Likewise.
+ (type::to_array): Likewise.
+ (type::verify_dimensions): Rewrote.
+ (type::merge): Likewise.
+ (check_class_constant): Updated for type constructor change.
+ (check_constant): Likewise.
+ (check_field_constant): Likewise.
+ (get_one_type): Likewise.
+ (initialize_stack): Likewise.
+ (verify_instructions_0): Likewise.
+ (verify_instructions_0) [op_invokeinterface]: Removed special
+ case.
+ (isect_list): New field.
+ (_Jv_BytecodeVerifier): Initialize it.
+ (~_Jv_BytecodeVerifier): Destroy ref_intersection objects.
+
+2003-07-24 H. Väisänen <hvaisane@joyx.joensuu.fi>
+
+ * java/text/SimpleDateFormat.java (format) [YEAR_FIELD]: Zero pad
+ unless field size is 2.
+
+2003-07-23 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+ (connectHooks): New method.
+ (handleEvent): Remove.
+ * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+ (createHooks): Remove declaration.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (generates_key_typed_event): Change to handle only certain
+ keyvals.
+ (awt_event_handler): Add special handling for GtkTextView.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+ (textcomponent_commit_cb): New function.
+ (textcomponent_changed_cb): Likewise.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
+ (connectHooks): Remove.
+
+2003-07-23 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natSystem.cc (arraycopy): Check for overflow.
+
+ * boehm.cc (_Jv_BuildGCDescr): Use `1ULL'.
+
+2003-07-22 Tom Tromey <tromey@redhat.com>
+
+ * boehm.cc (_Jv_BuildGCDescr): Wrote.
+ Include limits.h.
+
+2003-07-22 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/Window.java (getWarningString): Just return the
+ string.
+ (Window): Set warningString; check with security manager.
+
+2003-07-22 Scott Gilbertson <scottg@mantatest.com>
+
+ * gnu/awt/xlib/XGraphicsConfiguration.java
+ (FontMetricsCache): Made static.
+
+2003-07-22 Tom Tromey <tromey@redhat.com>
+
+ * java/net/URLEncoder.java (encode(String)): Use platform default
+ encoding.
+ (encode(String,String)): Convert to 2-digit upper-case hex
+ number.
+ (hex): New field.
+
2003-07-21 Thomas Fitzsimmons <fitzsim@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index de217371699..cfbdbd80783 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -64,10 +64,11 @@ if NULL_TARGET
## In this case, gcj is found outside the build tree. However, zip is
## found in the build tree.
ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
+GCJH = gcjh
else
ZIP = jar
+GCJH = $(target_alias)-gcjh
endif
-GCJH = gcjh
else # CANADIAN
GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh
ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
@@ -94,13 +95,14 @@ GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -W -Wall
## We need _GNU_SOURCE defined for some Linux builds. It doesn't hurt
## to always define it.
-AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
+AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions $(THREADCXXFLAGS) \
## 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)\"" -DLIBDIR="\"$(libdir)\""
+ -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\"" \
+ -DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\""
if USING_GCC
AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
else
@@ -165,6 +167,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
@@ -205,6 +208,7 @@ gnu/java/awt/peer/gtk/GtkClipboard.java \
gnu/java/awt/peer/gtk/GtkComponentPeer.java \
gnu/java/awt/peer/gtk/GtkContainerPeer.java \
gnu/java/awt/peer/gtk/GtkDialogPeer.java \
+gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java \
gnu/java/awt/peer/gtk/GtkFileDialogPeer.java \
gnu/java/awt/peer/gtk/GtkFontPeer.java \
gnu/java/awt/peer/gtk/GtkFramePeer.java \
@@ -757,6 +761,7 @@ gnu/java/awt/EventModifier.java \
gnu/java/awt/GLightweightPeer.java \
gnu/java/awt/image/ImageDecoder.java \
gnu/java/awt/image/XBMDecoder.java \
+gnu/java/awt/peer/EmbeddedWindowPeer.java \
gnu/java/beans/editors/ColorEditor.java \
gnu/java/beans/editors/FontEditor.java \
gnu/java/beans/editors/NativeBooleanEditor.java \
@@ -818,6 +823,7 @@ java/awt/Graphics2D.java \
java/awt/GraphicsConfiguration.java \
java/awt/GridBagConstraints.java \
java/awt/GridBagLayout.java \
+java/awt/GridBagLayoutInfo.java \
java/awt/GridLayout.java \
java/awt/IllegalComponentStateException.java \
java/awt/Image.java \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index bc78ea935ab..6ba2a979605 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -123,6 +123,7 @@ STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
SYS_ZLIBS = @SYS_ZLIBS@
+THREADCXXFLAGS = @THREADCXXFLAGS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
THREADLDFLAGS = @THREADLDFLAGS@
@@ -176,7 +177,8 @@ bin_SCRIPTS = addr2name.awk
@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_FALSE@jar
@CANADIAN_FALSE@ZIP = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
-@CANADIAN_TRUE@GCJH = @CANADIAN_TRUE@gcjh
+@CANADIAN_TRUE@@NULL_TARGET_TRUE@GCJH = @CANADIAN_TRUE@@NULL_TARGET_TRUE@gcjh
+@CANADIAN_TRUE@@NULL_TARGET_FALSE@GCJH = @CANADIAN_TRUE@@NULL_TARGET_FALSE@$(target_alias)-gcjh
@CANADIAN_FALSE@GCJH = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
@@ -192,11 +194,12 @@ JAVAC = $(GCJ_WITH_FLAGS) -C
GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -W -Wall
-AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
+AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions $(THREADCXXFLAGS) \
-fdollars-in-identifiers \
-Wswitch-enum \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
- -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\""
+ -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\"" \
+ -DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\""
@USING_GCC_TRUE@AM_CFLAGS = @USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
@USING_GCC_FALSE@AM_CFLAGS = @USING_GCC_FALSE@@LIBGCJ_CFLAGS@
@@ -254,6 +257,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
@@ -294,6 +298,7 @@ gnu/java/awt/peer/gtk/GtkClipboard.java \
gnu/java/awt/peer/gtk/GtkComponentPeer.java \
gnu/java/awt/peer/gtk/GtkContainerPeer.java \
gnu/java/awt/peer/gtk/GtkDialogPeer.java \
+gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java \
gnu/java/awt/peer/gtk/GtkFileDialogPeer.java \
gnu/java/awt/peer/gtk/GtkFontPeer.java \
gnu/java/awt/peer/gtk/GtkFramePeer.java \
@@ -528,6 +533,7 @@ gnu/java/awt/EventModifier.java \
gnu/java/awt/GLightweightPeer.java \
gnu/java/awt/image/ImageDecoder.java \
gnu/java/awt/image/XBMDecoder.java \
+gnu/java/awt/peer/EmbeddedWindowPeer.java \
gnu/java/beans/editors/ColorEditor.java \
gnu/java/beans/editors/FontEditor.java \
gnu/java/beans/editors/NativeBooleanEditor.java \
@@ -589,6 +595,7 @@ java/awt/Graphics2D.java \
java/awt/GraphicsConfiguration.java \
java/awt/GridBagConstraints.java \
java/awt/GridBagLayout.java \
+java/awt/GridBagLayoutInfo.java \
java/awt/GridLayout.java \
java/awt/IllegalComponentStateException.java \
java/awt/Image.java \
@@ -2589,6 +2596,7 @@ gnu/java/awt/peer/gtk/GtkClipboard.lo \
gnu/java/awt/peer/gtk/GtkComponentPeer.lo \
gnu/java/awt/peer/gtk/GtkContainerPeer.lo \
gnu/java/awt/peer/gtk/GtkDialogPeer.lo \
+gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.lo \
gnu/java/awt/peer/gtk/GtkFileDialogPeer.lo \
gnu/java/awt/peer/gtk/GtkFontPeer.lo \
gnu/java/awt/peer/gtk/GtkFramePeer.lo \
@@ -2621,6 +2629,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.lo \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.lo \
@@ -2679,13 +2688,14 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DATA = $(jar_DATA) $(pkgconfig_DATA) $(toolexecmainlib_DATA)
DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \
-THANKS acinclude.m4 aclocal.m4 configure configure.in \
-libgcj-test.spec.in libgcj.pc.in libgcj.spec.in
+THANKS acconfig.h acinclude.m4 aclocal.m4 configure configure.in \
+gcj/libgcj-config.h.in gcj/stamp-h2.in include/config.h.in \
+include/stamp-h1.in libgcj-test.spec.in libgcj.pc.in libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
DIST_SUBDIRS = @DIRLTDL@ testsuite gcj include @DIRLTDL@ gcj include
DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
@@ -2783,6 +2793,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/awt/image/ImageDecoder.P \
.deps/gnu/java/awt/image/XBMDecoder.P \
.deps/gnu/java/awt/natEmbeddedWindow.P \
+.deps/gnu/java/awt/peer/EmbeddedWindowPeer.P \
.deps/gnu/java/awt/peer/gtk/GdkFontMetrics.P \
.deps/gnu/java/awt/peer/gtk/GdkGraphics.P \
.deps/gnu/java/awt/peer/gtk/GtkArg.P \
@@ -2797,6 +2808,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/awt/peer/gtk/GtkComponentPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkContainerPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkDialogPeer.P \
+.deps/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkFileDialogPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkFontPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkFramePeer.P \
@@ -3094,7 +3106,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/awt/GraphicsConfiguration.P .deps/java/awt/GraphicsDevice.P \
.deps/java/awt/GraphicsEnvironment.P \
.deps/java/awt/GridBagConstraints.P .deps/java/awt/GridBagLayout.P \
-.deps/java/awt/GridLayout.P .deps/java/awt/HeadlessException.P \
+.deps/java/awt/GridBagLayoutInfo.P .deps/java/awt/GridLayout.P \
+.deps/java/awt/HeadlessException.P \
.deps/java/awt/IllegalComponentStateException.P .deps/java/awt/Image.P \
.deps/java/awt/ImageCapabilities.P .deps/java/awt/Insets.P \
.deps/java/awt/ItemSelectable.P .deps/java/awt/JobAttributes.P \
@@ -4223,6 +4236,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.P \
+.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.P \
@@ -4304,6 +4318,53 @@ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
+
+include/config.h: include/stamp-h1
+ @if test ! -f $@; then \
+ rm -f include/stamp-h1; \
+ $(MAKE) include/stamp-h1; \
+ else :; fi
+include/stamp-h1: $(srcdir)/include/config.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=include/config.h \
+ $(SHELL) ./config.status
+ @echo timestamp > include/stamp-h1 2> /dev/null
+$(srcdir)/include/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/include/stamp-h1.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/include/stamp-h1.in; \
+ $(MAKE) $(srcdir)/include/stamp-h1.in; \
+ else :; fi
+$(srcdir)/include/stamp-h1.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/include/stamp-h1.in 2> /dev/null
+
+gcj/libgcj-config.h: gcj/stamp-h2
+ @if test ! -f $@; then \
+ rm -f gcj/stamp-h2; \
+ $(MAKE) gcj/stamp-h2; \
+ else :; fi
+gcj/stamp-h2: $(srcdir)/gcj/libgcj-config.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=gcj/libgcj-config.h \
+ $(SHELL) ./config.status
+ @echo timestamp > gcj/stamp-h2 2> /dev/null
+$(srcdir)/gcj/libgcj-config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/gcj/stamp-h2.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/gcj/stamp-h2.in; \
+ $(MAKE) $(srcdir)/gcj/stamp-h2.in; \
+ else :; fi
+$(srcdir)/gcj/stamp-h2.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/gcj/stamp-h2.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f include/config.h gcj/libgcj-config.h
+
+maintainer-clean-hdr:
libgcj.pc: $(top_builddir)/config.status libgcj.pc.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
libgcj.spec: $(top_builddir)/config.status libgcj.spec.in
@@ -4768,29 +4829,32 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
- mostlyclean-libtool mostlyclean-binPROGRAMS \
- mostlyclean-noinstPROGRAMS mostlyclean-tags \
- mostlyclean-depend mostlyclean-generic
+mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLTLIBRARIES \
+ mostlyclean-compile mostlyclean-libtool \
+ mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
+ mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive
-clean-am: clean-toolexeclibLTLIBRARIES clean-compile clean-libtool \
- clean-binPROGRAMS clean-noinstPROGRAMS clean-tags \
- clean-depend clean-generic mostlyclean-am clean-local
+clean-am: clean-hdr clean-toolexeclibLTLIBRARIES clean-compile \
+ clean-libtool clean-binPROGRAMS clean-noinstPROGRAMS \
+ clean-tags clean-depend clean-generic mostlyclean-am \
+ clean-local
clean: clean-recursive
-distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \
- distclean-libtool distclean-binPROGRAMS \
- distclean-noinstPROGRAMS distclean-tags \
- distclean-depend distclean-generic clean-am
+distclean-am: distclean-hdr distclean-toolexeclibLTLIBRARIES \
+ distclean-compile distclean-libtool \
+ distclean-binPROGRAMS distclean-noinstPROGRAMS \
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
-rm -f libtool
distclean: distclean-recursive
-rm -f config.status
-maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \
+maintainer-clean-am: maintainer-clean-hdr \
+ maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-binPROGRAMS \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
@@ -4802,9 +4866,9 @@ maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
-.PHONY: mostlyclean-toolexeclibLTLIBRARIES \
-distclean-toolexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \
-maintainer-clean-toolexeclibLTLIBRARIES \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \
+clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
diff --git a/libjava/acinclude.m4 b/libjava/acinclude.m4
index 4a836046fa7..e25b1aed1ad 100644
--- a/libjava/acinclude.m4
+++ b/libjava/acinclude.m4
@@ -106,12 +106,6 @@ version=0.0.7
dnl Still use "libjava" here to placate dejagnu.
AM_INIT_AUTOMAKE(libjava, $version)
-# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
-# run it explicitly here, it will be run implicitly before
-# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
-# be run before AC_CANONICAL_HOST.
-AC_CANONICAL_BUILD
-
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4
index ef532589313..29e3a1a2a97 100644
--- a/libjava/aclocal.m4
+++ b/libjava/aclocal.m4
@@ -118,12 +118,6 @@ version=0.0.7
dnl Still use "libjava" here to placate dejagnu.
AM_INIT_AUTOMAKE(libjava, $version)
-# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
-# run it explicitly here, it will be run implicitly before
-# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
-# be run before AC_CANONICAL_HOST.
-AC_CANONICAL_BUILD
-
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
@@ -878,7 +872,10 @@ AC_ARG_ENABLE(libarttest, [ --disable-libarttest Do not try to compile an
fi
fi
- AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
+ AC_PATH_PROG(LIBART_CONFIG, libart2-config, no)
+ if test "$LIBART_CONFIG" = "no" ; then
+ AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
+ fi
min_libart_version=ifelse([$1], ,0.2.5,$1)
AC_MSG_CHECKING(for LIBART - version >= $min_libart_version)
no_libart=""
diff --git a/libjava/boehm.cc b/libjava/boehm.cc
index 5006059dabd..95721c7fbeb 100644
--- a/libjava/boehm.cc
+++ b/libjava/boehm.cc
@@ -1,6 +1,6 @@
// boehm.cc - interface between libjava and Boehm GC.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -11,6 +11,7 @@ details. */
#include <config.h>
#include <stdio.h>
+#include <limits.h>
#include <jvm.h>
#include <gcj/cni.h>
@@ -325,11 +326,48 @@ _Jv_MarkArray (void *addr, void *msp, void *msl, void * /*env*/)
// since another one could be registered first. But the compiler also
// knows this, so in that case everything else will break, too.
#define GCJ_DEFAULT_DESCR GC_MAKE_PROC(GC_GCJ_RESERVED_MARK_PROC_INDEX,0)
+
void *
-_Jv_BuildGCDescr(jclass)
+_Jv_BuildGCDescr(jclass self)
{
- /* FIXME: We should really look at the class and build the descriptor. */
- return (void *)(GCJ_DEFAULT_DESCR);
+ jlong desc = 0;
+
+ // Note: for now we only consider a bitmap mark descriptor. We
+ // could also handle the case where the first N fields of a type are
+ // references. However, this is not very likely to be used by many
+ // classes, and it is easier to compute things this way.
+
+ for (jclass klass = self; klass != NULL; klass = klass->getSuperclass())
+ {
+ jfieldID field = JvGetFirstInstanceField(klass);
+ int count = JvNumInstanceFields(klass);
+
+ for (int i = 0; i < count; ++i)
+ {
+ if (field->isRef())
+ {
+ unsigned int off = field->getOffset();
+ // If we run into a weird situation, we bail.
+ if (off % sizeof (void *) != 0)
+ return (void *) (GCJ_DEFAULT_DESCR);
+ off /= sizeof (void *);
+ // Bottom 2 bits are reserved.
+ off += 2;
+ // If we find a field outside the range of our bitmap,
+ // fall back to procedure marker.
+ if (off > CHAR_BIT * sizeof (void *))
+ return (void *) (GCJ_DEFAULT_DESCR);
+ desc |= 1ULL << off;
+ }
+
+ field = field->getNextField();
+ }
+ }
+
+ // For bitmap mark type, bottom bits are 01.
+ desc |= 1;
+ // Bogus warning avoidance (on many platforms).
+ return (void *) (unsigned long) desc;
}
// Allocate some space that is known to be pointer-free.
diff --git a/libjava/configure b/libjava/configure
index ff307d17db0..a8ea89652db 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -1394,33 +1394,10 @@ fi
-# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
-# run it explicitly here, it will be run implicitly before
-# 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:1403: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-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:1424: checking for $ac_word" >&5
+echo "configure:1401: 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
@@ -1452,7 +1429,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:1456: checking for $ac_word" >&5
+echo "configure:1433: 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
@@ -1484,7 +1461,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:1488: checking for $ac_word" >&5
+echo "configure:1465: 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
@@ -1516,7 +1493,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:1520: checking for $ac_word" >&5
+echo "configure:1497: 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
@@ -1561,7 +1538,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:1565: checking for a BSD compatible install" >&5
+echo "configure:1542: 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
@@ -1615,7 +1592,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:1619: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1596: 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"
@@ -1641,7 +1618,7 @@ fi
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1645: checking for executable suffix" >&5
+echo "configure:1622: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1651,7 +1628,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -1695,8 +1672,8 @@ LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
-# Only use libltdl for native builds.
-if test -z "${with_cross_host}"; then
+# Only use libltdl for non-newlib builds.
+if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
case $enable_ltdl_convenience in
no) { echo "configure: error: this package needs a convenience libltdl" 1>&2; exit 1; } ;;
"") enable_ltdl_convenience=yes
@@ -1801,7 +1778,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:1805: checking for ld used by GCC" >&5
+echo "configure:1782: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1831,10 +1808,10 @@ echo "configure:1805: 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:1835: checking for GNU ld" >&5
+echo "configure:1812: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1838: checking for non-GNU ld" >&5
+echo "configure:1815: 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
@@ -1869,7 +1846,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:1873: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1850: 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
@@ -1886,7 +1863,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:1890: checking for $LD option to reload object files" >&5
+echo "configure:1867: 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
@@ -1898,7 +1875,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:1902: checking for BSD-compatible nm" >&5
+echo "configure:1879: 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
@@ -1936,7 +1913,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:1940: checking how to recognise dependant libraries" >&5
+echo "configure:1917: 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
@@ -2109,13 +2086,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:2113: checking for object suffix" >&5
+echo "configure:2090: 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:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -2139,7 +2116,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:2143: checking for ${ac_tool_prefix}file" >&5
+echo "configure:2120: 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
@@ -2201,7 +2178,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:2205: checking for file" >&5
+echo "configure:2182: 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
@@ -2272,7 +2249,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:2276: checking for $ac_word" >&5
+echo "configure:2253: 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
@@ -2304,7 +2281,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:2308: checking for $ac_word" >&5
+echo "configure:2285: 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
@@ -2339,7 +2316,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:2343: checking for $ac_word" >&5
+echo "configure:2320: 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
@@ -2371,7 +2348,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:2375: checking for $ac_word" >&5
+echo "configure:2352: 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
@@ -2438,8 +2415,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 2442 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2419 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
@@ -2472,7 +2449,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2488,7 +2465,7 @@ ia64-*-hpux*)
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
case $host in
@@ -2532,7 +2509,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2536: checking whether the C compiler needs -belf" >&5
+echo "configure:2513: 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
@@ -2545,14 +2522,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 2549 "configure"
+#line 2526 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2533: \"$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
@@ -2582,7 +2559,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:2586: checking how to run the C++ preprocessor" >&5
+echo "configure:2563: 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
@@ -2595,12 +2572,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 2599 "configure"
+#line 2576 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2581: \"$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
:
@@ -2836,7 +2813,7 @@ INTERPRETER="$libgcj_interpreter"
echo $ac_n "checking for exception model to use""... $ac_c" 1>&6
-echo "configure:2840: checking for exception model to use" >&5
+echo "configure:2817: 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.
@@ -2851,7 +2828,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
:
else
cat > conftest.$ac_ext << EOF
-#line 2855 "configure"
+#line 2832 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -2862,7 +2839,7 @@ void foo()
EOF
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=-S
-if { (eval echo configure:2866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2843: \"$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
@@ -2973,7 +2950,7 @@ case "$TARGET_ECOS" in
PLATFORMH=win32.h
echo $ac_n "checking whether 'ld' is at least 2.13""... $ac_c" 1>&6
-echo "configure:2977: checking whether 'ld' is at least 2.13" >&5
+echo "configure:2954: checking whether 'ld' is at least 2.13" >&5
LD_PROG=`$CC --print-prog-name=ld`
LD_VERSION=`$LD_PROG --version`
LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
@@ -3019,7 +2996,7 @@ esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3023: checking how to run the C preprocessor" >&5
+echo "configure:3000: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -3034,13 +3011,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 3038 "configure"
+#line 3015 "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:3044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3021: \"$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
:
@@ -3051,13 +3028,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 3055 "configure"
+#line 3032 "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:3061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3038: \"$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
:
@@ -3068,13 +3045,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 3072 "configure"
+#line 3049 "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:3078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3055: \"$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
:
@@ -3099,7 +3076,7 @@ fi
echo "$ac_t""$CPP" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 3103 "configure"
+#line 3080 "configure"
#include "confdefs.h"
#include <stdint.h>
EOF
@@ -3114,7 +3091,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3118 "configure"
+#line 3095 "configure"
#include "confdefs.h"
#include <inttypes.h>
EOF
@@ -3129,7 +3106,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3133 "configure"
+#line 3110 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3144,7 +3121,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3148 "configure"
+#line 3125 "configure"
#include "confdefs.h"
#include <sys/config.h>
EOF
@@ -3161,7 +3138,7 @@ rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3165 "configure"
+#line 3142 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3176,7 +3153,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3180 "configure"
+#line 3157 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3236,7 +3213,7 @@ ZLIBTESTSPEC=
# 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:3240: checking for X" >&5
+echo "configure:3217: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -3298,12 +3275,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 3302 "configure"
+#line 3279 "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:3307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3284: \"$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*
@@ -3372,14 +3349,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 3376 "configure"
+#line 3353 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3360: \"$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.
@@ -3485,17 +3462,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:3489: checking whether -R must be followed by a space" >&5
+echo "configure:3466: 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 3492 "configure"
+#line 3469 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -3511,14 +3488,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 3515 "configure"
+#line 3492 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
@@ -3550,7 +3527,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:3554: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:3531: 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
@@ -3558,7 +3535,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3562 "configure"
+#line 3539 "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
@@ -3569,7 +3546,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3550: \"$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
@@ -3591,7 +3568,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:3595: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:3572: 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
@@ -3599,7 +3576,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3603 "configure"
+#line 3580 "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
@@ -3610,7 +3587,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:3614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3591: \"$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
@@ -3639,12 +3616,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:3643: checking for gethostbyname" >&5
+echo "configure:3620: 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 3648 "configure"
+#line 3625 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -3667,7 +3644,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:3671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3648: \"$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
@@ -3688,7 +3665,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3692: checking for gethostbyname in -lnsl" >&5
+echo "configure:3669: 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
@@ -3696,7 +3673,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3700 "configure"
+#line 3677 "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
@@ -3707,7 +3684,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:3711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3688: \"$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
@@ -3737,12 +3714,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:3741: checking for connect" >&5
+echo "configure:3718: 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 3746 "configure"
+#line 3723 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -3765,7 +3742,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:3769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3746: \"$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
@@ -3786,7 +3763,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3790: checking for connect in -lsocket" >&5
+echo "configure:3767: 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
@@ -3794,7 +3771,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3798 "configure"
+#line 3775 "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
@@ -3805,7 +3782,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:3809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3786: \"$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
@@ -3829,12 +3806,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:3833: checking for remove" >&5
+echo "configure:3810: 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 3838 "configure"
+#line 3815 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -3857,7 +3834,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3838: \"$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
@@ -3878,7 +3855,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:3882: checking for remove in -lposix" >&5
+echo "configure:3859: 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
@@ -3886,7 +3863,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3890 "configure"
+#line 3867 "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
@@ -3897,7 +3874,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:3901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3878: \"$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
@@ -3921,12 +3898,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:3925: checking for shmat" >&5
+echo "configure:3902: 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 3930 "configure"
+#line 3907 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -3949,7 +3926,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3930: \"$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
@@ -3970,7 +3947,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:3974: checking for shmat in -lipc" >&5
+echo "configure:3951: 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
@@ -3978,7 +3955,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3982 "configure"
+#line 3959 "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
@@ -3989,7 +3966,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:3993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3970: \"$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
@@ -4022,7 +3999,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:4026: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:4003: 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
@@ -4030,7 +4007,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4034 "configure"
+#line 4011 "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
@@ -4041,7 +4018,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:4045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4022: \"$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
@@ -4139,7 +4116,7 @@ fi
libsubdir=.libs
echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:4143: checking for garbage collector to use" >&5
+echo "configure:4120: 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"
@@ -4160,11 +4137,10 @@ case "$GC" in
boehm)
echo "$ac_t""boehm" 1>&6
GCLIBS=../boehm-gc/libgcjgc_convenience.la
- GCINCS='-I$(top_srcdir)/../boehm-gc/include'
JC1GCSPEC='-fuse-boehm-gc'
GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs"
- GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
+ GCINCS="`cat ../boehm-gc/boehm-cflags`"
GCOBJS=boehm.lo
GCHDR=boehm-gc.h
cat >> confdefs.h <<\EOF
@@ -4192,7 +4168,7 @@ esac
echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
-echo "configure:4196: checking for thread model used by GCC" >&5
+echo "configure:4172: 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
@@ -4221,6 +4197,7 @@ EOF
;;
esac
+THREADCXXFLAGS=
THREADLDFLAGS=
THREADLIBS=
THREADINCS=
@@ -4255,6 +4232,12 @@ case "$THREADS" in
THREADLDFLAGS=-pthread
THREADSPEC=-lc_r
;;
+ alpha*-dec-osf*)
+ THREADCXXFLAGS=-pthread
+ # boehm-gc needs some functions from librt, so link that too.
+ THREADLIBS='-lpthread -lrt'
+ THREADSPEC='-lpthread -lrt'
+ ;;
*)
THREADLIBS=-lpthread
THREADSPEC=-lpthread
@@ -4302,6 +4285,7 @@ esac
+
if test -d sysdep; then true; else mkdir sysdep; fi
@@ -4338,7 +4322,7 @@ GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
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
+tool_include_dir='$(libdir)/gcc/$(target_alias)/'${gcc_version}/include
@@ -4386,27 +4370,17 @@ EOF
#define NO_GETUID 1
EOF
-
- # If Canadian cross, then don't pick up tools from the build
- # directory.
- if test x"$build" != x"$with_cross_host" \
- && test x"$build" != x"$target"; then
- CANADIAN=yes
- GCC_UNWIND_INCLUDE=
- GCJ="${target_alias}-gcj"
- fi
- NATIVE=no
PLATFORMNET=NoNet
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:4405: checking for $ac_func" >&5
+echo "configure:4379: 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 4410 "configure"
+#line 4384 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4429,7 +4403,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4407: \"$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,12 +4430,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:4460: checking for $ac_func" >&5
+echo "configure:4434: 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 4465 "configure"
+#line 4439 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4484,7 +4458,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4462: \"$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
@@ -4511,12 +4485,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:4515: checking for $ac_func" >&5
+echo "configure:4489: 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 4520 "configure"
+#line 4494 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4539,7 +4513,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4517: \"$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
@@ -4566,12 +4540,12 @@ done
for ac_func in nl_langinfo setlocale
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4570: checking for $ac_func" >&5
+echo "configure:4544: 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 4575 "configure"
+#line 4549 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4594,7 +4568,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4572: \"$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
@@ -4621,12 +4595,12 @@ done
for ac_func in inet_aton inet_addr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4625: checking for $ac_func" >&5
+echo "configure:4599: 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 4630 "configure"
+#line 4604 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4649,7 +4623,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4627: \"$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
@@ -4676,12 +4650,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:4680: checking for $ac_func" >&5
+echo "configure:4654: 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 4685 "configure"
+#line 4659 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4704,7 +4678,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4682: \"$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
@@ -4731,12 +4705,12 @@ done
for ac_func in fork execvp pipe sigaction ftruncate
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4735: checking for $ac_func" >&5
+echo "configure:4709: 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 4740 "configure"
+#line 4714 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4759,7 +4733,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4737: \"$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
@@ -4787,17 +4761,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4791: checking for $ac_hdr" >&5
+echo "configure:4765: 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 4796 "configure"
+#line 4770 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4775: \"$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*
@@ -4824,12 +4798,12 @@ fi
done
echo $ac_n "checking for backtrace""... $ac_c" 1>&6
-echo "configure:4828: checking for backtrace" >&5
+echo "configure:4802: 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 4833 "configure"
+#line 4807 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char backtrace(); below. */
@@ -4852,7 +4826,7 @@ backtrace();
; return 0; }
EOF
-if { (eval echo configure:4856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4830: \"$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
@@ -4896,7 +4870,7 @@ fi
echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6
-echo "configure:4900: checking for dladdr in -ldl" >&5
+echo "configure:4874: 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
@@ -4904,7 +4878,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4908 "configure"
+#line 4882 "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
@@ -4915,7 +4889,7 @@ int main() {
dladdr()
; return 0; }
EOF
-if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4893: \"$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
@@ -4945,7 +4919,7 @@ do
ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_file""... $ac_c" 1>&6
-echo "configure:4949: checking for $ac_file" >&5
+echo "configure:4923: 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
@@ -5003,7 +4977,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:5007: checking for iconv" >&5
+echo "configure:4981: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5011,7 +4985,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 5015 "configure"
+#line 4989 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5021,7 +4995,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -5033,7 +5007,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 5037 "configure"
+#line 5011 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5043,7 +5017,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5021: \"$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
@@ -5064,13 +5038,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:5068: checking for iconv declaration" >&5
+echo "configure:5042: 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 5074 "configure"
+#line 5048 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -5089,7 +5063,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5067: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -5118,19 +5092,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:5122: checking for LC_MESSAGES" >&5
+echo "configure:5096: 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 5127 "configure"
+#line 5101 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:5134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5108: \"$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
@@ -5151,12 +5125,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:5155: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:5129: 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 5160 "configure"
+#line 5134 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -5164,7 +5138,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:5168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -5185,12 +5159,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:5189: checking for tm_zone in struct tm" >&5
+echo "configure:5163: 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 5194 "configure"
+#line 5168 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -5198,7 +5172,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:5202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -5218,12 +5192,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:5222: checking for tzname" >&5
+echo "configure:5196: 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 5227 "configure"
+#line 5201 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -5233,7 +5207,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:5237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -5258,12 +5232,12 @@ fi
for ac_func in gethostbyname_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5262: checking for $ac_func" >&5
+echo "configure:5236: 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 5267 "configure"
+#line 5241 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5286,7 +5260,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5264: \"$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
@@ -5313,7 +5287,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 5317 "configure"
+#line 5291 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5333,7 +5307,7 @@ rm -f conftest*
*" -D_REENTRANT "*) ;;
*)
echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6
-echo "configure:5337: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
+echo "configure:5311: 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
@@ -5346,14 +5320,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 5350 "configure"
+#line 5324 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:5357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=no
else
@@ -5363,14 +5337,14 @@ else
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
cat > conftest.$ac_ext <<EOF
-#line 5367 "configure"
+#line 5341 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:5374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=yes
else
@@ -5405,12 +5379,12 @@ EOF
esac
echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6
-echo "configure:5409: checking for struct hostent_data" >&5
+echo "configure:5383: 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 5414 "configure"
+#line 5388 "configure"
#include "confdefs.h"
#if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
@@ -5421,7 +5395,7 @@ int main() {
struct hostent_data data;
; return 0; }
EOF
-if { (eval echo configure:5425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_struct_hostent_data=yes
else
@@ -5453,7 +5427,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 5457 "configure"
+#line 5431 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5464,12 +5438,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:5468: checking for $ac_func" >&5
+echo "configure:5442: 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 5473 "configure"
+#line 5447 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5492,7 +5466,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5470: \"$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
@@ -5519,7 +5493,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 5523 "configure"
+#line 5497 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5546,12 +5520,12 @@ rm -f conftest*
for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5550: checking for $ac_func" >&5
+echo "configure:5524: 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 5555 "configure"
+#line 5529 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5574,7 +5548,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5552: \"$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
@@ -5598,7 +5572,7 @@ EOF
EOF
cat > conftest.$ac_ext <<EOF
-#line 5602 "configure"
+#line 5576 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -5622,12 +5596,12 @@ done
for ac_func in usleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5626: checking for $ac_func" >&5
+echo "configure:5600: 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 5631 "configure"
+#line 5605 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5650,7 +5624,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5628: \"$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
@@ -5670,7 +5644,7 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
EOF
cat > conftest.$ac_ext <<EOF
-#line 5674 "configure"
+#line 5648 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -5701,12 +5675,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:5705: checking for $ac_func" >&5
+echo "configure:5679: 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 5710 "configure"
+#line 5684 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5729,7 +5703,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5707: \"$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
@@ -5759,12 +5733,12 @@ done
for ac_func in sched_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5763: checking for $ac_func" >&5
+echo "configure:5737: 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 5768 "configure"
+#line 5742 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5787,7 +5761,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5765: \"$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
@@ -5809,7 +5783,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:5813: checking for sched_yield in -lrt" >&5
+echo "configure:5787: 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
@@ -5817,7 +5791,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5821 "configure"
+#line 5795 "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
@@ -5828,7 +5802,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5806: \"$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
@@ -5854,7 +5828,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:5858: checking for sched_yield in -lposix4" >&5
+echo "configure:5832: 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
@@ -5862,7 +5836,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5866 "configure"
+#line 5840 "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
@@ -5873,7 +5847,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5851: \"$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
@@ -5909,7 +5883,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 5913 "configure"
+#line 5887 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5918,7 +5892,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE_M_COUNT 1
@@ -5930,7 +5904,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 5934 "configure"
+#line 5908 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5939,7 +5913,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE___M_COUNT 1
@@ -5959,12 +5933,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:5963: checking for $ac_func" >&5
+echo "configure:5937: 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 5968 "configure"
+#line 5942 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5987,7 +5961,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5965: \"$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
@@ -6018,12 +5992,12 @@ done
for ac_func in memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6022: checking for $ac_func" >&5
+echo "configure:5996: 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 6027 "configure"
+#line 6001 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6046,7 +6020,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6024: \"$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
@@ -6076,12 +6050,12 @@ done
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6080: checking for $ac_func" >&5
+echo "configure:6054: 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 6085 "configure"
+#line 6059 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6104,7 +6078,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6082: \"$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
@@ -6133,7 +6107,7 @@ done
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6137: checking for dlopen in -ldl" >&5
+echo "configure:6111: 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
@@ -6141,7 +6115,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6145 "configure"
+#line 6119 "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
@@ -6152,7 +6126,7 @@ int main() {
dlopen()
; 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:6130: \"$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
@@ -6197,7 +6171,7 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:6201: checking for socket libraries" >&5
+echo "configure:6175: 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
@@ -6205,12 +6179,12 @@ else
gcj_checkBoth=0
unset ac_cv_func_connect
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6209: checking for connect" >&5
+echo "configure:6183: 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 6214 "configure"
+#line 6188 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -6233,7 +6207,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:6237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6211: \"$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
@@ -6256,7 +6230,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:6260: checking for main in -lsocket" >&5
+echo "configure:6234: 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
@@ -6264,14 +6238,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6268 "configure"
+#line 6242 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6249: \"$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
@@ -6298,12 +6272,12 @@ fi
LIBS="$LIBS -lsocket -lnsl"
unset ac_cv_func_accept
echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:6302: checking for accept" >&5
+echo "configure:6276: 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 6307 "configure"
+#line 6281 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept(); below. */
@@ -6326,7 +6300,7 @@ accept();
; return 0; }
EOF
-if { (eval echo configure:6330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6304: \"$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
@@ -6353,12 +6327,12 @@ fi
gcj_oldLibs=$LIBS
LIBS="$LIBS $gcj_cv_lib_sockets"
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6357: checking for gethostbyname" >&5
+echo "configure:6331: 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 6362 "configure"
+#line 6336 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -6381,7 +6355,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:6385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6359: \"$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
@@ -6399,7 +6373,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:6403: checking for main in -lnsl" >&5
+echo "configure:6377: 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
@@ -6407,14 +6381,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6411 "configure"
+#line 6385 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6392: \"$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
@@ -6446,7 +6420,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:6450: checking for deflate in -lz" >&5
+echo "configure:6424: 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
@@ -6454,7 +6428,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6458 "configure"
+#line 6432 "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
@@ -6465,7 +6439,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:6469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6443: \"$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
@@ -6514,7 +6488,7 @@ fi
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6518: checking for $ac_word" >&5
+echo "configure:6492: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6562,7 +6536,7 @@ fi
min_gtk_version=2.0.0
echo $ac_n "checking for GTK+ - version >= $min_gtk_version""... $ac_c" 1>&6
-echo "configure:6566: checking for GTK+ - version >= $min_gtk_version" >&5
+echo "configure:6540: checking for GTK+ - version >= $min_gtk_version" >&5
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
@@ -6597,7 +6571,7 @@ echo "configure:6566: checking for GTK+ - version >= $min_gtk_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6601 "configure"
+#line 6575 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6672,7 +6646,7 @@ main ()
}
EOF
-if { (eval echo configure:6676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6706,7 +6680,7 @@ fi
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6710 "configure"
+#line 6684 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6716,7 +6690,7 @@ int main() {
return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
@@ -6775,7 +6749,7 @@ fi
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6779: checking for $ac_word" >&5
+echo "configure:6753: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6825,7 +6799,7 @@ fi
min_glib_version=2.0.0
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
-echo "configure:6829: checking for GLIB - version >= $min_glib_version" >&5
+echo "configure:6803: checking for GLIB - version >= $min_glib_version" >&5
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
@@ -6864,7 +6838,7 @@ echo "configure:6829: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6868 "configure"
+#line 6842 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -6939,7 +6913,7 @@ main ()
}
EOF
-if { (eval echo configure:6943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6973,7 +6947,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6977 "configure"
+#line 6951 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -6983,7 +6957,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
@@ -7059,10 +7033,47 @@ fi
fi
fi
- # Extract the first word of "libart-config", so it can be a program name with args.
+ # Extract the first word of "libart2-config", so it can be a program name with args.
+set dummy libart2-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:7040: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_LIBART_CONFIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$LIBART_CONFIG" in
+ /*)
+ ac_cv_path_LIBART_CONFIG="$LIBART_CONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_LIBART_CONFIG="$LIBART_CONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ 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_path_LIBART_CONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_LIBART_CONFIG" && ac_cv_path_LIBART_CONFIG="no"
+ ;;
+esac
+fi
+LIBART_CONFIG="$ac_cv_path_LIBART_CONFIG"
+if test -n "$LIBART_CONFIG"; then
+ echo "$ac_t""$LIBART_CONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "$LIBART_CONFIG" = "no" ; then
+ # Extract the first word of "libart-config", so it can be a program name with args.
set dummy libart-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7066: checking for $ac_word" >&5
+echo "configure:7077: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_LIBART_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7095,9 +7106,10 @@ else
echo "$ac_t""no" 1>&6
fi
+ fi
min_libart_version=2.1.0
echo $ac_n "checking for LIBART - version >= $min_libart_version""... $ac_c" 1>&6
-echo "configure:7101: checking for LIBART - version >= $min_libart_version" >&5
+echo "configure:7113: checking for LIBART - version >= $min_libart_version" >&5
no_libart=""
if test "$LIBART_CONFIG" = "no" ; then
no_libart=yes
@@ -7121,7 +7133,7 @@ echo "configure:7101: checking for LIBART - version >= $min_libart_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 7125 "configure"
+#line 7137 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7179,7 +7191,7 @@ int main ()
EOF
-if { (eval echo configure:7183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7213,7 +7225,7 @@ fi
CFLAGS="$CFLAGS $LIBART_CFLAGS"
LIBS="$LIBS $LIBART_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7217 "configure"
+#line 7229 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7223,7 +7235,7 @@ int main() {
return 0;
; return 0; }
EOF
-if { (eval echo configure:7227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding LIBART or finding the wrong"
@@ -7262,7 +7274,7 @@ rm -f conftest*
# requires -ldl.
if test "$GC" = boehm; then
echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6
-echo "configure:7266: checking for main in -ldl" >&5
+echo "configure:7278: 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
@@ -7270,14 +7282,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7274 "configure"
+#line 7286 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:7281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7293: \"$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
@@ -7306,15 +7318,69 @@ fi
builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
fi
- if test -x "${builddotdot}/../../gcc/gcj"; then
- dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
- GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/"
- else
+fi
+
+# Which gcj do we use?
+which_gcj=default
+built_gcc_dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
+if test -n "${with_cross_host}"; then
+ # We are being configured with a cross compiler. We can't
+ # use ac_exeext, because that is for the target platform.
+ NATIVE=no
+ cross_host_exeext=
+ case "${with_cross_host}" in
+ *mingw* | *cygwin*)
+ cross_host_exeext=.exe
+ ;;
+ esac
+ if test -x "${built_gcc_dir}/gcj${cross_host_exeext}"; then
+ if test x"$build_alias" = x"$with_cross_host"; then
+ # Ordinary cross (host!=target and host=build)
+ which_gcj=built
+ else
+ # Canadian cross (host!=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=cross
+ fi
+else
+ # We are being configured with a native or crossed-native compiler
+ if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
+ if test x"$build" = x"$host"; then
+ # True native build (host=target and host=build)
+ which_gcj=built
+ else
+ # Crossed-native build (host=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=path
+ fi
+fi
+case "${which_gcj}" in
+ built)
+ GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
+ ;;
+ cross)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
+ CANADIAN=yes
+ NULL_TARGET=no
+ if test "x${with_newlib}" = "xyes"; then
+ # FIXME (comment): Why is this needed?
+ GCC_UNWIND_INCLUDE=
+ GCJ="${target_alias}-gcj"
+ else
+ GCJ="${target_alias}-gcj -B`${PWDCMD-pwd}`/"
+ fi
+ ;;
+ path)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
CANADIAN=yes
NULL_TARGET=yes
GCJ="gcj -B`${PWDCMD-pwd}`/"
- fi
-fi
+ ;;
+esac
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
@@ -7344,7 +7410,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:7348: checking for $ac_word" >&5
+echo "configure:7414: 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
@@ -7376,7 +7442,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:7380: checking for $ac_word" >&5
+echo "configure:7446: 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
@@ -7438,13 +7504,13 @@ exec 5>>./config.log
CPPFLAGS=$GCJ_SAVE_CPPFLAGS
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:7442: checking size of void *" >&5
+echo "configure:7508: 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 7448 "configure"
+#line 7514 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -7454,7 +7520,7 @@ int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:7458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
@@ -7564,18 +7630,18 @@ EOF
echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6
-echo "configure:7568: checking for g++ -ffloat-store bug" >&5
+echo "configure:7634: checking for g++ -ffloat-store bug" >&5
save_CFLAGS="$CFLAGS"
CFLAGS="-x c++ -O2 -ffloat-store"
cat > conftest.$ac_ext <<EOF
-#line 7572 "configure"
+#line 7638 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:7579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""no" 1>&6
else
@@ -7595,17 +7661,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:7599: checking for $ac_hdr" >&5
+echo "configure:7665: 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 7604 "configure"
+#line 7670 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7675: \"$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*
@@ -7635,17 +7701,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:7639: checking for $ac_hdr" >&5
+echo "configure:7705: 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 7644 "configure"
+#line 7710 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7715: \"$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*
@@ -7675,17 +7741,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:7679: checking for $ac_hdr" >&5
+echo "configure:7745: 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 7684 "configure"
+#line 7750 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7755: \"$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*
@@ -7721,12 +7787,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:7725: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:7791: 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 7730 "configure"
+#line 7796 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -7742,7 +7808,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:7746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -7764,12 +7830,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:7768: checking for ANSI C header files" >&5
+echo "configure:7834: 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 7773 "configure"
+#line 7839 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -7777,7 +7843,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7847: \"$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*
@@ -7794,7 +7860,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 7798 "configure"
+#line 7864 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -7812,7 +7878,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 7816 "configure"
+#line 7882 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -7833,7 +7899,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 7837 "configure"
+#line 7903 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -7844,7 +7910,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:7848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7868,12 +7934,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:7872: checking for ssize_t" >&5
+echo "configure:7938: 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 7877 "configure"
+#line 7943 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -7902,9 +7968,9 @@ fi
echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:7906: checking for in_addr_t" >&5
+echo "configure:7972: checking for in_addr_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 7908 "configure"
+#line 7974 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -7918,7 +7984,7 @@ int main() {
in_addr_t foo;
; return 0; }
EOF
-if { (eval echo configure:7922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_IN_ADDR_T 1
@@ -7934,16 +8000,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7938: checking whether struct ip_mreq is in netinet/in.h" >&5
+echo "configure:8004: checking whether struct ip_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7940 "configure"
+#line 8006 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ip_mreq mreq;
; return 0; }
EOF
-if { (eval echo configure:7947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IP_MREQ 1
@@ -7959,16 +8025,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7963: checking whether struct ipv6_mreq is in netinet/in.h" >&5
+echo "configure:8029: checking whether struct ipv6_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7965 "configure"
+#line 8031 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ipv6_mreq mreq6;
; return 0; }
EOF
-if { (eval echo configure:7972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IPV6_MREQ 1
@@ -7984,16 +8050,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7988: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:8054: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7990 "configure"
+#line 8056 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct sockaddr_in6 addr6;
; return 0; }
EOF
-if { (eval echo configure:7997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_INET6 1
@@ -8009,9 +8075,9 @@ fi
rm -f conftest*
echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:8013: checking for socklen_t in sys/socket.h" >&5
+echo "configure:8079: checking for socklen_t in sys/socket.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 8015 "configure"
+#line 8081 "configure"
#include "confdefs.h"
#define _POSIX_PII_SOCKET
#include <sys/types.h>
@@ -8020,7 +8086,7 @@ int main() {
socklen_t x = 5;
; return 0; }
EOF
-if { (eval echo configure:8024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
@@ -8036,16 +8102,16 @@ fi
rm -f conftest*
echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:8040: checking for tm_gmtoff in struct tm" >&5
+echo "configure:8106: checking for tm_gmtoff in struct tm" >&5
cat > conftest.$ac_ext <<EOF
-#line 8042 "configure"
+#line 8108 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm tim; tim.tm_gmtoff = 0;
; return 0; }
EOF
-if { (eval echo configure:8049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define STRUCT_TM_HAS_GMTOFF 1
@@ -8058,16 +8124,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:8062: checking for global timezone variable" >&5
+echo "configure:8128: checking for global timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 8064 "configure"
+#line 8130 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
void i(){long z2 = 2*timezone;}
; return 0; }
EOF
-if { (eval echo configure:8071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_TIMEZONE 1
@@ -8080,16 +8146,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:8084: checking for global _timezone variable" >&5
+echo "configure:8150: checking for global _timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 8086 "configure"
+#line 8152 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
long z2 = _timezone;
; return 0; }
EOF
-if { (eval echo configure:8093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_UNDERSCORE_TIMEZONE 1
@@ -8111,19 +8177,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:8115: checking for working alloca.h" >&5
+echo "configure:8181: 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 8120 "configure"
+#line 8186 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:8127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8193: \"$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
@@ -8144,12 +8210,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8148: checking for alloca" >&5
+echo "configure:8214: 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 8153 "configure"
+#line 8219 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -8177,7 +8243,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:8181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8247: \"$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
@@ -8209,12 +8275,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8213: checking whether alloca needs Cray hooks" >&5
+echo "configure:8279: 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 8218 "configure"
+#line 8284 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -8239,12 +8305,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:8243: checking for $ac_func" >&5
+echo "configure:8309: 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 8248 "configure"
+#line 8314 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8267,7 +8333,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8337: \"$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
@@ -8294,7 +8360,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8298: checking stack direction for C alloca" >&5
+echo "configure:8364: 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
@@ -8302,7 +8368,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 8306 "configure"
+#line 8372 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -8321,7 +8387,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:8325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8391: \"$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
@@ -8346,17 +8412,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8350: checking for $ac_hdr" >&5
+echo "configure:8416: 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 8355 "configure"
+#line 8421 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8426: \"$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*
@@ -8385,12 +8451,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8389: checking for $ac_func" >&5
+echo "configure:8455: 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 8394 "configure"
+#line 8460 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8413,7 +8479,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8483: \"$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
@@ -8438,7 +8504,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:8442: checking for working mmap" >&5
+echo "configure:8508: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8446,7 +8512,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 8450 "configure"
+#line 8516 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -8586,7 +8652,7 @@ main()
}
EOF
-if { (eval echo configure:8590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -8614,7 +8680,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:8618: checking for $ac_word" >&5
+echo "configure:8684: 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
@@ -8937,6 +9003,7 @@ s%@THREADDEPS@%$THREADDEPS%g
s%@THREADOBJS@%$THREADOBJS%g
s%@THREADSPEC@%$THREADSPEC%g
s%@THREADLDFLAGS@%$THREADLDFLAGS%g
+s%@THREADCXXFLAGS@%$THREADCXXFLAGS%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
diff --git a/libjava/configure.host b/libjava/configure.host
index 1e2183184e4..91b529b2cd0 100644
--- a/libjava/configure.host
+++ b/libjava/configure.host
@@ -222,6 +222,13 @@ EOF
*-*-freebsd*)
slow_pthread_self=
;;
+ *-mingw*)
+ # FIXME: win32_exception_handler( ) in win32.cc does not do the
+ # right stuff yet w.r.t. SEH. Live with the following for now.
+ can_unwind_signal=no
+ CHECKREFSPEC=-fcheck-references
+ DIVIDESPEC=-fuse-divide-subroutine
+ ;;
*-cygwin*)
# The cygwin linker doesn't do 8-byte alignment by default, so
# disable hash synchronization for now.
diff --git a/libjava/configure.in b/libjava/configure.in
index af22dc6a45f..25bd5223045 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -23,8 +23,8 @@ LIBGCJ_CONFIGURE(.)
AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
-# Only use libltdl for native builds.
-if test -z "${with_cross_host}"; then
+# Only use libltdl for non-newlib builds.
+if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
AC_LIBLTDL_CONVENIENCE
AC_LIBTOOL_DLOPEN
DIRLTDL=libltdl
@@ -375,13 +375,12 @@ case "$GC" in
boehm)
AC_MSG_RESULT(boehm)
GCLIBS=../boehm-gc/libgcjgc_convenience.la
- GCINCS='-I$(top_srcdir)/../boehm-gc/include'
JC1GCSPEC='-fuse-boehm-gc'
GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-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`"
+ GCINCS="`cat ../boehm-gc/boehm-cflags`"
GCOBJS=boehm.lo
GCHDR=boehm-gc.h
dnl The POSIX thread support needs to know this.
@@ -432,6 +431,7 @@ case "$THREADS" in
;;
esac
+THREADCXXFLAGS=
THREADLDFLAGS=
THREADLIBS=
THREADINCS=
@@ -466,6 +466,12 @@ changequote([,])
THREADLDFLAGS=-pthread
THREADSPEC=-lc_r
;;
+ alpha*-dec-osf*)
+ THREADCXXFLAGS=-pthread
+ # boehm-gc needs some functions from librt, so link that too.
+ THREADLIBS='-lpthread -lrt'
+ THREADSPEC='-lpthread -lrt'
+ ;;
*)
THREADLIBS=-lpthread
THREADSPEC=-lpthread
@@ -503,6 +509,7 @@ AC_SUBST(THREADDEPS)
AC_SUBST(THREADOBJS)
AC_SUBST(THREADSPEC)
AC_SUBST(THREADLDFLAGS)
+AC_SUBST(THREADCXXFLAGS)
if test -d sysdep; then true; else mkdir sysdep; fi
AC_LINK_FILES(sysdep/$sysdeps_dir/locks.h, sysdep/locks.h)
@@ -530,7 +537,7 @@ 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
+tool_include_dir='$(libdir)/gcc/$(target_alias)/'${gcc_version}/include
changequote([,])dnl
AC_SUBST(tool_include_dir)
AC_SUBST(gcc_version)
@@ -555,16 +562,6 @@ if test "x${with_newlib}" = "xyes"; then
dnl Assume we do not have getuid and friends.
AC_DEFINE(NO_GETUID)
-
- # If Canadian cross, then don't pick up tools from the build
- # directory.
- if test x"$build" != x"$with_cross_host" \
- && test x"$build" != x"$target"; then
- CANADIAN=yes
- GCC_UNWIND_INCLUDE=
- GCJ="${target_alias}-gcj"
- fi
- NATIVE=no
PLATFORMNET=NoNet
else
AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep opendir)
@@ -809,15 +806,69 @@ changequote(<<,>>)
builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
changequote([,])
fi
- if test -x "${builddotdot}/../../gcc/gcj"; then
- dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
- GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/"
- else
+fi
+
+# Which gcj do we use?
+which_gcj=default
+built_gcc_dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
+if test -n "${with_cross_host}"; then
+ # We are being configured with a cross compiler. We can't
+ # use ac_exeext, because that is for the target platform.
+ NATIVE=no
+ cross_host_exeext=
+ case "${with_cross_host}" in
+ *mingw* | *cygwin*)
+ cross_host_exeext=.exe
+ ;;
+ esac
+ if test -x "${built_gcc_dir}/gcj${cross_host_exeext}"; then
+ if test x"$build_alias" = x"$with_cross_host"; then
+ # Ordinary cross (host!=target and host=build)
+ which_gcj=built
+ else
+ # Canadian cross (host!=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=cross
+ fi
+else
+ # We are being configured with a native or crossed-native compiler
+ if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
+ if test x"$build" = x"$host"; then
+ # True native build (host=target and host=build)
+ which_gcj=built
+ else
+ # Crossed-native build (host=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=path
+ fi
+fi
+case "${which_gcj}" in
+ built)
+ GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
+ ;;
+ cross)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
+ CANADIAN=yes
+ NULL_TARGET=no
+ if test "x${with_newlib}" = "xyes"; then
+ # FIXME (comment): Why is this needed?
+ GCC_UNWIND_INCLUDE=
+ GCJ="${target_alias}-gcj"
+ else
+ GCJ="${target_alias}-gcj -B`${PWDCMD-pwd}`/"
+ fi
+ ;;
+ path)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
CANADIAN=yes
NULL_TARGET=yes
GCJ="gcj -B`${PWDCMD-pwd}`/"
- fi
-fi
+ ;;
+esac
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc
index 001fa0131f0..4cd4f4f1936 100644
--- a/libjava/defineclass.cc
+++ b/libjava/defineclass.cc
@@ -75,7 +75,7 @@ struct _Jv_ClassReader {
// allways on. You always want this as far as I can see, but it also
// controls weither identifiers and type descriptors/signatures are
// verified as legal. This could be somewhat more expensive since it
- // will call Characher.isJavaIdentifier{Start,Part} for each character
+ // will call Character.isJavaIdentifier{Start,Part} for each character
// in any identifier (field name or method name) it comes by. Thus,
// it might be useful to turn off this verification for classes that
// come from a trusted source. However, for GCJ, trusted classes are
@@ -403,15 +403,15 @@ void _Jv_ClassReader::read_fields ()
int name_index = read2u ();
int descriptor_index = read2u ();
int attributes_count = read2u ();
-
+
check_tag (name_index, JV_CONSTANT_Utf8);
prepare_pool_entry (name_index, JV_CONSTANT_Utf8);
check_tag (descriptor_index, JV_CONSTANT_Utf8);
prepare_pool_entry (descriptor_index, JV_CONSTANT_Utf8);
-
+
handleField (i, access_flags, name_index, descriptor_index);
-
+
for (int j = 0; j < attributes_count; j++)
{
read_one_field_attribute (i);
@@ -1071,14 +1071,25 @@ void _Jv_ClassReader::handleField (int field_no,
field->nameIndex = name;
#endif
- if (verify)
- verify_identifier (field_name);
-
- // ignore flags we don't know about.
+ // Ignore flags we don't know about.
field->flags = flags & Modifier::ALL_FLAGS;
+ _Jv_Utf8Const* sig = pool_data[desc].utf8;
+
if (verify)
{
+ verify_identifier (field_name);
+
+ for (int i = 0; i < field_no; ++i)
+ {
+ if (_Jv_equalUtf8Consts (field_name, def->fields[i].name)
+ && _Jv_equalUtf8Consts (sig,
+ // We know the other fields are
+ // unresolved.
+ (_Jv_Utf8Const *) def->fields[i].type))
+ throw_class_format_error ("duplicate field name");
+ }
+
if (field->flags & (Modifier::SYNCHRONIZED
| Modifier::NATIVE
| Modifier::INTERFACE
@@ -1091,8 +1102,6 @@ void _Jv_ClassReader::handleField (int field_no,
throw_class_format_error ("erroneous field access flags");
}
- _Jv_Utf8Const* sig = pool_data[desc].utf8;
-
if (verify)
_Jv_VerifyFieldSignature (sig);
@@ -1233,6 +1242,14 @@ void _Jv_ClassReader::handleMethod
_Jv_VerifyMethodSignature (method->signature);
+ for (int i = 0; i < mth_index; ++i)
+ {
+ if (_Jv_equalUtf8Consts (method->name, def->methods[i].name)
+ && _Jv_equalUtf8Consts (method->signature,
+ def->methods[i].signature))
+ throw_class_format_error ("duplicate method");
+ }
+
if (method->accflags & (Modifier::VOLATILE
| Modifier::TRANSIENT
| Modifier::INTERFACE))
diff --git a/libjava/gij.cc b/libjava/gij.cc
index 293f3c30fd8..3b0683de03e 100644
--- a/libjava/gij.cc
+++ b/libjava/gij.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -31,7 +31,8 @@ help ()
printf (" --cp LIST set class path\n");
printf (" --classpath LIST set class path\n");
printf (" -DVAR=VAL define property VAR with value VAL\n");
- printf (" --help print this help, then exit\n");
+ printf (" -?, --help print this help, then exit\n");
+ printf (" -X print help on supported -X options, then exit\n");
printf (" --ms=NUMBER set initial heap size\n");
printf (" --mx=NUMBER set maximum heap size\n");
printf (" --showversion print version number, then keep going\n");
@@ -90,7 +91,7 @@ main (int argc, const char **argv)
if (arg[1] == '-')
++arg;
- if (! strcmp (arg, "-help"))
+ if (! strcmp (arg, "-help") || ! strcmp (arg, "-?"))
help ();
else if (! strcmp (arg, "-version"))
{
@@ -132,6 +133,15 @@ main (int argc, const char **argv)
// correct behavior.
_Jv_Jar_Class_Path = argv[++i];
}
+ else if (arg[1] == 'X')
+ {
+ if (arg[2] == '\0')
+ {
+ printf ("gij: currently no -X options are recognized\n");
+ exit (0);
+ }
+ /* Ignore other -X options. */
+ }
else
{
fprintf (stderr, "gij: unrecognized option -- `%s'\n", argv[i]);
diff --git a/libjava/gnu/awt/xlib/XGraphicsConfiguration.java b/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
index d867beed225..bdbf3e18a74 100644
--- a/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
+++ b/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
@@ -51,7 +51,7 @@ public class XGraphicsConfiguration extends GraphicsConfiguration
* XXX: lruOrder rolls over after a few billion operations, so it might
* on very rare occasions misinterpret which is the oldest entry
*/
- class FontMetricsCache
+ static class FontMetricsCache
{
private java.util.Hashtable displays = new java.util.Hashtable ();
diff --git a/libjava/gnu/gcj/convert/natIconv.cc b/libjava/gnu/gcj/convert/natIconv.cc
index 7b7ec64488e..d98e449677a 100644
--- a/libjava/gnu/gcj/convert/natIconv.cc
+++ b/libjava/gnu/gcj/convert/natIconv.cc
@@ -1,6 +1,6 @@
-// Input_iconv.java -- Java side of iconv() reader.
+// natIconv.cc -- Java side of iconv() reader.
-/* Copyright (C) 2000, 2001 Free Software Foundation
+/* Copyright (C) 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -201,25 +201,39 @@ gnu::gcj::convert::Output_iconv::write (jcharArray inbuffer,
inbuf = (char *) temp_buffer;
}
- // If the conversion fails on the very first character, then we
- // assume that the character can't be represented in the output
- // encoding. There's nothing useful we can do here, so we simply
- // omit that character. Note that we can't check `errno' because
- // glibc 2.1.3 doesn't set it correctly. We could check it if we
- // really needed to, but we'd have to disable support for 2.1.3.
size_t loop_old_in = old_in;
while (1)
{
size_t r = iconv_adapter (iconv, (iconv_t) handle,
&inbuf, &inavail,
&outbuf, &outavail);
- if (r == (size_t) -1 && inavail == loop_old_in)
+ if (r == (size_t) -1)
{
- inavail -= 2;
- if (inavail == 0)
- break;
- loop_old_in -= 2;
- inbuf += 2;
+ if (errno == EINVAL)
+ {
+ // Incomplete byte sequence at the end of the input
+ // buffer. This shouldn't be able to happen here.
+ break;
+ }
+ else if (errno == E2BIG)
+ {
+ // Output buffer is too small.
+ break;
+ }
+ else if (errno == EILSEQ || inavail == loop_old_in)
+ {
+ // Untranslatable sequence. Since glibc 2.1.3 doesn't
+ // properly set errno, we also assume that this is what
+ // is happening if no conversions took place. (This can
+ // be a bogus assumption if in fact the output buffer is
+ // too small.) We skip the first character and try
+ // again.
+ inavail -= 2;
+ if (inavail == 0)
+ break;
+ loop_old_in -= 2;
+ inbuf += 2;
+ }
}
else
break;
diff --git a/libjava/gnu/java/awt/EmbeddedWindow.java b/libjava/gnu/java/awt/EmbeddedWindow.java
index 607cc38518c..fc64e215162 100644
--- a/libjava/gnu/java/awt/EmbeddedWindow.java
+++ b/libjava/gnu/java/awt/EmbeddedWindow.java
@@ -38,25 +38,59 @@ exception statement from your version. */
package gnu.java.awt;
-import java.awt.Window;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
+import java.awt.Frame;
+import java.awt.Toolkit;
/**
- * This class represents an AWT window embedded into another graphical
- * toolkit or anther application.
+ * Represents an AWT window that can be embedded into another
+ * application.
*
* @author Michael Koch <konqueror@gmx.de>
*/
-public class EmbeddedWindow extends Window
+public class EmbeddedWindow extends Frame
{
+ private int window_id;
+
/**
- * Creates an window embedded into another application of graphical toolkit.
+ * Creates an window to be embedded into another application.
*
* @param window_id The native handle to the screen area where the AWT window
* should be embedded.
- * @param width The width of the screen area.
- * @param height The height of the screen area.
*/
+ public EmbeddedWindow (int window_id)
+ {
+ super();
+ this.window_id = window_id;
+ }
+
+ /**
+ * Creates the native peer for this embedded window.
+ */
+ public void addNotify()
+ {
+ Toolkit tk = getToolkit();
+
+ if (! (tk instanceof EmbeddedWindowSupport))
+ throw new UnsupportedOperationException
+ ("Embedded windows are not supported by the current peers: " + tk.getClass());
+
+ setWindowPeer (((EmbeddedWindowSupport) tk).createEmbeddedWindow (this));
+ super.addNotify();
+ }
+
// This method is only made native to circumvent the package-privateness of
- // an internal java.awt.Window constructor.
- public static native Window create (int window_id, int width, int height);
+ // an AWT internal java.awt.Component.peer member variable.
+ native void setWindowPeer (EmbeddedWindowPeer peer);
+
+ /**
+ * Gets the native handle of the screen area where the window will
+ * be embedded.
+ *
+ * @return The native handle that was passed to the constructor.
+ */
+ public int getHandle()
+ {
+ return window_id;
+ }
}
diff --git a/libjava/gnu/java/awt/EmbeddedWindowSupport.java b/libjava/gnu/java/awt/EmbeddedWindowSupport.java
index b29db278197..986095305f7 100644
--- a/libjava/gnu/java/awt/EmbeddedWindowSupport.java
+++ b/libjava/gnu/java/awt/EmbeddedWindowSupport.java
@@ -38,14 +38,15 @@ exception statement from your version. */
package gnu.java.awt;
-import java.awt.peer.WindowPeer;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
/**
- * This interface defines a method for creating embedded windows.
+ * Declares a method for creating native embedded window peers.
*
- * All classes inherited from java.awt.Toolkit that implement this interface
- * are assumed to support embedded windows. To embed the real embedded window
- * you need to use gnu.java.awt.EmbeddedWindow.
+ * All classes inherited from java.awt.Toolkit that implement this
+ * interface are assumed to support the creation of embedded window
+ * peers. To create an embedded window, use
+ * gnu.java.awt.EmbeddedWindow.
*
* @see gnu.java.awt.EmbeddedWindow
* @see java.awt.Toolkit
@@ -55,13 +56,10 @@ import java.awt.peer.WindowPeer;
public interface EmbeddedWindowSupport
{
/**
- * This method creates an embedded window in an application.
+ * Creates an embedded window peer, and associates it with an
+ * EmbeddedWindow object.
*
- * @param window_id The native handle of a screen area to display an
- * AWT window in it.
- * @param width The width of the screen area.
- * @param height The height of the screen area.
+ * @param w The embedded window with which to associate a peer.
*/
- public WindowPeer createEmbeddedWindow (int window_id,
- int width, int height);
+ public EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w);
}
diff --git a/libjava/gnu/java/awt/natEmbeddedWindow.cc b/libjava/gnu/java/awt/natEmbeddedWindow.cc
index 0811d415482..14aa30f9295 100644
--- a/libjava/gnu/java/awt/natEmbeddedWindow.cc
+++ b/libjava/gnu/java/awt/natEmbeddedWindow.cc
@@ -7,10 +7,11 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <gnu/java/awt/EmbeddedWindow.h>
-#include <java/awt/Window.h>
+#include <gnu/java/awt/peer/EmbeddedWindowPeer.h>
-::java::awt::Window*
-gnu::java::awt::EmbeddedWindow::create (jint window_id, jint width, jint height)
+void
+gnu::java::awt::EmbeddedWindow::setWindowPeer (gnu::java::awt::peer::EmbeddedWindowPeer* w)
{
- return new ::java::awt::Window (window_id, width, height);
+ if (!peer)
+ (::java::lang::Object*) peer = (::java::lang::Object*) w;
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
index 0aa42f5307a..830b9f08f8b 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
@@ -95,6 +95,6 @@ public class GtkButtonPeer extends GtkComponentPeer
public void setFont (Font f)
{
- gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ gtkSetFont(f.getName(), f.getSize());
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index 43ada95cf00..ac092c8f4d1 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -350,13 +350,13 @@ public class GtkComponentPeer extends GtkGenericPeer
new Rectangle (x, y, width, height)));
}
- protected void postKeyEvent (int id, long when, int mods,
- int keyCode, char keyChar)
+ protected void postKeyEvent (int id, long when, int mods,
+ int keyCode, char keyChar, int keyLocation)
{
- q.postEvent (new KeyEvent (awtComponent, id, when, mods,
- keyCode, keyChar));
+ q.postEvent (new KeyEvent (awtComponent, id, when, mods,
+ keyCode, keyChar, keyLocation));
}
-
+
protected void postFocusEvent (int id, boolean temporary)
{
q.postEvent (new FocusEvent (awtComponent, id, temporary));
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
index 7fdbac0aa99..b8973fdca95 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
@@ -107,6 +107,6 @@ public class GtkTextAreaPeer extends GtkTextComponentPeer
public void setFont (Font f)
{
- gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ gtkSetFont(f.getName(), f.getSize());
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
index fd99d1d1ecd..b3199d87c9a 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
@@ -55,7 +55,9 @@ public class GtkTextComponentPeer extends GtkComponentPeer
setText (tc.getText ());
}
-
+
+ public native void connectHooks ();
+
public native int getCaretPosition ();
public native void setCaretPosition (int pos);
public native int getSelectionStart ();
@@ -84,16 +86,4 @@ public class GtkTextComponentPeer extends GtkComponentPeer
{
q.postEvent (new TextEvent (awtComponent, TextEvent.TEXT_VALUE_CHANGED));
}
-
- public void handleEvent (AWTEvent e)
- {
- if (e.getID () == KeyEvent.KEY_TYPED
- && ((TextComponent)e.getSource()).isEditable())
- {
- KeyEvent ke = (KeyEvent)e;
-
- if (!ke.isConsumed())
- postTextEvent ();
- }
- }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
index 51f17b861f6..20f61aa81e0 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
@@ -52,7 +52,6 @@ public class GtkTextFieldPeer extends GtkTextComponentPeer
// native void create (ComponentPeer parent, String text);
native void create ();
- native void createHooks ();
native void gtkEntryGetSize (int cols, int dims[]);
@@ -105,7 +104,7 @@ public class GtkTextFieldPeer extends GtkTextComponentPeer
public void setFont (Font f)
{
- gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ gtkSetFont(f.getName(), f.getSize());
}
public void handleEvent (AWTEvent e)
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
index c998d1909e4..9f669ac5281 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
@@ -52,6 +52,9 @@ import java.util.Hashtable;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Properties;
+import gnu.java.awt.EmbeddedWindow;
+import gnu.java.awt.EmbeddedWindowSupport;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
import gnu.classpath.Configuration;
/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer().
@@ -61,7 +64,8 @@ import gnu.classpath.Configuration;
this class. If getPeer() ever goes away, we can implement a hash table
that will keep up with every window's peer, but for now this is faster. */
-public class GtkToolkit extends java.awt.Toolkit
+public class GtkToolkit extends Toolkit
+ implements EmbeddedWindowSupport
{
GtkMainThread main;
Hashtable containers = new Hashtable();
@@ -299,6 +303,11 @@ public class GtkToolkit extends java.awt.Toolkit
return new GtkWindowPeer (w);
}
+ public EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w)
+ {
+ return new GtkEmbeddedWindowPeer (w);
+ }
+
protected FontPeer getFontPeer (String name, int style)
{
try {
diff --git a/libjava/gnu/java/lang/ArrayHelper.java b/libjava/gnu/java/lang/ArrayHelper.java
index 0216caba167..aac7a545723 100644
--- a/libjava/gnu/java/lang/ArrayHelper.java
+++ b/libjava/gnu/java/lang/ArrayHelper.java
@@ -76,16 +76,22 @@ public class ArrayHelper
return -1;
}
- public static boolean equalsArray(Object[] a, Object[] b) {
- if(a.length == b.length) {
- for(int i=0;i<a.length;i++) {
- if(!a[i].equals(b[i])) {
- return false;
- }
- }
- return true;
- } else {
- return false;
- }
- }
+ /**
+ * Checks if two arrays are equal.
+ *
+ * @param array1 the first array
+ * @param array2 the second array
+ * @return true if both arrays are equal.
+ */
+ public static boolean equalsArray(Object[] array1, Object[] array2)
+ {
+ if (array1.length != array2.length)
+ return false;
+
+ for (int index = 0; index < array1.length; index++)
+ if (!array1 [index].equals (array2 [index]))
+ return false;
+
+ return true;
+ }
}
diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h
index 869a928332c..280b72e5586 100644
--- a/libjava/include/i386-signal.h
+++ b/libjava/include/i386-signal.h
@@ -108,26 +108,44 @@ struct old_i386_kernel_sigaction {
void (*sa_restorer) (void);
};
+#define RESTORE(name, syscall) RESTORE2 (name, syscall)
+# define RESTORE2(name, syscall) \
+asm \
+ ( \
+ ".text\n" \
+ ".byte 0 # Yes, this really is necessary\n" \
+ " .align 8\n" \
+ "__" #name ":\n" \
+ " popl %eax\n" \
+ " movl $" #syscall ", %eax\n" \
+ " int $0x80" \
+ );
+
+RESTORE (restore, __NR_sigreturn)
+static void restore (void) asm ("__restore");
+
#define INIT_SEGV \
do \
{ \
struct old_i386_kernel_sigaction kact; \
kact.k_sa_handler = catch_segv; \
kact.k_sa_mask = 0; \
- kact.k_sa_flags = 0; \
+ kact.k_sa_flags = 0x4000000; \
+ kact.sa_restorer = restore; \
syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \
} \
while (0)
-#define INIT_FPE \
-do \
- { \
- 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); \
- } \
+#define INIT_FPE \
+do \
+ { \
+ struct old_i386_kernel_sigaction kact; \
+ kact.k_sa_handler = catch_fpe; \
+ kact.k_sa_mask = 0; \
+ kact.k_sa_flags = 0x4000000; \
+ kact.sa_restorer = restore; \
+ syscall (SYS_sigaction, SIGFPE, &kact, NULL); \
+ } \
while (0)
/* You might wonder why we use syscall(SYS_sigaction) in INIT_FPE
@@ -144,10 +162,7 @@ while (0)
* 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. */
+ * through them anyway. */
#endif /* JAVA_SIGNAL_H */
diff --git a/libjava/java/awt/Color.java b/libjava/java/awt/Color.java
index 761b738e448..e6eb03e8f0a 100644
--- a/libjava/java/awt/Color.java
+++ b/libjava/java/awt/Color.java
@@ -496,7 +496,7 @@ public class Color implements Paint, Serializable
public int getAlpha()
{
// Do not inline getRGB() to value, because of SystemColor.
- return (getRGB() & ALPHA_MASK) >> 24;
+ return (getRGB() & ALPHA_MASK) >>> 24;
}
/**
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java
index cc723b480f2..9a38919f1c5 100644
--- a/libjava/java/awt/Component.java
+++ b/libjava/java/awt/Component.java
@@ -1452,12 +1452,7 @@ public abstract class Component
*/
public Dimension getPreferredSize()
{
- if (prefSize == null)
- if (peer == null)
- return new Dimension(width, height);
- else
- prefSize = peer.getPreferredSize();
- return prefSize;
+ return preferredSize();
}
/**
@@ -1468,7 +1463,12 @@ public abstract class Component
*/
public Dimension preferredSize()
{
- return getPreferredSize();
+ if (prefSize == null)
+ if (peer == null)
+ return new Dimension(width, height);
+ else
+ prefSize = peer.getPreferredSize();
+ return prefSize;
}
/**
@@ -1480,10 +1480,7 @@ public abstract class Component
*/
public Dimension getMinimumSize()
{
- if (minSize == null)
- minSize = (peer != null ? peer.getMinimumSize()
- : new Dimension(width, height));
- return minSize;
+ return minimumSize();
}
/**
@@ -1494,7 +1491,10 @@ public abstract class Component
*/
public Dimension minimumSize()
{
- return getMinimumSize();
+ if (minSize == null)
+ minSize = (peer != null ? peer.getMinimumSize()
+ : new Dimension(width, height));
+ return minSize;
}
/**
@@ -1941,7 +1941,10 @@ public abstract class Component
public boolean prepareImage(Image image, int width, int height,
ImageObserver observer)
{
- return peer.prepareImage(image, width, height, observer);
+ if (peer != null)
+ return peer.prepareImage(image, width, height, observer);
+ else
+ return getToolkit().prepareImage(image, width, height, observer);
}
/**
@@ -1957,8 +1960,7 @@ public abstract class Component
*/
public int checkImage(Image image, ImageObserver observer)
{
- return checkImage(image, image.getWidth(observer),
- image.getHeight(observer), observer);
+ return checkImage(image, -1, -1, observer);
}
/**
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java
index 72812cbc2aa..e96b13d4bb5 100644
--- a/libjava/java/awt/Container.java
+++ b/libjava/java/awt/Container.java
@@ -473,7 +473,7 @@ public class Container extends Component
{
synchronized (getTreeLock ())
{
- if (! isValid())
+ if (! isValid() && peer != null)
{
validateTree();
}
@@ -535,10 +535,7 @@ public class Container extends Component
*/
public Dimension getPreferredSize()
{
- if (layoutMgr != null)
- return layoutMgr.preferredLayoutSize(this);
- else
- return super.getPreferredSize();
+ return preferredSize();
}
/**
@@ -550,7 +547,10 @@ public class Container extends Component
*/
public Dimension preferredSize()
{
- return getPreferredSize();
+ if (layoutMgr != null)
+ return layoutMgr.preferredLayoutSize(this);
+ else
+ return super.preferredSize();
}
/**
@@ -560,10 +560,7 @@ public class Container extends Component
*/
public Dimension getMinimumSize()
{
- if (layoutMgr != null)
- return layoutMgr.minimumLayoutSize(this);
- else
- return super.getMinimumSize();
+ return minimumSize();
}
/**
@@ -575,7 +572,10 @@ public class Container extends Component
*/
public Dimension minimumSize()
{
- return getMinimumSize();
+ if (layoutMgr != null)
+ return layoutMgr.minimumLayoutSize(this);
+ else
+ return super.minimumSize();
}
/**
@@ -658,6 +658,7 @@ public class Container extends Component
*/
public void update(Graphics g)
{
+ g.clearRect(0, 0, width, height);
super.update(g);
}
diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java
index d6204cefd9a..45dc9713b6e 100644
--- a/libjava/java/awt/EventQueue.java
+++ b/libjava/java/awt/EventQueue.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -37,6 +37,8 @@ exception statement from your version. */
package java.awt;
+import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
import java.awt.event.InvocationEvent;
import java.lang.reflect.InvocationTargetException;
import java.util.EmptyStackException;
@@ -44,7 +46,7 @@ import java.util.EmptyStackException;
/* Written using on-line Java 2 Platform Standard Edition v1.3 API
* Specification, as well as "The Java Class Libraries", 2nd edition
* (Addison-Wesley, 1998).
- * Status: Believed complete, but untested. Check FIXME's.
+ * Status: Believed complete, but untested.
*/
/**
@@ -65,6 +67,8 @@ public class EventQueue
private EventQueue next;
private EventQueue prev;
+ private AWTEvent currentEvent;
+ private long lastWhen = System.currentTimeMillis();
private EventDispatchThread dispatchThread = new EventDispatchThread(this);
@@ -162,7 +166,6 @@ public class EventQueue
next.postEvent(evt);
return;
}
- // FIXME: Security checks?
/* Check for any events already on the queue with the same source
and ID. */
@@ -249,6 +252,10 @@ public class EventQueue
}
/**
+ * This arranges for runnable to have its run method called in the
+ * dispatch thread of the EventQueue. This will happen after all
+ * pending events are processed.
+ *
* @since 1.2
*/
public static void invokeLater(Runnable runnable)
@@ -261,6 +268,10 @@ public class EventQueue
eq.postEvent(ie);
}
+ /**
+ * Return true if the current thread is the AWT event dispatch
+ * thread.
+ */
public static boolean isDispatchThread()
{
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
@@ -268,6 +279,21 @@ public class EventQueue
}
/**
+ * Return the event currently being dispatched by the event
+ * dispatch thread. If the current thread is not the event
+ * dispatch thread, this method returns null.
+ *
+ * @since 1.4
+ */
+ public static AWTEvent getCurrentEvent()
+ {
+ EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+ if (Thread.currentThread() != eq.dispatchThread)
+ return null;
+ return eq.currentEvent;
+ }
+
+ /**
* Allows a custom EventQueue implementation to replace this one.
* All pending events are transferred to the new queue. Calls to postEvent,
* getNextEvent, and peekEvent are forwarded to the pushed queue until it
@@ -332,6 +358,15 @@ public class EventQueue
*/
protected void dispatchEvent(AWTEvent evt)
{
+ currentEvent = evt;
+
+ if (evt instanceof InputEvent)
+ lastWhen = ((InputEvent) evt).getWhen();
+ else if (evt instanceof ActionEvent)
+ lastWhen = ((ActionEvent) evt).getWhen();
+ else if (evt instanceof InvocationEvent)
+ lastWhen = ((InvocationEvent) evt).getWhen();
+
if (evt instanceof ActiveEvent)
{
ActiveEvent active_evt = (ActiveEvent) evt;
@@ -373,7 +408,9 @@ public class EventQueue
*/
public static long getMostRecentEventTime()
{
- // XXX For now, this ONLY does the current time.
- return System.currentTimeMillis();
+ EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+ if (Thread.currentThread() != eq.dispatchThread)
+ return System.currentTimeMillis();
+ return eq.lastWhen;
}
}
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
index b887d8ea5ed..d1ff566e559 100644
--- a/libjava/java/awt/Font.java
+++ b/libjava/java/awt/Font.java
@@ -39,10 +39,20 @@ exception statement from your version. */
package java.awt;
import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
import java.awt.font.LineMetrics;
+import java.awt.font.TextAttribute;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
import java.awt.peer.FontPeer;
+import java.io.InputStream;
+import java.io.IOException;
import java.io.Serializable;
+import java.util.Locale;
+import java.util.Map;
import java.util.StringTokenizer;
+import java.text.CharacterIterator;
+import java.text.AttributedCharacterIterator;
/**
* This class represents a windowing system font.
@@ -72,9 +82,20 @@ public static final int BOLD = 1;
*/
public static final int ITALIC = 2;
+/**
+ * Constant indicating the baseline mode characteristic of Roman.
+ */
public static final int ROMAN_BASELINE = 0;
+
+/**
+ * Constant indicating the baseline mode characteristic of Chinese.
+ */
public static final int CENTER_BASELINE = 1;
-public static final int HANGING_BASELINE = 2;
+
+/**
+ * Constant indicating the baseline mode characteristic of Devanigri.
+ */
+public static final int HANGING_BASELINE = 2;
/**
@@ -294,6 +315,12 @@ Font(String name, int style, int size)
this.pointSize = size;
}
+public
+Font(Map attributes)
+{
+ throw new UnsupportedOperationException();
+}
+
/*************************************************************************/
/*
@@ -301,9 +328,15 @@ Font(String name, int style, int size)
*/
/**
- * Returns the name of the font.
+ * Returns the logical name of the font. A logical name describes a very
+ * general typographic style (such as Sans Serif). It is less specific
+ * than both a font family name (such as Helvetica) and a font face name
+ * (such as Helvetica Bold).
*
- * @return The name of the font.
+ * @return The logical name of the font.
+ *
+ * @see getFamily()
+ * @see getFontName()
*/
public String
getName()
@@ -385,9 +418,18 @@ isItalic()
/*************************************************************************/
/**
- * Returns the system specific font family name.
+ * Returns the family name of this font. A family name describes a
+ * typographic style (such as Helvetica or Palatino). It is more specific
+ * than a logical font name (such as Sans Serif) but less specific than a
+ * font face name (such as Helvetica Bold).
+ *
+ * @return A string containing the font family name.
+ *
+ * @since 1.2
*
- * @return The system specific font family name.
+ * @see getName()
+ * @see getFontName()
+ * @see GraphicsEnvironment.getAvailableFontFamilyNames()
*/
public String
getFamily()
@@ -396,12 +438,744 @@ getFamily()
return(name);
}
+/**
+ * Returns integer code representing the sum of style flags of this font, a
+ * combination of either {@link PLAIN}, {@link BOLD}, or {@link ITALIC}.
+ *
+ * @return code representing the style of this font.
+ *
+ * @see isPlain()
+ * @see isBold()
+ * @see isItalic()
+ */
public int
getStyle()
{
return style;
}
+/**
+ * Checks if specified character maps to a glyph in this font.
+ *
+ * @param c The character to check.
+ *
+ * @return Whether the character has a corresponding glyph in this font.
+ *
+ * @since 1.2
+ */
+public boolean
+canDisplay(char c)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Checks how much of a given string can be mapped to glyphs in
+ * this font.
+ *
+ * @param s The string to check.
+ *
+ * @return The index of the first character in <code>s</code> which cannot
+ * be converted to a glyph by this font, or <code>-1</code> if all
+ * characters can be mapped to glyphs.
+ *
+ * @since 1.2
+ */
+public int
+canDisplayUpTo(String s)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Checks how much of a given sequence of text can be mapped to glyphs in
+ * this font.
+ *
+ * @param text Array containing the text to check.
+ * @param start Position of first character to check in <code>text</code>.
+ * @param limit Position of last character to check in <code>text</code>.
+ *
+ * @return The index of the first character in the indicated range which
+ * cannot be converted to a glyph by this font, or <code>-1</code> if all
+ * characters can be mapped to glyphs.
+ *
+ * @since 1.2
+ *
+ * @throws IndexOutOfBoundsException if the range [start, limit] is
+ * invalid in <code>text</code>.
+ */
+public int
+canDisplayUpTo(char[] text, int start, int limit)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Checks how much of a given sequence of text can be mapped to glyphs in
+ * this font.
+ *
+ * @param i Iterator over the text to check.
+ * @param start Position of first character to check in <code>i</code>.
+ * @param limit Position of last character to check in <code>i</code>.
+ *
+ * @return The index of the first character in the indicated range which
+ * cannot be converted to a glyph by this font, or <code>-1</code> if all
+ * characters can be mapped to glyphs.
+ *
+ * @since 1.2
+ *
+ * @throws IndexOutOfBoundsException if the range [start, limit] is
+ * invalid in <code>i</code>.
+ */
+public int
+canDisplayUpTo(CharacterIterator i, int start, int limit)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Creates a new font with point size 1 and {@link PLAIN} style,
+ * reading font data from the provided input stream. The resulting font
+ * can have further fonts derived from it using its
+ * <code>deriveFont</code> method.
+ *
+ * @param fontFormat Integer code indicating the format the font data is
+ * in.Currently this can only be {@link TRUETYPE_FONT}.
+ * @param is {@link InputStream} from which font data will be read. This
+ * stream is not closed after font data is extracted.
+ *
+ * @return A new {@link Font} of the format indicated.
+ *
+ * @throws IllegalArgumentException if <code>fontType</code> is not
+ * recognized.
+ * @throws FontFormatException if data in InputStream is not of format
+ * indicated.
+ * @throws IOException if insufficient data is present on InputStream.
+ *
+ * @since 1.3
+ */
+public static Font
+createFont(int fontFormat, InputStream is)
+ throws FontFormatException, IOException
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Maps characters to glyphs in a one-to-one relationship, returning a new
+ * {@link GlyphVector} with a mapped glyph for each input character. This
+ * sort of mapping is often sufficient for some scripts such as Roman, but
+ * is inappropriate for scripts with special shaping or contextual layout
+ * requirements such as Arabic, Indic, Hebrew or Thai.
+ *
+ * @param ctx The rendering context used for precise glyph placement.
+ * @param str The string to convert to Glyphs.
+ *
+ * @return A new {@link GlyphVector} containing glyphs mapped from str,
+ * through the font's cmap table.
+ *
+ * @see layoutGlyphVector()
+ */
+public GlyphVector
+createGlyphVector(FontRenderContext ctx, String str)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Maps characters to glyphs in a one-to-one relationship, returning a new
+ * {@link GlyphVector} with a mapped glyph for each input character. This
+ * sort of mapping is often sufficient for some scripts such as Roman, but
+ * is inappropriate for scripts with special shaping or contextual layout
+ * requirements such as Arabic, Indic, Hebrew or Thai.
+ *
+ * @param ctx The rendering context used for precise glyph placement.
+ * @param i Iterator over the text to convert to glyphs.
+ *
+ * @return A new {@link GlyphVector} containing glyphs mapped from str,
+ * through the font's cmap table.
+ *
+ * @see layoutGlyphVector()
+ */
+public GlyphVector
+createGlyphVector(FontRenderContext ctx, CharacterIterator i)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Maps characters to glyphs in a one-to-one relationship, returning a new
+ * {@link GlyphVector} with a mapped glyph for each input character. This
+ * sort of mapping is often sufficient for some scripts such as Roman, but
+ * is inappropriate for scripts with special shaping or contextual layout
+ * requirements such as Arabic, Indic, Hebrew or Thai.
+ *
+ * @param ctx The rendering context used for precise glyph placement.
+ * @param chars Array of characters to convert to glyphs.
+ *
+ * @return A new {@link GlyphVector} containing glyphs mapped from str,
+ * through the font's cmap table.
+ *
+ * @see layoutGlyphVector()
+ */
+public GlyphVector
+createGlyphVector(FontRenderContext ctx, char[] chars)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Extracts a sequence of glyphs from a font, returning a new {@link
+ * GlyphVector} with a mapped glyph for each input glyph code.
+ *
+ * @param ctx The rendering context used for precise glyph placement.
+ * @param chars Array of characters to convert to glyphs.
+ *
+ * @return A new {@link GlyphVector} containing glyphs mapped from str,
+ * through the font's cmap table.
+ *
+ * @see layoutGlyphVector()
+ *
+ * @specnote This method is documented to perform character-to-glyph
+ * conversions, in the Sun documentation, but its second parameter name is
+ * "glyphCodes" and it is not clear to me why it would exist if its
+ * purpose was to transport character codes inside integers. I assume it
+ * is mis-documented in the Sun documentation.
+ */
+public GlyphVector
+createGlyphVector(FontRenderContext ctx, int[] glyphCodes)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a new {@link Font} based on the current font, adjusted to a
+ * new size.
+ *
+ * @param size The size of the newly created font.
+ *
+ * @return A clone of the current font, with the specified size.
+ *
+ * @since 1.2
+ */
+public Font
+deriveFont(float size)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a new {@link Font} based on the current font, adjusted to a
+ * new style.
+ *
+ * @param style The style of the newly created font.
+ *
+ * @return A clone of the current font, with the specified style.
+ *
+ * @since 1.2
+ */
+public Font
+deriveFont(int style)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a new {@link Font} based on the current font, adjusted to a
+ * new style and subjected to a new affine transformation.
+ *
+ * @param style The style of the newly created font.
+ * @param a The transformation to apply.
+ *
+ * @return A clone of the current font, with the specified style and
+ * transform.
+ *
+ * @throws IllegalArgumentException If transformation is
+ * <code>null</code>.
+ *
+ * @since 1.2
+ */
+public Font
+deriveFont(int style, AffineTransform a)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a new {@link Font} based on the current font, adjusted to a
+ * new set of attributes.
+ *
+ * @param attributes Attributes of the newly created font.
+ *
+ * @return A clone of the current font, with the specified attributes.
+ *
+ * @since 1.2
+ */
+public Font
+deriveFont(Map attributes)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a map of chracter attributes which this font currently has set.
+ *
+ * @return A map of chracter attributes which this font currently has set.
+ *
+ * @see getAvailableAttributes()
+ * @see java.text.AttributedCharacterIterator.Attribute
+ * @see java.awt.font.TextAttribute
+ */
+public Map
+getAttributes()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns an array of chracter attribute keys which this font understands.
+ *
+ * @return An array of chracter attribute keys which this font understands.
+ *
+ * @see getAttributes()
+ * @see java.text.AttributedCharacterIterator.Attribute
+ * @see java.awt.font.TextAttribute
+ */
+public AttributedCharacterIterator.Attribute[]
+getAvailableAttributes()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a baseline code (one of {@link ROMAN_BASELINE}, {@link
+ * CENTER_BASELINE} or {@link HANGING_BASELINE}) indicating which baseline
+ * this font will measure baseline offsets for, when presenting glyph
+ * metrics for a given character.
+ *
+ * Baseline offsets describe the position of a glyph relative to an
+ * invisible line drawn under, through the center of, or over a line of
+ * rendered text, respectively. Different scripts use different baseline
+ * modes, so clients should not assume all baseline offsets in a glyph
+ * vector are from a common baseline.
+ *
+ * @param c The character code to select a baseline mode for.
+ *
+ * @return The baseline mode which would be used in a glyph associated
+ * with the provided character.
+ *
+ * @since 1.2
+ *
+ * @see LineMetrics.getBaselineOffsets()
+ */
+public byte
+getBaselineFor(char c)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the family name of this font. A family name describes a
+ * typographic style (such as Helvetica or Palatino). It is more specific
+ * than a logical font name (such as Sans Serif) but less specific than a
+ * font face name (such as Helvetica Bold).
+ *
+ * @param lc The locale in which to describe the name of the font family.
+ *
+ * @return A string containing the font family name, localized for the
+ * provided locale.
+ *
+ * @since 1.2
+ *
+ * @see getName()
+ * @see getFontName()
+ * @see GraphicsEnvironment.getAvailableFontFamilyNames()
+ * @see Locale
+ */
+public String
+getFamily(Locale lc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a font appropriate for the given attribute set.
+ *
+ * @param attributes The attributes required for the new font.
+ *
+ * @return A new Font with the given attributes.
+ *
+ * @since 1.2
+ *
+ * @see TextAttribure
+ */
+public static Font
+getFont(Map attributes)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the font face name of the font. A font face name describes a
+ * specific variant of a font family (such as Helvetica Bold). It is more
+ * specific than both a font family name (such as Helvetica) and a logical
+ * font name (such as Sans Serif).
+ *
+ * @return The font face name of the font.
+ *
+ * @since 1.2
+ *
+ * @see getName()
+ * @see getFamily()
+ */
+public String
+getFontName()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the font face name of the font. A font face name describes a
+ * specific variant of a font family (such as Helvetica Bold). It is more
+ * specific than both a font family name (such as Helvetica) and a logical
+ * font name (such as Sans Serif).
+ *
+ * @param lc The locale in which to describe the name of the font face.
+ *
+ * @return A string containing the font face name, localized for the
+ * provided locale.
+ *
+ * @since 1.2
+ *
+ * @see getName()
+ * @see getFamily()
+ */
+public String
+getFontName(Locale lc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the italic angle of this font, a measurement of its slant when
+ * style is {@link ITALIC}. The precise meaning is the inverse slope of a
+ * caret line which "best measures" the font's italic posture.
+ *
+ * @return The italic angle.
+ *
+ * @see TextAttribute.POSTURE
+ */
+public float
+getItalicAngle()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a {@link LineMetrics} object constructed with the specified
+ * text and {@link FontRenderContext}.
+ *
+ * @param text The string to calculate metrics from.
+ * @param begin Index of first character in <code>text</code> to measure.
+ * @param limit Index of last character in <code>text</code> to measure.
+ * @param rc Context for calculating precise glyph placement and hints.
+ *
+ * @return A new {@link LineMetrics} object.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>text</code>.
+ */
+public LineMetrics
+getLineMetrics(String text, int begin, int limit, FontRenderContext rc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a {@link LineMetrics} object constructed with the specified
+ * text and {@link FontRenderContext}.
+ *
+ * @param chars The string to calculate metrics from.
+ * @param begin Index of first character in <code>text</code> to measure.
+ * @param limit Index of last character in <code>text</code> to measure.
+ * @param rc Context for calculating precise glyph placement and hints.
+ *
+ * @return A new {@link LineMetrics} object.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>chars</code>.
+ */
+public LineMetrics
+getLineMetrics(char[] chars, int begin, int limit, FontRenderContext rc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a {@link LineMetrics} object constructed with the specified
+ * text and {@link FontRenderContext}.
+ *
+ * @param ci The string to calculate metrics from.
+ * @param begin Index of first character in <code>text</code> to measure.
+ * @param limit Index of last character in <code>text</code> to measure.
+ * @param rc Context for calculating precise glyph placement and hints.
+ *
+ * @return A new {@link LineMetrics} object.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>ci</code>.
+ */
+public LineMetrics
+getLineMetrics(CharacterIterator ci, int begin, int limit, FontRenderContext rc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the maximal bounding box of all the bounding boxes in this
+ * font, when the font's bounding boxes are evaluated in a given {@link
+ * FontRenderContext}
+ *
+ * @param rc Context in which to evaluate bounding boxes.
+ *
+ * @return The maximal bounding box.
+ */
+public Rectangle2D
+getMaxCharBounds(FontRenderContext rc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the glyph code this font uses to represent missing glyphs. This
+ * code will be present in glyph vectors when the font was unable to
+ * locate a glyph to represent a particular character code.
+ *
+ * @return The missing glyph code.
+ *
+ * @since 1.2
+ */
+public int
+getMissingGlyphCode()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the overall number of glyphs in this font. This number is one
+ * more than the greatest glyph code used in any glyph vectors this font
+ * produces. In other words, glyph codes are taken from the range
+ * <code>[ 0, getNumGlyphs() - 1 ]</code>.
+ *
+ * @return The number of glyphs in this font.
+ *
+ * @since 1.2
+ */
+public int
+getNumGlyphs()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the PostScript Name of this font.
+ *
+ * @return The PostScript Name of this font.
+ *
+ * @since 1.2
+ *
+ * @see getName()
+ * @see getFamily()
+ * @see getFontName()
+ */
+public String
+getPSName()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the logical bounds of the specified string when rendered with this
+ * font in the specified {@link FontRenderContext}. This box will include the
+ * glyph origin, ascent, advance, height, and leading, but may not include all
+ * diacritics or accents. To get the complete visual bounding box of all the
+ * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
+ * {@link TextLayout}.
+ *
+ * @param str The string to measure.
+ * @param frc The context in which to make the precise glyph measurements.
+ *
+ * @return A bounding box covering the logical bounds of the specified text.
+ *
+ * @see createGlyphVector()
+ */
+public Rectangle2D
+getStringBounds(String str, FontRenderContext frc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the logical bounds of the specified string when rendered with this
+ * font in the specified {@link FontRenderContext}. This box will include the
+ * glyph origin, ascent, advance, height, and leading, but may not include all
+ * diacritics or accents. To get the complete visual bounding box of all the
+ * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
+ * {@link TextLayout}.
+ *
+ * @param str The string to measure.
+ * @param begin Index of the first character in <code>str</code> to measure.
+ * @param limit Index of the last character in <code>str</code> to measure.
+ * @param frc The context in which to make the precise glyph measurements.
+ *
+ * @return A bounding box covering the logical bounds of the specified text.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>str</code>.
+ *
+ * @since 1.2
+ *
+ * @see createGlyphVector()
+ */
+public Rectangle2D
+getStringBounds(String str, int begin, int limit, FontRenderContext frc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the logical bounds of the specified string when rendered with this
+ * font in the specified {@link FontRenderContext}. This box will include the
+ * glyph origin, ascent, advance, height, and leading, but may not include all
+ * diacritics or accents. To get the complete visual bounding box of all the
+ * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
+ * {@link TextLayout}.
+ *
+ * @param ci The text to measure.
+ * @param begin Index of the first character in <code>ci</code> to measure.
+ * @param limit Index of the last character in <code>ci</code> to measure.
+ * @param frc The context in which to make the precise glyph measurements.
+ *
+ * @return A bounding box covering the logical bounds of the specified text.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>ci</code>.
+ *
+ * @since 1.2
+ *
+ * @see createGlyphVector()
+ */
+public Rectangle2D
+getStringBounds(CharacterIterator ci, int begin, int limit, FontRenderContext frc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the logical bounds of the specified string when rendered with this
+ * font in the specified {@link FontRenderContext}. This box will include the
+ * glyph origin, ascent, advance, height, and leading, but may not include all
+ * diacritics or accents. To get the complete visual bounding box of all the
+ * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
+ * {@link TextLayout}.
+ *
+ * @param chars The text to measure.
+ * @param begin Index of the first character in <code>ci</code> to measure.
+ * @param limit Index of the last character in <code>ci</code> to measure.
+ * @param frc The context in which to make the precise glyph measurements.
+ *
+ * @return A bounding box covering the logical bounds of the specified text.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>chars</code>.
+ *
+ * @since 1.2
+ *
+ * @see createGlyphVector()
+ */
+public Rectangle2D
+getStringBounds(char[] chars, int begin, int limit, FontRenderContext frc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a copy of the affine transformation this font is currently
+ * subject to, if any.
+ *
+ * @return The current transformation.
+ */
+public AffineTransform
+getTransform()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Indicates whether this font's line metrics are uniform. A font may be
+ * composed of several "subfonts", each covering a different code range,
+ * and each with their own line metrics. A font with no subfonts, or
+ * subfonts with identical line metrics, is said to have "uniform" line
+ * metrics.
+ *
+ * @return Whether this font has uniform line metrics.
+ *
+ * @see LineMetrics
+ * @see getLineMetrics()
+ */
+public boolean
+hasUniformLineMetrics()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Indicates whether this font is subject to a non-identity affine
+ * transformation.
+ *
+ * @return <code>true</code> iff the font has a non-identity affine
+ * transformation applied to it.
+ */
+public boolean
+isTransformed()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a glyph vector representing a full layout fo the specified
+ * text in this font. Full layouts may include complex shaping and
+ * reordering operations, for scripts such as Arabic or Hindi.
+ *
+ * Bidirectional (bidi) layout is not performed in this method; text
+ * should have its bidi direction specified with one of the flags {@link
+ * LAYOUT_LEFT_TO_RIGHT} or {@link LAYOUT_RIGHT_TO_LEFT}.
+ *
+ * Some types of layout (notably Arabic glyph shaping) may examine context
+ * characters beyond the bounds of the indicated range, in order to select
+ * an appropriate shape. The flags {@link LAYOUT_NO_START_CONTEXT} and
+ * {@link LAYOUT_NO_LIMIT_CONTEXT} can be provided to prevent these extra
+ * context areas from being examined, for instance if they contain invalid
+ * characters.
+ *
+ * @param frc Context in which to perform the layout.
+ * @param chars Text to perform layout on.
+ * @param start Index of first character to perform layout on.
+ * @param limit Index of last character to perform layout on.
+ * @param flags Combination of flags controlling layout.
+ *
+ * @return A new {@link GlyphVector} representing the specified text.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>chars</code>.
+ */
+public GlyphVector
+layoutGlyphVector(FontRenderContext frc, char[] chars, int start, int limit, int flags)
+{
+ throw new UnsupportedOperationException ();
+}
+
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/GridBagLayout.java b/libjava/java/awt/GridBagLayout.java
index dc2b3c9fd69..dd49a1cf905 100644
--- a/libjava/java/awt/GridBagLayout.java
+++ b/libjava/java/awt/GridBagLayout.java
@@ -1,5 +1,5 @@
/* GridBagLayout - Layout manager for components according to GridBagConstraints
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,64 +35,644 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.awt;
import java.io.Serializable;
+import java.util.Hashtable;
/**
- * Stub implementation.
+ * @author Michael Koch <konqueror@gmx.de>
+ * @author Jeroen Frijters <jeroen@frijters.net>
*/
public class GridBagLayout
- implements Serializable, LayoutManager2
+ implements Serializable, LayoutManager2
{
- static final long serialVersionUID = 8838754796412211005L;
-
- public void addLayoutComponent(String name, Component component)
- {
- }
-
- public void removeLayoutComponent(Component component)
- {
- }
-
- public Dimension preferredLayoutSize(Container parent)
- {
- return null;
- }
-
- public Dimension minimumLayoutSize(Container parent)
- {
- return null;
- }
-
- public void layoutContainer(Container parent)
- {
- }
-
- public void addLayoutComponent(Component component, Object contraint)
- {
- }
-
- public Dimension maximumLayoutSize(Container target)
- {
- return null;
- }
-
- public float getLayoutAlignmentX(Container target)
- {
- return 0.0f;
- }
-
- public float getLayoutAlignmentY(Container target)
- {
- return 0.0f;
- }
-
- public void invalidateLayout(Container target)
- {
- }
-
- public void setConstraints(Component comp, GridBagConstraints constraints)
- {
- }
+ private static final long serialVersionUID = 8838754796412211005L;
+
+ protected static final int MINSIZE = 1;
+ protected static final int PREFERREDSIZE = 2;
+ protected static final int MAXGRIDSIZE = 512;
+
+ protected Hashtable comptable;
+ protected GridBagLayoutInfo layoutInfo;
+ protected GridBagConstraints defaultConstraints;
+
+ public double[] columnWeights;
+ public int[] columnWidths;
+ public double[] rowWeights;
+ public int[] rowHeights;
+
+ public GridBagLayout ()
+ {
+ this.comptable = new Hashtable();
+ this.defaultConstraints= new GridBagConstraints();
+ }
+
+ /**
+ * Helper method to calc the sum of a range of elements in an int array.
+ */
+ private int sumIntArray (int[] array, int upto)
+ {
+ int result = 0;
+
+ for (int i = 0; i < upto; i++)
+ result += array [i];
+
+ return result;
+ }
+
+ /**
+ * Helper method to calc the sum of all elements in an int array.
+ */
+ private int sumIntArray (int[] array)
+ {
+ return sumIntArray(array, array.length);
+ }
+
+ /**
+ * Helper method to calc the sum of all elements in an double array.
+ */
+ private double sumDoubleArray (double[] array)
+ {
+ double result = 0;
+
+ for (int i = 0; i < array.length; i++)
+ result += array [i];
+
+ return result;
+ }
+
+ public void addLayoutComponent (String name, Component component)
+ {
+ // do nothing here.
+ }
+
+ public void removeLayoutComponent (Component component)
+ {
+ // do nothing here
+ }
+
+ public void addLayoutComponent (Component component, Object constraints)
+ {
+ if (constraints == null)
+ return;
+
+ if (!(constraints instanceof GridBagConstraints))
+ throw new IllegalArgumentException();
+
+ setConstraints (component, (GridBagConstraints) constraints);
+ }
+
+ public Dimension preferredLayoutSize (Container parent)
+ {
+ if (parent == null)
+ return new Dimension (0, 0);
+
+ GridBagLayoutInfo li = getLayoutInfo (parent, PREFERREDSIZE);
+ return getMinSize (parent, li);
+ }
+
+ public Dimension minimumLayoutSize (Container parent)
+ {
+ if (parent == null)
+ return new Dimension (0, 0);
+
+ GridBagLayoutInfo li = getLayoutInfo (parent, MINSIZE);
+ return getMinSize (parent, li);
+ }
+
+ public Dimension maximumLayoutSize (Container target)
+ {
+ return new Dimension (Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+
+ public void layoutContainer (Container parent)
+ {
+ arrangeGrid (parent);
+ }
+
+ public float getLayoutAlignmentX (Container target)
+ {
+ return Component.CENTER_ALIGNMENT;
+ }
+
+ public float getLayoutAlignmentY (Container target)
+ {
+ return Component.CENTER_ALIGNMENT;
+ }
+
+ public void invalidateLayout (Container target)
+ {
+ this.layoutInfo = null;
+ }
+
+ public void setConstraints (Component component,
+ GridBagConstraints constraints)
+ {
+ GridBagConstraints clone = (GridBagConstraints) constraints.clone();
+
+ if (clone.gridx < 0)
+ clone.gridx = GridBagConstraints.RELATIVE;
+
+ if (clone.gridy < 0)
+ clone.gridy = GridBagConstraints.RELATIVE;
+
+ if (clone.gridwidth == 0)
+ clone.gridwidth = GridBagConstraints.REMAINDER;
+ else if (clone.gridwidth < 0
+ && clone.gridwidth != GridBagConstraints.REMAINDER
+ && clone.gridwidth != GridBagConstraints.RELATIVE)
+ clone.gridwidth = 1;
+
+ if (clone.gridheight == 0)
+ clone.gridheight = GridBagConstraints.REMAINDER;
+ else if (clone.gridheight < 0
+ && clone.gridheight != GridBagConstraints.REMAINDER
+ && clone.gridheight != GridBagConstraints.RELATIVE)
+ clone.gridheight = 1;
+
+ comptable.put (component, clone);
+ }
+
+ public GridBagConstraints getConstraints (Component component)
+ {
+ return (GridBagConstraints) (lookupConstraints (component).clone());
+ }
+
+ protected GridBagConstraints lookupConstraints (Component component)
+ {
+ GridBagConstraints result = (GridBagConstraints) comptable.get (component);
+
+ if (result == null)
+ {
+ setConstraints (component, defaultConstraints);
+ result = (GridBagConstraints) comptable.get (component);
+ }
+
+ return result;
+ }
+
+ /**
+ * @since 1.1
+ */
+ public Point getLayoutOrigin ()
+ {
+ if (layoutInfo == null)
+ return new Point (0, 0);
+
+ return new Point (layoutInfo.pos_x, layoutInfo.pos_y);
+ }
+
+ /**
+ * @since 1.1
+ */
+ public int[][] getLayoutDimensions ()
+ {
+ if (layoutInfo == null)
+ return new int [2][];
+
+ int[][] result = new int [2][];
+ result [0] = new int [layoutInfo.cols];
+ System.arraycopy (layoutInfo.colWidths, 0, result [0], 0, layoutInfo.cols);
+ result [1] = new int [layoutInfo.rows];
+ System.arraycopy (layoutInfo.rowHeights, 0, result [1], 0, layoutInfo.rows);
+ return result;
+ }
+
+ public double[][] getLayoutWeights ()
+ {
+ if (layoutInfo == null)
+ return new double [2][];
+
+ double[][] result = new double [2][];
+ result [0] = new double [layoutInfo.cols];
+ System.arraycopy (layoutInfo.colWeights, 0, result [0], 0, layoutInfo.cols);
+ result [1] = new double [layoutInfo.rows];
+ System.arraycopy (layoutInfo.rowWeights, 0, result [1], 0, layoutInfo.rows);
+ return result;
+ }
+
+ /**
+ * @since 1.1
+ */
+ public Point location (int x, int y)
+ {
+ if (layoutInfo == null)
+ return new Point (0, 0);
+
+ int col;
+ int row;
+ int pixel_x = layoutInfo.pos_x;
+ int pixel_y = layoutInfo.pos_y;
+
+ for (col = 0; col < layoutInfo.cols; col++)
+ {
+ int w = layoutInfo.colWidths [col];
+ if (x < pixel_x + w)
+ break;
+
+ pixel_x += w;
+ }
+
+ for (row = 0; row < layoutInfo.rows; row++)
+ {
+ int h = layoutInfo.rowHeights [row];
+ if (y < pixel_y + h)
+ break;
+
+ pixel_y += h;
+ }
+
+ return new Point (col, row);
+ }
+
+ /**
+ * Obsolete.
+ */
+ protected void AdjustForGravity (GridBagConstraints gbc, Rectangle rect)
+ {
+ adjustForGravity (gbc, rect);
+ }
+
+ /**
+ * Obsolete.
+ */
+ protected void ArrangeGrid (Container parent)
+ {
+ arrangeGrid (parent);
+ }
+
+ /**
+ * Obsolete.
+ */
+ protected GridBagLayoutInfo GetLayoutInfo (Container parent, int sizeflag)
+ {
+ return getLayoutInfo (parent, sizeflag);
+ }
+
+ /**
+ * Obsolete.
+ */
+ protected Dimension GetMinSize (Container parent, GridBagLayoutInfo info)
+ {
+ return getMinSize (parent, info);
+ }
+
+ /**
+ * @since 1.4
+ */
+ protected Dimension getMinSize (Container parent, GridBagLayoutInfo info)
+ {
+ if (parent == null || info == null)
+ return new Dimension (0, 0);
+
+ Insets insets = parent.getInsets();
+ int width = sumIntArray (info.colWidths) + insets.left + insets.right;
+ int height = sumIntArray (info.rowHeights) + insets.top + insets.bottom;
+ return new Dimension (width, height);
+ }
+
+ private void calcCellSizes (int[] sizes, double[] weights, int range)
+ {
+ int diff = range - sumIntArray (sizes);
+
+ if (diff == 0)
+ return;
+
+ double weight = sumDoubleArray (weights);
+
+ for (int i = 0; i < sizes.length; i++)
+ {
+ sizes [i] += (int) (((double) diff) * weights [i] / weight );
+
+ if (sizes [i] < 0)
+ sizes [i] = 0;
+ }
+ }
+
+ private void dumpLayoutInfo (GridBagLayoutInfo info)
+ {
+ System.out.println ("GridBagLayoutInfo:");
+ System.out.println ("cols: " + info.cols + ", rows: " + info.rows);
+ System.out.print ("colWidths: ");
+ dumpArray(info.colWidths);
+ System.out.print ("rowHeights: ");
+ dumpArray(info.rowHeights);
+ System.out.print ("colWeights: ");
+ dumpArray(info.colWeights);
+ System.out.print ("rowWeights: ");
+ dumpArray(info.rowWeights);
+ }
+
+ private void dumpArray(int[] array)
+ {
+ String sep = "";
+ for(int i = 0; i < array.length; i++)
+ {
+ System.out.print(sep);
+ System.out.print(array[i]);
+ sep = ", ";
+ }
+ System.out.println();
+ }
+
+ private void dumpArray(double[] array)
+ {
+ String sep = "";
+ for(int i = 0; i < array.length; i++)
+ {
+ System.out.print(sep);
+ System.out.print(array[i]);
+ sep = ", ";
+ }
+ System.out.println();
+ }
+
+ /**
+ * @since 1.4
+ */
+ protected void arrangeGrid (Container parent)
+ {
+ Component[] components = parent.getComponents();
+
+ if (components.length == 0)
+ return;
+
+ GridBagLayoutInfo info = getLayoutInfo (parent, PREFERREDSIZE);
+ if (info.cols == 0 && info.rows == 0)
+ return;
+ layoutInfo = info;
+
+ // DEBUG
+ //dumpLayoutInfo (layoutInfo);
+
+ for(int i = 0; i < components.length; i++)
+ {
+ Component component = components [i];
+
+ // If component is not visible we dont have to care about it.
+ if (!component.isVisible())
+ continue;
+
+ GridBagConstraints constraints = lookupConstraints (component);
+
+ int cellx = sumIntArray(layoutInfo.colWidths, constraints.gridx);
+ int celly = sumIntArray(layoutInfo.rowHeights, constraints.gridy);
+ int cellw = sumIntArray(layoutInfo.colWidths,
+ constraints.gridx + constraints.gridwidth) - cellx;
+ int cellh = sumIntArray(layoutInfo.rowHeights,
+ constraints.gridy + constraints.gridheight) - celly;
+
+ Insets insets = constraints.insets;
+ if (insets != null)
+ {
+ cellx += insets.left;
+ celly += insets.top;
+ cellw -= insets.left + insets.right;
+ cellh -= insets.top + insets.bottom;
+ }
+
+ Dimension dim = component.preferredSize();
+
+ // Note: Documentation says that padding is added on both sides, but
+ // visual inspection shows that the Sun implementation only adds it
+ // once, so we do the same.
+ dim.width += constraints.ipadx;
+ dim.height += constraints.ipady;
+
+ switch(constraints.fill)
+ {
+ case GridBagConstraints.HORIZONTAL:
+ dim.width = cellw;
+ break;
+ case GridBagConstraints.VERTICAL:
+ dim.height = cellh;
+ break;
+ case GridBagConstraints.BOTH:
+ dim.width = cellw;
+ dim.height = cellh;
+ break;
+ }
+
+ int x;
+ int y;
+
+ switch(constraints.anchor)
+ {
+ case GridBagConstraints.NORTH:
+ x = cellx + (cellw - dim.width) / 2;
+ y = celly;
+ break;
+ case GridBagConstraints.SOUTH:
+ x = cellx + (cellw - dim.width) / 2;
+ y = celly + cellh - dim.height;
+ break;
+ case GridBagConstraints.WEST:
+ x = cellx;
+ y = celly + (cellh - dim.height) / 2;
+ break;
+ case GridBagConstraints.EAST:
+ x = cellx + cellw - dim.width;
+ y = celly + (cellh - dim.height) / 2;
+ break;
+ case GridBagConstraints.NORTHEAST:
+ x = cellx + cellw - dim.width;
+ y = celly;
+ break;
+ case GridBagConstraints.NORTHWEST:
+ x = cellx;
+ y = celly;
+ break;
+ case GridBagConstraints.SOUTHEAST:
+ x = cellx + cellw - dim.width;
+ y = celly + cellh - dim.height;
+ break;
+ case GridBagConstraints.SOUTHWEST:
+ x = cellx;
+ y = celly + cellh - dim.height;
+ break;
+ default:
+ x = cellx + (cellw - dim.width) / 2;
+ y = celly + (cellh - dim.height) / 2;
+ break;
+ }
+
+ component.setBounds(layoutInfo.pos_x + x, layoutInfo.pos_y + y, dim.width, dim.height);
+ }
+
+ // DEBUG
+ //dumpLayoutInfo (layoutInfo);
+
+ }
+
+ /**
+ * @since 1.4
+ */
+ protected GridBagLayoutInfo getLayoutInfo (Container parent, int sizeflag)
+ {
+ if (sizeflag != MINSIZE && sizeflag != PREFERREDSIZE)
+ throw new IllegalArgumentException();
+
+ Dimension parentDim = parent.size();
+ Insets parentInsets = parent.insets();
+ parentDim.width -= parentInsets.left + parentInsets.right;
+ parentDim.height -= parentInsets.top + parentInsets.bottom;
+
+ int x = 0;
+ int y = 0;
+ int max_x = 0;
+ int max_y = 0;
+
+ // first we figure out how many rows/columns
+ Component[] components = parent.getComponents();
+ for (int i = 0; i < components.length; i++)
+ {
+ Component component = components [i];
+
+ // If component is not visible we dont have to care about it.
+ if (!component.isVisible())
+ continue;
+
+ GridBagConstraints constraints = lookupConstraints (component);
+
+ if(constraints.gridx == GridBagConstraints.RELATIVE)
+ constraints.gridx = x;
+
+ if(constraints.gridy == GridBagConstraints.RELATIVE)
+ constraints.gridy = y;
+
+ max_x = Math.max(max_x,
+ constraints.gridx + Math.max(1, constraints.gridwidth));
+ max_y = Math.max(max_y,
+ constraints.gridy + Math.max(1, constraints.gridheight));
+
+ if(constraints.gridwidth == GridBagConstraints.REMAINDER)
+ {
+ x = 0;
+ y++;
+ }
+ else
+ {
+ x = constraints.gridx + Math.max(1, constraints.gridwidth);
+ y = constraints.gridy;
+ }
+ }
+
+ GridBagLayoutInfo info = new GridBagLayoutInfo(max_x, max_y);
+
+ for (x = 0; x <= max_x; x++)
+ {
+ if(columnWidths != null && columnWidths.length > x)
+ {
+ info.colWidths[x] = columnWidths[x];
+ }
+ if(columnWeights != null && columnWeights.length > x)
+ {
+ info.colWeights[x] = columnWeights[x];
+ }
+ for (int i = 0; i < components.length; i++)
+ {
+ Component component = components [i];
+
+ // If component is not visible we dont have to care about it.
+ if (!component.isVisible())
+ continue;
+
+ GridBagConstraints constraints = lookupConstraints (component);
+
+ // first we fix up any REMAINDER cells
+ if(constraints.gridwidth == GridBagConstraints.REMAINDER)
+ {
+ constraints.gridwidth = max_x - constraints.gridx;
+ }
+ if(constraints.gridheight == GridBagConstraints.REMAINDER)
+ {
+ constraints.gridheight = max_y - constraints.gridy;
+ }
+
+ if(constraints.gridx + constraints.gridwidth - 1 == x)
+ {
+ int width = (sizeflag == PREFERREDSIZE) ?
+ component.preferredSize().width :
+ component.minimumSize().width;
+ if(constraints.insets != null)
+ {
+ width += constraints.insets.left + constraints.insets.right;
+ }
+ width += constraints.ipadx;
+ for(int w = 1; w < constraints.gridwidth; w++)
+ {
+ width -= info.colWidths[x - w];
+ }
+ info.colWidths[x] = Math.max(info.colWidths[x], width);
+ info.colWeights[x] =
+ Math.max(info.colWeights[x], constraints.weightx);
+ }
+ }
+ }
+
+ for (y = 0; y <= max_y; y++)
+ {
+ if(rowHeights != null && rowHeights.length > y)
+ {
+ info.rowHeights[y] = rowHeights[y];
+ }
+ if(rowWeights != null && rowWeights.length > y)
+ {
+ info.rowWeights[y] = rowWeights[y];
+ }
+ for (int i = 0; i < components.length; i++)
+ {
+ Component component = components [i];
+
+ // If component is not visible we dont have to care about it.
+ if (!component.isVisible())
+ continue;
+
+ GridBagConstraints constraints = lookupConstraints (component);
+
+ if(constraints.gridy + constraints.gridheight - 1 == y)
+ {
+ int height = (sizeflag == PREFERREDSIZE) ?
+ component.preferredSize().height :
+ component.minimumSize().height;
+ if(constraints.insets != null)
+ {
+ height += constraints.insets.top + constraints.insets.bottom;
+ }
+ height += constraints.ipady;
+ for(int h = 1; h < constraints.gridheight; h++)
+ {
+ height -= info.rowHeights[y - h];
+ }
+ info.rowHeights[y] = Math.max(info.rowHeights[y], height);
+ info.rowWeights[y] =
+ Math.max(info.rowWeights[y], constraints.weighty);
+ }
+ }
+ }
+
+ calcCellSizes (info.colWidths, info.colWeights, parentDim.width);
+ calcCellSizes (info.rowHeights, info.rowWeights, parentDim.height);
+
+ int totalWidth = sumIntArray(info.colWidths);
+ int totalHeight = sumIntArray(info.rowHeights);
+ info.pos_x = parentInsets.left + (parentDim.width - totalWidth) / 2;
+ info.pos_y = parentInsets.top + (parentDim.height - totalHeight) / 2;
+
+ // DEBUG
+ //dumpLayoutInfo (info);
+
+ return info;
+ }
+
+ /**
+ * @since 1.4
+ */
+ protected void adjustForGravity (GridBagConstraints gbc, Rectangle rect)
+ {
+ // FIXME
+ throw new Error ("Not implemented");
+ }
}
diff --git a/libjava/java/awt/MediaTracker.java b/libjava/java/awt/MediaTracker.java
index a94d6507114..0f4e1c3aeda 100644
--- a/libjava/java/awt/MediaTracker.java
+++ b/libjava/java/awt/MediaTracker.java
@@ -76,9 +76,9 @@ public class MediaTracker implements java.io.Serializable
int width, int height)
{
if ((flags & ABORT) != 0)
- status = ABORTED & COMPLETE;
+ status = ABORTED | COMPLETE;
else if ((flags & ERROR) != 0)
- status = ERRORED & COMPLETE;
+ status = ERRORED | COMPLETE;
else if ((flags & ALLBITS) != 0)
status = COMPLETE;
else
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index c286381c36a..2f625aa6d81 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package java.awt;
-import gnu.java.awt.EmbeddedWindowSupport;
import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
import java.awt.event.WindowListener;
@@ -84,7 +83,6 @@ public class Window extends Container implements Accessible
*/
Window()
{
- setVisible(false);
setLayout(new BorderLayout());
}
@@ -94,19 +92,6 @@ public class Window extends Container implements Accessible
graphicsConfiguration = gc;
}
- Window(int window_id, int width, int height)
- {
- this();
-
- Toolkit tk = getToolkit();
- if (!(tk instanceof EmbeddedWindowSupport))
- throw new UnsupportedOperationException
- ("Embedded windows not supported by the current peers: " + tk.getClass());
-
- peer = ((EmbeddedWindowSupport) getToolkit())
- .createEmbeddedWindow (window_id, width, height);
- }
-
/**
* Initializes a new instance of <code>Window</code> with the specified
* parent. The window will initially be invisible.
@@ -159,9 +144,10 @@ public class Window extends Container implements Accessible
// FIXME: add to owner's "owned window" list
//owner.owned.add(this); // this should be a weak reference
- /* FIXME: Security check
- SecurityManager.checkTopLevelWindow(...)
- */
+ // FIXME: make this text visible in the window.
+ SecurityManager s = System.getSecurityManager();
+ if (s != null && ! s.checkTopLevelWindow(this))
+ warningString = System.getProperty("awt.appletWarning");
if (gc != null
&& gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)
@@ -315,20 +301,7 @@ public class Window extends Container implements Accessible
*/
public final String getWarningString()
{
- boolean secure = true;
- /* boolean secure = SecurityManager.checkTopLevelWindow(...) */
-
- if (!secure)
- {
- if (warningString != null)
- return warningString;
- else
- {
- String warning = System.getProperty("awt.appletWarning");
- return warning;
- }
- }
- return null;
+ return warningString;
}
/**
diff --git a/libjava/java/awt/event/KeyEvent.java b/libjava/java/awt/event/KeyEvent.java
index f93bab1dc78..455d7ee5266 100644
--- a/libjava/java/awt/event/KeyEvent.java
+++ b/libjava/java/awt/event/KeyEvent.java
@@ -1503,7 +1503,7 @@ public class KeyEvent extends InputEvent
case VK_NUMPAD7:
case VK_NUMPAD8:
case VK_NUMPAD9:
- return "NumPad-" + (char) (keyCode - VK_NUMPAD0);
+ return "NumPad-" + (keyCode - VK_NUMPAD0);
case VK_F1:
case VK_F2:
case VK_F3:
@@ -1642,63 +1642,64 @@ public class KeyEvent extends InputEvent
}
/**
- * Returns a string identifying the event. This is formatted as the field
- * name of the id type, followed by the keyCode, then the keyChar (if
- * available), modifiers (if any), extModifiers (if any), and keyLocation.
- * The keyChar is available unless the keyCode is Backspace, Tab, Enter,
- * Escape, Numpad-[0-9], Delete, or a keyCode which is an action.
+ * Returns a string identifying the event. This is formatted as the
+ * field name of the id type, followed by the keyCode, then the
+ * keyChar, modifiers (if any), extModifiers (if any), and
+ * keyLocation.
*
* @return a string identifying the event
*/
public String paramString()
{
StringBuffer s = new StringBuffer();
+
switch (id)
{
case KEY_PRESSED:
- s.append("KEY_PRESSED,keyCode=");
+ s.append("KEY_PRESSED");
break;
case KEY_RELEASED:
- s.append("KEY_RELEASED,keyCode=");
+ s.append("KEY_RELEASED");
break;
case KEY_TYPED:
- s.append("KEY_TYPED,keyCode=");
+ s.append("KEY_TYPED");
break;
default:
- s.append("unknown type,keyCode=");
+ s.append("unknown type");
}
- s.append(keyCode);
- switch (keyCode)
+
+ s.append(",keyCode=").append(keyCode);
+
+ s.append(",keyText=").append(getKeyText(keyCode));
+
+ s.append(",keyChar=");
+ if (isActionKey()
+ || keyCode == VK_SHIFT
+ || keyCode == VK_CONTROL
+ || keyCode == VK_ALT)
+ s.append("Undefined keyChar");
+ else
{
- default:
- if (! isActionKey())
- {
- s.append(",keyChar='").append(keyChar).append('\'');
- break;
- }
- // Fallthrough.
- case VK_BACK_SPACE:
- case VK_TAB:
- case VK_ENTER:
- case VK_ESCAPE:
- case VK_NUMPAD0:
- case VK_NUMPAD1:
- case VK_NUMPAD2:
- case VK_NUMPAD3:
- case VK_NUMPAD4:
- case VK_NUMPAD5:
- case VK_NUMPAD6:
- case VK_NUMPAD7:
- case VK_NUMPAD8:
- case VK_NUMPAD9:
- case VK_DELETE:
- s.append(',').append(getKeyText(keyCode));
+ /* This output string must be selected by examining keyChar
+ * rather than keyCode, because key code information is not
+ * included in KEY_TYPED events.
+ */
+ if (keyChar == VK_BACK_SPACE
+ || keyChar == VK_TAB
+ || keyChar == VK_ENTER
+ || keyChar == VK_ESCAPE
+ || keyChar == VK_DELETE)
+ s.append(getKeyText(keyChar));
+ else
+ s.append("'").append(keyChar).append("'");
}
+
if ((modifiers & CONVERT_MASK) != 0)
s.append(",modifiers=").append(getModifiersExText(modifiers
& CONVERT_MASK));
if (modifiers != 0)
s.append(",extModifiers=").append(getModifiersExText(modifiers));
+
s.append(",keyLocation=KEY_LOCATION_");
switch (keyLocation)
{
@@ -1717,6 +1718,7 @@ public class KeyEvent extends InputEvent
case KEY_LOCATION_NUMPAD:
s.append("NUMPAD");
}
+
return s.toString();
}
diff --git a/libjava/java/awt/geom/Arc2D.java b/libjava/java/awt/geom/Arc2D.java
index d62fa676f89..3819efe62cd 100644
--- a/libjava/java/awt/geom/Arc2D.java
+++ b/libjava/java/awt/geom/Arc2D.java
@@ -1,5 +1,5 @@
/* Arc2D.java -- represents an arc in 2-D space
- Copyright (C) 2002 Free Software Foundation
+ Copyright (C) 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -126,9 +126,11 @@ public abstract class Arc2D extends RectangularShape
*/
public Point2D getStartPoint()
{
- double angle = getAngleStart() * (-180 / Math.PI);
- double x = (Math.cos(angle) * getWidth() + getX()) / 2;
- double y = (Math.sin(angle) * getHeight() + getY()) / 2;
+ double angle = Math.toRadians(getAngleStart());
+ double rx = getWidth() / 2;
+ double ry = getHeight() / 2;
+ double x = getX() + rx + rx * Math.cos(angle);
+ double y = getY() + ry - ry * Math.sin(angle);
return new Point2D.Double(x, y);
}
@@ -139,9 +141,11 @@ public abstract class Arc2D extends RectangularShape
*/
public Point2D getEndPoint()
{
- double angle = (getAngleStart() + getAngleExtent()) * (-180 / Math.PI);
- double x = (Math.cos(angle) * getWidth() + getX()) / 2;
- double y = (Math.sin(angle) * getHeight() + getY()) / 2;
+ double angle = Math.toRadians(getAngleStart() + getAngleExtent());
+ double rx = getWidth() / 2;
+ double ry = getHeight() / 2;
+ double x = getX() + rx + rx * Math.cos(angle);
+ double y = getY() + ry - ry * Math.sin(angle);
return new Point2D.Double(x, y);
}
@@ -280,9 +284,10 @@ public abstract class Arc2D extends RectangularShape
*/
public void setAngleStart(Point2D p)
{
- double x = ((p.getX() * 2) - getX()) / getWidth();
- double y = ((p.getY() * 2) - getY()) / getHeight();
- setAngleStart(Math.atan2(y, x) * (-180 / Math.PI));
+ // Normalize.
+ double x = p.getX() - (getX() + getWidth() / 2);
+ double y = p.getY() - (getY() + getHeight() / 2);
+ setAngleStart(Math.toDegrees(Math.atan2(y, x)));
}
/**
@@ -303,12 +308,12 @@ public abstract class Arc2D extends RectangularShape
double my = getY();
double mw = getWidth();
double mh = getHeight();
- x1 = ((x1 * 2) - mx) / mw;
- y1 = ((y1 * 2) - my) / mh;
- x2 = ((x2 * 2) - mx) / mw;
- y2 = ((y2 * 2) - my) / mh;
- double start = Math.atan2(y1, x1) * (-180 / Math.PI);
- double extent = Math.atan2(y2, x2) * (-180 / Math.PI) - start;
+ x1 = x1 - (mx + mw / 2);
+ y1 = y1 - (my + mh / 2);
+ x2 = x2 - (mx + mw / 2);
+ y2 = y2 - (my + mh / 2);
+ double start = Math.toDegrees(Math.atan2(y1, x1));
+ double extent = Math.toDegrees(Math.atan2(y2, x2)) - start;
if (extent < 0)
extent += 360;
setAngleStart(start);
@@ -372,8 +377,31 @@ public abstract class Arc2D extends RectangularShape
double extent = getAngleExtent();
if (Math.abs(extent) >= 360)
return makeBounds(getX(), getY(), getWidth(), getHeight());
- // XXX Finish implementing.
- throw new Error("not implemented");
+
+ // Find the minimal bounding box. This determined by its extrema,
+ // which are the center, the endpoints of the arc, and any local
+ // maximum contained by the arc.
+ double rX = getWidth() / 2;
+ double rY = getHeight() / 2;
+ double centerX = getX() + rX;
+ double centerY = getY() + rY;
+
+ Point2D p1 = getStartPoint();
+ Rectangle2D result = makeBounds(p1.getX(), p1.getY(), 0, 0);
+ result.add(getEndPoint());
+
+ if (type == PIE)
+ result.add(centerX, centerY);
+ if (containsAngle(0))
+ result.add(centerX + rX, centerY);
+ if (containsAngle(90))
+ result.add(centerX, centerY - rY);
+ if (containsAngle(180))
+ result.add(centerX - rX, centerY);
+ if (containsAngle(270))
+ result.add(centerX, centerY + rY);
+
+ return result;
}
/**
@@ -390,16 +418,29 @@ public abstract class Arc2D extends RectangularShape
/**
* Tests if the given angle, in degrees, is included in the arc.
- *
- * XXX Does this normalize all angles to -180 - 180 first?
+ * All angles are normalized to be between 0 and 360 degrees.
*
* @param a the angle to test
* @return true if it is contained
*/
public boolean containsAngle(double a)
{
- // XXX Implement.
- throw new Error("not implemented");
+ double start = getAngleStart();
+ double end = start + getAngleExtent();
+
+ start %= 360;
+ if (start < 0)
+ start += 360;
+
+ end %= 360;
+ if (end < 0)
+ end += 360;
+
+ a %= 360;
+ if (a < 0)
+ a += 360;
+
+ return a >= start && a <= end;
}
/**
diff --git a/libjava/java/io/FilePermission.java b/libjava/java/io/FilePermission.java
index a86c7c9ff99..7d3e0af1c6c 100644
--- a/libjava/java/io/FilePermission.java
+++ b/libjava/java/io/FilePermission.java
@@ -144,9 +144,10 @@ public final class FilePermission extends Permission implements Serializable
/* Compare names, taking into account if they refer to a
* directory and one has a separator and the other does not.
*/
- if(f1.charAt(f1.length()) == File.separatorChar)
+ if(f1.length() > 0 && f1.charAt(f1.length() - 1) == File.separatorChar)
{
- if(f2.charAt(f2.length()) == File.separatorChar)
+ if(f2.length() > 0
+ && f2.charAt(f2.length() - 1) == File.separatorChar)
{
if(!f2.equals(f1))
return false;
@@ -159,7 +160,8 @@ public final class FilePermission extends Permission implements Serializable
}
else
{
- if(f2.charAt(f2.length()) == File.separatorChar)
+ if(f2.length() > 0
+ && f2.charAt(f2.length() - 1) == File.separatorChar)
{
if(!f1.equals(f2.substring(0,f2.length()-1)))
return false;
diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java
index ef79727c1e1..918626905a4 100644
--- a/libjava/java/io/ObjectInputStream.java
+++ b/libjava/java/io/ObjectInputStream.java
@@ -41,10 +41,13 @@ package java.io;
import java.lang.reflect.Array;
import java.lang.reflect.Modifier;
import java.lang.reflect.Proxy;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
+
import gnu.java.io.ObjectIdentityWrapper;
import gnu.java.lang.reflect.TypeSignature;
import java.lang.reflect.Field;
@@ -1075,9 +1078,7 @@ public class ObjectInputStream extends InputStream
try
{
Class classArgs[] = {};
- m = obj.getClass ().getDeclaredMethod ("readResolve", classArgs);
- // m can't be null by definition since an exception would
- // have been thrown so a check for null is not needed.
+ m = getMethod(obj.getClass(), "readResolve", classArgs);
obj = m.invoke (obj, new Object[] {});
}
catch (NoSuchMethodException ignore)
@@ -1416,13 +1417,31 @@ public class ObjectInputStream extends InputStream
private static Field getField (Class klass, String name)
throws java.lang.NoSuchFieldException
{
- return klass.getDeclaredField(name);
+ final Field f = klass.getDeclaredField(name);
+ AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ f.setAccessible(true);
+ return null;
+ }
+ });
+ return f;
}
private static Method getMethod (Class klass, String name, Class args[])
throws java.lang.NoSuchMethodException
{
- return klass.getDeclaredMethod(name, args);
+ final Method m = klass.getDeclaredMethod(name, args);
+ AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ m.setAccessible(true);
+ return null;
+ }
+ });
+ return m;
}
private void callReadMethod (Object obj, ObjectStreamClass osc) throws IOException
@@ -1432,11 +1451,13 @@ public class ObjectInputStream extends InputStream
{
Class classArgs[] = {ObjectInputStream.class};
Method m = getMethod (klass, "readObject", classArgs);
- if (m == null)
- return;
Object args[] = {this};
m.invoke (obj, args);
}
+ catch (NoSuchMethodException nsme)
+ {
+ // Nothing.
+ }
catch (InvocationTargetException x)
{
/* Rethrow if possible. */
@@ -1467,7 +1488,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setBoolean (obj, val);
}
catch (Exception _)
@@ -1481,7 +1501,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setByte (obj, val);
}
catch (Exception _)
@@ -1495,7 +1514,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setChar (obj, val);
}
catch (Exception _)
@@ -1509,7 +1527,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setDouble (obj, val);
}
catch (Exception _)
@@ -1523,7 +1540,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setFloat (obj, val);
}
catch (Exception _)
@@ -1537,7 +1553,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setInt (obj, val);
}
catch (Exception _)
@@ -1552,7 +1567,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setLong (obj, val);
}
catch (Exception _)
@@ -1567,7 +1581,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setShort (obj, val);
}
catch (Exception _)
@@ -1576,13 +1589,12 @@ public class ObjectInputStream extends InputStream
}
- private void setObjectField (Object obj, Class klass, String field_name, String type_code,
- Object val)
+ private void setObjectField (Object obj, Class klass, String field_name,
+ String type_code, Object val)
{
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
// FIXME: We should check the type_code here
f.set (obj, val);
}
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index 4014fcd3dc2..1437a4f6918 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -42,6 +42,8 @@ import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
import java.util.Hashtable;
import gnu.java.io.ObjectIdentityWrapper;
@@ -240,10 +242,11 @@ public class ObjectOutputStream extends OutputStream
try
{
Class classArgs[] = {};
- m = obj.getClass ().getDeclaredMethod ("writeReplace",
- classArgs);
- // m can't be null by definition since an exception would
- // have been thrown so a check for null is not needed.
+ m = getMethod(obj.getClass(), "writeReplace",
+ classArgs);
+ // m can't be null by definition since an
+ // exception would have been thrown so a check
+ // for null is not needed.
obj = m.invoke (obj, new Object[] {});
}
catch (NoSuchMethodException ignore)
@@ -993,7 +996,8 @@ public class ObjectOutputStream extends OutputStream
private void checkType (ObjectStreamField field, char type)
throws IllegalArgumentException
{
- if (TypeSignature.getEncodingOfClass (field.getType ()).charAt (0) != type)
+ if (TypeSignature.getEncodingOfClass (field.getType ()).charAt (0)
+ != type)
throw new IllegalArgumentException ();
}
};
@@ -1193,18 +1197,21 @@ public class ObjectOutputStream extends OutputStream
}
- private void callWriteMethod (Object obj, ObjectStreamClass osc) throws IOException
+ private void callWriteMethod (Object obj, ObjectStreamClass osc)
+ throws IOException
{
Class klass = osc.forClass();
try
{
Class classArgs[] = {ObjectOutputStream.class};
Method m = getMethod (klass, "writeObject", classArgs);
- if (m == null)
- return;
Object args[] = {this};
m.invoke (obj, args);
}
+ catch (NoSuchMethodException nsme)
+ {
+ // Nothing.
+ }
catch (InvocationTargetException x)
{
/* Rethrow if possible. */
@@ -1214,13 +1221,19 @@ public class ObjectOutputStream extends OutputStream
if (exception instanceof IOException)
throw (IOException) exception;
- throw new IOException ("Exception thrown from writeObject() on " +
- klass + ": " + exception.getClass().getName());
+ IOException ioe
+ = new IOException ("Exception thrown from writeObject() on " +
+ klass + ": " + exception.getClass().getName());
+ ioe.initCause(exception);
+ throw ioe;
}
catch (Exception x)
{
- throw new IOException ("Failure invoking writeObject() on " +
- klass + ": " + x.getClass().getName());
+ IOException ioe
+ = new IOException ("Failure invoking writeObject() on " +
+ klass + ": " + x.getClass().getName());
+ ioe.initCause(x);
+ throw ioe;
}
}
@@ -1239,7 +1252,8 @@ public class ObjectOutputStream extends OutputStream
}
}
- private byte getByteField (Object obj, Class klass, String field_name) throws IOException
+ private byte getByteField (Object obj, Class klass, String field_name)
+ throws IOException
{
try
{
@@ -1253,7 +1267,8 @@ public class ObjectOutputStream extends OutputStream
}
}
- private char getCharField (Object obj, Class klass, String field_name) throws IOException
+ private char getCharField (Object obj, Class klass, String field_name)
+ throws IOException
{
try
{
@@ -1297,7 +1312,8 @@ public class ObjectOutputStream extends OutputStream
}
}
- private int getIntField (Object obj, Class klass, String field_name) throws IOException
+ private int getIntField (Object obj, Class klass, String field_name)
+ throws IOException
{
try
{
@@ -1311,7 +1327,8 @@ public class ObjectOutputStream extends OutputStream
}
}
- private long getLongField (Object obj, Class klass, String field_name) throws IOException
+ private long getLongField (Object obj, Class klass, String field_name)
+ throws IOException
{
try
{
@@ -1359,13 +1376,31 @@ public class ObjectOutputStream extends OutputStream
private static Field getField (Class klass, String name)
throws java.lang.NoSuchFieldException
{
- return klass.getDeclaredField(name);
+ final Field f = klass.getDeclaredField(name);
+ AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ f.setAccessible(true);
+ return null;
+ }
+ });
+ return f;
}
private static Method getMethod (Class klass, String name, Class[] args)
throws java.lang.NoSuchMethodException
{
- return klass.getDeclaredMethod(name, args);
+ final Method m = klass.getDeclaredMethod(name, args);
+ AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ m.setAccessible(true);
+ return null;
+ }
+ });
+ return m;
}
// this value comes from 1.2 spec, but is used in 1.1 as well
diff --git a/libjava/java/io/PrintStream.java b/libjava/java/io/PrintStream.java
index 94800150870..d2a211744e2 100644
--- a/libjava/java/io/PrintStream.java
+++ b/libjava/java/io/PrintStream.java
@@ -95,7 +95,9 @@ public class PrintStream extends FilterOutputStream
* This method intializes a new <code>PrintStream</code> object to write
* to the specified output sink. This constructor also allows "auto-flush"
* functionality to be specified where the stream will be flushed after
- * every line is terminated or newline character is written.
+ * every <code>print</code> or <code>println</code> call, when the
+ * <code>write</code> methods with array arguments are called, or when a
+ * single new-line character is written.
* <p>
*
* @param out The <code>OutputStream</code> to write to.
@@ -114,7 +116,9 @@ public class PrintStream extends FilterOutputStream
* This method intializes a new <code>PrintStream</code> object to write
* to the specified output sink. This constructor also allows "auto-flush"
* functionality to be specified where the stream will be flushed after
- * every line is terminated or newline character is written.
+ * every <code>print</code> or <code>println</code> call, when the
+ * <code>write</code> methods with array arguments are called, or when a
+ * single new-line character is written.
* <p>
*
* @param out The <code>OutputStream</code> to write to.
@@ -257,9 +261,7 @@ public class PrintStream extends FilterOutputStream
pw.print (str);
if (auto_flush)
- if ((str.indexOf ('\r') != -1)
- || (str.indexOf ('\n') != -1))
- flush ();
+ flush ();
}
/**
@@ -422,9 +424,21 @@ public class PrintStream extends FilterOutputStream
*/
public void write (int oneByte)
{
- byte[] data = new byte [1];
- data [0] = (byte) (oneByte & 0xff);
- write (data, 0, 1);
+ // We actually have to implement this method. Flush first so that
+ // things get written in the right order.
+ flush();
+
+ try
+ {
+ out.write (oneByte & 0xff);
+
+ if (auto_flush && (oneByte == '\n'))
+ flush ();
+ }
+ catch (IOException e)
+ {
+ setError ();
+ }
}
/**
@@ -446,19 +460,12 @@ public class PrintStream extends FilterOutputStream
out.write (buffer, offset, len);
if (auto_flush)
- for (int i = offset; i < len; i++)
- if ((buffer [i] == '\r')
- || (buffer [i] == '\n'))
- {
- flush ();
- break;
- }
+ flush ();
}
catch (IOException e)
{
setError ();
}
}
-
} // class PrintStream
diff --git a/libjava/java/io/natFileDescriptorPosix.cc b/libjava/java/io/natFileDescriptorPosix.cc
index 2ad2d9dce77..e43bb9d1135 100644
--- a/libjava/java/io/natFileDescriptorPosix.cc
+++ b/libjava/java/io/natFileDescriptorPosix.cc
@@ -150,7 +150,8 @@ java::io::FileDescriptor::write (jint b)
iioe->bytesTransferred = r == -1 ? 0 : r;
throw iioe;
}
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
+ if (errno != EINTR)
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
}
position++;
@@ -178,7 +179,8 @@ java::io::FileDescriptor::write (jbyteArray b, jint offset, jint len)
iioe->bytesTransferred = written;
throw iioe;
}
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
+ if (errno != EINTR)
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
written += r;
@@ -282,20 +284,26 @@ jint
java::io::FileDescriptor::read (void)
{
jbyte b;
- int r = ::read (fd, &b, 1);
- if (r == 0)
- return -1;
- if (r == -1)
+ int r;
+ do
{
- if (java::lang::Thread::interrupted())
+ r = ::read (fd, &b, 1);
+ if (r == 0)
+ return -1;
+ if (r == -1)
{
- InterruptedIOException *iioe
- = new InterruptedIOException (JvNewStringLatin1 (strerror (errno)));
- iioe->bytesTransferred = r == -1 ? 0 : r;
- throw iioe;
+ if (java::lang::Thread::interrupted())
+ {
+ InterruptedIOException *iioe
+ = new InterruptedIOException (JvNewStringLatin1 (strerror (errno)));
+ iioe->bytesTransferred = r == -1 ? 0 : r;
+ throw iioe;
+ }
+ if (errno != EINTR)
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
+ while (r != 1);
position++;
return b & 0xFF;
}
@@ -314,20 +322,26 @@ java::io::FileDescriptor::read (jbyteArray buffer, jint offset, jint count)
return 0;
jbyte *bytes = elements (buffer) + offset;
- int r = ::read (fd, bytes, count);
- if (r == 0)
- return -1;
- if (r == -1)
- {
- if (java::lang::Thread::interrupted())
+ int r;
+ do
+ {
+ r = ::read (fd, bytes, count);
+ if (r == 0)
+ return -1;
+ if (r == -1)
{
- InterruptedIOException *iioe
- = new InterruptedIOException (JvNewStringLatin1 (strerror (errno)));
- iioe->bytesTransferred = r == -1 ? 0 : r;
- throw iioe;
+ if (java::lang::Thread::interrupted())
+ {
+ InterruptedIOException *iioe
+ = new InterruptedIOException (JvNewStringLatin1 (strerror (errno)));
+ iioe->bytesTransferred = r == -1 ? 0 : r;
+ throw iioe;
+ }
+ if (errno != EINTR)
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
+ while (r <= 0);
position += r;
return r;
}
diff --git a/libjava/java/lang/String.java b/libjava/java/lang/String.java
index fe00b9100cc..6844405e34c 100644
--- a/libjava/java/lang/String.java
+++ b/libjava/java/lang/String.java
@@ -419,7 +419,7 @@ public final class String implements Serializable, Comparable, CharSequence
{
// No need to synchronize or mark the buffer, since we know it is
// only used once.
- init (buffer.value, 0, buffer.count, true);
+ init (buffer);
}
/**
@@ -1253,5 +1253,6 @@ public final class String implements Serializable, Comparable, CharSequence
private native void init(byte[] chars, int hibyte, int offset, int count);
private native void init(byte[] chars, int offset, int count, String enc)
throws UnsupportedEncodingException;
+ private native void init(gnu.gcj.runtime.StringBuffer buffer);
private static native void rehash();
}
diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java
index 32f7d174580..64498b23ba4 100644
--- a/libjava/java/lang/Thread.java
+++ b/libjava/java/lang/Thread.java
@@ -614,11 +614,6 @@ public class Thread implements Runnable
public Thread (ThreadGroup g, Runnable r, String n)
{
this (currentThread (), g, r, n);
-
- // The Class Libraries book says ``threadName cannot be null''. I
- // take this to mean NullPointerException.
- if (n == null)
- throw new NullPointerException ();
}
/**
@@ -645,15 +640,15 @@ public class Thread implements Runnable
{
// Just ignore stackSize for now.
this (currentThread (), g, r, n);
+ }
+ private Thread (Thread current, ThreadGroup g, Runnable r, String n)
+ {
// The Class Libraries book says ``threadName cannot be null''. I
// take this to mean NullPointerException.
if (n == null)
throw new NullPointerException ();
- }
-
- private Thread (Thread current, ThreadGroup g, Runnable r, String n)
- {
+
if (g == null)
{
// If CURRENT is null, then we are bootstrapping the first thread.
diff --git a/libjava/java/lang/Win32Process.java b/libjava/java/lang/Win32Process.java
index b1c7e027379..7a5872705b8 100644
--- a/libjava/java/lang/Win32Process.java
+++ b/libjava/java/lang/Win32Process.java
@@ -67,6 +67,14 @@ final class ConcreteProcess extends Process
File dir)
throws IOException
{
+ for (int i = 0; i < progarray.length; i++)
+ {
+ String s = progarray[i];
+
+ if ( (s.indexOf (' ') >= 0) || (s.indexOf ('\t') >= 0))
+ progarray[i] = "\"" + s + "\"";
+ }
+
startProcess (progarray, envp, dir);
}
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index 69f78f64491..b86da32f8f3 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -217,7 +217,8 @@ java::lang::Runtime::_load (jstring path, jboolean do_search)
if (h == NULL)
{
const char *msg = lt_dlerror ();
- jstring str = path->concat (JvNewStringLatin1 (": "));
+ jstring str = JvNewStringLatin1 (lib_name);
+ str = str->concat (JvNewStringLatin1 (": "));
str = str->concat (JvNewStringLatin1 (msg));
throw new UnsatisfiedLinkError (str);
}
@@ -563,7 +564,7 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
if (_Jv_Jar_Class_Path)
newprops->put(JvNewStringLatin1 ("java.class.path"),
- JvNewStringLatin1 (_Jv_Jar_Class_Path));
+ JvNewStringLatin1 (_Jv_Jar_Class_Path));
else
{
// FIXME: find libgcj.zip and append its path?
@@ -585,6 +586,9 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
sb->toString ());
}
+ // The path to libgcj's boot classes
+ SET ("sun.boot.class.path", BOOT_CLASS_PATH);
+
// The name used to invoke this process (argv[0] in C).
SET ("gnu.gcj.progname", _Jv_GetSafeArg (0));
diff --git a/libjava/java/lang/natString.cc b/libjava/java/lang/natString.cc
index 98309cfe62e..6fd928478b5 100644
--- a/libjava/java/lang/natString.cc
+++ b/libjava/java/lang/natString.cc
@@ -28,6 +28,7 @@ details. */
#include <java/util/Locale.h>
#include <gnu/gcj/convert/UnicodeToBytes.h>
#include <gnu/gcj/convert/BytesToUnicode.h>
+#include <gnu/gcj/runtime/StringBuffer.h>
#include <jvm.h>
static void unintern (jobject);
@@ -525,6 +526,12 @@ java::lang::String::init (jbyteArray bytes, jint offset, jint count,
this->count = outpos;
}
+void
+java::lang::String::init (gnu::gcj::runtime::StringBuffer *buffer)
+{
+ init (buffer->value, 0, buffer->count, true);
+}
+
jboolean
java::lang::String::equals(jobject anObject)
{
diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc
index e2d42324386..4a08bb138bf 100644
--- a/libjava/java/lang/natSystem.cc
+++ b/libjava/java/lang/natSystem.cc
@@ -66,8 +66,10 @@ java::lang::System::arraycopy (jobject src, jint src_offset,
__JArray *src_a = (__JArray *) src;
__JArray *dst_a = (__JArray *) dst;
if (src_offset < 0 || dst_offset < 0 || count < 0
- || src_offset + count > src_a->length
- || dst_offset + count > dst_a->length)
+ || (unsigned jint) src_offset > (unsigned jint) src_a->length
+ || (unsigned jint) (src_offset + count) > (unsigned jint) src_a->length
+ || (unsigned jint) dst_offset > (unsigned jint) dst_a->length
+ || (unsigned jint) (dst_offset + count) > (unsigned jint) dst_a->length)
throw new ArrayIndexOutOfBoundsException;
// Do-nothing cases.
diff --git a/libjava/java/lang/natWin32Process.cc b/libjava/java/lang/natWin32Process.cc
index ff7ddb5f50a..710753ec215 100644
--- a/libjava/java/lang/natWin32Process.cc
+++ b/libjava/java/lang/natWin32Process.cc
@@ -136,7 +136,7 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
int cmdLineLen = 0;
for (int i = 0; i < progarray->length; ++i)
- cmdLineLen += (_Jv_GetStringUTFLength (elts[i]) + 3);
+ cmdLineLen += (_Jv_GetStringUTFLength (elts[i]) + 1);
char *cmdLine = (char *) _Jv_Malloc (cmdLineLen + 1);
char *cmdLineCurPos = cmdLine;
@@ -145,11 +145,9 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
{
if (i > 0)
*cmdLineCurPos++ = ' ';
- *cmdLineCurPos++ = '\"';
jsize s = _Jv_GetStringUTFLength (elts[i]);
_Jv_GetStringUTFRegion (elts[i], 0, s, cmdLineCurPos);
cmdLineCurPos += s;
- *cmdLineCurPos++ = '\"';
}
*cmdLineCurPos = '\0';
diff --git a/libjava/java/lang/reflect/Constructor.java b/libjava/java/lang/reflect/Constructor.java
index 4a30e2ae394..53db35a6975 100644
--- a/libjava/java/lang/reflect/Constructor.java
+++ b/libjava/java/lang/reflect/Constructor.java
@@ -1,6 +1,6 @@
// Constructor.java - Represents a constructor for a class.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -11,88 +11,196 @@ details. */
package java.lang.reflect;
/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date December 12, 1998
+ * The Constructor class represents a constructor of a class. It also allows
+ * dynamic creation of an object, via reflection. Invocation on Constructor
+ * objects knows how to do widening conversions, but throws
+ * {@link IllegalArgumentException} if a narrowing conversion would be
+ * necessary. You can query for information on this Constructor regardless
+ * of location, but construction access may be limited by Java language
+ * access controls. If you can't do it in the compiler, you can't normally
+ * do it here either.<p>
+ *
+ * <B>Note:</B> This class returns and accepts types as Classes, even
+ * primitive types; there are Class types defined that represent each
+ * different primitive type. They are <code>java.lang.Boolean.TYPE,
+ * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
+ * byte.class</code>, etc. These are not to be confused with the
+ * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
+ * real classes.<p>
+ *
+ * Also note that this is not a serializable class. It is entirely feasible
+ * to make it serializable using the Externalizable interface, but this is
+ * on Sun, not me.
+ *
+ * @author John Keiser
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey <tromey@redhat.com>
+ * @see Member
+ * @see Class
+ * @see java.lang.Class#getConstructor(Object[])
+ * @see java.lang.Class#getDeclaredConstructor(Object[])
+ * @see java.lang.Class#getConstructors()
+ * @see java.lang.Class#getDeclaredConstructors()
+ * @since 1.1
+ * @status updated to 1.4
*/
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Incomplete: needs a private constructor, and
- * newInstance() needs to be written.
- */
-
public final class Constructor extends AccessibleObject implements Member
{
- public boolean equals (Object obj)
- {
- if (! (obj instanceof Constructor))
- return false;
- Constructor c = (Constructor) obj;
- return declaringClass == c.declaringClass && offset == c.offset;
- }
+ /**
+ * This class is uninstantiable except from native code.
+ */
+ private Constructor ()
+ {
+ }
+ /**
+ * Gets the class that declared this constructor.
+ * @return the class that declared this member
+ */
public Class getDeclaringClass ()
- {
- return declaringClass;
- }
-
- public Class[] getExceptionTypes ()
- {
- if (exception_types == null)
- getType();
- return (Class[]) exception_types.clone();
- }
-
- public native int getModifiers ();
+ {
+ return declaringClass;
+ }
+ /**
+ * Gets the name of this constructor (the non-qualified name of the class
+ * it was declared in).
+ * @return the name of this constructor
+ */
public String getName ()
{
return declaringClass.getName();
}
+ /**
+ * Gets the modifiers this constructor uses. Use the <code>Modifier</code>
+ * class to interpret the values. A constructor can only have a subset of the
+ * following modifiers: public, private, protected.
+ *
+ * @return an integer representing the modifiers to this Member
+ * @see Modifier
+ */
+ public native int getModifiers ();
+
+ /**
+ * Get the parameter list for this constructor, in declaration order. If the
+ * constructor takes no parameters, returns a 0-length array (not null).
+ *
+ * @return a list of the types of the constructor's parameters
+ */
public Class[] getParameterTypes ()
- {
- if (parameter_types == null)
- getType ();
- return (Class[]) parameter_types.clone();
- }
+ {
+ if (parameter_types == null)
+ getType ();
+ return (Class[]) parameter_types.clone();
+ }
+ /**
+ * Get the exception types this constructor says it throws, in no particular
+ * order. If the constructor has no throws clause, returns a 0-length array
+ * (not null).
+ *
+ * @return a list of the types in the constructor's throws clause
+ */
+ public Class[] getExceptionTypes ()
+ {
+ if (exception_types == null)
+ getType();
+ return (Class[]) exception_types.clone();
+ }
+
+ /**
+ * Compare two objects to see if they are semantically equivalent.
+ * Two Constructors are semantically equivalent if they have the same
+ * declaring class and the same parameter list.
+ *
+ * @param o the object to compare to
+ * @return <code>true</code> if they are equal; <code>false</code> if not.
+ */
+ public boolean equals (Object obj)
+ {
+ if (! (obj instanceof Constructor))
+ return false;
+ Constructor c = (Constructor) obj;
+ return declaringClass == c.declaringClass && offset == c.offset;
+ }
+
+ /**
+ * Get the hash code for the Constructor.
+ *
+ * @return the hash code for the object
+ */
public int hashCode ()
- {
- // FIXME.
- return getName().hashCode() + declaringClass.getName().hashCode();
- }
+ {
+ // FIXME.
+ return getName().hashCode() + declaringClass.getName().hashCode();
+ }
- // Update cached values from method descriptor in class.
- private native void getType ();
+ /**
+ * Get a String representation of the Constructor. A Constructor's String
+ * representation is "&lt;modifier&gt; &lt;classname&gt;(&lt;paramtypes&gt;)
+ * throws &lt;exceptions&gt;", where everything after ')' is omitted if
+ * there are no exceptions.<br> Example:
+ * <code>public java.io.FileInputStream(java.lang.Runnable)
+ * throws java.io.FileNotFoundException</code>
+ *
+ * @return the String representation of the Constructor
+ */
+ public String toString ()
+ {
+ if (parameter_types == null)
+ getType ();
+ StringBuffer b = new StringBuffer ();
+ Modifier.toString(getModifiers(), b);
+ b.append(" ");
+ Method.appendClassName (b, declaringClass);
+ b.append("(");
+ for (int i = 0; i < parameter_types.length; ++i)
+ {
+ Method.appendClassName (b, parameter_types[i]);
+ if (i < parameter_types.length - 1)
+ b.append(",");
+ }
+ b.append(")");
+ return b.toString();
+ }
+ /**
+ * Create a new instance by invoking the constructor. Arguments are
+ * automatically unwrapped and widened, if needed.<p>
+ *
+ * If this class is abstract, you will get an
+ * <code>InstantiationException</code>. If the constructor takes 0
+ * arguments, you may use null or a 0-length array for <code>args</code>.<p>
+ *
+ * If this Constructor enforces access control, your runtime context is
+ * evaluated, and you may have an <code>IllegalAccessException</code> if
+ * you could not create this object in similar compiled code. If the class
+ * is uninitialized, you trigger class initialization, which may end in a
+ * <code>ExceptionInInitializerError</code>.<p>
+ *
+ * Then, the constructor is invoked. If it completes normally, the return
+ * value will be the new object. If it completes abruptly, the exception is
+ * wrapped in an <code>InvocationTargetException</code>.
+ *
+ * @param args the arguments to the constructor
+ * @return the newly created object
+ * @throws IllegalAccessException if the constructor could not normally be
+ * called by the Java code (i.e. it is not public)
+ * @throws IllegalArgumentException if the number of arguments is incorrect;
+ * or if the arguments types are wrong even with a widening
+ * conversion
+ * @throws InstantiationException if the class is abstract
+ * @throws InvocationTargetException if the constructor throws an exception
+ * @throws ExceptionInInitializerError if construction triggered class
+ * initialization, which then failed
+ */
public native Object newInstance (Object[] args)
throws InstantiationException, IllegalAccessException,
- IllegalArgumentException, InvocationTargetException;
+ IllegalArgumentException, InvocationTargetException;
- public String toString ()
- {
- if (parameter_types == null)
- getType ();
- StringBuffer b = new StringBuffer ();
- Modifier.toString(getModifiers(), b);
- b.append(" ");
- Method.appendClassName (b, declaringClass);
- b.append("(");
- for (int i = 0; i < parameter_types.length; ++i)
- {
- Method.appendClassName (b, parameter_types[i]);
- if (i < parameter_types.length - 1)
- b.append(",");
- }
- b.append(")");
- return b.toString();
- }
-
- // Can't create these.
- private Constructor ()
- {
- }
+ // Update cached values from method descriptor in class.
+ private native void getType ();
// Declaring class.
private Class declaringClass;
diff --git a/libjava/java/lang/reflect/Method.java b/libjava/java/lang/reflect/Method.java
index 7bd0a312511..3e0507fcaa1 100644
--- a/libjava/java/lang/reflect/Method.java
+++ b/libjava/java/lang/reflect/Method.java
@@ -1,6 +1,6 @@
// Method.java - Represent method of class or interface.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -13,43 +13,92 @@ package java.lang.reflect;
import gnu.gcj.RawData;
/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date December 12, 1998
+ * The Method class represents a member method of a class. It also allows
+ * dynamic invocation, via reflection. This works for both static and
+ * instance methods. Invocation on Method objects knows how to do
+ * widening conversions, but throws {@link IllegalArgumentException} if
+ * a narrowing conversion would be necessary. You can query for information
+ * on this Method regardless of location, but invocation access may be limited
+ * by Java language access controls. If you can't do it in the compiler, you
+ * can't normally do it here either.<p>
+ *
+ * <B>Note:</B> This class returns and accepts types as Classes, even
+ * primitive types; there are Class types defined that represent each
+ * different primitive type. They are <code>java.lang.Boolean.TYPE,
+ * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
+ * byte.class</code>, etc. These are not to be confused with the
+ * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
+ * real classes.<p>
+ *
+ * Also note that this is not a serializable class. It is entirely feasible
+ * to make it serializable using the Externalizable interface, but this is
+ * on Sun, not me.
+ *
+ * @author John Keiser
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey <tromey@redhat.com>
+ * @see Member
+ * @see Class
+ * @see java.lang.Class#getMethod(String,Object[])
+ * @see java.lang.Class#getDeclaredMethod(String,Object[])
+ * @see java.lang.Class#getMethods()
+ * @see java.lang.Class#getDeclaredMethods()
+ * @since 1.1
+ * @status updated to 1.4
*/
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Complete, but not correct: access checks aren't done.
- */
-
public final class Method extends AccessibleObject implements Member
{
- public boolean equals (Object obj)
+ /**
+ * This class is uninstantiable.
+ */
+ private Method ()
{
- if (! (obj instanceof Method))
- return false;
- Method m = (Method) obj;
- return declaringClass == m.declaringClass && offset == m.offset;
}
+ /**
+ * Gets the class that declared this method, or the class where this method
+ * is a non-inherited member.
+ * @return the class that declared this member
+ */
public Class getDeclaringClass ()
{
return declaringClass;
}
- public Class[] getExceptionTypes ()
- {
- if (exception_types == null)
- getType();
- return (Class[]) exception_types.clone();
- }
+ /**
+ * Gets the name of this method.
+ * @return the name of this method
+ */
+ public native String getName ();
+ /**
+ * Gets the modifiers this method uses. Use the <code>Modifier</code>
+ * class to interpret the values. A method can only have a subset of the
+ * following modifiers: public, private, protected, abstract, static,
+ * final, synchronized, native, and strictfp.
+ *
+ * @return an integer representing the modifiers to this Member
+ * @see Modifier
+ */
public native int getModifiers ();
- public native String getName ();
-
- private native void getType ();
+ /**
+ * Gets the return type of this method.
+ * @return the type of this method
+ */
+ public Class getReturnType ()
+ {
+ if (return_type == null)
+ getType();
+ return return_type;
+ }
+ /**
+ * Get the parameter list for this method, in declaration order. If the
+ * method takes no parameters, returns a 0-length array (not null).
+ *
+ * @return a list of the types of the method's parameters
+ */
public Class[] getParameterTypes ()
{
if (parameter_types == null)
@@ -57,43 +106,57 @@ public final class Method extends AccessibleObject implements Member
return (Class[]) parameter_types.clone();
}
- public Class getReturnType ()
+ /**
+ * Get the exception types this method says it throws, in no particular
+ * order. If the method has no throws clause, returns a 0-length array
+ * (not null).
+ *
+ * @return a list of the types in the method's throws clause
+ */
+ public Class[] getExceptionTypes ()
{
- if (return_type == null)
+ if (exception_types == null)
getType();
- return return_type;
+ return (Class[]) exception_types.clone();
}
- public int hashCode ()
+ /**
+ * Compare two objects to see if they are semantically equivalent.
+ * Two Methods are semantically equivalent if they have the same declaring
+ * class, name, and parameter list. This ignores different exception
+ * clauses or return types.
+ *
+ * @param o the object to compare to
+ * @return <code>true</code> if they are equal; <code>false</code> if not
+ */
+ public boolean equals (Object obj)
{
- // FIXME.
- return getName().hashCode() + declaringClass.getName().hashCode();
+ if (! (obj instanceof Method))
+ return false;
+ Method m = (Method) obj;
+ return declaringClass == m.declaringClass && offset == m.offset;
}
- public native Object invoke (Object obj, Object[] args)
- throws IllegalAccessException, IllegalArgumentException,
- InvocationTargetException;
-
- // Append a class name to a string buffer. We try to print the
- // fully-qualified name, the way that a Java programmer would expect
- // it to be written. Weirdly, Class has no appropriate method for
- // this.
- static void appendClassName (StringBuffer buf, Class k)
+ /**
+ * Get the hash code for the Method.
+ *
+ * @return the hash code for the object
+ */
+ public int hashCode ()
{
- if (k.isArray ())
- {
- appendClassName (buf, k.getComponentType ());
- buf.append ("[]");
- }
- else
- {
- // This is correct for primitive and reference types. Really
- // we'd like `Main$Inner' to be printed as `Main.Inner', I
- // think, but that is a pain.
- buf.append (k.getName ());
- }
+ // FIXME.
+ return getName().hashCode() + declaringClass.getName().hashCode();
}
+ /**
+ * Get a String representation of the Method. A Method's String
+ * representation is "&lt;modifiers&gt; &lt;returntype&gt;
+ * &lt;methodname&gt;(&lt;paramtypes&gt;) throws &lt;exceptions&gt;", where
+ * everything after ')' is omitted if there are no exceptions.<br> Example:
+ * <code>public static int run(java.lang.Runnable,int)</code>
+ *
+ * @return the String representation of the Method
+ */
public String toString ()
{
if (parameter_types == null)
@@ -128,8 +191,71 @@ public final class Method extends AccessibleObject implements Member
return b.toString();
}
- private Method ()
+ /**
+ * Invoke the method. Arguments are automatically unwrapped and widened,
+ * and the result is automatically wrapped, if needed.<p>
+ *
+ * If the method is static, <code>o</code> will be ignored. Otherwise,
+ * the method uses dynamic lookup as described in JLS 15.12.4.4. You cannot
+ * mimic the behavior of nonvirtual lookup (as in super.foo()). This means
+ * you will get a <code>NullPointerException</code> if <code>o</code> is
+ * null, and an <code>IllegalArgumentException</code> if it is incompatible
+ * with the declaring class of the method. If the method takes 0 arguments,
+ * you may use null or a 0-length array for <code>args</code>.<p>
+ *
+ * Next, if this Method enforces access control, your runtime context is
+ * evaluated, and you may have an <code>IllegalAccessException</code> if
+ * you could not acces this method in similar compiled code. If the method
+ * is static, and its class is uninitialized, you trigger class
+ * initialization, which may end in a
+ * <code>ExceptionInInitializerError</code>.<p>
+ *
+ * Finally, the method is invoked. If it completes normally, the return value
+ * will be null for a void method, a wrapped object for a primitive return
+ * method, or the actual return of an Object method. If it completes
+ * abruptly, the exception is wrapped in an
+ * <code>InvocationTargetException</code>.
+ *
+ * @param o the object to invoke the method on
+ * @param args the arguments to the method
+ * @return the return value of the method, wrapped in the appropriate
+ * wrapper if it is primitive
+ * @throws IllegalAccessException if the method could not normally be called
+ * by the Java code (i.e. it is not public)
+ * @throws IllegalArgumentException if the number of arguments is incorrect;
+ * if the arguments types are wrong even with a widening conversion;
+ * or if <code>o</code> is not an instance of the class or interface
+ * declaring this method
+ * @throws InvocationTargetException if the method throws an exception
+ * @throws NullPointerException if <code>o</code> is null and this field
+ * requires an instance
+ * @throws ExceptionInInitializerError if accessing a static method triggered
+ * class initialization, which then failed
+ */
+ public native Object invoke (Object obj, Object[] args)
+ throws IllegalAccessException, IllegalArgumentException,
+ InvocationTargetException;
+
+ private native void getType ();
+
+ // Append a class name to a string buffer. We try to print the
+ // fully-qualified name, the way that a Java programmer would expect
+ // it to be written. Weirdly, Class has no appropriate method for
+ // this.
+ static void appendClassName (StringBuffer buf, Class k)
{
+ if (k.isArray ())
+ {
+ appendClassName (buf, k.getComponentType ());
+ buf.append ("[]");
+ }
+ else
+ {
+ // This is correct for primitive and reference types. Really
+ // we'd like `Main$Inner' to be printed as `Main.Inner', I
+ // think, but that is a pain.
+ buf.append (k.getName ());
+ }
}
// Declaring class.
diff --git a/libjava/java/lang/reflect/natField.cc b/libjava/java/lang/reflect/natField.cc
index 5f104a9d999..b7f12f06e92 100644
--- a/libjava/java/lang/reflect/natField.cc
+++ b/libjava/java/lang/reflect/natField.cc
@@ -59,13 +59,14 @@ getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj)
// calls. However, we never implemented that, so we have to find
// the caller by hand instead.
gnu::gcj::runtime::StackTrace *t
- = new gnu::gcj::runtime::StackTrace(4);
+ = new gnu::gcj::runtime::StackTrace(7);
try
{
- for (int i = 1; !caller; i++)
- {
- caller = t->classAt (i);
- }
+ // We want to skip all the frames on the stack from this class.
+ for (int i = 1;
+ !caller || caller == &java::lang::reflect::Field::class$;
+ i++)
+ caller = t->classAt (i);
}
catch (::java::lang::ArrayIndexOutOfBoundsException *e)
{
diff --git a/libjava/java/math/BigDecimal.java b/libjava/java/math/BigDecimal.java
index fc99cf1f7d2..f9965add4c1 100644
--- a/libjava/java/math/BigDecimal.java
+++ b/libjava/java/math/BigDecimal.java
@@ -1,5 +1,5 @@
/* java.math.BigDecimal -- Arbitrary precision decimals.
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -273,7 +273,7 @@ public class BigDecimal extends Number implements Comparable
// Ensure that pow gets a non-negative value.
int valScale = val.scale;
BigInteger valIntVal = val.intVal;
- int power = newScale + 1 - (scale - val.scale);
+ int power = newScale - (scale - val.scale);
if (power < 0)
{
// Effectively increase the scale of val to avoid an
@@ -285,50 +285,53 @@ public class BigDecimal extends Number implements Comparable
BigInteger dividend = intVal.multiply (BigInteger.valueOf (10).pow (power));
BigInteger parts[] = dividend.divideAndRemainder (valIntVal);
-// System.out.println("int: " + parts[0]);
-// System.out.println("rem: " + parts[1]);
- int roundDigit = parts[0].mod (BigInteger.valueOf (10)).intValue ();
- BigInteger unrounded = parts[0].divide (BigInteger.valueOf (10));
-
- if (roundDigit == 0 && parts[1].signum () == 0) // no rounding necessary
+ BigInteger unrounded = parts[0];
+ if (parts[1].signum () == 0) // no remainder, no rounding necessary
return new BigDecimal (unrounded, newScale);
- int sign = unrounded.signum ();
+ if (roundingMode == ROUND_UNNECESSARY)
+ throw new ArithmeticException ("newScale is not large enough");
+
+ int sign = intVal.signum () * valIntVal.signum ();
- switch (roundingMode)
+ if (roundingMode == ROUND_CEILING)
+ roundingMode = (sign > 0) ? ROUND_UP : ROUND_DOWN;
+ else if (roundingMode == ROUND_FLOOR)
+ roundingMode = (sign < 0) ? ROUND_UP : ROUND_DOWN;
+ else
{
- case ROUND_UNNECESSARY:
- throw new ArithmeticException ("newScale is not large enough");
- case ROUND_CEILING:
- roundingMode = (sign == 1) ? ROUND_UP : ROUND_DOWN;
- break;
- case ROUND_FLOOR:
- roundingMode = (sign == 1) ? ROUND_DOWN : ROUND_UP;
- break;
- case ROUND_HALF_UP:
- roundingMode = (roundDigit >= 5) ? ROUND_UP : ROUND_DOWN;
- break;
- case ROUND_HALF_DOWN:
- roundingMode = (roundDigit > 5) ? ROUND_UP : ROUND_DOWN;
- break;
- case ROUND_HALF_EVEN:
- if (roundDigit < 5)
- roundingMode = ROUND_DOWN;
- else
+ // half is -1 if remainder*2 < positive intValue (*power), 0 if equal,
+ // 1 if >. This implies that the remainder to round is less than,
+ // equal to, or greater than half way to the next digit.
+ BigInteger posRemainder
+ = parts[1].signum () < 0 ? parts[1].negate() : parts[1];
+ valIntVal = valIntVal.signum () < 0 ? valIntVal.negate () : valIntVal;
+ int half = posRemainder.shiftLeft(1).compareTo(valIntVal);
+
+ switch(roundingMode)
{
- int rightmost =
- unrounded.mod (BigInteger.valueOf (10)).intValue ();
- if (rightmost % 2 == 1) // odd, then ROUND_HALF_UP
+ case ROUND_HALF_UP:
+ roundingMode = (half < 0) ? ROUND_DOWN : ROUND_UP;
+ break;
+ case ROUND_HALF_DOWN:
+ roundingMode = (half > 0) ? ROUND_UP : ROUND_DOWN;
+ break;
+ case ROUND_HALF_EVEN:
+ if (half < 0)
+ roundingMode = ROUND_DOWN;
+ else if (half > 0)
+ roundingMode = ROUND_UP;
+ else if (unrounded.testBit(0)) // odd, then ROUND_HALF_UP
roundingMode = ROUND_UP;
- else // even, then ROUND_HALF_DOWN
- roundingMode = (roundDigit > 5) ? ROUND_UP : ROUND_DOWN;
+ else // even, ROUND_HALF_DOWN
+ roundingMode = ROUND_DOWN;
+ break;
}
- break;
}
if (roundingMode == ROUND_UP)
- return new BigDecimal (unrounded.add (BigInteger.valueOf (1)), newScale);
+ unrounded = unrounded.add (BigInteger.valueOf (sign > 0 ? 1 : -1));
// roundingMode == ROUND_DOWN
return new BigDecimal (unrounded, newScale);
diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java
index 699319e70b2..3614354f227 100644
--- a/libjava/java/net/ServerSocket.java
+++ b/libjava/java/net/ServerSocket.java
@@ -154,12 +154,6 @@ public class ServerSocket
{
this();
- if (impl == null)
- throw new IOException("Cannot initialize Socket implementation");
-
- // create socket
- impl.create(true);
-
// bind/listen socket
bind (new InetSocketAddress (bindAddr, port), backlog);
}
@@ -208,9 +202,6 @@ public class ServerSocket
if (closed)
throw new SocketException ("ServerSocket is closed");
- if (impl == null)
- throw new IOException ("Cannot initialize Socket implementation");
-
if (! (endpoint instanceof InetSocketAddress))
throw new IllegalArgumentException ("Address type not supported");
@@ -220,45 +211,24 @@ public class ServerSocket
if (s != null)
s.checkListen (tmp.getPort ());
- // bind to address/port
try
{
- impl.bind (tmp.getAddress (), tmp.getPort ());
+ impl.bind (tmp.getAddress (), tmp.getPort ());
+ impl.listen(backlog);
}
catch (IOException exception)
{
- impl.close();
+ close();
throw exception;
}
catch (RuntimeException exception)
{
- impl.close();
+ close();
throw exception;
}
catch (Error error)
{
- impl.close();
- throw error;
- }
-
- // listen on socket
- try
- {
- impl.listen(backlog);
- }
- catch (IOException exception)
- {
- impl.close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- impl.close();
- throw exception;
- }
- catch (Error error)
- {
- impl.close();
+ close();
throw error;
}
}
@@ -320,9 +290,6 @@ public class ServerSocket
*/
public Socket accept () throws IOException
{
- if (impl == null)
- throw new IOException ("Cannot initialize Socket implementation");
-
SecurityManager sm = System.getSecurityManager ();
if (sm != null)
sm.checkListen (impl.getLocalPort ());
@@ -466,9 +433,6 @@ public class ServerSocket
public void setReuseAddress (boolean on)
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
}
@@ -482,9 +446,6 @@ public class ServerSocket
public boolean getReuseAddress()
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
Object reuseaddr = impl.getOption (SocketOptions.SO_REUSEADDR);
if (!(reuseaddr instanceof Boolean))
@@ -508,9 +469,6 @@ public class ServerSocket
public void setReceiveBufferSize (int size)
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Not connected");
-
if (size <= 0)
throw new IllegalArgumentException ("SO_RCVBUF value must be > 0");
@@ -531,9 +489,6 @@ public class ServerSocket
public int getReceiveBufferSize ()
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Not connected");
-
Object buf = impl.getOption (SocketOptions.SO_RCVBUF);
if (!(buf instanceof Integer))
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java
index ef88de5c151..c2615164d39 100644
--- a/libjava/java/net/Socket.java
+++ b/libjava/java/net/Socket.java
@@ -82,8 +82,8 @@ public class Socket
*/
SocketImpl impl;
- private boolean inputShutdown;
- private boolean outputShutdown;
+ private boolean inputShutdown = false;
+ private boolean outputShutdown = false;
SocketChannel ch; // this field must have been set if created by SocketChannel
@@ -103,9 +103,6 @@ public class Socket
impl = factory.createSocketImpl();
else
impl = new PlainSocketImpl();
-
- inputShutdown = false;
- outputShutdown = false;
}
/**
@@ -115,9 +112,8 @@ public class Socket
* <p>
* Additionally, this socket will be created using the supplied
* implementation class instead the default class or one returned by a
- * factory. This value can be <code>null</code>, but if it is, all instance
- * methods in <code>Socket</code> should be overridden because most of them
- * rely on this value being populated.
+ * factory. If this value is <code>null</code>, the default Socket
+ * implementation is used.
*
* @param impl The <code>SocketImpl</code> to use for this
* <code>Socket</code>
@@ -128,9 +124,10 @@ public class Socket
*/
protected Socket (SocketImpl impl) throws SocketException
{
- this.impl = impl;
- this.inputShutdown = false;
- this.outputShutdown = false;
+ if (impl == null)
+ this.impl = new PlainSocketImpl();
+ else
+ this.impl = impl;
}
/**
@@ -282,12 +279,6 @@ public class Socket
{
this();
- if (raddr == null)
- throw new NullPointerException ();
-
- if (impl == null)
- throw new IOException("Cannot initialize Socket implementation");
-
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkConnect(raddr.getHostName(), rport);
@@ -351,17 +342,17 @@ public class Socket
}
catch (IOException exception)
{
- impl.close ();
+ close ();
throw exception;
}
catch (RuntimeException exception)
{
- impl.close ();
+ close ();
throw exception;
}
catch (Error error)
{
- impl.close ();
+ close ();
throw error;
}
}
@@ -420,17 +411,17 @@ public class Socket
}
catch (IOException exception)
{
- impl.close ();
+ close ();
throw exception;
}
catch (RuntimeException exception)
{
- impl.close ();
+ close ();
throw exception;
}
catch (Error error)
{
- impl.close ();
+ close ();
throw error;
}
}
@@ -443,10 +434,7 @@ public class Socket
*/
public InetAddress getInetAddress ()
{
- if (impl != null)
- return impl.getInetAddress();
-
- return null;
+ return impl.getInetAddress();
}
/**
@@ -459,9 +447,6 @@ public class Socket
*/
public InetAddress getLocalAddress ()
{
- if (impl == null)
- return null;
-
InetAddress addr = null;
try
{
@@ -586,9 +571,6 @@ public class Socket
*/
public void setTcpNoDelay (boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
impl.setOption(SocketOptions.TCP_NODELAY, new Boolean(on));
}
@@ -606,9 +588,6 @@ public class Socket
*/
public boolean getTcpNoDelay() throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object on = impl.getOption(SocketOptions.TCP_NODELAY);
if (on instanceof Boolean)
@@ -636,9 +615,6 @@ public class Socket
*/
public void setSoLinger(boolean on, int linger) throws SocketException
{
- if (impl == null)
- throw new SocketException("No socket created");
-
if (on == true)
{
if (linger < 0)
@@ -673,9 +649,6 @@ public class Socket
*/
public int getSoLinger() throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object linger = impl.getOption(SocketOptions.SO_LINGER);
if (linger instanceof Integer)
return(((Integer)linger).intValue());
@@ -709,9 +682,6 @@ public class Socket
*/
public void setOOBInline (boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
impl.setOption(SocketOptions.SO_OOBINLINE, new Boolean(on));
}
@@ -724,9 +694,6 @@ public class Socket
*/
public boolean getOOBInline () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object buf = impl.getOption(SocketOptions.SO_OOBINLINE);
if (buf instanceof Boolean)
@@ -754,9 +721,6 @@ public class Socket
*/
public synchronized void setSoTimeout (int timeout) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
if (timeout < 0)
throw new IllegalArgumentException("SO_TIMEOUT value must be >= 0");
@@ -782,9 +746,6 @@ public class Socket
*/
public synchronized int getSoTimeout () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object timeout = impl.getOption(SocketOptions.SO_TIMEOUT);
if (timeout instanceof Integer)
return(((Integer)timeout).intValue());
@@ -806,9 +767,6 @@ public class Socket
*/
public void setSendBufferSize (int size) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
if (size <= 0)
throw new IllegalArgumentException("SO_SNDBUF value must be > 0");
@@ -828,9 +786,6 @@ public class Socket
*/
public int getSendBufferSize () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object buf = impl.getOption(SocketOptions.SO_SNDBUF);
if (buf instanceof Integer)
@@ -853,9 +808,6 @@ public class Socket
*/
public void setReceiveBufferSize (int size) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
if (size <= 0)
throw new IllegalArgumentException("SO_RCVBUF value must be > 0");
@@ -875,9 +827,6 @@ public class Socket
*/
public int getReceiveBufferSize () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object buf = impl.getOption(SocketOptions.SO_RCVBUF);
if (buf instanceof Integer)
@@ -898,9 +847,6 @@ public class Socket
*/
public void setKeepAlive (boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
impl.setOption(SocketOptions.SO_KEEPALIVE, new Boolean(on));
}
@@ -916,9 +862,6 @@ public class Socket
*/
public boolean getKeepAlive () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object buf = impl.getOption(SocketOptions.SO_KEEPALIVE);
if (buf instanceof Boolean)
@@ -1037,9 +980,6 @@ public class Socket
*/
public boolean getReuseAddress () throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
Object reuseaddr = impl.getOption (SocketOptions.SO_REUSEADDR);
if (!(reuseaddr instanceof Boolean))
@@ -1057,9 +997,6 @@ public class Socket
*/
public void setReuseAddress (boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
}
@@ -1074,9 +1011,6 @@ public class Socket
*/
public int getTrafficClass () throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
Object obj = impl.getOption(SocketOptions.IP_TOS);
if (obj instanceof Integer)
@@ -1099,9 +1033,6 @@ public class Socket
*/
public void setTrafficClass (int tc) throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
if (tc < 0 || tc > 255)
throw new IllegalArgumentException();
diff --git a/libjava/java/net/SocketImpl.java b/libjava/java/net/SocketImpl.java
index 14101513e09..e43b49ed599 100644
--- a/libjava/java/net/SocketImpl.java
+++ b/libjava/java/net/SocketImpl.java
@@ -276,7 +276,8 @@ public abstract class SocketImpl implements SocketOptions
*/
public String toString()
{
- return "[addr=" + address
+ return "[addr=" + ((address == null) ? "0.0.0.0/0.0.0.0" :
+ address.toString())
+ ",port=" + port
+ ",localport=" + localport + "]";
}
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index fa6f660ffb7..2db8c4dd1cd 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -98,6 +98,14 @@ import java.util.StringTokenizer;
* <p>
* Please note that a protocol handler must be a subclass of
* URLStreamHandler.
+ * <p>
+ * Normally, this class caches protocol handlers. Once it finds a handler
+ * for a particular protocol, it never tries to look up a new handler
+ * again. However, if the system property
+ * gnu.java.net.nocache_protocol_handlers is set, then this
+ * caching behavior is disabled. This property is specific to this
+ * implementation. Sun's JDK may or may not do protocol caching, but it
+ * almost certainly does not examine this property.
*
* @author Aaron M. Renn <arenn@urbanophile.com>
* @author Warren Levy <warrenl@cygnus.com>
@@ -150,18 +158,32 @@ public final class URL implements Serializable
transient URLStreamHandler ph;
/**
+ * If an application installs its own protocol handler factory, this is
+ * where we keep track of it.
+ */
+ private static URLStreamHandlerFactory factory;
+
+ private static final long serialVersionUID = -7627629688361524110L;
+
+ /**
* This a table where we cache protocol handlers to avoid the overhead
* of looking them up each time.
*/
- private static Hashtable handlers = new Hashtable();
+ private static Hashtable ph_cache = new Hashtable();
/**
- * If an application installs its own protocol handler factory, this is
- * where we keep track of it.
+ * Whether or not to cache protocol handlers.
*/
- private static URLStreamHandlerFactory factory;
+ private static boolean cache_handlers;
- private static final long serialVersionUID = -7627629688361524110L;
+ static
+ {
+ String s = System.getProperty("gnu.java.net.nocache_protocol_handlers");
+ if (s == null)
+ cache_handlers = true;
+ else
+ cache_handlers = false;
+ }
/**
* Constructs a URL and loads a protocol handler for the values passed as
@@ -732,12 +754,14 @@ public final class URL implements Serializable
URLStreamHandler ph;
// See if a handler has been cached for this protocol.
- if ((ph = (URLStreamHandler) handlers.get(protocol)) != null)
+ if ((ph = (URLStreamHandler) ph_cache.get(protocol)) != null)
return ph;
// If a non-default factory has been set, use it to find the protocol.
if (factory != null)
- ph = factory.createURLStreamHandler(protocol);
+ {
+ ph = factory.createURLStreamHandler(protocol);
+ }
else if (protocol.equals ("core"))
{
ph = new gnu.gcj.protocol.core.Handler ();
@@ -788,9 +812,10 @@ public final class URL implements Serializable
}
// Update the hashtable with the new protocol handler.
- if (ph != null)
+ if (ph != null
+ && cache_handlers)
if (ph instanceof URLStreamHandler)
- handlers.put(protocol, ph);
+ ph_cache.put(protocol, ph);
else
ph = null;
diff --git a/libjava/java/net/URLEncoder.java b/libjava/java/net/URLEncoder.java
index f03b8a1d8f8..24d0d25b6d8 100644
--- a/libjava/java/net/URLEncoder.java
+++ b/libjava/java/net/URLEncoder.java
@@ -1,5 +1,5 @@
/* URLEncoder.java -- Class to convert strings to a properly encoded URL
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,8 @@ import java.io.UnsupportedEncodingException;
* US alphabet remain as is, the space character (' ') is replaced with
* '+' sign, and all other characters are converted to a "%XX" format
* where XX is the hexadecimal representation of that character in a
- * certain encoding (by default "UTF-8").
+ * certain encoding (by default, the platform encoding, though the
+ * standard is "UTF-8").
* <p>
* This method is very useful for encoding strings to be sent to CGI scripts
*
@@ -65,8 +66,9 @@ public class URLEncoder
{
/**
* This method translates the passed in string into x-www-form-urlencoded
- * format using the standard "UTF-8" character encoding to hex-encode the
- * unsafe characters.
+ * format using the default encoding. The standard encoding is
+ * "UTF-8", and the two-argument form of this method should be used
+ * instead.
*
* @param s The String to convert
*
@@ -78,11 +80,13 @@ public class URLEncoder
{
try
{
- return encode(s, "UTF-8");
+ // We default to 8859_1 for compatibility with the same
+ // default elsewhere in the library.
+ return encode(s, System.getProperty("file.encoding", "8859_1"));
}
catch (UnsupportedEncodingException uee)
{
- // Should never happen since UTF-8 should always be supported
+ // Should never happen since default should always be supported
return s;
}
}
@@ -139,7 +143,9 @@ public class URLEncoder
for (int j = 0; j < bytes.length; j++)
{
result.append('%');
- result.append(Integer.toHexString(((int) bytes[j]) & 0xFF));
+ int val = bytes[j];
+ result.append(hex.charAt((val & 0xf0) >> 4));
+ result.append(hex.charAt(val & 0x0f));
}
}
start = i;
@@ -166,4 +172,11 @@ public class URLEncoder
*/
private URLEncoder() { }
+ /**
+ * Used to convert to hex. We don't use Integer.toHexString, since
+ * it converts to lower case (and the Sun docs pretty clearly
+ * specify upper case here), and because it doesn't provide a
+ * leading 0.
+ */
+ private static final String hex = "0123456789ABCDEF";
} // class URLEncoder
diff --git a/libjava/java/net/natPlainSocketImplPosix.cc b/libjava/java/net/natPlainSocketImplPosix.cc
index 65feac87324..f2a71b68a02 100644
--- a/libjava/java/net/natPlainSocketImplPosix.cc
+++ b/libjava/java/net/natPlainSocketImplPosix.cc
@@ -174,19 +174,21 @@ java::net::PlainSocketImpl::connect (java::net::SocketAddress *addr,
if ((_Jv_connect (fnum, ptr, len) != 0) && (errno != EINPROGRESS))
goto error;
- fd_set rset;
+ fd_set fset;
struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
+ FD_ZERO(&fset);
+ FD_SET(fnum, &fset);
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
int retval;
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
+ if ((retval = _Jv_select (fnum + 1, &fset, &fset, NULL, &tv)) < 0)
goto error;
else if (retval == 0)
throw new java::net::SocketTimeoutException
(JvNewStringUTF ("Connect timed out"));
+ // Set the socket back into a blocking state.
+ ::fcntl (fnum, F_SETFL, flags);
}
else
{
@@ -233,17 +235,17 @@ java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *s)
// Do timeouts via select since SO_RCVTIMEO is not always available.
if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
{
- fd_set rset;
+ fd_set fset;
struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
+ FD_ZERO(&fset);
+ FD_SET(fnum, &fset);
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
int retval;
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
+ if ((retval = _Jv_select (fnum + 1, &fset, &fset, NULL, &tv)) < 0)
goto error;
else if (retval == 0)
- throw new java::io::InterruptedIOException (
+ throw new java::net::SocketTimeoutException (
JvNewStringUTF("Accept timed out"));
}
@@ -402,7 +404,7 @@ java::net::PlainSocketImpl::read(void)
// If select returns 0 we've waited without getting data...
// that means we've timed out.
if (sel_retval == 0)
- throw new java::io::InterruptedIOException
+ throw new java::net::SocketTimeoutException
(JvNewStringUTF ("read timed out") );
// If select returns ok we know we either got signalled or read some data...
// either way we need to try to read.
@@ -467,11 +469,10 @@ java::net::PlainSocketImpl::read(jbyteArray buffer, jint offset, jint count)
// the socket to see what happened.
if (sel_retval == 0)
{
- java::io::InterruptedIOException *iioe =
- new java::io::InterruptedIOException
- (JvNewStringUTF ("read interrupted"));
- iioe->bytesTransferred = 0;
- throw iioe;
+ java::net::SocketTimeoutException *timeoutException =
+ new java::net::SocketTimeoutException
+ (JvNewStringUTF ("read timed out"));
+ throw timeoutException;
}
}
diff --git a/libjava/java/nio/ByteBufferImpl.java b/libjava/java/nio/ByteBufferImpl.java
index 37db881fa4c..7ea3a3a0e6d 100644
--- a/libjava/java/nio/ByteBufferImpl.java
+++ b/libjava/java/nio/ByteBufferImpl.java
@@ -182,13 +182,20 @@ final class ByteBufferImpl extends ByteBuffer
final public char getChar ()
{
- // FIXME: this handles big endian only
- return (char) (((get () & 0xff) << 8) + (get () & 0xff));
+ if (remaining() < 2)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
+ return (char) (((get () & 0xff) << 8)
+ + (get () & 0xff));
}
final public ByteBuffer putChar (char value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff00) >> 8));
put ((byte) (((int) value) & 0x00ff));
return this;
@@ -196,13 +203,18 @@ final class ByteBufferImpl extends ByteBuffer
final public char getChar (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (char) (((get (index) & 0xff) << 8) + (get (index + 1) & 0xff));
}
final public ByteBuffer putChar (int index, char value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferOverflowException();
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff00) >> 8));
put (index + 1, (byte) (((int) value) & 0x00ff));
return this;
@@ -210,13 +222,19 @@ final class ByteBufferImpl extends ByteBuffer
final public short getShort ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (short) (((get () & 0xff) << 8) + (get () & 0xff));
}
final public ByteBuffer putShort (short value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff00) >> 8));
put ((byte) (((int) value) & 0x00ff));
return this;
@@ -224,13 +242,19 @@ final class ByteBufferImpl extends ByteBuffer
final public short getShort (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (short) (((get (index) & 0xff) << 8) + (get (index + 1) & 0xff));
}
final public ByteBuffer putShort (int index, short value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff00) >> 8));
put (index + 1, (byte) (((int) value) & 0x00ff));
return this;
@@ -238,58 +262,76 @@ final class ByteBufferImpl extends ByteBuffer
final public int getInt ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (int) (((get () & 0xff) << 24)
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putInt (int value)
{
- // FIXME: this handles big endian only
- put ((byte) ((((int) value) & 0xff000000) >> 24));
- put ((byte) ((((int) value) & 0x00ff0000) >> 16));
- put ((byte) ((((int) value) & 0x0000ff00) >> 8));
- put ((byte) (((int) value) & 0x000000ff));
+ if (remaining() < 4)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
+ put ((byte) ((value & 0xff000000) >> 24));
+ put ((byte) ((value & 0x00ff0000) >> 16));
+ put ((byte) ((value & 0x0000ff00) >> 8));
+ put ((byte) (value & 0x000000ff));
return this;
}
final public int getInt (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (int) (((get (index) & 0xff) << 24)
- + (get (index + 1) & 0xff) << 16
- + (get (index + 2) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 16)
+ + ((get (index + 2) & 0xff) << 8)
+ (get (index + 3) & 0xff));
}
final public ByteBuffer putInt (int index, int value)
{
- // FIXME: this handles big endian only
- put (index, (byte) ((((int) value) & 0xff000000) >> 24));
- put (index + 1, (byte) ((((int) value) & 0x00ff0000) >> 16));
- put (index + 2, (byte) ((((int) value) & 0x0000ff00) >> 8));
- put (index + 3, (byte) (((int) value) & 0x000000ff));
+ if (remaining() < 4)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
+ put (index, (byte) ((value & 0xff000000) >> 24));
+ put (index + 1, (byte) ((value & 0x00ff0000) >> 16));
+ put (index + 2, (byte) ((value & 0x0000ff00) >> 8));
+ put (index + 3, (byte) (value & 0x000000ff));
return this;
}
final public long getLong ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (long) (((get () & 0xff) << 56)
- + (get () & 0xff) << 48
- + (get () & 0xff) << 40
- + (get () & 0xff) << 32
- + (get () & 0xff) << 24
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 48)
+ + ((get () & 0xff) << 40)
+ + ((get () & 0xff) << 32)
+ + ((get () & 0xff) << 24)
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putLong (long value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((value & 0xff00000000000000L) >> 56));
put ((byte) ((value & 0x00ff000000000000L) >> 48));
put ((byte) ((value & 0x0000ff0000000000L) >> 40));
@@ -303,20 +345,26 @@ final class ByteBufferImpl extends ByteBuffer
final public long getLong (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (long) (((get (index) & 0xff) << 56)
- + (get (index + 1) & 0xff) << 48
- + (get (index + 2) & 0xff) << 40
- + (get (index + 3) & 0xff) << 32
- + (get (index + 4) & 0xff) << 24
- + (get (index + 5) & 0xff) << 16
- + (get (index + 6) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 48)
+ + ((get (index + 2) & 0xff) << 40)
+ + ((get (index + 3) & 0xff) << 32)
+ + ((get (index + 4) & 0xff) << 24)
+ + ((get (index + 5) & 0xff) << 16)
+ + ((get (index + 6) & 0xff) << 8)
+ (get (index + 7) & 0xff));
}
final public ByteBuffer putLong (int index, long value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put (index, (byte) ((value & 0xff00000000000000L) >> 56));
put (index + 1, (byte) ((value & 0x00ff000000000000L) >> 48));
put (index + 2, (byte) ((value & 0x0000ff0000000000L) >> 40));
@@ -330,16 +378,22 @@ final class ByteBufferImpl extends ByteBuffer
final public float getFloat ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (float) (((get () & 0xff) << 24)
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putFloat (float value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff000000) >> 24));
put ((byte) ((((int) value) & 0x00ff0000) >> 16));
put ((byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -349,16 +403,22 @@ final class ByteBufferImpl extends ByteBuffer
final public float getFloat (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (float) (((get (index) & 0xff) << 24)
- + (get (index + 1) & 0xff) << 16
- + (get (index + 2) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 16)
+ + ((get (index + 2) & 0xff) << 8)
+ (get (index + 3) & 0xff));
}
final public ByteBuffer putFloat (int index, float value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff000000) >> 24));
put (index + 1, (byte) ((((int) value) & 0x00ff0000) >> 16));
put (index + 2, (byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -368,20 +428,26 @@ final class ByteBufferImpl extends ByteBuffer
final public double getDouble ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (double) (((get () & 0xff) << 56)
- + (get () & 0xff) << 48
- + (get () & 0xff) << 40
- + (get () & 0xff) << 32
- + (get () & 0xff) << 24
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 48)
+ + ((get () & 0xff) << 40)
+ + ((get () & 0xff) << 32)
+ + ((get () & 0xff) << 24)
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putDouble (double value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((((long) value) & 0xff00000000000000L) >> 56));
put ((byte) ((((long) value) & 0x00ff000000000000L) >> 48));
put ((byte) ((((long) value) & 0x0000ff0000000000L) >> 40));
@@ -395,20 +461,26 @@ final class ByteBufferImpl extends ByteBuffer
final public double getDouble (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (double) (((get (index) & 0xff) << 56)
- + (get (index + 1) & 0xff) << 48
- + (get (index + 2) & 0xff) << 40
- + (get (index + 3) & 0xff) << 32
- + (get (index + 4) & 0xff) << 24
- + (get (index + 5) & 0xff) << 16
- + (get (index + 6) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 48)
+ + ((get (index + 2) & 0xff) << 40)
+ + ((get (index + 3) & 0xff) << 32)
+ + ((get (index + 4) & 0xff) << 24)
+ + ((get (index + 5) & 0xff) << 16)
+ + ((get (index + 6) & 0xff) << 8)
+ (get (index + 7) & 0xff));
}
final public ByteBuffer putDouble (int index, double value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put (index, (byte) ((((long) value) & 0xff00000000000000L) >> 56));
put (index + 1, (byte) ((((long) value) & 0x00ff000000000000L) >> 48));
put (index + 2, (byte) ((((long) value) & 0x0000ff0000000000L) >> 40));
diff --git a/libjava/java/nio/DirectByteBufferImpl.java b/libjava/java/nio/DirectByteBufferImpl.java
index 352016372f7..cdeafef6dfd 100644
--- a/libjava/java/nio/DirectByteBufferImpl.java
+++ b/libjava/java/nio/DirectByteBufferImpl.java
@@ -181,13 +181,14 @@ class DirectByteBufferImpl extends ByteBuffer
final public char getChar ()
{
- // FIXME: this handles big endian only
- return (char) (((get () & 0xff) << 8) + (get () & 0xff));
+ // FIXME: this handles little endian only
+ return (char) (((get () & 0xff) << 8)
+ + (get () & 0xff));
}
final public ByteBuffer putChar (char value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff00) >> 8));
put ((byte) (((int) value) & 0x00ff));
return this;
@@ -195,13 +196,14 @@ class DirectByteBufferImpl extends ByteBuffer
final public char getChar (int index)
{
- // FIXME: this handles big endian only
- return (char) (((get (index) & 0xff) << 8) + (get (index + 1) & 0xff));
+ // FIXME: this handles little endian only
+ return (char) (((get (index) & 0xff) << 8)
+ + (get (index + 1) & 0xff));
}
final public ByteBuffer putChar (int index, char value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff00) >> 8));
put (index + 1, (byte) (((int) value) & 0x00ff));
return this;
@@ -209,13 +211,14 @@ class DirectByteBufferImpl extends ByteBuffer
final public short getShort ()
{
- // FIXME: this handles big endian only
- return (short) (((get () & 0xff) << 8) + (get () & 0xff));
+ // FIXME: this handles little endian only
+ return (short) (((get () & 0xff) << 8)
+ + (get () & 0xff));
}
final public ByteBuffer putShort (short value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff00) >> 8));
put ((byte) (((int) value) & 0x00ff));
return this;
@@ -223,13 +226,14 @@ class DirectByteBufferImpl extends ByteBuffer
final public short getShort (int index)
{
- // FIXME: this handles big endian only
- return (short) (((get (index) & 0xff) << 8) + (get (index + 1) & 0xff));
+ // FIXME: this handles little endian only
+ return (short) (((get (index) & 0xff) << 8)
+ + (get (index + 1) & 0xff));
}
final public ByteBuffer putShort (int index, short value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff00) >> 8));
put (index + 1, (byte) (((int) value) & 0x00ff));
return this;
@@ -237,16 +241,16 @@ class DirectByteBufferImpl extends ByteBuffer
final public int getInt ()
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (int) (((get () & 0xff) << 24)
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putInt (int value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff000000) >> 24));
put ((byte) ((((int) value) & 0x00ff0000) >> 16));
put ((byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -256,16 +260,16 @@ class DirectByteBufferImpl extends ByteBuffer
final public int getInt (int index)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (int) (((get (index) & 0xff) << 24)
- + (get (index + 1) & 0xff) << 16
- + (get (index + 2) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 16)
+ + ((get (index + 2) & 0xff) << 8)
+ (get (index + 3) & 0xff));
}
final public ByteBuffer putInt (int index, int value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff000000) >> 24));
put (index + 1, (byte) ((((int) value) & 0x00ff0000) >> 16));
put (index + 2, (byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -275,20 +279,20 @@ class DirectByteBufferImpl extends ByteBuffer
final public long getLong ()
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (long) (((get () & 0xff) << 56)
- + (get () & 0xff) << 48
- + (get () & 0xff) << 40
- + (get () & 0xff) << 32
- + (get () & 0xff) << 24
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 48)
+ + ((get () & 0xff) << 40)
+ + ((get () & 0xff) << 32)
+ + ((get () & 0xff) << 24)
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putLong (long value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((value & 0xff00000000000000L) >> 56));
put ((byte) ((value & 0x00ff000000000000L) >> 48));
put ((byte) ((value & 0x0000ff0000000000L) >> 40));
@@ -302,20 +306,20 @@ class DirectByteBufferImpl extends ByteBuffer
final public long getLong (int index)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (long) (((get (index) & 0xff) << 56)
- + (get (index + 1) & 0xff) << 48
- + (get (index + 2) & 0xff) << 40
- + (get (index + 3) & 0xff) << 32
- + (get (index + 4) & 0xff) << 24
- + (get (index + 5) & 0xff) << 16
- + (get (index + 6) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 48)
+ + ((get (index + 2) & 0xff) << 40)
+ + ((get (index + 3) & 0xff) << 32)
+ + ((get (index + 4) & 0xff) << 24)
+ + ((get (index + 5) & 0xff) << 16)
+ + ((get (index + 6) & 0xff) << 8)
+ (get (index + 7) & 0xff));
}
final public ByteBuffer putLong (int index, long value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((value & 0xff00000000000000L) >> 56));
put (index + 1, (byte) ((value & 0x00ff000000000000L) >> 48));
put (index + 2, (byte) ((value & 0x0000ff0000000000L) >> 40));
@@ -329,16 +333,16 @@ class DirectByteBufferImpl extends ByteBuffer
final public float getFloat ()
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (float) (((get () & 0xff) << 24)
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putFloat (float value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff000000) >> 24));
put ((byte) ((((int) value) & 0x00ff0000) >> 16));
put ((byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -348,16 +352,16 @@ class DirectByteBufferImpl extends ByteBuffer
final public float getFloat (int index)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (float) (((get (index) & 0xff) << 24)
- + (get (index + 1) & 0xff) << 16
- + (get (index + 2) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 16)
+ + ((get (index + 2) & 0xff) << 8)
+ (get (index + 3) & 0xff));
}
final public ByteBuffer putFloat (int index, float value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff000000) >> 24));
put (index + 1, (byte) ((((int) value) & 0x00ff0000) >> 16));
put (index + 2, (byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -367,20 +371,20 @@ class DirectByteBufferImpl extends ByteBuffer
final public double getDouble ()
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (double) (((get () & 0xff) << 56)
- + (get () & 0xff) << 48
- + (get () & 0xff) << 40
- + (get () & 0xff) << 32
- + (get () & 0xff) << 24
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 48)
+ + ((get () & 0xff) << 40)
+ + ((get () & 0xff) << 32)
+ + ((get () & 0xff) << 24)
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putDouble (double value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((long) value) & 0xff00000000000000L) >> 56));
put ((byte) ((((long) value) & 0x00ff000000000000L) >> 48));
put ((byte) ((((long) value) & 0x0000ff0000000000L) >> 40));
@@ -394,20 +398,20 @@ class DirectByteBufferImpl extends ByteBuffer
final public double getDouble (int index)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (double) (((get (index) & 0xff) << 56)
- + (get (index + 1) & 0xff) << 48
- + (get (index + 2) & 0xff) << 40
- + (get (index + 3) & 0xff) << 32
- + (get (index + 4) & 0xff) << 24
- + (get (index + 5) & 0xff) << 16
- + (get (index + 6) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 48)
+ + ((get (index + 2) & 0xff) << 40)
+ + ((get (index + 3) & 0xff) << 32)
+ + ((get (index + 4) & 0xff) << 24)
+ + ((get (index + 5) & 0xff) << 16)
+ + ((get (index + 6) & 0xff) << 8)
+ (get (index + 7) & 0xff));
}
final public ByteBuffer putDouble (int index, double value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((long) value) & 0xff00000000000000L) >> 56));
put (index + 1, (byte) ((((long) value) & 0x00ff000000000000L) >> 48));
put (index + 2, (byte) ((((long) value) & 0x0000ff0000000000L) >> 40));
diff --git a/libjava/java/nio/MappedByteBufferImpl.java b/libjava/java/nio/MappedByteBufferImpl.java
index f28f1137535..c5b460e4900 100644
--- a/libjava/java/nio/MappedByteBufferImpl.java
+++ b/libjava/java/nio/MappedByteBufferImpl.java
@@ -102,7 +102,16 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer compact ()
{
- throw new Error ("Not implemented");
+ int copied = 0;
+
+ while (remaining () > 0)
+ {
+ put (copied, get ());
+ copied++;
+ }
+
+ position (copied);
+ return this;
}
public boolean isDirect ()
@@ -157,7 +166,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public char getChar ()
{
- throw new Error ("Not implemented");
+ char value = getChar (position());
+ position (position() + 2);
+ return value;
}
public char getChar (int index)
@@ -167,7 +178,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putChar (char value)
{
- throw new Error ("Not implemented");
+ putChar (position(), value);
+ position (position() + 2);
+ return this;
}
public ByteBuffer putChar (int index, char value)
@@ -177,7 +190,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public double getDouble ()
{
- throw new Error ("Not implemented");
+ double value = getDouble (position());
+ position (position() + 8);
+ return value;
}
public double getDouble (int index)
@@ -187,7 +202,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putDouble (double value)
{
- throw new Error ("Not implemented");
+ putDouble (position(), value);
+ position (position() + 8);
+ return this;
}
public ByteBuffer putDouble (int index, double value)
@@ -197,7 +214,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public float getFloat ()
{
- throw new Error ("Not implemented");
+ float value = getFloat (position ());
+ position (position() + 4);
+ return value;
}
public float getFloat (int index)
@@ -207,7 +226,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putFloat (float value)
{
- throw new Error ("Not implemented");
+ putFloat (position(), value);
+ position (position() + 4);
+ return this;
}
public ByteBuffer putFloat (int index, float value)
@@ -217,7 +238,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public int getInt ()
{
- throw new Error ("Not implemented");
+ int value = getInt (position());
+ position (position() + 8);
+ return value;
}
public int getInt (int index)
@@ -227,7 +250,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putInt (int value)
{
- throw new Error ("Not implemented");
+ putInt (position(), value);
+ position (position() + 4);
+ return this;
}
public ByteBuffer putInt (int index, int value)
@@ -237,7 +262,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public long getLong ()
{
- throw new Error ("Not implemented");
+ long value = getLong (position());
+ position (position() + 8);
+ return value;
}
public long getLong (int index)
@@ -247,7 +274,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putLong (long value)
{
- throw new Error ("Not implemented");
+ putLong (position(), value);
+ position (position() + 8);
+ return this;
}
public ByteBuffer putLong (int index, long value)
@@ -257,7 +286,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public short getShort ()
{
- throw new Error ("Not implemented");
+ short value = getShort (position());
+ position (position() + 2);
+ return value;
}
public short getShort (int index)
@@ -267,7 +298,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putShort (short value)
{
- throw new Error ("Not implemented");
+ putShort (position(), value);
+ position (position() + 2);
+ return this;
}
public ByteBuffer putShort (int index, short value)
diff --git a/libjava/java/nio/channels/FileChannelImpl.java b/libjava/java/nio/channels/FileChannelImpl.java
index 9d610551a37..85113a0287b 100644
--- a/libjava/java/nio/channels/FileChannelImpl.java
+++ b/libjava/java/nio/channels/FileChannelImpl.java
@@ -146,6 +146,7 @@ public class FileChannelImpl extends FileChannel
long oldPosition;
oldPosition = implPosition ();
+ position (position);
result = implRead (dst);
implPosition (oldPosition);
@@ -208,6 +209,7 @@ public class FileChannelImpl extends FileChannel
long oldPosition;
oldPosition = implPosition ();
+ position (position);
result = implWrite (src);
implPosition (oldPosition);
@@ -298,6 +300,7 @@ public class FileChannelImpl extends FileChannel
// XXX: count needs to be casted from long to int. Dataloss ?
ByteBuffer buffer = ByteBuffer.allocate ((int) count);
read (buffer, position);
+ buffer.flip();
return target.write (buffer);
}
@@ -317,6 +320,7 @@ public class FileChannelImpl extends FileChannel
// XXX: count needs to be casted from long to int. Dataloss ?
ByteBuffer buffer = ByteBuffer.allocate ((int) count);
src.read (buffer);
+ buffer.flip();
return write (buffer, position);
}
diff --git a/libjava/java/text/DecimalFormat.java b/libjava/java/text/DecimalFormat.java
index 7f946173fee..0cf2d8fff3b 100644
--- a/libjava/java/text/DecimalFormat.java
+++ b/libjava/java/text/DecimalFormat.java
@@ -474,7 +474,7 @@ public class DecimalFormat extends NumberFormat
intPart = Math.floor(intPart / 10);
// Append group separator if required.
- if (groupingUsed && count > 0 && count % groupingSize == 0)
+ if (groupingUsed && count > 0 && groupingSize != 0 && count % groupingSize == 0)
dest.insert(index, symbols.getGroupingSeparator());
dest.insert(index, (char) (symbols.getZeroDigit() + dig));
@@ -602,7 +602,7 @@ public class DecimalFormat extends NumberFormat
}
// Append group separator if required.
- if (groupingUsed && count > 0 && count % groupingSize == 0)
+ if (groupingUsed && count > 0 && groupingSize != 0 && count % groupingSize == 0)
dest.insert(index, symbols.getGroupingSeparator());
dest.insert(index, (char) (symbols.getZeroDigit() + dig));
@@ -748,7 +748,8 @@ public class DecimalFormat extends NumberFormat
// FIXME: what about grouping size?
if (groupingUsed && c == symbols.getGroupingSeparator())
{
- if (last_group != -1
+ if (last_group != -1
+ && groupingSize != 0
&& (index - last_group) % groupingSize != 0)
{
pos.setErrorIndex(index);
@@ -765,7 +766,8 @@ public class DecimalFormat extends NumberFormat
break;
else if (c == symbols.getDecimalSeparator())
{
- if (last_group != -1
+ if (last_group != -1
+ && groupingSize != 0
&& (index - last_group) % groupingSize != 0)
{
pos.setErrorIndex(index);
diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java
index 67523e1628d..b43c6cd86d4 100644
--- a/libjava/java/text/SimpleDateFormat.java
+++ b/libjava/java/text/SimpleDateFormat.java
@@ -430,11 +430,15 @@ public class SimpleDateFormat extends DateFormat
buffer.append(formatData.eras[calendar.get(Calendar.ERA)]);
break;
case YEAR_FIELD:
- temp = String.valueOf(calendar.get(Calendar.YEAR));
- if (p.size < 4)
- buffer.append(temp.substring(temp.length()-2));
+ // If we have two digits, then we truncate. Otherwise, we
+ // use the size of the pattern, and zero pad.
+ if (p.size == 2)
+ {
+ temp = String.valueOf(calendar.get(Calendar.YEAR));
+ buffer.append(temp.substring(temp.length() - 2));
+ }
else
- buffer.append(temp);
+ withLeadingZeros(calendar.get(Calendar.YEAR), p.size, buffer);
break;
case MONTH_FIELD:
if (p.size < 3)
diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java
index 9faca0339d1..6b3466ca15d 100644
--- a/libjava/java/util/HashMap.java
+++ b/libjava/java/util/HashMap.java
@@ -1,6 +1,6 @@
/* HashMap.java -- a class providing a basic hashtable data structure,
mapping Object --> Object
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -808,6 +808,7 @@ public class HashMap extends AbstractMap
// Read and use capacity, followed by key/value pairs.
buckets = new HashEntry[s.readInt()];
int len = s.readInt();
+ size = len;
while (len-- > 0)
{
Object key = s.readObject();
diff --git a/libjava/java/util/WeakHashMap.java b/libjava/java/util/WeakHashMap.java
index 3431ac921e1..4cce821c5ff 100644
--- a/libjava/java/util/WeakHashMap.java
+++ b/libjava/java/util/WeakHashMap.java
@@ -1,6 +1,6 @@
/* WeakHashMap -- a hashtable that keeps only weak references
to its keys, allowing the virtual machine to reclaim them
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -544,6 +544,8 @@ public class WeakHashMap extends AbstractMap implements Map
// Check loadFactor for NaN as well.
if (initialCapacity < 0 || ! (loadFactor > 0))
throw new IllegalArgumentException();
+ if (initialCapacity == 0)
+ initialCapacity = 1;
this.loadFactor = loadFactor;
threshold = (int) (initialCapacity * loadFactor);
theEntrySet = new WeakEntrySet();
diff --git a/libjava/javax/swing/border/BevelBorder.java b/libjava/javax/swing/border/BevelBorder.java
index 87bf04a0c61..dd5a52b0184 100644
--- a/libjava/javax/swing/border/BevelBorder.java
+++ b/libjava/javax/swing/border/BevelBorder.java
@@ -125,7 +125,7 @@ public class BevelBorder
* constructed by this method will automatically reflect a change
* to the component&#x2019;s background color.
*
- * <p><img src="BevelBorder-1.png" width="500" height="150"
+ * <p><img src="doc-files/BevelBorder-1.png" width="500" height="150"
* alt="[An illustration showing raised and lowered BevelBorders]" />
*
* @param bevelType the desired appearance of the border. The value
@@ -147,7 +147,7 @@ public class BevelBorder
* Constructs a BevelBorder given its appearance type and two colors
* for its highlight and shadow.
*
- * <p><img src="BevelBorder-2.png" width="500" height="150"
+ * <p><img src="doc-files/BevelBorder-2.png" width="500" height="150"
* alt="[An illustration showing BevelBorders that were constructed
* with this method]" />
*
@@ -188,7 +188,7 @@ public class BevelBorder
* Constructs a BevelBorder given its appearance type and all
* colors.
*
- * <p><img src="BevelBorder-3.png" width="500" height="150"
+ * <p><img src="doc-files/BevelBorder-3.png" width="500" height="150"
* alt="[An illustration showing BevelBorders that were constructed
* with this method]" />
*
diff --git a/libjava/javax/swing/border/EtchedBorder.java b/libjava/javax/swing/border/EtchedBorder.java
index bb16ae925b1..859e5f832fd 100644
--- a/libjava/javax/swing/border/EtchedBorder.java
+++ b/libjava/javax/swing/border/EtchedBorder.java
@@ -51,7 +51,7 @@ import java.awt.Insets;
* explicitly specify the border colors, or to let the colors derive
* from the background color of the enclosed Component.
*
- * <p><img src="EtchedBorder-1.png" width="500" height="200"
+ * <p><img src="doc-files/EtchedBorder-1.png" width="500" height="200"
* alt="[An illustration of the two EtchedBorder variants]" />
*
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -119,7 +119,7 @@ public class EtchedBorder
* colors will be derived from the background color of the enclosed
* Component when the border gets painted.
*
- * <p><img src="EtchedBorder-1.png" width="500" height="200"
+ * <p><img src="doc-files/EtchedBorder-1.png" width="500" height="200"
* alt="[An illustration of the two EtchedBorder variants]" />
*
* @param etchType the desired appearance of the border. The value
@@ -165,7 +165,7 @@ public class EtchedBorder
* explicitly selecting the colors that will be used for
* highlight and shadow.
*
- * <p><img src="EtchedBorder-2.png" width="500" height="200"
+ * <p><img src="doc-files/EtchedBorder-2.png" width="500" height="200"
* alt="[An illustration that shows which pixels get painted
* in what color]" />
*
diff --git a/libjava/javax/swing/border/LineBorder.java b/libjava/javax/swing/border/LineBorder.java
index 3c85c29dfdb..bf42309a27b 100644
--- a/libjava/javax/swing/border/LineBorder.java
+++ b/libjava/javax/swing/border/LineBorder.java
@@ -128,7 +128,7 @@ public class LineBorder
* Constructs a LineBorder given its color, thickness, and whether
* it has rounded corners.
*
- * <p><img src="LineBorder-1.png" width="500" height="200"
+ * <p><img src="doc-files/LineBorder-1.png" width="500" height="200"
* alt="[An illustration of two LineBorders] />
*
* <p>Note that the enlarged view in the right-hand picture shows
diff --git a/libjava/javax/swing/border/MatteBorder.java b/libjava/javax/swing/border/MatteBorder.java
index 1cc66f70a1f..e7b0f62e465 100644
--- a/libjava/javax/swing/border/MatteBorder.java
+++ b/libjava/javax/swing/border/MatteBorder.java
@@ -49,7 +49,7 @@ import javax.swing.Icon;
* A border that is filled with either a solid color or with repeated
* icon tiles.
*
- * <p><img src="MatteBorder-1.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-1.png" width="500" height="150"
* alt="[Two MatteBorders]" />
*
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -88,7 +88,7 @@ public class MatteBorder
* Constructs a MatteBorder given the width on each side
* and a fill color.
*
- * <p><img src="MatteBorder-2.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-2.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param top the width of the border at its top edge.
@@ -112,7 +112,7 @@ public class MatteBorder
/**
* Constructs a MatteBorder given its insets and fill color.
*
- * <p><img src="MatteBorder-3.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-3.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param borderInsets an Insets object whose <code>top</code>,
@@ -134,7 +134,7 @@ public class MatteBorder
* Constructs a MatteBorder given the width on each side
* and an icon for tiling the border area.
*
- * <p><img src="MatteBorder-4.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-4.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param top the width of the border at its top edge.
@@ -159,7 +159,7 @@ public class MatteBorder
* Constructs a MatteBorder given its insets and an icon
* for tiling the border area.
*
- * <p><img src="MatteBorder-5.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-5.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param borderInsets an Insets object whose <code>top</code>,
@@ -183,7 +183,7 @@ public class MatteBorder
* at the left and right edge, the icon height for the top and
* bottom edge.
*
- * <p><img src="MatteBorder-6.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-6.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param tileIcon an icon for tiling the border area.
diff --git a/libjava/javax/swing/border/SoftBevelBorder.java b/libjava/javax/swing/border/SoftBevelBorder.java
index c08fb00d259..341954c3c9f 100644
--- a/libjava/javax/swing/border/SoftBevelBorder.java
+++ b/libjava/javax/swing/border/SoftBevelBorder.java
@@ -74,7 +74,7 @@ public class SoftBevelBorder
* constructed by this method will automatically reflect a change
* to the component&#x2019;s background color.
*
- * <p><img src="SoftBevelBorder-1.png" width="500" height="200"
+ * <p><img src="doc-files/SoftBevelBorder-1.png" width="500" height="200"
* alt="[An illustration showing raised and lowered SoftBevelBorders]" />
*
* @param bevelType the desired appearance of the border. The value
@@ -94,7 +94,7 @@ public class SoftBevelBorder
* Constructs a SoftBevelBorder given its appearance type and two
* colors for its highlight and shadow.
*
- * <p><img src="SoftBevelBorder-2.png" width="500" height="150"
+ * <p><img src="doc-files/SoftBevelBorder-2.png" width="500" height="150"
* alt="[An illustration showing SoftBevelBorders that were
* constructed with this method]" />
*
@@ -136,7 +136,7 @@ public class SoftBevelBorder
* Constructs a SoftBevelBorder given its appearance type and all
* colors.
*
- * <p><img src="SoftBevelBorder-3.png" width="500" height="150"
+ * <p><img src="doc-files/SoftBevelBorder-3.png" width="500" height="150"
* alt="[An illustration showing SoftBevelBorders that were
* constructed with this method]" />
*
diff --git a/libjava/javax/swing/plaf/BorderUIResource.java b/libjava/javax/swing/plaf/BorderUIResource.java
index aebb1a03fe3..a3f0db026fd 100644
--- a/libjava/javax/swing/plaf/BorderUIResource.java
+++ b/libjava/javax/swing/plaf/BorderUIResource.java
@@ -277,7 +277,8 @@ public class BorderUIResource
* constructed by this method will automatically reflect a change
* to the component&#x2019;s background color.
*
- * <p><img src="../border/BevelBorder-1.png" width="500" height="150"
+ * <p><img src="../border/doc-files/BevelBorder-1.png"
+ * width="500" height="150"
* alt="[An illustration showing raised and lowered BevelBorders]" />
*
* @param bevelType the desired appearance of the border. The value
@@ -297,9 +298,9 @@ public class BorderUIResource
* Constructs a BevelBorderUIResource given its appearance type
* and two colors for its highlight and shadow.
*
- * <p><img src="../border/BevelBorder-2.png" width="500" height="150"
- * alt="[An illustration showing BevelBorders that were constructed
- * with this method]" />
+ * <p><img src="../border/doc-files/BevelBorder-2.png" width="500"
+ * height="150" alt="[An illustration showing BevelBorders that were
+ * constructed with this method]" />
*
* @param bevelType the desired appearance of the border. The value
* must be either {@link javax.swing.border.BevelBorder#RAISED}
@@ -337,9 +338,9 @@ public class BorderUIResource
* Constructs a BevelBorderUIResource given its appearance type
* and all its colors.
*
- * <p><img src="../border/BevelBorder-3.png" width="500" height="150"
- * alt="[An illustration showing BevelBorders that were constructed
- * with this method]" />
+ * <p><img src="../border/doc-files/BevelBorder-3.png" width="500"
+ * height="150" alt="[An illustration showing BevelBorders that
+ * were constructed with this method]" />
*
* @param bevelType the desired appearance of the border. The value
* must be either {@link javax.swing.border.BevelBorder#RAISED}
@@ -429,7 +430,8 @@ public class BorderUIResource
* always install borders that implement <code>UIResource</code>,
* such as the borders provided by this class.
*
- * <p><img src="../border/EmptyBorder-1.png" width="290" height="200"
+ * <p><img src="../border/doc-files/EmptyBorder-1.png"
+ * width="290" height="200"
* alt="[An illustration of EmptyBorder]" />
*
* @author Brian Jones (cbj@gnu.org)
@@ -483,8 +485,9 @@ public class BorderUIResource
* always install borders that implement <code>UIResource</code>,
* such as the borders provided by this class.
*
- * <p><img src="../border/EtchedBorder-1.png" width="500" height="200"
- * alt="[An illustration of the two EtchedBorder variants]" />
+ * <p><img src="../border/doc-files/EtchedBorder-1.png" width="500"
+ * height="200" alt="[An illustration of the two EtchedBorder
+ * variants]" />
*
* @author Brian Jones (cbj@gnu.org)
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -509,8 +512,9 @@ public class BorderUIResource
* appearance. The colors will be derived from the background
* color of the enclosed Component when the border gets painted.
*
- * <p><img src="../border/EtchedBorder-1.png" width="500" height="200"
- * alt="[An illustration of the two EtchedBorder variants]" />
+ * <p><img src="../border/doc-files/EtchedBorder-1.png"
+ * width="500" height="200" alt="[An illustration of the two
+ * EtchedBorder variants]" />
*
* @param etchType the desired appearance of the border. The value
* must be either {@link javax.swing.border.EtchedBorder#RAISED}
@@ -549,7 +553,7 @@ public class BorderUIResource
* appearance, explicitly selecting the colors that will be used
* for highlight and shadow.
*
- * <p><img src="../border/EtchedBorder-2.png" width="500"
+ * <p><img src="../border/doc-files/EtchedBorder-2.png" width="500"
* height="200" alt="[An illustration that shows which pixels get
* painted in what color]" />
*
@@ -583,8 +587,8 @@ public class BorderUIResource
* always install borders that implement <code>UIResource</code>,
* such as the borders provided by this class.
*
- * <p><img src="../border/LineBorder-1.png" width="500" height="200"
- * alt="[An illustration of two LineBorders] />
+ * <p><img src="../border/doc-files/LineBorder-1.png" width="500"
+ * height="200" alt="[An illustration of two LineBorders] />
*
* @author Brian Jones (cbj@gnu.org)
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -638,8 +642,8 @@ public class BorderUIResource
* always install borders that implement <code>UIResource</code>,
* such as the borders provided by this class.
*
- * <p><img src="../border/MatteBorder-1.png" width="500" height="150"
- * alt="[An illustration of two MatteBorders] />
+ * <p><img src="../border/doc-files/MatteBorder-1.png" width="500"
+ * height="150" alt="[An illustration of two MatteBorders] />
*
* @author Brian Jones (cbj@gnu.org)
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -652,8 +656,9 @@ public class BorderUIResource
* Constructs a MatteBorderUIResource given the width on each side
* and a fill color.
*
- * <p><img src="../border/MatteBorder-2.png" width="500" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
+ * <p><img src="../border/doc-files/MatteBorder-2.png" width="500"
+ * height="150" alt="[A picture of a MatteBorder made by this
+ * constructor]" />
*
* @param top the width of the border at its top edge.
* @param left the width of the border at its left edge.
@@ -673,7 +678,7 @@ public class BorderUIResource
* Constructs a MatteBorderUIResource given the width on each side
* and an icon for tiling the border area.
*
- * <p><img src="../border/MatteBorder-4.png" width="500"
+ * <p><img src="../border/doc-files/MatteBorder-4.png" width="500"
* height="150" alt="[A picture of a MatteBorder made by this
* constructor]" />
*
@@ -697,10 +702,11 @@ public class BorderUIResource
* the left and right edge, the icon height for the top and bottom
* edge.
*
- * <p><img src="../border/MatteBorder-6.png" width="500" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
+ * <p><img src="../border/doc-files/MatteBorder-6.png" width="500"
+ * height="150" alt="[A picture of a MatteBorder made by this
+ * constructor]" />
*
- * @param tileIcon an icon for tiling the border area.
+ * @param tileIcon an icon for tiling the border area.
*/
public MatteBorderUIResource(Icon tileIcon)
{
diff --git a/libjava/javax/swing/plaf/ComponentUI.java b/libjava/javax/swing/plaf/ComponentUI.java
index 22c2f30fd7b..5147ebb9609 100644
--- a/libjava/javax/swing/plaf/ComponentUI.java
+++ b/libjava/javax/swing/plaf/ComponentUI.java
@@ -50,7 +50,7 @@ import javax.swing.JComponent;
* should not need to access this class; it is internal to Swing
* and the look-and-feel implementations.
*
- * <p><img src="ComponentUI-1.png" width="700" height="550"
+ * <p><img src="doc-files/ComponentUI-1.png" width="700" height="550"
* alt="[UML diagram illustrating the architecture for pluggable
* look and feels]" />
*
diff --git a/libjava/javax/swing/plaf/TreeUI.java b/libjava/javax/swing/plaf/TreeUI.java
index 59dca9d877f..7c441343bb2 100644
--- a/libjava/javax/swing/plaf/TreeUI.java
+++ b/libjava/javax/swing/plaf/TreeUI.java
@@ -125,7 +125,7 @@ public abstract class TreeUI
/**
* Finds the path that is closest to the specified position.
*
- * <p><img src="TreeUI-1.png" width="300" height="250"
+ * <p><img src="doc-files/TreeUI-1.png" width="300" height="250"
* alt="[A screen shot of a JTree] />
*
* <p>As shown by the above illustration, the bounds of the
diff --git a/libjava/javax/swing/plaf/basic/BasicBorders.java b/libjava/javax/swing/plaf/basic/BasicBorders.java
index d59ab253322..7002d14332c 100644
--- a/libjava/javax/swing/plaf/basic/BasicBorders.java
+++ b/libjava/javax/swing/plaf/basic/BasicBorders.java
@@ -85,7 +85,7 @@ public class BasicBorders
* <code>&#x201c;Button.light&#x201d;</code>, and
* <code>&#x201c;Button.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.ButtonBorder-1.png" width="300"
+ * <p><img src="doc-files/BasicBorders.ButtonBorder-1.png" width="300"
* height="170" alt="[A screen shot of the returned border]" />
*
* @return a {@link
@@ -135,7 +135,7 @@ public class BasicBorders
* <code>&#x201c;RadioButton.light&#x201d;</code>, and
* <code>&#x201c;RadioButton.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.RadioButtonBorder-1.png" width="300"
+ * <p><img src="doc-files/BasicBorders.RadioButtonBorder-1.png" width="300"
* height="135" alt="[A screen shot of the returned border]" />
*
* @return a {@link
@@ -187,7 +187,7 @@ public class BasicBorders
* <code>&#x201c;ToggleButton.light&#x201d;</code>, and
* <code>&#x201c;ToggleButton.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.ToggleButtonBorder-1.png" width="270"
+ * <p><img src="doc-files/BasicBorders.ToggleButtonBorder-1.png" width="270"
* height="135" alt="[A screen shot of the returned border]" />
*
* @return a {@link
@@ -238,7 +238,7 @@ public class BasicBorders
* using the keys <code>&#x201c;MenuBar.shadow&#x201d;</code> and
* <code>&#x201c;MenuBar.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
* height="140" alt="[A screen shot of a JMenuBar with this border]" />
*
* @return a {@link #MenuBarBorder}.
@@ -266,10 +266,10 @@ public class BasicBorders
* using the keys <code>&#x201c;SplitPane.darkShadow&#x201d;</code> and
* <code>&#x201c;SplitPane.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
*
- * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
*
* @return a {@link #SplitPaneBorder}.
@@ -299,8 +299,9 @@ public class BasicBorders
* <code>&#x201c;SplitPane.highlight&#x201d;</code>. The color of the
* other two edges is the background color of the divider.
*
- * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png" width="520"
- * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
+ * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
+ * width="520" height="200" alt=
+ * "[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
*
* @return an instance of <code>SplitPaneDividerBorder</code>, which is
* not a public API class of this package.
@@ -334,7 +335,7 @@ public class BasicBorders
* <code>&#x201c;TextField.light&#x201d;</code>, and
* <code>&#x201c;TextField.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.FieldBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.FieldBorder-1.png" width="500"
* height="200" alt="[A screen shot of a border returned by
* this method]" />
*
@@ -364,7 +365,7 @@ public class BasicBorders
* feels better use different borders for their progress bars, or
* they will look really terrible.
*
- * <p><img src="BasicBorders-1.png" width="120" height="80"
+ * <p><img src="doc-files/BasicBorders-1.png" width="120" height="80"
* alt="[A screen shot of a border returned by this method]" />
*/
public static Border getProgressBarBorder()
@@ -380,7 +381,7 @@ public class BasicBorders
* Returns a border that is composed of a raised bevel border and a
* one-pixel thick line border.
*
- * <p><img src="BasicBorders-2.png" width="300" height="200"
+ * <p><img src="doc-files/BasicBorders-2.png" width="300" height="200"
* alt="[A screen shot of a border returned by this method]" />
*
* <p>The colors of the border are retrieved from the
@@ -440,7 +441,7 @@ public class BasicBorders
* A border whose appearance depends on the state of
* the enclosed button.
*
- * <p><img src="BasicBorders.ButtonBorder-1.png" width="300"
+ * <p><img src="doc-files/BasicBorders.ButtonBorder-1.png" width="300"
* height="170" alt="[A screen shot of this border]" />
*
* @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
@@ -616,7 +617,7 @@ public class BasicBorders
* A border that makes its enclosed component appear as lowered
* into the surface. Typically used for text fields.
*
- * <p><img src="BasicBorders.FieldBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.FieldBorder-1.png" width="500"
* height="200" alt="[A screen shot of this border]" />
*
* @see javax.swing.plaf.basic.BasicGraphicsUtils#drawEtchedRect
@@ -784,7 +785,7 @@ public class BasicBorders
* component. If the enclosed component has no such method,
* this border will not occupy any space.
*
- * <p><img src="BasicBorders.MarginBorder-1.png" width="325"
+ * <p><img src="doc-files/BasicBorders.MarginBorder-1.png" width="325"
* height="200" alt="[An illustration that shows how MarginBorder
* determines its borders]" />
*
@@ -885,7 +886,7 @@ public class BasicBorders
/**
* A border for drawing a separator line below JMenuBar.
*
- * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
* height="140" alt="[A screen shot of a JMenuBar with this border]" />
*
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -919,7 +920,7 @@ public class BasicBorders
* Constructs a new MenuBarBorder for drawing a JMenuBar in
* the Basic look and feel.
*
- * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
* height="140" alt="[A screen shot of a JMenuBar with this
* border]" />
*
@@ -1041,7 +1042,7 @@ public class BasicBorders
/**
* A border for drawing radio buttons in the Basic look and feel.
*
- * <p><img src="BasicBorders.RadioButtonBorder-1.png" width="300"
+ * <p><img src="doc-files/BasicBorders.RadioButtonBorder-1.png" width="300"
* height="135" alt="[A screen shot of this border]" />
*
* <p>Note about the screen shot: Normally, the
@@ -1285,10 +1286,10 @@ public class BasicBorders
* in the middle of the JSplitPane has its own border class, of which
* an instance can be obtained with {@link #getSplitPaneDividerBorder()}.
*
- * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
*
- * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
*
* <p>In contrast to the other borders of the Basic look and feel,
@@ -1381,10 +1382,10 @@ public class BasicBorders
/**
* Paints the border around a <code>JSplitPane</code>.
*
- * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
*
- * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
*
* @param c the <code>JSplitPane</code> whose border is to be painted.
@@ -1535,7 +1536,7 @@ public class BasicBorders
/**
* A border for the divider inside a JSplitPane.
*
- * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png"
+ * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
* width="520" height="200" alt="[A screen shot of this border]" />
*
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -1575,9 +1576,9 @@ public class BasicBorders
/**
* Paints the border around the divider of a <code>JSplitPane</code>.
*
- * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png" width="520"
- * height="200" alt="[A picture that shows which pixels get painted
- * in what color]" />
+ * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
+ * width="520" height="200" alt="[A picture that shows which pixels
+ * get painted in what color]" />
*
* @param c the <code>JSplitPane</code> whose divider&#x2019;s border
* is to be painted.
@@ -1687,8 +1688,8 @@ public class BasicBorders
/**
* A border for toggle buttons in the Basic look and feel.
*
- * <p><img src="BasicBorders.ToggleButtonBorder-1.png" width="270"
- * height="135" alt="[A screen shot of this border]" />
+ * <p><img src="doc-files/BasicBorders.ToggleButtonBorder-1.png"
+ * width="270" height="135" alt="[A screen shot of this border]" />
*
* <p>The Sun implementation always seems to draw exactly
* the same border, irrespective of the state of the button.
diff --git a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
index a7b64111f53..d7b53d54f6c 100644
--- a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
+++ b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
@@ -78,7 +78,7 @@ public class BasicGraphicsUtils
* Draws a rectangle that appears etched into the surface, given
* four colors that are used for drawing.
*
- * <p><img src="BasicGraphicsUtils-1.png" width="360"
+ * <p><img src="doc-files/BasicGraphicsUtils-1.png" width="360"
* height="200" alt="[An illustration that shows which pixels
* get painted in what color]" />
*
@@ -166,7 +166,7 @@ public class BasicGraphicsUtils
* Draws a rectangle that appears etched into the surface, given
* two colors that are used for drawing.
*
- * <p><img src="BasicGraphicsUtils-2.png" width="360"
+ * <p><img src="doc-files/BasicGraphicsUtils-2.png" width="360"
* height="200" alt="[An illustration that shows which pixels
* get painted in what color]" />
*
@@ -224,7 +224,7 @@ public class BasicGraphicsUtils
* Draws a border that is suitable for buttons of the Basic look and
* feel.
*
- * <p><img src="BasicGraphicsUtils-3.png" width="500"
+ * <p><img src="doc-files/BasicGraphicsUtils-3.png" width="500"
* height="300" alt="[An illustration that shows which pixels
* get painted in what color]" />
*
@@ -305,7 +305,7 @@ public class BasicGraphicsUtils
* Draws a rectangle that appears lowered into the surface, given
* four colors that are used for drawing.
*
- * <p><img src="BasicGraphicsUtils-4.png" width="360"
+ * <p><img src="doc-files/BasicGraphicsUtils-4.png" width="360"
* height="200" alt="[An illustration that shows which pixels
* get painted in what color]" />
*
@@ -362,7 +362,7 @@ public class BasicGraphicsUtils
* drawn without underlining. Drawing is performed in the current
* color and font of <code>g</code>.
*
- * <p><img src="BasicGraphicsUtils-5.png" width="500"
+ * <p><img src="doc-files/BasicGraphicsUtils-5.png" width="500"
* height="100" alt="[An illustration showing how to use the
* method]" />
*
@@ -413,7 +413,7 @@ public class BasicGraphicsUtils
* at the specified index. Drawing is performed in the current color
* and font of <code>g</code>.
*
- * <p><img src="BasicGraphicsUtils-5.png" width="500"
+ * <p><img src="doc-files/BasicGraphicsUtils-5.png" width="500"
* height="100" alt="[An illustration showing how to use the
* method]" />
*
@@ -540,7 +540,7 @@ public class BasicGraphicsUtils
* those pixels is the current color of the Graphics <code>g</code>.
* Any other pixels are left unchanged.
*
- * <p><img src="BasicGraphicsUtils-7.png" width="360"
+ * <p><img src="doc-files/BasicGraphicsUtils-7.png" width="360"
* height="200" alt="[An illustration that shows which pixels
* get painted]" />
*
diff --git a/libjava/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
index d9af1010ba7..0c20cb7c710 100644
--- a/libjava/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
@@ -132,7 +132,7 @@ public class BasicTreeUI
/**
* Finds the path that is closest to the specified position.
*
- * <p><img src="../TreeUI-1.png" width="300" height="250"
+ * <p><img src="../doc-files/TreeUI-1.png" width="300" height="250"
* alt="[A screen shot of a JTree] />
*
* <p>As shown by the above illustration, the bounds of the
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
index e87a9c4d7f0..110b01974d9 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
@@ -42,11 +42,11 @@ exception statement from your version. */
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create
(JNIEnv *env, jobject obj)
{
- GtkButton *button;
+ GtkWidget *button;
gdk_threads_enter ();
button = gtk_button_new();
- gtk_widget_show (GTK_WIDGET(button));
+ gtk_widget_show (button);
gdk_threads_leave ();
NSA_SET_PTR (env, obj, button);
}
@@ -74,8 +74,10 @@ Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetFont
gdk_threads_enter();
font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
gtk_widget_modify_font (GTK_WIDGET(label), font_desc);
+
pango_font_description_free (font_desc);
gdk_threads_leave();
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
index c1baa587784..46cd64fca1b 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
@@ -503,7 +503,7 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_S
arg.type = GTK_TYPE_STRING;
arg.name = (char *) name;
GTK_VALUE_STRING (arg) = (char *) value;
- gdk_threads_enter();
+ gdk_threads_enter();
g_object_set(ptr, name, value, NULL);
gdk_threads_leave();
@@ -618,9 +618,10 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks
gdk_threads_enter ();
gtk_widget_realize (GTK_WIDGET (ptr));
+
if(GTK_IS_BUTTON(ptr))
- connect_awt_hook (env, obj, 1, GTK_BUTTON(ptr)->event_window);
+ connect_awt_hook (env, obj, 1, GTK_BUTTON(ptr)->event_window);
else
- connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
+ connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
gdk_threads_leave ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
index 3c400114e4b..cdcd72e187c 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
@@ -48,7 +48,8 @@ struct event_hook_info
{
jobject *peer_obj;
int nwindows;
- GdkWindow ***windows; /* array of pointers to (GdkWindow *) */
+ /* array of pointers to (GdkWindow *) */
+ GdkWindow ***windows;
};
static jint
@@ -68,68 +69,317 @@ button_to_awt_mods (int button)
}
static jint
-state_to_awt_mods (int mods)
+state_to_awt_mods (guint state)
{
jint result = 0;
- if (mods & (GDK_SHIFT_MASK | GDK_LOCK_MASK))
+ if (state & GDK_SHIFT_MASK)
result |= AWT_SHIFT_MASK;
- if (mods & GDK_CONTROL_MASK)
+ if (state & GDK_CONTROL_MASK)
result |= AWT_CTRL_MASK;
-
+ if (state & GDK_MOD1_MASK)
+ result |= AWT_ALT_MASK;
+
+ return result;
+}
+
+/* Modifier key events need special treatment. In Sun's peer
+ implementation, when a modifier key is pressed, the KEY_PRESSED
+ event has that modifier in its modifiers list. The corresponding
+ KEY_RELEASED event's modifier list does not contain the modifier.
+ For example, pressing and releasing the shift key will produce a
+ key press event with modifiers=Shift, and a key release event with
+ no modifiers. GDK's key events behave in the exact opposite way,
+ so this translation code is needed. */
+static jint
+keyevent_state_to_awt_mods (GdkEvent *event)
+{
+ jint result = 0;
+ guint state;
+
+ if (event->type == GDK_KEY_PRESS)
+ {
+ state = event->key.state;
+
+ if (event->key.keyval == GDK_Shift_L
+ || event->key.keyval == GDK_Shift_R)
+ result |= AWT_SHIFT_MASK;
+ else
+ {
+ if (state & GDK_SHIFT_MASK)
+ result |= AWT_SHIFT_MASK;
+ }
+
+ if (event->key.keyval == GDK_Control_L
+ || event->key.keyval == GDK_Control_R)
+ result |= AWT_CTRL_MASK;
+ else
+ {
+ if (state & GDK_CONTROL_MASK)
+ result |= AWT_CTRL_MASK;
+ }
+
+ if (event->key.keyval == GDK_Alt_L
+ || event->key.keyval == GDK_Alt_R)
+ result |= AWT_ALT_MASK;
+ else
+ {
+ if (state & GDK_MOD1_MASK)
+ result |= AWT_ALT_MASK;
+ }
+ }
+ else if (event->type == GDK_KEY_RELEASE)
+ {
+ state = event->key.state;
+
+ if (event->key.keyval != GDK_Shift_L
+ && event->key.keyval != GDK_Shift_R)
+ {
+ if (state & GDK_SHIFT_MASK)
+ result |= AWT_SHIFT_MASK;
+ }
+ if (event->key.keyval != GDK_Control_L
+ && event->key.keyval != GDK_Control_R)
+ {
+ if (state & GDK_CONTROL_MASK)
+ result |= AWT_CTRL_MASK;
+ }
+
+ if (event->key.keyval != GDK_Alt_L
+ && event->key.keyval != GDK_Alt_R)
+ {
+ if (state & GDK_MOD1_MASK)
+ result |= AWT_ALT_MASK;
+ }
+ }
+
return result;
}
+/* Get the first keyval in the keymap for this event's keycode. The
+ first keyval corresponds roughly to Java's notion of a virtual
+ key. Returns the uppercase version of the first keyval. */
+static guint
+get_first_keyval_from_keymap (GdkEvent *event)
+{
+ guint keyval;
+ guint *keyvals;
+ gint n_entries;
+
+ if (!gdk_keymap_get_entries_for_keycode (NULL,
+ event->key.hardware_keycode,
+ NULL,
+ &keyvals,
+ &n_entries))
+ {
+ g_warning ("No keyval found for hardware keycode %d\n",
+ event->key.hardware_keycode);
+ /* Try to recover by using the keyval in the event structure. */
+ keyvals = &(event->key.keyval);
+ }
+ keyval = keyvals[0];
+ g_free (keyvals);
+
+ return gdk_keyval_to_upper (keyval);
+}
+
#ifdef __GNUC__
__inline
#endif
static jint
-keysym_to_awt_keycode (guint keyval)
+keysym_to_awt_keycode (GdkEvent *event)
{
- guint vk;
+ guint ukeyval;
+ guint state;
- vk = gdk_keyval_to_upper (keyval);
+ ukeyval = get_first_keyval_from_keymap (event);
+ state = event->key.state;
- if (vk >= 0x41 && vk <= 0x5A) /* VK_A through VK_Z */
- return vk;
+ /* VK_A through VK_Z */
+ if (ukeyval >= GDK_A && ukeyval <= GDK_Z)
+ return ukeyval;
- if (vk >= 0x30 && vk <= 0x39) /* VK_0 through VK_9 */
- return vk;
+ /* VK_0 through VK_9 */
+ if (ukeyval >= GDK_0 && ukeyval <= GDK_9)
+ return ukeyval;
- switch (vk)
+ switch (ukeyval)
{
- case GDK_Alt_L:
- case GDK_Alt_R:
- return VK_ALT;
+ case GDK_Return:
+ case GDK_KP_Enter:
+ return VK_ENTER;
case GDK_BackSpace:
return VK_BACK_SPACE;
+ case GDK_Tab:
+ return VK_TAB;
case GDK_Cancel:
return VK_CANCEL;
- case GDK_Caps_Lock:
- return VK_CAPS_LOCK;
case GDK_Clear:
return VK_CLEAR;
- case GDK_bracketright:
- return VK_CLOSE_BRACKET;
- case GDK_comma:
- return VK_COMMA;
+ case GDK_Shift_L:
+ case GDK_Shift_R:
+ return VK_SHIFT;
case GDK_Control_L:
case GDK_Control_R:
return VK_CONTROL;
+ case GDK_Alt_L:
+ case GDK_Alt_R:
+ return VK_ALT;
+ case GDK_Pause:
+ return VK_PAUSE;
+ case GDK_Caps_Lock:
+ return VK_CAPS_LOCK;
+ case GDK_Escape:
+ return VK_ESCAPE;
+ case GDK_space:
+ return VK_SPACE;
+ case GDK_KP_Page_Up:
+ /* For keys on the numeric keypad, the JVM produces one of two
+ virtual keys, depending on the num lock state. */
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD9;
+ else
+ return VK_PAGE_UP;
+ case GDK_Page_Up:
+ return VK_PAGE_UP;
+ case GDK_KP_Page_Down:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD3;
+ else
+ return VK_PAGE_DOWN;
+ case GDK_Page_Down:
+ return VK_PAGE_DOWN;
+ case GDK_KP_End:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD1;
+ else
+ return VK_END;
+ case GDK_End:
+ return VK_END;
+ case GDK_KP_Home:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD7;
+ else
+ return VK_HOME;
+ case GDK_Home:
+ return VK_HOME;
+ case GDK_KP_Begin:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD5;
+ else
+ return VK_UNDEFINED;
+ case GDK_Left:
+ return VK_LEFT;
+ case GDK_Up:
+ return VK_UP;
+ case GDK_Right:
+ return VK_RIGHT;
+ case GDK_Down:
+ return VK_DOWN;
+ case GDK_comma:
+ return VK_COMMA;
+ case GDK_minus:
+ return VK_MINUS;
+ case GDK_period:
+ return VK_PERIOD;
+ case GDK_slash:
+ return VK_SLASH;
+ /*
+ return VK_0;
+ return VK_1;
+ return VK_2;
+ return VK_3;
+ return VK_4;
+ return VK_5;
+ return VK_6;
+ return VK_7;
+ return VK_8;
+ return VK_9;
+ */
+ case GDK_semicolon:
+ return VK_SEMICOLON;
+ case GDK_equal:
+ return VK_EQUALS;
+ /*
+ return VK_A;
+ return VK_B;
+ return VK_C;
+ return VK_D;
+ return VK_E;
+ return VK_F;
+ return VK_G;
+ return VK_H;
+ return VK_I;
+ return VK_J;
+ return VK_K;
+ return VK_L;
+ return VK_M;
+ return VK_N;
+ return VK_O;
+ return VK_P;
+ return VK_Q;
+ return VK_R;
+ return VK_S;
+ return VK_T;
+ return VK_U;
+ return VK_V;
+ return VK_W;
+ return VK_X;
+ return VK_Y;
+ return VK_Z;
+ */
+ case GDK_bracketleft:
+ return VK_OPEN_BRACKET;
+ case GDK_backslash:
+ return VK_BACK_SLASH;
+ case GDK_bracketright:
+ return VK_CLOSE_BRACKET;
+ case GDK_KP_0:
+ return VK_NUMPAD0;
+ case GDK_KP_1:
+ return VK_NUMPAD1;
+ case GDK_KP_2:
+ return VK_NUMPAD2;
+ case GDK_KP_3:
+ return VK_NUMPAD3;
+ case GDK_KP_4:
+ return VK_NUMPAD4;
+ case GDK_KP_5:
+ return VK_NUMPAD5;
+ case GDK_KP_6:
+ return VK_NUMPAD6;
+ case GDK_KP_7:
+ return VK_NUMPAD7;
+ case GDK_KP_8:
+ return VK_NUMPAD8;
+ case GDK_KP_9:
+ return VK_NUMPAD9;
+ case GDK_KP_Multiply:
+ return VK_MULTIPLY;
+ case GDK_KP_Add:
+ return VK_ADD;
+ /*
+ return VK_SEPARATER;
+ */
+ case GDK_KP_Separator:
+ return VK_SEPARATOR;
+ case GDK_KP_Subtract:
+ return VK_SUBTRACT;
case GDK_KP_Decimal:
return VK_DECIMAL;
- case GDK_Delete:
- return VK_DELETE;
case GDK_KP_Divide:
return VK_DIVIDE;
- case GDK_Down:
- return VK_DOWN;
- case GDK_End:
- return VK_END;
- case GDK_Return:
- return VK_ENTER;
- case GDK_Escape:
- return VK_ESCAPE;
+ case GDK_KP_Delete:
+ if (state & GDK_MOD2_MASK)
+ return VK_DECIMAL;
+ else
+ return VK_DELETE;
+ case GDK_Delete:
+ return VK_DELETE;
+ case GDK_Num_Lock:
+ return VK_NUM_LOCK;
+ case GDK_Scroll_Lock:
+ return VK_SCROLL_LOCK;
case GDK_F1:
return VK_F1;
case GDK_F2:
@@ -154,100 +404,410 @@ keysym_to_awt_keycode (guint keyval)
return VK_F11;
case GDK_F12:
return VK_F12;
- case GDK_Help:
- return VK_HELP;
- case GDK_Home:
- return VK_HOME;
+ case GDK_F13:
+ return VK_F13;
+ case GDK_F14:
+ return VK_F14;
+ case GDK_F15:
+ return VK_F15;
+ case GDK_F16:
+ return VK_F16;
+ case GDK_F17:
+ return VK_F17;
+ case GDK_F18:
+ return VK_F18;
+ case GDK_F19:
+ return VK_F19;
+ case GDK_F20:
+ return VK_F20;
+ case GDK_F21:
+ return VK_F21;
+ case GDK_F22:
+ return VK_F22;
+ case GDK_F23:
+ return VK_F23;
+ case GDK_F24:
+ return VK_F24;
+ case GDK_Print:
+ return VK_PRINTSCREEN;
+ case GDK_KP_Insert:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD0;
+ else
+ return VK_INSERT;
case GDK_Insert:
return VK_INSERT;
+ case GDK_Help:
+ return VK_HELP;
+ case GDK_Meta_L:
+ case GDK_Meta_R:
+ return VK_META;
+ case GDK_grave:
+ return VK_BACK_QUOTE;
+ case GDK_apostrophe:
+ return VK_QUOTE;
+ case GDK_KP_Up:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD8;
+ else
+ return VK_KP_UP;
+ case GDK_KP_Down:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD2;
+ else
+ return VK_KP_DOWN;
+ case GDK_KP_Left:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD4;
+ else
+ return VK_KP_LEFT;
+ case GDK_KP_Right:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD6;
+ else
+ return VK_KP_RIGHT;
+ case GDK_dead_grave:
+ return VK_DEAD_GRAVE;
+ case GDK_dead_acute:
+ return VK_DEAD_ACUTE;
+ case GDK_dead_circumflex:
+ return VK_DEAD_CIRCUMFLEX;
+ case GDK_dead_tilde:
+ return VK_DEAD_TILDE;
+ case GDK_dead_macron:
+ return VK_DEAD_MACRON;
+ case GDK_dead_breve:
+ return VK_DEAD_BREVE;
+ case GDK_dead_abovedot:
+ return VK_DEAD_ABOVEDOT;
+ case GDK_dead_diaeresis:
+ return VK_DEAD_DIAERESIS;
+ case GDK_dead_abovering:
+ return VK_DEAD_ABOVERING;
+ case GDK_dead_doubleacute:
+ return VK_DEAD_DOUBLEACUTE;
+ case GDK_dead_caron:
+ return VK_DEAD_CARON;
+ case GDK_dead_cedilla:
+ return VK_DEAD_CEDILLA;
+ case GDK_dead_ogonek:
+ return VK_DEAD_OGONEK;
+ case GDK_dead_iota:
+ return VK_DEAD_IOTA;
+ case GDK_dead_voiced_sound:
+ return VK_DEAD_VOICED_SOUND;
+ case GDK_dead_semivoiced_sound:
+ return VK_DEAD_SEMIVOICED_SOUND;
+ case GDK_ampersand:
+ return VK_AMPERSAND;
+ case GDK_asterisk:
+ return VK_ASTERISK;
+ case GDK_quotedbl:
+ return VK_QUOTEDBL;
+ case GDK_less:
+ return VK_LESS;
+ case GDK_greater:
+ return VK_GREATER;
+ case GDK_braceleft:
+ return VK_BRACELEFT;
+ case GDK_braceright:
+ return VK_BRACERIGHT;
+ case GDK_at:
+ return VK_AT;
+ case GDK_colon:
+ return VK_COLON;
+ case GDK_asciicircum:
+ return VK_CIRCUMFLEX;
+ case GDK_dollar:
+ return VK_DOLLAR;
+ case GDK_EuroSign:
+ return VK_EURO_SIGN;
+ case GDK_exclam:
+ return VK_EXCLAMATION_MARK;
+ case GDK_exclamdown:
+ return VK_INVERTED_EXCLAMATION_MARK;
+ case GDK_parenleft:
+ return VK_LEFT_PARENTHESIS;
+ case GDK_numbersign:
+ return VK_NUMBER_SIGN;
+ case GDK_plus:
+ return VK_PLUS;
+ case GDK_parenright:
+ return VK_RIGHT_PARENTHESIS;
+ case GDK_underscore:
+ return VK_UNDERSCORE;
+ /*
+ return VK_FINAL;
+ return VK_CONVERT;
+ return VK_NONCONVERT;
+ return VK_ACCEPT;
+ */
+ case GDK_Mode_switch:
+ return VK_MODECHANGE;
+ /*
+ return VK_KANA;
+ */
case GDK_Kanji:
return VK_KANJI;
- case GDK_Left:
- return VK_LEFT;
+ /*
+ return VK_ALPHANUMERIC;
+ */
+ case GDK_Katakana:
+ return VK_KATAKANA;
+ case GDK_Hiragana:
+ return VK_HIRAGANA;
+ /*
+ return VK_FULL_WIDTH;
+ return VK_HALF_WIDTH;
+ return VK_ROMAN_CHARACTERS;
+ return VK_ALL_CANDIDATES;
+ */
+ case GDK_PreviousCandidate:
+ return VK_PREVIOUS_CANDIDATE;
+ case GDK_Codeinput:
+ return VK_CODE_INPUT;
+ /*
+ return VK_JAPANESE_KATAKANA;
+ return VK_JAPANESE_HIRAGANA;
+ return VK_JAPANESE_ROMAN;
+ */
+ case GDK_Kana_Lock:
+ return VK_KANA_LOCK;
+ /*
+ return VK_INPUT_METHOD_ON_OFF;
+ return VK_CUT;
+ return VK_COPY;
+ return VK_PASTE;
+ return VK_UNDO;
+ return VK_AGAIN;
+ return VK_FIND;
+ return VK_PROPS;
+ return VK_STOP;
+ return VK_COMPOSE;
+ return VK_ALT_GRAPH;
+ */
+ default:
+ return VK_UNDEFINED;
+ }
+}
+
+static jint
+keysym_to_awt_keylocation (GdkEvent *event)
+{
+ guint ukeyval;
+
+ ukeyval = get_first_keyval_from_keymap (event);
+
+ /* VK_A through VK_Z */
+ if (ukeyval >= GDK_A && ukeyval <= GDK_Z)
+ return AWT_KEY_LOCATION_STANDARD;
+
+ /* VK_0 through VK_9 */
+ if (ukeyval >= GDK_0 && ukeyval <= GDK_9)
+ return AWT_KEY_LOCATION_STANDARD;
+
+ switch (ukeyval)
+ {
+ case GDK_Shift_L:
+ case GDK_Control_L:
+ case GDK_Alt_L:
case GDK_Meta_L:
+ return AWT_KEY_LOCATION_LEFT;
+
+ case GDK_Shift_R:
+ case GDK_Control_R:
+ case GDK_Alt_R:
case GDK_Meta_R:
- return VK_META;
- case GDK_KP_Multiply:
- return VK_MULTIPLY;
- case GDK_Num_Lock:
- return VK_NUM_LOCK;
+ return AWT_KEY_LOCATION_RIGHT;
+
+ case GDK_Return:
+ case GDK_BackSpace:
+ case GDK_Tab:
+ case GDK_Cancel:
+ case GDK_Clear:
+ case GDK_Pause:
+ case GDK_Caps_Lock:
+ case GDK_Escape:
+ case GDK_space:
+ case GDK_Page_Up:
+ case GDK_Page_Down:
+ case GDK_End:
+ case GDK_Home:
+ case GDK_Left:
+ case GDK_Up:
+ case GDK_Right:
+ case GDK_Down:
+ case GDK_comma:
+ case GDK_minus:
+ case GDK_period:
+ case GDK_slash:
+ case GDK_semicolon:
+ case GDK_equal:
+ case GDK_bracketleft:
+ case GDK_backslash:
+ case GDK_bracketright:
+ case GDK_Delete:
+ case GDK_Scroll_Lock:
+ case GDK_F1:
+ case GDK_F2:
+ case GDK_F3:
+ case GDK_F4:
+ case GDK_F5:
+ case GDK_F6:
+ case GDK_F7:
+ case GDK_F8:
+ case GDK_F9:
+ case GDK_F10:
+ case GDK_F11:
+ case GDK_F12:
+ case GDK_F13:
+ case GDK_F14:
+ case GDK_F15:
+ case GDK_F16:
+ case GDK_F17:
+ case GDK_F18:
+ case GDK_F19:
+ case GDK_F20:
+ case GDK_F21:
+ case GDK_F22:
+ case GDK_F23:
+ case GDK_F24:
+ case GDK_Print:
+ case GDK_Insert:
+ case GDK_Help:
+ case GDK_grave:
+ case GDK_apostrophe:
+ case GDK_dead_grave:
+ case GDK_dead_acute:
+ case GDK_dead_circumflex:
+ case GDK_dead_tilde:
+ case GDK_dead_macron:
+ case GDK_dead_breve:
+ case GDK_dead_abovedot:
+ case GDK_dead_diaeresis:
+ case GDK_dead_abovering:
+ case GDK_dead_doubleacute:
+ case GDK_dead_caron:
+ case GDK_dead_cedilla:
+ case GDK_dead_ogonek:
+ case GDK_dead_iota:
+ case GDK_dead_voiced_sound:
+ case GDK_dead_semivoiced_sound:
+ case GDK_ampersand:
+ case GDK_asterisk:
+ case GDK_quotedbl:
+ case GDK_less:
+ case GDK_greater:
+ case GDK_braceleft:
+ case GDK_braceright:
+ case GDK_at:
+ case GDK_colon:
+ case GDK_asciicircum:
+ case GDK_dollar:
+ case GDK_EuroSign:
+ case GDK_exclam:
+ case GDK_exclamdown:
+ case GDK_parenleft:
+ case GDK_numbersign:
+ case GDK_plus:
+ case GDK_parenright:
+ case GDK_underscore:
+ case GDK_Mode_switch:
+ case GDK_Kanji:
+ case GDK_Katakana:
+ case GDK_Hiragana:
+ case GDK_PreviousCandidate:
+ case GDK_Codeinput:
+ case GDK_Kana_Lock:
+ return AWT_KEY_LOCATION_STANDARD;
+
+ case GDK_KP_Enter:
+ case GDK_KP_Page_Up:
+ case GDK_KP_Page_Down:
+ case GDK_KP_End:
+ case GDK_KP_Home:
+ case GDK_KP_Begin:
case GDK_KP_0:
- return VK_NUMPAD0;
case GDK_KP_1:
- return VK_NUMPAD1;
case GDK_KP_2:
- return VK_NUMPAD2;
case GDK_KP_3:
- return VK_NUMPAD3;
case GDK_KP_4:
- return VK_NUMPAD4;
case GDK_KP_5:
- return VK_NUMPAD5;
case GDK_KP_6:
- return VK_NUMPAD6;
case GDK_KP_7:
- return VK_NUMPAD7;
case GDK_KP_8:
- return VK_NUMPAD8;
case GDK_KP_9:
- return VK_NUMPAD9;
- case GDK_bracketleft:
- return VK_OPEN_BRACKET;
- case GDK_Page_Down:
- return VK_PAGE_DOWN;
- case GDK_Page_Up:
- return VK_PAGE_UP;
- case GDK_Pause:
- return VK_PAUSE;
- case GDK_period:
- return VK_PERIOD;
- case GDK_Print:
- return VK_PRINTSCREEN;
- case GDK_quoteright:
- return VK_QUOTE;
- case GDK_Right:
- return VK_RIGHT;
- case GDK_Scroll_Lock:
- return VK_SCROLL_LOCK;
- case GDK_semicolon:
- return VK_SEMICOLON;
+ case GDK_KP_Multiply:
+ case GDK_KP_Add:
case GDK_KP_Separator:
- return VK_SEPARATOR;
- case GDK_Shift_L:
- case GDK_Shift_R:
- return VK_SHIFT;
- case GDK_slash:
- return VK_SLASH;
- case GDK_space:
- return VK_SPACE;
case GDK_KP_Subtract:
- return VK_SUBTRACT;
- case GDK_Tab:
- return VK_TAB;
- case GDK_Up:
- return VK_UP;
+ case GDK_KP_Decimal:
+ case GDK_KP_Divide:
+ case GDK_KP_Delete:
+ case GDK_Num_Lock:
+ case GDK_KP_Insert:
+ case GDK_KP_Up:
+ case GDK_KP_Down:
+ case GDK_KP_Left:
+ case GDK_KP_Right:
+ return AWT_KEY_LOCATION_NUMPAD;
default:
- return VK_UNDEFINED;
+ return AWT_KEY_LOCATION_UNKNOWN;
}
}
+static jchar
+keyevent_to_awt_keychar (GdkEvent *event)
+{
+ if (event->key.length > 0)
+ {
+ /* Translate GDK carriage return to Java linefeed. */
+ if (event->key.string[0] == 13)
+ return VK_ENTER;
+ else
+ return event->key.string[0];
+ }
+ else
+ {
+ switch (event->key.keyval)
+ {
+ case GDK_BackSpace:
+ return VK_BACK_SPACE;
+ case GDK_Tab:
+ return VK_TAB;
+ case GDK_Delete:
+ case GDK_KP_Delete:
+ return VK_DELETE;
+ default:
+ return AWT_KEY_CHAR_UNDEFINED;
+ }
+ }
+}
+
+/* Checks if keyval triggers a KEY_TYPED event on the source widget.
+ This function identifies special keyvals that don't trigger
+ GtkIMContext "commit" signals, but that do trigger Java KEY_TYPED
+ events. */
static int
-generates_key_typed_event (guint keyval)
+generates_key_typed_event (GdkEvent *event, GtkWidget *source)
{
- guint vk;
+ guint keyval;
- vk = gdk_keyval_to_upper (keyval);
+ if (!GTK_IS_ENTRY (source)
+ && !GTK_IS_TEXT_VIEW (source))
+ return event->key.length ? 1 : 0;
- if ((vk >= 0x20 && vk <= 0x7e) /* Most printable keysyms on a
- standard US keyboard. */
- || (vk >= 0xFF9F && vk <= 0xFFB9) /* Numeric Keypad keysyms. */
- || vk == GDK_BackSpace
- || vk == GDK_Delete
- || vk == GDK_Return)
- return 1;
- else
- return 0;
+ keyval = event->key.keyval;
+
+ return (keyval == GDK_Escape
+ || keyval == GDK_BackSpace
+ || keyval == GDK_Delete
+ || keyval == GDK_KP_Delete
+ || keyval == GDK_Return
+ || keyval == GDK_KP_Enter
+ || (keyval == GDK_Tab
+ && GTK_IS_TEXT_VIEW(source))) ? 1 : 0;
}
void
@@ -465,19 +1025,30 @@ awt_event_handler (GdkEvent *event)
{
GtkWidget *widget;
GtkWindow *window;
+ /* The window to which the Java peer is attached. */
+ GdkWindow *obj_window;
gdk_window_get_user_data (event->any.window, (void **) &widget);
window = GTK_WINDOW (gtk_widget_get_ancestor (widget,
GTK_TYPE_WINDOW));
if (window
- && GTK_WIDGET_IS_SENSITIVE (window)
+ && GTK_WIDGET_IS_SENSITIVE (window)
&& window->focus_widget
&& GTK_WIDGET_IS_SENSITIVE (window->focus_widget)
&& window->focus_widget->window)
{
gtk_widget_activate (window->focus_widget);
- gdk_property_get (window->focus_widget->window,
+
+ /* TextArea peers are attached to the scrolled window
+ that contains the GtkTextView, not to the text view
+ itself. */
+ if (GTK_IS_TEXT_VIEW (window->focus_widget))
+ obj_window = gtk_widget_get_parent (window->focus_widget)->window;
+ else
+ obj_window = window->focus_widget->window;
+
+ gdk_property_get (obj_window,
gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
gdk_atom_intern ("CARDINAL", FALSE),
0,
@@ -488,27 +1059,24 @@ awt_event_handler (GdkEvent *event)
NULL,
(guchar **)&obj_ptr);
- /* if (grab && GTK_WIDGET_HAS_DEFAULT (widget) ) */
- /* { */
(*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
postKeyEventID,
(jint) AWT_KEY_PRESSED,
(jlong) event->key.time,
- state_to_awt_mods (event->key.state),
- keysym_to_awt_keycode (event->key.keyval),
- (jchar) (event->key.length) ?
- event->key.string[0] :
- AWT_KEY_CHAR_UNDEFINED);
-
- if (event->key.length
- && generates_key_typed_event(event->key.keyval))
- (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
- postKeyEventID,
- (jint) AWT_KEY_TYPED,
- (jlong) event->key.time,
+ keyevent_state_to_awt_mods (event),
+ keysym_to_awt_keycode (event),
+ keyevent_to_awt_keychar (event),
+ keysym_to_awt_keylocation (event));
+
+ if (generates_key_typed_event (event, window->focus_widget))
+ (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
+ postKeyEventID,
+ (jint) AWT_KEY_TYPED,
+ (jlong) event->key.time,
state_to_awt_mods (event->key.state),
- VK_UNDEFINED,
- (jchar) event->key.string[0]);
+ VK_UNDEFINED,
+ keyevent_to_awt_keychar (event),
+ AWT_KEY_LOCATION_UNKNOWN);
}
}
break;
@@ -516,6 +1084,7 @@ awt_event_handler (GdkEvent *event)
{
GtkWidget *widget;
GtkWindow *window;
+ GdkWindow *obj_window;
gdk_window_get_user_data (event->any.window, (void **) &widget);
@@ -528,7 +1097,13 @@ awt_event_handler (GdkEvent *event)
&& window->focus_widget->window)
{
gtk_widget_activate (window->focus_widget);
- gdk_property_get (window->focus_widget->window,
+
+ if (GTK_IS_TEXT_VIEW (window->focus_widget))
+ obj_window = gtk_widget_get_parent (window->focus_widget)->window;
+ else
+ obj_window = window->focus_widget->window;
+
+ gdk_property_get (obj_window,
gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
gdk_atom_intern ("CARDINAL", FALSE),
0,
@@ -543,11 +1118,10 @@ awt_event_handler (GdkEvent *event)
postKeyEventID,
(jint) AWT_KEY_RELEASED,
(jlong) event->key.time,
- state_to_awt_mods (event->key.state),
- keysym_to_awt_keycode (event->key.keyval),
- (jchar) (event->key.length) ?
- event->key.string[0] :
- AWT_KEY_CHAR_UNDEFINED);
+ keyevent_state_to_awt_mods (event),
+ keysym_to_awt_keycode (event),
+ keyevent_to_awt_keychar (event),
+ keysym_to_awt_keylocation (event));
}
}
break;
@@ -558,11 +1132,11 @@ awt_event_handler (GdkEvent *event)
AWT_FOCUS_GAINED : AWT_FOCUS_LOST,
JNI_FALSE);
break;
- default:
+ default:
}
g_free (obj_ptr);
- }
-
+ }
+
gtk_main_do_event (event);
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
index 9313a8a815b..7bddc330ddb 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
@@ -39,19 +39,17 @@ exception statement from your version. */
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkLabelPeer.h"
-JNIEXPORT void JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create
(JNIEnv *env, jobject obj)
{
GtkWidget *label;
- GtkContainer *ebox;
gdk_threads_enter ();
- ebox = GTK_CONTAINER (gtk_type_new (gtk_event_box_get_type ()));
- label = GTK_WIDGET (gtk_type_new (gtk_label_get_type ()));
- gtk_container_add (ebox, label);
- gtk_widget_show (label);
+
+ label = gtk_label_new (NULL);
+
gdk_threads_leave ();
- NSA_SET_PTR (env, obj, ebox);
+ NSA_SET_PTR (env, obj, label);
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
index 7c59f20a56e..f67845a794f 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
@@ -155,7 +155,7 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz)
postExposeEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
"postExposeEvent", "(IIII)V");
postKeyEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postKeyEvent", "(IJIIC)V");
+ "postKeyEvent", "(IJIICI)V");
postFocusEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
"postFocusEvent", "(IZ)V");
postAdjustmentEventID = (*env)->GetMethodID (env, gtkscrollbarpeer,
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
index 103ddd22a9a..9a62c1a5a36 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
@@ -47,6 +47,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create
GtkWidget *text, *sw;
gdk_threads_enter ();
+
text = gtk_text_view_new ();
gtk_widget_show (text);
@@ -159,7 +160,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_replaceRange
(*env)->ReleaseStringUTFChars (env, contents, str);
}
-JNIEXPORT void JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkSetFont
(JNIEnv *env, jobject obj, jstring jname, jint size)
{
@@ -169,19 +170,21 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkSetFont
PangoFontDescription *font_desc;
ptr = NSA_GET_PTR (env, obj);
+
text = GTK_WIDGET (TEXT_FROM_SW (ptr));
-
+
font_name = (*env)->GetStringUTFChars (env, jname, NULL);
gdk_threads_enter();
font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
gtk_widget_modify_font (GTK_WIDGET(text), font_desc);
+
pango_font_description_free (font_desc);
-
+
gdk_threads_leave();
(*env)->ReleaseStringUTFChars (env, jname, font_name);
-
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
index de590352dd1..29689fb8c00 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
@@ -39,6 +39,62 @@ exception statement from your version. */
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkTextComponentPeer.h"
+static void textcomponent_commit_cb (GtkIMContext *context,
+ const gchar *str,
+ jobject peer);
+
+static void textcomponent_changed_cb (GtkEditable *editable,
+ jobject peer);
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectHooks
+ (JNIEnv *env, jobject obj)
+{
+ void *ptr;
+ GtkTextView *text = NULL;
+ GtkTextBuffer *buf;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ gdk_threads_enter ();
+
+ if (GTK_IS_ENTRY(ptr))
+ {
+ g_signal_connect (GTK_ENTRY (ptr)->im_context, "commit",
+ G_CALLBACK (textcomponent_commit_cb), obj);
+
+ g_signal_connect (GTK_EDITABLE (ptr), "changed",
+ G_CALLBACK (textcomponent_changed_cb), obj);
+ }
+ else
+ {
+ if (GTK_IS_SCROLLED_WINDOW (ptr))
+ {
+ text = GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child);
+ }
+ else if (GTK_IS_TEXT_VIEW (ptr))
+ {
+ text = GTK_TEXT_VIEW (ptr);
+ }
+
+ if (text)
+ {
+ g_signal_connect (text->im_context, "commit",
+ G_CALLBACK (textcomponent_commit_cb), obj);
+
+ buf = gtk_text_view_get_buffer (text);
+ if (buf)
+ g_signal_connect (buf, "changed",
+ G_CALLBACK (textcomponent_changed_cb), obj);
+ }
+ }
+
+ gdk_threads_leave ();
+
+ /* Connect the superclass hooks. */
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks (env, obj);
+}
+
JNIEXPORT jint JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getCaretPosition
(JNIEnv *env, jobject obj)
@@ -371,18 +427,6 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText
if (GTK_IS_EDITABLE (ptr))
{
gtk_entry_set_text (GTK_ENTRY (ptr), str);
-
- if (gdk_property_get (GTK_WIDGET(ptr)->window,
- gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
- gdk_atom_intern ("CARDINAL", FALSE),
- 0,
- sizeof (jobject),
- FALSE,
- NULL,
- NULL,
- NULL,
- (guchar **)&obj_ptr))
- (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postTextEventID);
}
else
{
@@ -406,3 +450,35 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText
(*env)->ReleaseStringUTFChars (env, contents, str);
}
+
+static void
+textcomponent_commit_cb (GtkIMContext *context,
+ const gchar *str,
+ jobject peer)
+{
+ /* str is a \0-terminated UTF-8 encoded character. */
+ gunichar2 *jc = g_utf8_to_utf16 (str, -1, NULL, NULL, NULL);
+
+ if (jc)
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postKeyEventID,
+ (jint) AWT_KEY_TYPED,
+ /* We don't have access to the event
+ that caused this commit signal to
+ be fired. So approximate the event
+ time... */
+ (jlong) gdk_event_get_time (NULL),
+ /* ... and assume no modifiers. */
+ 0,
+ VK_UNDEFINED,
+ (jchar) jc[0],
+ AWT_KEY_LOCATION_UNKNOWN);
+ g_free (jc);
+}
+
+static void
+textcomponent_changed_cb (GtkEditable *editable,
+ jobject peer)
+{
+ (*gdk_env)->CallVoidMethod (gdk_env, peer, postTextEventID);
+}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
index 69b3e521abc..ee6132ddeea 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
@@ -52,23 +52,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create
NSA_SET_PTR (env, obj, widget);
}
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_connectHooks
- (JNIEnv *env, jobject obj)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gtk_widget_realize (GTK_WIDGET (ptr));
- connect_awt_hook (env, obj, 2,
- GTK_WIDGET (ptr)->window,
- GTK_ENTRY (ptr)->text_area);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkEntryGetSize
(JNIEnv *env, jobject obj, jint cols, jintArray jdims)
{
@@ -116,7 +100,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_setEchoChar
gdk_threads_leave ();
}
-JNIEXPORT void JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkSetFont
(JNIEnv *env, jobject obj, jstring jname, jint size)
{
@@ -126,15 +110,17 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkSetFont
PangoFontDescription *font_desc;
ptr = NSA_GET_PTR (env, obj);
-
+
entry = GTK_WIDGET (ptr);
font_name = (*env)->GetStringUTFChars (env, jname, NULL);
gdk_threads_enter();
font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
gtk_widget_modify_font (GTK_WIDGET(entry), font_desc);
+
pango_font_description_free (font_desc);
gdk_threads_leave();
diff --git a/libjava/jni/gtk-peer/gtkpeer.h b/libjava/jni/gtk-peer/gtkpeer.h
index 1cfa6c472cd..2aa7109725a 100644
--- a/libjava/jni/gtk-peer/gtkpeer.h
+++ b/libjava/jni/gtk-peer/gtkpeer.h
@@ -142,77 +142,82 @@ struct graphics
#define AWT_KEY_PRESSED 401
#define AWT_KEY_RELEASED 402
-#define VK_UNDEFINED 0
#define AWT_KEY_CHAR_UNDEFINED 0
-#define VK_0 48
-#define VK_1 49
-#define VK_2 50
-#define VK_3 51
-#define VK_4 52
-#define VK_5 53
-#define VK_6 54
-#define VK_7 55
-#define VK_8 56
-#define VK_9 57
-#define VK_A 65
-#define VK_ACCEPT 30
-#define VK_ADD 107
-#define VK_ALT 18
-#define VK_B 66
-#define VK_BACK_QUOTE 192
-#define VK_BACK_SLASH 92
-#define VK_BACK_SPACE 8
-#define VK_C 67
+#define AWT_KEY_LOCATION_UNKNOWN 0
+#define AWT_KEY_LOCATION_STANDARD 1
+#define AWT_KEY_LOCATION_LEFT 2
+#define AWT_KEY_LOCATION_RIGHT 3
+#define AWT_KEY_LOCATION_NUMPAD 4
+
+/* Virtual Keys */
+/* This list should be kept in the same order as the VK_ field
+ declarations in KeyEvent.java. */
+#define VK_ENTER '\n'
+#define VK_BACK_SPACE '\b'
+#define VK_TAB '\t'
#define VK_CANCEL 3
-#define VK_CAPS_LOCK 20
-#define VK_CLEAR 12
-#define VK_CLOSE_BRACKET 93
-#define VK_COMMA 44
+#define VK_CLEAR 12
+#define VK_SHIFT 16
#define VK_CONTROL 17
-#define VK_CONVERT 28
-#define VK_D 68
-#define VK_DECIMAL 110
-#define VK_DELETE 127
-#define VK_DIVIDE 111
-#define VK_DOWN 40
-#define VK_E 69
-#define VK_END 35
-#define VK_ENTER 10
+#define VK_ALT 18
+#define VK_PAUSE 19
+#define VK_CAPS_LOCK 20
#define VK_ESCAPE 27
-#define VK_F 70
-#define VK_F1 112
-#define VK_F10 121
-#define VK_F11 122
-#define VK_F12 123
-#define VK_F2 113
-#define VK_F3 114
-#define VK_F4 115
-#define VK_F5 116
-#define VK_F6 117
-#define VK_F7 118
-#define VK_F8 119
-#define VK_F9 120
-#define VK_FINAL 24
-#define VK_G 71
-#define VK_H 72
-#define VK_HELP 156
+#define VK_SPACE ' '
+#define VK_PAGE_UP 33
+#define VK_PAGE_DOWN 34
+#define VK_END 35
#define VK_HOME 36
-#define VK_I 73
-#define VK_INSERT 155
-#define VK_J 74
-#define VK_K 75
-#define VK_KANA 21
-#define VK_KANJI 25
-#define VK_L 76
#define VK_LEFT 37
-#define VK_M 77
-#define VK_META 157
-#define VK_MODECHANGE 31
-#define VK_MULTIPLY 106
-#define VK_N 78
-#define VK_NONCONVERT 29
-#define VK_NUM_LOCK 144
+#define VK_UP 38
+#define VK_RIGHT 39
+#define VK_DOWN 40
+#define VK_COMMA ','
+#define VK_MINUS '-'
+#define VK_PERIOD '.'
+#define VK_SLASH '/'
+#define VK_0 '0'
+#define VK_1 '1'
+#define VK_2 '2'
+#define VK_3 '3'
+#define VK_4 '4'
+#define VK_5 '5'
+#define VK_6 '6'
+#define VK_7 '7'
+#define VK_8 '8'
+#define VK_9 '9'
+#define VK_SEMICOLON ';'
+#define VK_EQUALS '='
+#define VK_A 'A'
+#define VK_B 'B'
+#define VK_C 'C'
+#define VK_D 'D'
+#define VK_E 'E'
+#define VK_F 'F'
+#define VK_G 'G'
+#define VK_H 'H'
+#define VK_I 'I'
+#define VK_J 'J'
+#define VK_K 'K'
+#define VK_L 'L'
+#define VK_M 'M'
+#define VK_N 'N'
+#define VK_O 'O'
+#define VK_P 'P'
+#define VK_Q 'Q'
+#define VK_R 'R'
+#define VK_S 'S'
+#define VK_T 'T'
+#define VK_U 'U'
+#define VK_V 'V'
+#define VK_W 'W'
+#define VK_X 'X'
+#define VK_Y 'Y'
+#define VK_Z 'Z'
+#define VK_OPEN_BRACKET '['
+#define VK_BACK_SLASH '\\'
+#define VK_CLOSE_BRACKET ']'
#define VK_NUMPAD0 96
#define VK_NUMPAD1 97
#define VK_NUMPAD2 98
@@ -223,35 +228,117 @@ struct graphics
#define VK_NUMPAD7 103
#define VK_NUMPAD8 104
#define VK_NUMPAD9 105
-#define VK_O 79
-#define VK_OPEN_BRACKET 91
-#define VK_P 80
-#define VK_PAGE_DOWN 34
-#define VK_PAGE_UP 33
-#define VK_PAUSE 19
-#define VK_PERIOD 46
-#define VK_PRINTSCREEN 154
-#define VK_Q 81
-#define VK_QUOTE 222
-#define VK_R 82
-#define VK_RIGHT 39
-#define VK_S 83
-#define VK_SCROLL_LOCK 145
-#define VK_SEMICOLON 59
+#define VK_MULTIPLY 106
+#define VK_ADD 107
+#define VK_SEPARATER 108
#define VK_SEPARATOR 108
-#define VK_SHIFT 16
-#define VK_SLASH 47
-#define VK_SPACE 32
#define VK_SUBTRACT 109
-#define VK_T 84
-#define VK_TAB 9
-#define VK_U 85
-#define VK_UP 38
-#define VK_V 86
-#define VK_W 87
-#define VK_X 88
-#define VK_Y 89
-#define VK_Z 90
+#define VK_DECIMAL 110
+#define VK_DIVIDE 111
+#define VK_DELETE 127
+#define VK_NUM_LOCK 144
+#define VK_SCROLL_LOCK 145
+#define VK_F1 112
+#define VK_F2 113
+#define VK_F3 114
+#define VK_F4 115
+#define VK_F5 116
+#define VK_F6 117
+#define VK_F7 118
+#define VK_F8 119
+#define VK_F9 120
+#define VK_F10 121
+#define VK_F11 122
+#define VK_F12 123
+#define VK_F13 61440
+#define VK_F14 61441
+#define VK_F15 61442
+#define VK_F16 61443
+#define VK_F17 61444
+#define VK_F18 61445
+#define VK_F19 61446
+#define VK_F20 61447
+#define VK_F21 61448
+#define VK_F22 61449
+#define VK_F23 61450
+#define VK_F24 61451
+#define VK_PRINTSCREEN 154
+#define VK_INSERT 155
+#define VK_HELP 156
+#define VK_META 157
+#define VK_BACK_QUOTE 192
+#define VK_QUOTE 222
+#define VK_KP_UP 224
+#define VK_KP_DOWN 225
+#define VK_KP_LEFT 226
+#define VK_KP_RIGHT 227
+#define VK_DEAD_GRAVE 128
+#define VK_DEAD_ACUTE 129
+#define VK_DEAD_CIRCUMFLEX 130
+#define VK_DEAD_TILDE 131
+#define VK_DEAD_MACRON 132
+#define VK_DEAD_BREVE 133
+#define VK_DEAD_ABOVEDOT 134
+#define VK_DEAD_DIAERESIS 135
+#define VK_DEAD_ABOVERING 136
+#define VK_DEAD_DOUBLEACUTE 137
+#define VK_DEAD_CARON 138
+#define VK_DEAD_CEDILLA 139
+#define VK_DEAD_OGONEK 140
+#define VK_DEAD_IOTA 141
+#define VK_DEAD_VOICED_SOUND 142
+#define VK_DEAD_SEMIVOICED_SOUND 143
+#define VK_AMPERSAND 150
+#define VK_ASTERISK 151
+#define VK_QUOTEDBL 152
+#define VK_LESS 153
+#define VK_GREATER 160
+#define VK_BRACELEFT 161
+#define VK_BRACERIGHT 162
+#define VK_AT 512
+#define VK_COLON 513
+#define VK_CIRCUMFLEX 514
+#define VK_DOLLAR 515
+#define VK_EURO_SIGN 516
+#define VK_EXCLAMATION_MARK 517
+#define VK_INVERTED_EXCLAMATION_MARK 518
+#define VK_LEFT_PARENTHESIS 519
+#define VK_NUMBER_SIGN 520
+#define VK_PLUS 521
+#define VK_RIGHT_PARENTHESIS 522
+#define VK_UNDERSCORE 523
+#define VK_FINAL 24
+#define VK_CONVERT 28
+#define VK_NONCONVERT 29
+#define VK_ACCEPT 30
+#define VK_MODECHANGE 31
+#define VK_KANA 21
+#define VK_KANJI 25
+#define VK_ALPHANUMERIC 240
+#define VK_KATAKANA 241
+#define VK_HIRAGANA 242
+#define VK_FULL_WIDTH 243
+#define VK_HALF_WIDTH 244
+#define VK_ROMAN_CHARACTERS 245
+#define VK_ALL_CANDIDATES 256
+#define VK_PREVIOUS_CANDIDATE 257
+#define VK_CODE_INPUT 258
+#define VK_JAPANESE_KATAKANA 259
+#define VK_JAPANESE_HIRAGANA 260
+#define VK_JAPANESE_ROMAN 261
+#define VK_KANA_LOCK 262
+#define VK_INPUT_METHOD_ON_OFF 263
+#define VK_CUT 65489
+#define VK_COPY 65485
+#define VK_PASTE 65487
+#define VK_UNDO 65483
+#define VK_AGAIN 65481
+#define VK_FIND 65488
+#define VK_PROPS 65482
+#define VK_STOP 65480
+#define VK_COMPOSE 65312
+#define VK_ALT_GRAPH 65406
+#define VK_UNDEFINED 0
#define AWT_FOCUS_LOST 1004
#define AWT_FOCUS_GAINED 1005
diff --git a/libjava/libart.m4 b/libjava/libart.m4
index 9380a222de6..48d86651636 100644
--- a/libjava/libart.m4
+++ b/libjava/libart.m4
@@ -32,7 +32,10 @@ AC_ARG_ENABLE(libarttest, [ --disable-libarttest Do not try to compile an
fi
fi
- AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
+ AC_PATH_PROG(LIBART_CONFIG, libart2-config, no)
+ if test "$LIBART_CONFIG" = "no" ; then
+ AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
+ fi
min_libart_version=ifelse([$1], ,0.2.5,$1)
AC_MSG_CHECKING(for LIBART - version >= $min_libart_version)
no_libart=""
diff --git a/libjava/libltdl/ChangeLog b/libjava/libltdl/ChangeLog
index e84f3c7591b..67edbdd80cb 100644
--- a/libjava/libltdl/ChangeLog
+++ b/libjava/libltdl/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Don't initialize GCINCS to boehm-gc/include.
+ * Regenerate.
+
2002-04-28 Mark Mitchell <mark@codesourcery.com>
* .cvsignore: Remove files that are present in CVS.
diff --git a/libjava/libltdl/configure b/libjava/libltdl/configure
index 9dc2aea355e..76d37e8b4ba 100755
--- a/libjava/libltdl/configure
+++ b/libjava/libltdl/configure
@@ -2497,8 +2497,7 @@ fi
GCINCS=
if test "$GC" = "boehm"; then
- GCINCS='-I$(top_srcdir)/../../boehm-gc/include'
- GCINCS="$GCINCS `cat ../../boehm-gc/boehm-cflags`"
+ GCINCS="`cat ../../boehm-gc/boehm-cflags`"
cat >> confdefs.h <<\EOF
#define HAVE_BOEHM_GC 1
EOF
@@ -2507,7 +2506,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2511: checking how to run the C preprocessor" >&5
+echo "configure:2510: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2522,13 +2521,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 2526 "configure"
+#line 2525 "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:2532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2531: \"$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
:
@@ -2539,13 +2538,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2543 "configure"
+#line 2542 "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:2549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2548: \"$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
:
@@ -2556,13 +2555,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2560 "configure"
+#line 2559 "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:2566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2565: \"$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
:
@@ -2594,7 +2593,7 @@ rm -f conftest
# Check for command to grab the raw symbol name followed by C symbol from nm.
echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:2598: checking command to parse $NM output" >&5
+echo "configure:2597: checking command to parse $NM output" >&5
if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2657,11 +2656,11 @@ void nm_test_func(){}
int main(){nm_test_var='a';nm_test_func;return 0;}
EOF
- if { (eval echo configure:2661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
# Now try to grab the symbols.
ac_nlist=conftest.nm
- if { (eval echo configure:2665: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ if { (eval echo configure:2664: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
# Try sorting and uniquifying the output.
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
@@ -2713,7 +2712,7 @@ EOF
ac_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo configure:2717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ if { (eval echo configure:2716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_pipe_works=yes
else
echo "configure: failed program was:" >&5
@@ -2759,12 +2758,12 @@ fi
echo "$ac_t""$ac_result" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2763: checking for ANSI C header files" >&5
+echo "configure:2762: 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 2768 "configure"
+#line 2767 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2772,7 +2771,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2775: \"$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*
@@ -2789,7 +2788,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 2793 "configure"
+#line 2792 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2807,7 +2806,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 2811 "configure"
+#line 2810 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2828,7 +2827,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2832 "configure"
+#line 2831 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2839,7 +2838,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2889,7 +2888,7 @@ else
fi
echo $ac_n "checking which extension is used for shared libraries""... $ac_c" 1>&6
-echo "configure:2893: checking which extension is used for shared libraries" >&5
+echo "configure:2892: checking which extension is used for shared libraries" >&5
if eval "test \"`echo '$''{'libltdl_cv_shlibext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2916,7 +2915,7 @@ EOF
fi
echo $ac_n "checking which variable specifies run-time library path""... $ac_c" 1>&6
-echo "configure:2920: checking which variable specifies run-time library path" >&5
+echo "configure:2919: checking which variable specifies run-time library path" >&5
if eval "test \"`echo '$''{'libltdl_cv_shlibpath_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2932,7 +2931,7 @@ EOF
fi
echo $ac_n "checking for the default library search path""... $ac_c" 1>&6
-echo "configure:2936: checking for the default library search path" >&5
+echo "configure:2935: checking for the default library search path" >&5
if eval "test \"`echo '$''{'libltdl_cv_sys_search_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2960,7 +2959,7 @@ EOF
fi
echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:2964: checking for objdir" >&5
+echo "configure:2963: checking for objdir" >&5
if eval "test \"`echo '$''{'libltdl_cv_objdir'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2987,7 +2986,7 @@ EOF
echo $ac_n "checking whether libtool supports -dlopen/-dlpreopen""... $ac_c" 1>&6
-echo "configure:2991: checking whether libtool supports -dlopen/-dlpreopen" >&5
+echo "configure:2990: checking whether libtool supports -dlopen/-dlpreopen" >&5
if eval "test \"`echo '$''{'libltdl_cv_preloaded_symbols'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3009,7 +3008,7 @@ fi
LIBADD_DL=
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:3013: checking for dlopen in -ldl" >&5
+echo "configure:3012: 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
@@ -3017,7 +3016,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3021 "configure"
+#line 3020 "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
@@ -3028,7 +3027,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:3032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3031: \"$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
@@ -3050,12 +3049,12 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:3054: checking for dlopen" >&5
+echo "configure:3053: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3059 "configure"
+#line 3058 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -3078,7 +3077,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:3082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -3099,7 +3098,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:3103: checking for dlopen in -lsvld" >&5
+echo "configure:3102: checking for dlopen in -lsvld" >&5
ac_lib_var=`echo svld'_'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
@@ -3107,7 +3106,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsvld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3111 "configure"
+#line 3110 "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
@@ -3118,7 +3117,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3121: \"$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
@@ -3147,12 +3146,12 @@ fi
fi
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:3151: checking for shl_load" >&5
+echo "configure:3150: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3156 "configure"
+#line 3155 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
@@ -3175,7 +3174,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo configure:3179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shl_load=yes"
else
@@ -3196,7 +3195,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:3200: checking for shl_load in -ldld" >&5
+echo "configure:3199: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3204,7 +3203,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3208 "configure"
+#line 3207 "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
@@ -3215,7 +3214,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3218: \"$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
@@ -3243,7 +3242,7 @@ fi
fi
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:3247: checking for dld_link in -ldld" >&5
+echo "configure:3246: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3251,7 +3250,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3255 "configure"
+#line 3254 "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
@@ -3262,7 +3261,7 @@ int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3265: \"$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
@@ -3293,12 +3292,12 @@ if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; the
for ac_func in dlerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3297: checking for $ac_func" >&5
+echo "configure:3296: 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 3302 "configure"
+#line 3301 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3321,7 +3320,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3324: \"$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
@@ -3349,7 +3348,7 @@ done
fi
echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:3353: checking for _ prefix in compiled symbols" >&5
+echo "configure:3352: checking for _ prefix in compiled symbols" >&5
if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3358,10 +3357,10 @@ cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
-if { (eval echo configure:3362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
# Now try to grab the symbols.
ac_nlist=conftest.nm
- if { (eval echo configure:3365: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ if { (eval echo configure:3364: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
# See whether the symbols have a leading underscore.
if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
ac_cv_sys_symbol_underscore=yes
@@ -3388,7 +3387,7 @@ if test x"$ac_cv_sys_symbol_underscore" = xyes; then
if test x"$ac_cv_func_dlopen" = xyes ||
test x"$ac_cv_lib_dl_dlopen" = xyes ; then
echo $ac_n "checking whether we have to add an underscore for dlsym""... $ac_c" 1>&6
-echo "configure:3392: checking whether we have to add an underscore for dlsym" >&5
+echo "configure:3391: checking whether we have to add an underscore for dlsym" >&5
if eval "test \"`echo '$''{'libltdl_cv_need_uscore'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3397,7 +3396,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 3401 "configure"
+#line 3400 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -3444,7 +3443,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo configure:3448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
libltdl_cv_need_uscore=no
else
@@ -3476,17 +3475,17 @@ for ac_hdr in malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3480: checking for $ac_hdr" >&5
+echo "configure:3479: 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 3485 "configure"
+#line 3484 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3489: \"$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*
@@ -3516,17 +3515,17 @@ for ac_hdr in string.h strings.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3520: checking for $ac_hdr" >&5
+echo "configure:3519: 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 3525 "configure"
+#line 3524 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3529: \"$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*
@@ -3555,12 +3554,12 @@ done
for ac_func in strchr index
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3559: checking for $ac_func" >&5
+echo "configure:3558: 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 3564 "configure"
+#line 3563 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3583,7 +3582,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3586: \"$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
@@ -3610,12 +3609,12 @@ done
for ac_func in strrchr rindex
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3614: checking for $ac_func" >&5
+echo "configure:3613: 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 3619 "configure"
+#line 3618 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3638,7 +3637,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3641: \"$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
@@ -3665,12 +3664,12 @@ done
for ac_func in strcmp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3669: checking for $ac_func" >&5
+echo "configure:3668: 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 3674 "configure"
+#line 3673 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3693,7 +3692,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3696: \"$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
diff --git a/libjava/libltdl/configure.in b/libjava/libltdl/configure.in
index 9d96d9086fd..3c1fa37356f 100644
--- a/libjava/libltdl/configure.in
+++ b/libjava/libltdl/configure.in
@@ -47,8 +47,7 @@ changequote([,])
GCINCS=
if test "$GC" = "boehm"; then
- GCINCS='-I$(top_srcdir)/../../boehm-gc/include'
- GCINCS="$GCINCS `cat ../../boehm-gc/boehm-cflags`"
+ GCINCS="`cat ../../boehm-gc/boehm-cflags`"
AC_DEFINE(HAVE_BOEHM_GC)
fi
AC_SUBST(GCINCS)
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 8c37e22858e..835092de709 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,35 @@
+2003-08-12 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jacks/jacks.xfail: Updated to account for new passes.
+ * libjava.compile/abstr.xfail: Now can compile from bytecode.
+ * libjava.compile/PR5641.xfail: Now can compile from bytecode.
+
+ * libjava.mauve/mauve.exp (test_mauve_sim): Don't find
+ DejaGNUTestHarness in gnu/testlet.
+ (test_mauve): Use correct object extension.
+
+2003-08-12 Tom Tromey <tromey@redhat.com>
+
+ * lib/libjava.exp (libjava_find_lib): Search for .so file first.
+ (libjava_arguments): Don't add libraries to link line explictly.
+
+2003-08-05 Tom Tromey <tromey@redhat.com>
+
+ For PR java/11600:
+ * libjava.compile/PR11600.xfail: New file.
+ * libjava.compile/PR11600.java: New file.
+
+2003-08-04 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jacks/jacks.exp (gcj_jacks_run): Just ignore errors
+ from jacks.
+
+2003-07-24 Tom Tromey <tromey@redhat.com>
+
+ For PR libgcj/7482:
+ * libjava.lang/PR7482.java: New file.
+ * libjava.lang/PR7482.out: New file.
+
2003-07-20 Tom Tromey <tromey@redhat.com>
* libjava.mauve/mauve.exp (mauve_find_harness_files): New proc.
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 972b7be64cc..0717256b396 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -200,6 +200,7 @@ proc libjava_init { args } {
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
lappend libjava_libgcc_s_path $gccdir
+ verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
set compiler ${gccdir}/xgcc
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
@@ -234,21 +235,24 @@ proc libjava_init { args } {
proc libjava_find_lib {dir name} {
global base_dir
set gp [get_multilibs]
- foreach sub {.libs _libs} {
- if {$gp != ""} {
- if {[file exists $gp/$dir/$sub/lib${name}.a]} then {
- # Just return the `-L' option. The library itself
- # will be picked up via the spec file.
- return "-L$gp/$dir/$sub"
+ foreach extension {so dll a} {
+ foreach sub {.libs _libs} {
+ if {$gp != ""} {
+ if {[file exists $gp/$dir/$sub/lib${name}.${extension}]} then {
+ # Just return the `-L' option. The library itself
+ # will be picked up via the spec file.
+ return "-L$gp/$dir/$sub"
+ }
+ }
+ # Just return the `-L' option. The library itself will be
+ # picked up via the spec file.
+ set lib [findfile \
+ $base_dir/../../$dir/$sub/lib${name}.${extension} \
+ "-L$base_dir/../../$dir/$sub" \
+ ""]
+ if {$lib != ""} {
+ return $lib
}
- }
- # Just return the `-L' option. The library itself will be
- # picked up via the spec file.
- set lib [findfile $base_dir/../../$dir/$sub/lib${name}.a \
- "-L$base_dir/../../$dir/$sub" \
- ""]
- if {$lib != ""} {
- return $lib
}
}
return ""
@@ -340,10 +344,6 @@ proc libjava_arguments {{mode compile}} {
set libz [libjava_find_lib zlib zgcj]
}
- # FIXME: there's no way to determine whether -lpthread is
- # required. We should get this info from configure, or it should
- # just be in the compiler driver.
-
verbose "using LIBJAVA = $libjava" 2
verbose "using LIBGC = $libgc" 2
verbose "using LIBQTHREADS = $libqthreads" 2
@@ -365,6 +365,7 @@ proc libjava_arguments {{mode compile}} {
}
set lpath [concat $lpath $libjava_libgcc_s_path]
+ verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
set ld_library_path [join $lpath :]
# That's enough to make things work for the normal case.
@@ -384,13 +385,9 @@ proc libjava_arguments {{mode compile}} {
set env(CLASSPATH) ".:$srcdir/$subdir:$objdir:$libgcj_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"
+ global wrapper_file wrap_compile_flags
+ lappend args "additional_flags=$wrap_compile_flags"
+ lappend args "libs=$wrapper_file"
lappend args debug
}
diff --git a/libjava/testsuite/libjava.compile/PR5641.xfail b/libjava/testsuite/libjava.compile/PR5641.xfail
index b3630c99118..76540afa49b 100644
--- a/libjava/testsuite/libjava.compile/PR5641.xfail
+++ b/libjava/testsuite/libjava.compile/PR5641.xfail
@@ -1,2 +1 @@
no-link
-xfail-byte
diff --git a/libjava/testsuite/libjava.compile/abstr.xfail b/libjava/testsuite/libjava.compile/abstr.xfail
index b3630c99118..76540afa49b 100644
--- a/libjava/testsuite/libjava.compile/abstr.xfail
+++ b/libjava/testsuite/libjava.compile/abstr.xfail
@@ -1,2 +1 @@
no-link
-xfail-byte
diff --git a/libjava/testsuite/libjava.jacks/jacks.exp b/libjava/testsuite/libjava.jacks/jacks.exp
index d8611f5e438..8b2bd9b5b5a 100644
--- a/libjava/testsuite/libjava.jacks/jacks.exp
+++ b/libjava/testsuite/libjava.jacks/jacks.exp
@@ -89,14 +89,11 @@ proc gcj_jacks_run {} {
gcj_jacks_write gcj_setup
verbose "Running Jacks..."
- if {[catch {exec ./jacks gcj} msg]} {
- verbose "jacks invocation failure: $msg"
- fail "running jacks"
- } else {
- pass "running jacks"
+ # Just ignore error exits from the jacks program.
+ # It will always error exit for us, since don't completely pass.
+ catch {exec ./jacks gcj} msg
- gcj_jacks_parse logging/gcj.log
- }
+ gcj_jacks_parse logging/gcj.log
cd $here
}
diff --git a/libjava/testsuite/libjava.jacks/jacks.xfail b/libjava/testsuite/libjava.jacks/jacks.xfail
index df8d5b94dab..e5baf9f88ad 100644
--- a/libjava/testsuite/libjava.jacks/jacks.xfail
+++ b/libjava/testsuite/libjava.jacks/jacks.xfail
@@ -141,8 +141,6 @@
8.1.1.1-default-abstract-15
8.1.1.1-default-abstract-19
8.1.1.1-default-abstract-21
-8.1.1.1-default-abstract-22
-8.1.1.1-default-abstract-24
8.1.1.1-default-abstract-25
8.1.2-static-1
8.1.2-static-11
@@ -223,21 +221,15 @@
8.5-inheritance-3
8.5-inheritance-6
8.5.2-non-static-member-usage-2
-8.4.6-miranda-2
-8.4.6-miranda-3
-8.4.6-miranda-4
8.4.6-inheritance-1
8.4.6-inheritance-2
8.4.6.2-hiding-3
8.4.6.4-multiple-3
8.4.6.4-multiple-4
-8.4.6.4-multiple-5
8.4.6.4-multiple-7
8.4.6.4-multiple-8
8.4.6.4-abstract-1
8.4.6.4-abstract-2
-8.4.6.4-abstract-4
-8.4.6.4-abstract-9
8.4.6.4-abstract-10
8.4.6.1-override-3
8.4.6.3-modifier-8
@@ -252,11 +244,6 @@
8.4.6.3-default-12
8.4.6.3-default-14
8.4.6.3-signature-4
-8.4.6.3-signature-7
-8.4.6.3-signature-9
-8.4.6.3-signature-10
-8.4.6.3-signature-12
-8.4.6.3-signature-15
8.7-abrupt-1
8.7-complete-1
8.7-complete-3
@@ -613,10 +600,7 @@
9.2-implicit-4
9.2-implicit-6
9.2-implicit-7
-9.2-implicit-11
-9.2-implicit-12
9.2-implicit-15
-9.2-implicit-17
9.2-implicit-18
9.2-implicit-19
3.2-valid-1
diff --git a/libjava/testsuite/libjava.mauve/mauve.exp b/libjava/testsuite/libjava.mauve/mauve.exp
index 4ef1a104fd2..03bbed9fd9f 100644
--- a/libjava/testsuite/libjava.mauve/mauve.exp
+++ b/libjava/testsuite/libjava.mauve/mauve.exp
@@ -167,11 +167,17 @@ proc test_mauve {} {
set link_args [concat [libjava_arguments link] \
[list "additional_flags=--main=DejaGNUTestHarness"]]
+ if {[string match "*libtool*" $compile_args]} {
+ set objext lo
+ } else {
+ set objext o
+ }
+
set ok 1
set objlist {}
foreach base [mauve_find_harness_files] {
set file $base.class
- set obj $base.o
+ set obj $base.$objext
set x [libjava_prune_warnings \
[target_compile [pwd]/$file $obj object $compile_args]]
if {$x != ""} then {
@@ -194,7 +200,10 @@ proc test_mauve {} {
regsub -all -- / $class . class
set ok 1
+ set this_olist {}
foreach obj $uses($file) {
+ set obj [file rootname $obj].$objext
+ lappend this_olist $obj
if {! [file exists $obj]} then {
verbose "compiling $obj for test of $class"
# The .class file does contain a $, but we can quote it between "'"s.
@@ -216,7 +225,7 @@ proc test_mauve {} {
}
set x [libjava_prune_warnings \
- [libjava_tcompile [concat $uses($file) $objlist] \
+ [libjava_tcompile [concat $this_olist $objlist] \
$Executable executable $link_args]]
if {$x != ""} then {
set proc_ok 0
@@ -325,8 +334,6 @@ proc test_mauve_sim {} {
return 0
}
- lappend objlist gnu/testlet/DejaGNUTestHarness.o
-
set proc_ok 1
set Executable DejaGNUTestHarness
foreach file $choices {
@@ -377,8 +384,8 @@ proc test_mauve_sim {} {
}
set x [libjava_prune_warnings \
- [target_compile gnu/testlet/DejaGNUTestHarness.class \
- gnu/testlet/DejaGNUTestHarness.o object $compile_args]]
+ [target_compile DejaGNUTestHarness.class \
+ DejaGNUTestHarness.o object $compile_args]]
if {$x != ""} then {
fail "Compile DejaGNUTestHarness.java"
set proc_ok 0
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 4a6ca458849..ba408aa98be 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1,4 +1,4 @@
-// defineclass.cc - defining a class from .class format.
+// verify.cc - verify bytecode
/* Copyright (C) 2001, 2002, 2003 Free Software Foundation
@@ -58,6 +58,7 @@ private:
struct subr_info;
struct subr_entry_info;
struct linked_utf8;
+ struct ref_intersection;
// The current PC.
int PC;
@@ -104,6 +105,9 @@ private:
// but without this our utf8 objects would be collected.
linked_utf8 *utf8_list;
+ // A linked list of all ref_intersection objects we allocate.
+ ref_intersection *isect_list;
+
struct linked_utf8
{
_Jv_Utf8Const *val;
@@ -189,9 +193,219 @@ private:
// Everything after `reference_type' must be a reference type.
reference_type,
null_type,
- unresolved_reference_type,
- uninitialized_reference_type,
- uninitialized_unresolved_reference_type
+ uninitialized_reference_type
+ };
+
+ // This represents a merged class type. Some verifiers (including
+ // earlier versions of this one) will compute the intersection of
+ // two class types when merging states. However, this loses
+ // critical information about interfaces implemented by the various
+ // classes. So instead we keep track of all the actual classes that
+ // have been merged.
+ struct ref_intersection
+ {
+ // Whether or not this type has been resolved.
+ bool is_resolved;
+
+ // Actual type data.
+ union
+ {
+ // For a resolved reference type, this is a pointer to the class.
+ jclass klass;
+ // For other reference types, this it the name of the class.
+ _Jv_Utf8Const *name;
+ } data;
+
+ // Link to the next reference in the intersection.
+ ref_intersection *ref_next;
+
+ // This is used to keep track of all the allocated
+ // ref_intersection objects, so we can free them.
+ // FIXME: we should allocate these in chunks.
+ ref_intersection *alloc_next;
+
+ ref_intersection (jclass klass, _Jv_BytecodeVerifier *verifier)
+ : ref_next (NULL)
+ {
+ is_resolved = true;
+ data.klass = klass;
+ alloc_next = verifier->isect_list;
+ verifier->isect_list = this;
+ }
+
+ ref_intersection (_Jv_Utf8Const *name, _Jv_BytecodeVerifier *verifier)
+ : ref_next (NULL)
+ {
+ is_resolved = false;
+ data.name = name;
+ alloc_next = verifier->isect_list;
+ verifier->isect_list = this;
+ }
+
+ ref_intersection (ref_intersection *dup, ref_intersection *tail,
+ _Jv_BytecodeVerifier *verifier)
+ : ref_next (tail)
+ {
+ is_resolved = dup->is_resolved;
+ data = dup->data;
+ alloc_next = verifier->isect_list;
+ verifier->isect_list = this;
+ }
+
+ bool equals (ref_intersection *other, _Jv_BytecodeVerifier *verifier)
+ {
+ if (! is_resolved && ! other->is_resolved
+ && _Jv_equalUtf8Consts (data.name, other->data.name))
+ return true;
+ if (! is_resolved)
+ resolve (verifier);
+ if (! other->is_resolved)
+ other->resolve (verifier);
+ return data.klass == other->data.klass;
+ }
+
+ // Merge THIS type into OTHER, returning the result. This will
+ // return OTHER if all the classes in THIS already appear in
+ // OTHER.
+ ref_intersection *merge (ref_intersection *other,
+ _Jv_BytecodeVerifier *verifier)
+ {
+ ref_intersection *tail = other;
+ for (ref_intersection *self = this; self != NULL; self = self->ref_next)
+ {
+ bool add = true;
+ for (ref_intersection *iter = other; iter != NULL;
+ iter = iter->ref_next)
+ {
+ if (iter->equals (self, verifier))
+ {
+ add = false;
+ break;
+ }
+ }
+
+ if (add)
+ tail = new ref_intersection (self, tail, verifier);
+ }
+ return tail;
+ }
+
+ void resolve (_Jv_BytecodeVerifier *verifier)
+ {
+ if (is_resolved)
+ return;
+
+ using namespace java::lang;
+ java::lang::ClassLoader *loader
+ = verifier->current_class->getClassLoaderInternal();
+ // We might see either kind of name. Sigh.
+ if (data.name->data[0] == 'L'
+ && data.name->data[data.name->length - 1] == ';')
+ data.klass = _Jv_FindClassFromSignature (data.name->data, loader);
+ else
+ data.klass = Class::forName (_Jv_NewStringUtf8Const (data.name),
+ false, loader);
+ is_resolved = true;
+ }
+
+ // See if an object of type OTHER can be assigned to an object of
+ // type *THIS. This might resolve classes in one chain or the
+ // other.
+ bool compatible (ref_intersection *other,
+ _Jv_BytecodeVerifier *verifier)
+ {
+ ref_intersection *self = this;
+
+ for (; self != NULL; self = self->ref_next)
+ {
+ ref_intersection *other_iter = other;
+
+ for (; other_iter != NULL; other_iter = other_iter->ref_next)
+ {
+ // Avoid resolving if possible.
+ if (! self->is_resolved
+ && ! other_iter->is_resolved
+ && _Jv_equalUtf8Consts (self->data.name,
+ other_iter->data.name))
+ continue;
+
+ if (! self->is_resolved)
+ self->resolve(verifier);
+ if (! other_iter->is_resolved)
+ other_iter->resolve(verifier);
+
+ if (! is_assignable_from_slow (self->data.klass,
+ other_iter->data.klass))
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ bool isarray ()
+ {
+ // assert (ref_next == NULL);
+ if (is_resolved)
+ return data.klass->isArray ();
+ else
+ return data.name->data[0] == '[';
+ }
+
+ bool isinterface (_Jv_BytecodeVerifier *verifier)
+ {
+ // assert (ref_next == NULL);
+ if (! is_resolved)
+ resolve (verifier);
+ return data.klass->isInterface ();
+ }
+
+ bool isabstract (_Jv_BytecodeVerifier *verifier)
+ {
+ // assert (ref_next == NULL);
+ if (! is_resolved)
+ resolve (verifier);
+ using namespace java::lang::reflect;
+ return Modifier::isAbstract (data.klass->getModifiers ());
+ }
+
+ jclass getclass (_Jv_BytecodeVerifier *verifier)
+ {
+ if (! is_resolved)
+ resolve (verifier);
+ return data.klass;
+ }
+
+ int count_dimensions ()
+ {
+ int ndims = 0;
+ if (is_resolved)
+ {
+ jclass k = data.klass;
+ while (k->isArray ())
+ {
+ k = k->getComponentType ();
+ ++ndims;
+ }
+ }
+ else
+ {
+ char *p = data.name->data;
+ while (*p++ == '[')
+ ++ndims;
+ }
+ return ndims;
+ }
+
+ void *operator new (size_t bytes)
+ {
+ return _Jv_Malloc (bytes);
+ }
+
+ void operator delete (void *mem)
+ {
+ _Jv_Free (mem);
+ }
};
// Return the type_val corresponding to a primitive signature
@@ -244,8 +458,21 @@ private:
// TARGET haven't been prepared.
static bool is_assignable_from_slow (jclass target, jclass source)
{
- // This will terminate when SOURCE==Object.
- while (true)
+ // First, strip arrays.
+ while (target->isArray ())
+ {
+ // If target is array, source must be as well.
+ if (! source->isArray ())
+ return false;
+ target = target->getComponentType ();
+ source = source->getComponentType ();
+ }
+
+ // Quick success.
+ if (target == &java::lang::Object::class$)
+ return true;
+
+ do
{
if (source == target)
return true;
@@ -253,49 +480,21 @@ private:
if (target->isPrimitive () || source->isPrimitive ())
return false;
- if (target->isArray ())
- {
- if (! source->isArray ())
- return false;
- target = target->getComponentType ();
- source = source->getComponentType ();
- }
- else if (target->isInterface ())
+ if (target->isInterface ())
{
for (int i = 0; i < source->interface_count; ++i)
{
// We use a recursive call because we also need to
// check superinterfaces.
if (is_assignable_from_slow (target, source->interfaces[i]))
- return true;
- }
- source = source->getSuperclass ();
- if (source == NULL)
- return false;
- }
- // We must do this check before we check to see if SOURCE is
- // an interface. This way we know that any interface is
- // assignable to an Object.
- else if (target == &java::lang::Object::class$)
- return true;
- else if (source->isInterface ())
- {
- for (int i = 0; i < target->interface_count; ++i)
- {
- // We use a recursive call because we also need to
- // check superinterfaces.
- if (is_assignable_from_slow (target->interfaces[i], source))
return true;
}
- target = target->getSuperclass ();
- if (target == NULL)
- return false;
}
- else if (source == &java::lang::Object::class$)
- return false;
- else
- source = source->getSuperclass ();
+ source = source->getSuperclass ();
}
+ while (source != NULL);
+
+ return false;
}
// This is used to keep track of which `jsr's correspond to a given
@@ -324,16 +523,12 @@ private:
// verifier.
struct type
{
- // The type.
+ // The type key.
type_val key;
- // Some associated data.
- union
- {
- // For a resolved reference type, this is a pointer to the class.
- jclass klass;
- // For other reference types, this it the name of the class.
- _Jv_Utf8Const *name;
- } data;
+
+ // For reference types, the representation of the type.
+ ref_intersection *klass;
+
// This is used when constructing a new object. It is the PC of the
// `new' instruction which created the object. We use the special
// value -2 to mean that this is uninitialized, and the special
@@ -348,7 +543,7 @@ private:
type ()
{
key = unsuitable_type;
- data.klass = NULL;
+ klass = NULL;
pc = UNINIT;
}
@@ -357,25 +552,26 @@ private:
type (type_val k)
{
key = k;
- data.klass = NULL;
- if (key == reference_type)
- data.klass = &java::lang::Object::class$;
+ // For reference_type, if KLASS==NULL then that means we are
+ // looking for a generic object of any kind, including an
+ // uninitialized reference.
+ klass = NULL;
pc = UNINIT;
}
// Make a new instance given a class.
- type (jclass klass)
+ type (jclass k, _Jv_BytecodeVerifier *verifier)
{
key = reference_type;
- data.klass = klass;
+ klass = new ref_intersection (k, verifier);
pc = UNINIT;
}
// Make a new instance given the name of a class.
- type (_Jv_Utf8Const *n)
+ type (_Jv_Utf8Const *n, _Jv_BytecodeVerifier *verifier)
{
- key = unresolved_reference_type;
- data.name = n;
+ key = reference_type;
+ klass = new ref_intersection (n, verifier);
pc = UNINIT;
}
@@ -383,7 +579,7 @@ private:
type (const type &t)
{
key = t.key;
- data = t.data;
+ klass = t.klass;
pc = t.pc;
}
@@ -402,7 +598,7 @@ private:
type& operator= (type_val k)
{
key = k;
- data.klass = NULL;
+ klass = NULL;
pc = UNINIT;
return *this;
}
@@ -410,7 +606,7 @@ private:
type& operator= (const type& t)
{
key = t.key;
- data = t.data;
+ klass = t.klass;
pc = t.pc;
return *this;
}
@@ -424,35 +620,11 @@ private:
return *this;
}
- // If *THIS is an unresolved reference type, resolve it.
- void resolve (_Jv_BytecodeVerifier *verifier)
- {
- if (key != unresolved_reference_type
- && key != uninitialized_unresolved_reference_type)
- return;
-
- using namespace java::lang;
- java::lang::ClassLoader *loader
- = verifier->current_class->getClassLoaderInternal();
- // We might see either kind of name. Sigh.
- if (data.name->data[0] == 'L'
- && data.name->data[data.name->length - 1] == ';')
- data.klass = _Jv_FindClassFromSignature (data.name->data, loader);
- else
- data.klass = Class::forName (_Jv_NewStringUtf8Const (data.name),
- false, loader);
- key = (key == unresolved_reference_type
- ? reference_type
- : uninitialized_reference_type);
- }
-
// Mark this type as the uninitialized result of `new'.
void set_uninitialized (int npc, _Jv_BytecodeVerifier *verifier)
{
if (key == reference_type)
key = uninitialized_reference_type;
- else if (key == unresolved_reference_type)
- key = uninitialized_unresolved_reference_type;
else
verifier->verify_fail ("internal error in type::uninitialized");
pc = npc;
@@ -461,13 +633,9 @@ private:
// Mark this type as now initialized.
void set_initialized (int npc)
{
- if (npc != UNINIT && pc == npc
- && (key == uninitialized_reference_type
- || key == uninitialized_unresolved_reference_type))
+ if (npc != UNINIT && pc == npc && key == uninitialized_reference_type)
{
- key = (key == uninitialized_reference_type
- ? reference_type
- : unresolved_reference_type);
+ key = reference_type;
pc = UNINIT;
}
}
@@ -488,14 +656,16 @@ private:
// The `null' type is convertible to any initialized reference
// type.
- if (key == null_type || k.key == null_type)
- return true;
+ if (key == null_type)
+ return k.key != uninitialized_reference_type;
+ if (k.key == null_type)
+ return key != uninitialized_reference_type;
- // Any reference type is convertible to Object. This is a special
- // case so we don't need to unnecessarily resolve a class.
- if (key == reference_type
- && data.klass == &java::lang::Object::class$)
+ // A special case for a generic reference.
+ if (klass == NULL)
return true;
+ if (k.klass == NULL)
+ verifier->verify_fail ("programmer error in type::compatible");
// An initialized type and an uninitialized type are not
// compatible.
@@ -511,16 +681,7 @@ private:
return false;
}
- // Two unresolved types are equal if their names are the same.
- if (! isresolved ()
- && ! k.isresolved ()
- && _Jv_equalUtf8Consts (data.name, k.data.name))
- return true;
-
- // We must resolve both types and check assignability.
- resolve (verifier);
- k.resolve (verifier);
- return is_assignable_from_slow (data.klass, k.data.klass);
+ return klass->compatible(k.klass, verifier);
}
bool isvoid () const
@@ -545,9 +706,7 @@ private:
// We treat null_type as not an array. This is ok based on the
// current uses of this method.
if (key == reference_type)
- return data.klass->isArray ();
- else if (key == unresolved_reference_type)
- return data.name->data[0] == '[';
+ return klass->isarray ();
return false;
}
@@ -558,33 +717,28 @@ private:
bool isinterface (_Jv_BytecodeVerifier *verifier)
{
- resolve (verifier);
if (key != reference_type)
return false;
- return data.klass->isInterface ();
+ return klass->isinterface (verifier);
}
bool isabstract (_Jv_BytecodeVerifier *verifier)
{
- resolve (verifier);
if (key != reference_type)
return false;
- using namespace java::lang::reflect;
- return Modifier::isAbstract (data.klass->getModifiers ());
+ return klass->isabstract (verifier);
}
// Return the element type of an array.
type element_type (_Jv_BytecodeVerifier *verifier)
{
- // FIXME: maybe should do string manipulation here.
- resolve (verifier);
if (key != reference_type)
verifier->verify_fail ("programmer error in type::element_type()", -1);
- jclass k = data.klass->getComponentType ();
+ jclass k = klass->getclass (verifier)->getComponentType ();
if (k->isPrimitive ())
return type (verifier->get_type_val_for_signature (k));
- return type (k);
+ return type (k, verifier);
}
// Return the array type corresponding to an initialized
@@ -592,16 +746,12 @@ private:
// types, but currently we don't need to.
type to_array (_Jv_BytecodeVerifier *verifier)
{
- // Resolving isn't ideal, because it might force us to load
- // another class, but it's easy. FIXME?
- if (key == unresolved_reference_type)
- resolve (verifier);
-
- if (key == reference_type)
- return type (_Jv_GetArrayClass (data.klass,
- data.klass->getClassLoaderInternal()));
- else
+ if (key != reference_type)
verifier->verify_fail ("internal error in type::to_array()");
+
+ jclass k = klass->getclass (verifier);
+ return type (_Jv_GetArrayClass (k, k->getClassLoaderInternal()),
+ verifier);
}
bool isreference () const
@@ -616,9 +766,7 @@ private:
bool isinitialized () const
{
- return (key == reference_type
- || key == null_type
- || key == unresolved_reference_type);
+ return key == reference_type || key == null_type;
}
bool isresolved () const
@@ -631,24 +779,10 @@ private:
void verify_dimensions (int ndims, _Jv_BytecodeVerifier *verifier)
{
// The way this is written, we don't need to check isarray().
- if (key == reference_type)
- {
- jclass k = data.klass;
- while (k->isArray () && ndims > 0)
- {
- k = k->getComponentType ();
- --ndims;
- }
- }
- else
- {
- // We know KEY == unresolved_reference_type.
- char *p = data.name->data;
- while (*p++ == '[' && ndims-- > 0)
- ;
- }
+ if (key != reference_type)
+ verifier->verify_fail ("internal error in verify_dimensions: not a reference type");
- if (ndims > 0)
+ if (klass->count_dimensions () < ndims)
verifier->verify_fail ("array type has fewer dimensions than required");
}
@@ -682,53 +816,12 @@ private:
verifier->verify_fail ("merging different uninitialized types");
}
- if (! isresolved ()
- && ! old_type.isresolved ()
- && _Jv_equalUtf8Consts (data.name, old_type.data.name))
+ ref_intersection *merged = old_type.klass->merge (klass,
+ verifier);
+ if (merged != klass)
{
- // Types are identical.
- }
- else
- {
- resolve (verifier);
- old_type.resolve (verifier);
-
- jclass k = data.klass;
- jclass oldk = old_type.data.klass;
-
- int arraycount = 0;
- while (k->isArray () && oldk->isArray ())
- {
- ++arraycount;
- k = k->getComponentType ();
- oldk = oldk->getComponentType ();
- }
-
- // Ordinarily this terminates when we hit Object...
- while (k != NULL)
- {
- if (is_assignable_from_slow (k, oldk))
- break;
- k = k->getSuperclass ();
- changed = true;
- }
- // ... but K could have been an interface, in which
- // case we'll end up here. We just convert this
- // into Object.
- if (k == NULL)
- k = &java::lang::Object::class$;
-
- if (changed)
- {
- while (arraycount > 0)
- {
- java::lang::ClassLoader *loader
- = verifier->current_class->getClassLoaderInternal();
- k = _Jv_GetArrayClass (k, loader);
- --arraycount;
- }
- data.klass = k;
- }
+ klass = merged;
+ changed = true;
}
}
}
@@ -782,9 +875,7 @@ private:
case unused_by_subroutine_type: c = '_'; break;
case reference_type: c = 'L'; break;
case null_type: c = '@'; break;
- case unresolved_reference_type: c = 'l'; break;
case uninitialized_reference_type: c = 'U'; break;
- case uninitialized_unresolved_reference_type: c = 'u'; break;
}
debug_print ("%c", c);
}
@@ -1624,9 +1715,7 @@ private:
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");
}
@@ -1997,9 +2086,9 @@ private:
check_pool_index (index);
_Jv_Constants *pool = &current_class->constants;
if (pool->tags[index] == JV_CONSTANT_ResolvedClass)
- return type (pool->data[index].clazz);
+ return type (pool->data[index].clazz, this);
else if (pool->tags[index] == JV_CONSTANT_Class)
- return type (pool->data[index].utf8);
+ return type (pool->data[index].utf8, this);
verify_fail ("expected class constant", start_PC);
}
@@ -2009,7 +2098,7 @@ private:
_Jv_Constants *pool = &current_class->constants;
if (pool->tags[index] == JV_CONSTANT_ResolvedString
|| pool->tags[index] == JV_CONSTANT_String)
- return type (&java::lang::String::class$);
+ return type (&java::lang::String::class$, this);
else if (pool->tags[index] == JV_CONSTANT_Integer)
return type (int_type);
else if (pool->tags[index] == JV_CONSTANT_Float)
@@ -2065,7 +2154,7 @@ private:
if (class_type)
*class_type = ct;
if (field_type->data[0] == '[' || field_type->data[0] == 'L')
- return type (field_type);
+ return type (field_type, this);
return get_type_val_for_signature (field_type->data[0]);
}
@@ -2099,7 +2188,7 @@ private:
++p;
++p;
_Jv_Utf8Const *name = make_utf8_const (start, p - start);
- return type (name);
+ return type (name, this);
}
// Casting to jchar here is ok since we are looking at an ASCII
@@ -2116,7 +2205,7 @@ private:
jclass k = construct_primitive_array_type (rt);
while (--arraycount > 0)
k = _Jv_GetArrayClass (k, NULL);
- return type (k);
+ return type (k, this);
}
void compute_argument_types (_Jv_Utf8Const *signature,
@@ -2160,7 +2249,7 @@ private:
using namespace java::lang::reflect;
if (! Modifier::isStatic (current_method->self->accflags))
{
- type kurr (current_class);
+ type kurr (current_class, this);
if (is_init)
{
kurr.set_uninitialized (type::SELF, this);
@@ -2287,7 +2376,7 @@ private:
{
if (PC >= exception[i].start_pc.i && PC < exception[i].end_pc.i)
{
- type handler (&java::lang::Throwable::class$);
+ type handler (&java::lang::Throwable::class$, this);
if (exception[i].handler_type.i != 0)
handler = check_class_constant (exception[i].handler_type.i);
push_exception_jump (handler, exception[i].handler_pc.i);
@@ -2959,33 +3048,13 @@ private:
{
// In this case the PC doesn't matter.
t.set_uninitialized (type::UNINIT, this);
+ // FIXME: check to make sure that the <init>
+ // call is to the right class.
+ // It must either be super or an exact class
+ // match.
}
type raw = pop_raw ();
- bool ok = false;
- if (! is_init && ! raw.isinitialized ())
- {
- // This is a failure.
- }
- else if (is_init && raw.isnull ())
- {
- // Another failure.
- }
- else if (t.compatible (raw, this))
- {
- ok = true;
- }
- else if (opcode == op_invokeinterface)
- {
- // This is a hack. We might have merged two
- // items and gotten `Object'. This can happen
- // because we don't keep track of where merges
- // come from. This is safe as long as the
- // interpreter checks interfaces at runtime.
- type obj (&java::lang::Object::class$);
- ok = raw.compatible (obj, this);
- }
-
- if (! ok)
+ if (! t.compatible (raw, this))
verify_fail ("incompatible type on stack");
if (is_init)
@@ -3017,7 +3086,8 @@ private:
if (atype < boolean_type || atype > long_type)
verify_fail ("type not primitive", start_PC);
pop_type (int_type);
- push_type (construct_primitive_array_type (type_val (atype)));
+ type t (construct_primitive_array_type (type_val (atype)), this);
+ push_type (t);
}
break;
case op_anewarray:
@@ -3033,7 +3103,7 @@ private:
}
break;
case op_athrow:
- pop_type (type (&java::lang::Throwable::class$));
+ pop_type (type (&java::lang::Throwable::class$, this));
invalidate_pc ();
break;
case op_checkcast:
@@ -3178,6 +3248,7 @@ public:
flags = NULL;
jsr_ptrs = NULL;
utf8_list = NULL;
+ isect_list = NULL;
entry_points = NULL;
}
@@ -3220,6 +3291,13 @@ public:
_Jv_Free (entry_points);
entry_points = next;
}
+
+ while (isect_list != NULL)
+ {
+ ref_intersection *next = isect_list->alloc_next;
+ delete isect_list;
+ isect_list = next;
+ }
}
};
diff --git a/libjava/win32.cc b/libjava/win32.cc
index 6fc2de08760..9597dc8bc1e 100644
--- a/libjava/win32.cc
+++ b/libjava/win32.cc
@@ -186,23 +186,24 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
// Set the OS architecture.
SYSTEM_INFO si;
GetSystemInfo (&si);
- switch (si.dwProcessorType)
+ switch (si.wProcessorArchitecture)
{
- case PROCESSOR_INTEL_386:
- SET ("os.arch", "i386");
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ SET ("os.arch", "x86");
break;
- case PROCESSOR_INTEL_486:
- SET ("os.arch", "i486");
+ case PROCESSOR_ARCHITECTURE_MIPS:
+ SET ("os.arch", "mips");
break;
- case PROCESSOR_INTEL_PENTIUM:
- SET ("os.arch", "i586");
+ case PROCESSOR_ARCHITECTURE_ALPHA:
+ SET ("os.arch", "alpha");
break;
- case PROCESSOR_MIPS_R4000:
- SET ("os.arch", "MIPS4000");
+ case PROCESSOR_ARCHITECTURE_PPC:
+ SET ("os.arch", "ppc");
break;
- case PROCESSOR_ALPHA_21064:
- SET ("os.arch", "ALPHA");
+ case PROCESSOR_ARCHITECTURE_IA64:
+ SET ("os.arch", "ia64");
break;
+ case PROCESSOR_ARCHITECTURE_UNKNOWN:
default:
SET ("os.arch", "unknown");
break;