summaryrefslogtreecommitdiff
path: root/libjava/prims.cc
diff options
context:
space:
mode:
authorfitzsim <fitzsim@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-30 21:38:51 +0000
committerfitzsim <fitzsim@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-30 21:38:51 +0000
commit03b8eaaddec1ba9a586be7987111526fa7ea088d (patch)
tree541f5e5b869d78007d2f185daf6d91235889cc93 /libjava/prims.cc
parent5f4f36179fad688358074cd9dd9cd0461168334a (diff)
downloadgcc-03b8eaaddec1ba9a586be7987111526fa7ea088d.tar.gz
2006-05-30 Thomas Fitzsimmons <fitzsim@redhat.com>
* scripts/makemake.tcl (emit_bc_rule): Do not skip gnu-java-awt-peer-gtk.lo. Include gnu/java/awt/peer/gtk Java objects in libgcj.so. Use C++ ABI for gnu/java/awt/peer/gtk package. * gnu/classpath/natSystemProperties.cc (PrependVersionedLibdir): New function. (insertSystemProperties): Only set java.ext.dirs if it is not already defined. Prepend GCJ_VERSIONED_LIBDIR to module search path where necessary. * configure.ac (GTK_AWT): Remove automake conditional. * include/jvm.h (_Jv_PrependVersionedLibdir): New function declaration. * gij.cc (main): Prepend LD_LIBRARY_PATH with GCJ_VERSIONED_LIBDIR and re-exec self. * Makefile.am (AM_CXXFLAGS): Define GCJ_VERSIONED_LIBDIR, GIJ_EXECUTABLE and PATH_SEPARATOR macros. Remove lib-gnu-java-awt-peer-gtk.la and libgcjawt.la build logic. * prims.cc (_Jv_PrependVersionedLibdir): New function. 2006-05-30 Thomas Fitzsimmons <fitzsim@redhat.com> * native/jni/gtk-peer/Makefile.am (gcc_version): New variable. (gcjversionedlibdir): Likewise. (libgtkpeer_la_LDFLAGS): Likewise. Install libgtkpeer.so in GCJ versioned library directory. * native/jawt/Makefile.am (gcc_version): New variable. (gcjversionedlibdir): Likewise. (libjawt_la_LDFLAGS): Likewise. Rename libjawtgnu.so libjawt.so. Install libjawt.so in GCJ versioned library directory. * gnu/java/awt/peer/gtk/GdkFontPeer.java (static): Call System.loadLibrary unconditionally. * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java: Likewise. * gnu/java/awt/peer/gtk/GdkGraphics2D.java: Likewise. * gnu/java/awt/peer/gtk/GdkGraphics.java: Likewise. * gnu/java/awt/peer/gtk/GtkToolkit.java: Likewise. * gnu/java/awt/peer/gtk/GdkTextLayout.java: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114247 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r--libjava/prims.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc
index 2536ca47e64..1c3490e7511 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -1723,3 +1723,45 @@ _Jv_CheckAccess (jclass self_klass, jclass other_klass, jint flags)
&& _Jv_ClassNameSamePackage (self_klass->name,
other_klass->name)));
}
+
+// Prepend GCJ_VERSIONED_LIBDIR to a module search path stored in a C
+// char array, if the path is not already prefixed by
+// GCJ_VERSIONED_LIBDIR. Return a newly JvMalloc'd char buffer. The
+// result should be freed using JvFree.
+char*
+_Jv_PrependVersionedLibdir (char* libpath)
+{
+ char* retval = 0;
+
+ if (libpath && libpath[0] != '\0')
+ {
+ if (! strncmp (libpath,
+ GCJ_VERSIONED_LIBDIR,
+ sizeof (GCJ_VERSIONED_LIBDIR) - 1))
+ {
+ // LD_LIBRARY_PATH is already prefixed with
+ // GCJ_VERSIONED_LIBDIR.
+ retval = (char*) _Jv_Malloc (strlen (libpath) + 1);
+ strcpy (retval, libpath);
+ }
+ else
+ {
+ // LD_LIBRARY_PATH is not prefixed with
+ // GCJ_VERSIONED_LIBDIR.
+ jsize total = (sizeof (GCJ_VERSIONED_LIBDIR) - 1)
+ + (sizeof (PATH_SEPARATOR) - 1) + strlen (libpath) + 1;
+ retval = (char*) _Jv_Malloc (total);
+ strcpy (retval, GCJ_VERSIONED_LIBDIR);
+ strcat (retval, PATH_SEPARATOR);
+ strcat (retval, libpath);
+ }
+ }
+ else
+ {
+ // LD_LIBRARY_PATH was not specified or is empty.
+ retval = (char*) _Jv_Malloc (sizeof (GCJ_VERSIONED_LIBDIR));
+ strcpy (retval, GCJ_VERSIONED_LIBDIR);
+ }
+
+ return retval;
+}