java-access-bridge r240 - in branches/gnome-2-24: . jni



Author: jeffcai
Date: Fri Jan  9 11:13:04 2009
New Revision: 240
URL: http://svn.gnome.org/viewvc/java-access-bridge?rev=240&view=rev

Log:
2009-01-09  Jeff Cai <jeff cai sun com>

    * Makefile.am:
    * acinclude.m4:
    * configure.in:
    * jni/Makefile.am:
    * jni/jni-main.c: (JNI_OnLoad), (JNI_OnUnload):
    Add a JNI library to set NO_AT_BRIDGE for all Java applications.
    GTK loads gtk modules according to the settting in xsettings, so
    GTK_MODULES doesnot work now. To make java applications not load
    atk-bridge, we add a JNI library to set a environmental variable
    to ask atk-bridge not load itself.



Added:
   branches/gnome-2-24/acinclude.m4
   branches/gnome-2-24/jni/
   branches/gnome-2-24/jni/Makefile.am
   branches/gnome-2-24/jni/jni-main.c
Modified:
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/Makefile.am
   branches/gnome-2-24/configure.in

Modified: branches/gnome-2-24/Makefile.am
==============================================================================
--- branches/gnome-2-24/Makefile.am	(original)
+++ branches/gnome-2-24/Makefile.am	Fri Jan  9 11:13:04 2009
@@ -4,6 +4,7 @@
 	bridge		\
 	impl		\
 	registry	\
+	jni		\
 	test
 
 gnome_java_bridgedir = ${prefix}/share/jar

Added: branches/gnome-2-24/acinclude.m4
==============================================================================
--- (empty file)
+++ branches/gnome-2-24/acinclude.m4	Fri Jan  9 11:13:04 2009
@@ -0,0 +1,72 @@
+AC_DEFUN([CHECK_JNI],[
+
+dnl Check to see what platform and set jni include path
+AC_CANONICAL_HOST
+AC_MSG_CHECKING([platform to setup platform specific variables])
+platform_win32="no"
+case $host in
+  *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-windows*)
+    if test $gcj_compile = "yes"; then
+      JNI_INCLUDES=
+    else
+      JNI_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/win32"
+    fi
+    platform_win32="yes"
+    PLATFORM_CFLAGS="-mms-bitfields"
+    PLATFORM_LDFLAGS="-Wl,--kill-at"
+    PLATFORM_CLASSPATH_SEPARATOR=";"
+    SOPREFIX="lib"
+    ;;
+  *-*-cygwin*)
+    if test $gcj_compile = "yes"; then
+      JNI_INCLUDES=
+    else
+      JNI_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/win32"
+    fi
+    platform_win32="yes"
+    PLATFORM_CFLAGS=
+    PLATFORM_LDFLAGS=
+    PLATFORM_CLASSPATH_SEPARATOR=":"
+    SOPREFIX="cyg"
+    ;;
+  *-*-linux*)
+    if test $gcj_compile = "yes"; then
+      JNI_INCLUDES=
+    else
+      JNI_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
+    fi
+    PLATFORM_CFLAGS=
+    PLATFORM_LDFLAGS=
+    PLATFORM_CLASSPATH_SEPARATOR=":"
+    SOPREFIX=
+    ;;
+  *-*-solaris*)
+    if test $gcj_compile = "yes"; then
+      JNI_INCLUDES=
+    else
+      JNI_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/solaris"
+    fi
+    PLATFORM_CFLAGS=
+    PLATFORM_LDFLAGS=
+    PLATFORM_CLASSPATH_SEPARATOR=":"
+    SOPREFIX=
+    ;;
+  *)
+    if test $gcj_compile = "yes"; then
+      JNI_INCLUDES=
+    else
+      JNI_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/$host_os"
+    fi
+    PLATFORM_CFLAGS=
+    PLATFORM_LDFLAGS=
+    PLATFORM_CLASSPATH_SEPARATOR=":"
+    SOPREFIX=
+    ;;
+esac
+AC_MSG_RESULT([$host_os])
+AC_SUBST(JNI_INCLUDES)
+AC_SUBST(PLATFORM_CFLAGS)
+AC_SUBST(PLATFORM_LDFLAGS)
+AC_SUBST(PLATFORM_CLASSPATH_SEPARATOR)
+
+])

Modified: branches/gnome-2-24/configure.in
==============================================================================
--- branches/gnome-2-24/configure.in	(original)
+++ branches/gnome-2-24/configure.in	Fri Jan  9 11:13:04 2009
@@ -23,6 +23,19 @@
 AC_SUBST(JAVA_HOME)
 AC_SUBST(JAVA)
 
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_ISC_POSIX
+
+CHECK_JNI
+
+AM_PROG_LIBTOOL
+
+PKG_CHECK_MODULES(GTK, [
+             gtk+-2.0          >= 1.17.0
+])
+
+
 AC_MSG_CHECKING([JDK version])
 jversion=`$JAVA -version 2>&1 | head -n1 | cut -f2 -d'"' | cut -f1 -d_`
 AC_MSG_RESULT($jversion)
@@ -149,5 +162,6 @@
 registry/org/Makefile
 registry/org/GNOME/Makefile
 registry/org/GNOME/Accessibility/Makefile
+jni/Makefile
 test/Makefile
 ])

Added: branches/gnome-2-24/jni/Makefile.am
==============================================================================
--- (empty file)
+++ branches/gnome-2-24/jni/Makefile.am	Fri Jan  9 11:13:04 2009
@@ -0,0 +1,9 @@
+lib_LTLIBRARIES = libjava-access-bridge-jni.la
+
+libjava_access_bridge_jni_la_SOURCES = jni-main.c
+
+libjava_access_bridge_jni_la_CPPFLAGS = $(JNI_INCLUDES)\
+					$(GTK_CFLAGS)
+
+libjava_access_bridge_jni_la_LIBADD = $(GTK_LIBS)
+

Added: branches/gnome-2-24/jni/jni-main.c
==============================================================================
--- (empty file)
+++ branches/gnome-2-24/jni/jni-main.c	Fri Jan  9 11:13:04 2009
@@ -0,0 +1,33 @@
+/*
+ * java-access-bridge for GNOME
+ * Copyright 2009 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <jni.h>
+#include <stdio.h>
+#include <gtk/gtk.h>
+
+JNIEXPORT jint JNICALL JNI_OnLoad (JavaVM *javaVM, void *reserve) {
+	g_type_init();
+	g_setenv( "NO_AT_BRIDGE", "1", TRUE );
+	return JNI_VERSION_1_4;
+}
+
+JNIEXPORT void JNICALL JNI_OnUnload (JavaVM *javaVM, void *reserve) {
+}
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]