зеркало из https://github.com/mozilla/pjs.git
Added java/Makefile.in, java/xpcom/TODO; minor correctoiosn to java/xpcom/README.
Fix libxpjava.so JNI and linking problems.
This commit is contained in:
Родитель
27410f1385
Коммит
6d50dd4d70
|
@ -0,0 +1,33 @@
|
|||
#!gmake
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS= xpcom \
|
||||
util \
|
||||
webshell \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),BeOS)
|
||||
EXTRA_DSO_LDOPTS += -lbe
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
|
@ -30,17 +30,22 @@ Currently only UNIX/Linux builds are supported (mainly because it's my
|
|||
platform of choice). Windows builds should not be too much more
|
||||
difficult, and
|
||||
|
||||
1. Make sure MOZILLA_FIVE_HOME is set correctly
|
||||
1. Make sure MOZILLA_FIVE_HOME is set correctly, and that JDKHOME indicates
|
||||
a valid JDK 1.2 installation.
|
||||
|
||||
2. Insure that the following are in your LD_LIBRARY_PATH:
|
||||
|
||||
$MOZILLA_FIVE_HOME/../lib
|
||||
$MOZILLA_FIVE_HOME
|
||||
$MOZILLA_FIVE_HOME/../lib
|
||||
mozilla/java/xpcom/test (or "." if you run in that directory)
|
||||
mozilla/java/xpcom/src (or "../src" if you run in "test")
|
||||
|
||||
3. In mozilla/java/xpcom, execute
|
||||
|
||||
../../build/autoconf/update-makefile.sh
|
||||
|
||||
if necessary, to generate a Makefile, and then
|
||||
|
||||
gmake JAVAC="javac -g -d $MOZILLA_FIVE_HOME/../classes"
|
||||
|
||||
This is to get around bugs in Java compilation.
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
TODO
|
||||
====
|
||||
|
||||
(By no means complete ...)
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
-- *GET XPCTest WORKING*. For some reason, the JDK 1.2 JVM on Solaris
|
||||
won't load libxpcom.so correctly, even if it's on LD_LIBRARY_PATH. I
|
||||
have yet to confirm whether this is a problem on Linux or NT.
|
||||
|
||||
-- Make Java compilation work correctly on Unix/Linux.
|
||||
|
||||
-- Better integration with Mozilla makefile/autoconf system.
|
||||
|
||||
-- Move XPCOM startup code to test programs.
|
||||
|
||||
-- Integrate into Java Plugin and test.
|
||||
|
||||
-- File and function renaming, to prevent conflicts and increase modularity.
|
||||
|
||||
|
||||
Registration and Activation
|
||||
---------------------------
|
||||
|
||||
-- Insure JNI libraries load an unload, even within JNI plugin
|
||||
|
||||
-- Derive proxy class from IID, and vice-versa
|
||||
|
||||
-- Generate static proxies (using genproxy)
|
||||
|
||||
-- Generate and load "on-the-fly" bytecode for proxy classes.
|
||||
|
||||
|
||||
Marshalling
|
||||
-----------
|
||||
|
||||
-- Verify nsID parameters are marshalled correctly.
|
||||
|
||||
-- Unwrap proxies used as "in" parameters.
|
||||
|
||||
-- Wrap "out" XPCOM objects in correct wrapper class. [dep: Proxy Generation]
|
||||
|
||||
-- Build C++ stubs for Java-implemented XPCOM objects. [big task?]
|
||||
|
||||
-- [Future] Allow mapping from native concrete type to Java types
|
||||
|
||||
-- [Future] Efficient handling of attributes and 0- or 1-arg methods.
|
||||
|
||||
-- [Future] Reflection API (if Java's is insufficient)
|
||||
|
||||
|
||||
NSRESULTs
|
||||
---------
|
||||
|
||||
-- Throw exceptions for error codes
|
||||
|
||||
-- Design and implement "success code mechanism", for single-threaded case
|
||||
|
||||
-- Store success codes per thread, and retrieve for current threads.
|
||||
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
-- Write proxy for ns[I]ComponentManager, by hand. (For performance,
|
||||
and because of the overloaded methods and lack of XPT.)
|
||||
|
||||
-- Write proxy for ns[I]ServiceManager, similar to above.
|
||||
|
||||
-- Throw exceptions for unknown or missing proxy classes (and other errors).
|
||||
|
||||
-- Implement XPCOM identity rules
|
||||
|
||||
-- Document (including Javadoc)
|
||||
|
||||
|
||||
Memory Management
|
||||
-----------------
|
||||
|
||||
-- Insure that temporary heap memory (esp. strings and nsIDs) is
|
||||
recycled.
|
||||
|
||||
-- Insure reference-counting rules aren't violated.
|
||||
|
||||
-- Cache previously allocated wrapper objects, to prevent unnecessary
|
||||
allocation.
|
||||
|
|
@ -43,18 +43,18 @@ EXPORTS = \
|
|||
|
||||
REQUIRES = xpcom
|
||||
|
||||
# XXX: fix this to substitute correct OS name
|
||||
|
||||
INCLUDES += -I$(JDKHOME)/include \
|
||||
-I$(JDKHOME)/include/solaris \
|
||||
-I$(JDKHOME)/include/linux \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
-L$(topsrcdir)/dist/lib \
|
||||
-lxptinfo \
|
||||
-lxptcmd \
|
||||
-lxptcall \
|
||||
-lxpt \
|
||||
-lxpcom \
|
||||
-lxp \
|
||||
-lreg \
|
||||
-lplds3 \
|
||||
-lplc3 \
|
||||
-lnspr3 \
|
||||
-lplds3 \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include "nscore.h"
|
||||
#include "nsID.h"
|
||||
#include "nsIFactory.h"
|
||||
|
@ -31,6 +32,9 @@
|
|||
|
||||
/* ---------- CLASS METHODS ------------ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_org_mozilla_xpcom_XPComUtilities_initialize(JNIEnv *env, jclass cls)
|
||||
|
@ -214,5 +218,6 @@ JNIEXPORT void JNICALL
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include "nscore.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
@ -40,6 +41,10 @@ jclass classXPCMethod = NULL;
|
|||
|
||||
#define USE_PARAM_TEMPLATE
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Class: XPCMethod
|
||||
* Method: init
|
||||
|
@ -51,7 +56,7 @@ JNIEXPORT jint JNICALL
|
|||
int offset;
|
||||
const nsXPTMethodInfo *mi;
|
||||
nsID *iidPtr = ID_GetNative(env, iid);
|
||||
const jbyte *tmpstr;
|
||||
const char *tmpstr;
|
||||
nsresult res;
|
||||
|
||||
// Get method info
|
||||
|
@ -153,7 +158,7 @@ JNIEXPORT void JNICALL
|
|||
* Class: XPCMethod
|
||||
* Method: getParameterType
|
||||
* Signature: (I)I
|
||||
XS */
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_mozilla_xpcom_XPCMethod_getParameterType
|
||||
(JNIEnv *env, jobject self, jint index) {
|
||||
|
||||
|
@ -251,3 +256,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_xpcom_XPCMethod_invoke
|
|||
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include "nscore.h"
|
||||
#include "nsID.h"
|
||||
#include "nsIAllocator.h"
|
||||
|
@ -84,6 +85,10 @@ jboolean ID_IsEqual(JNIEnv *env, jobject self, jobject other) {
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Class: ID
|
||||
* Method: NewIDPtr
|
||||
|
@ -121,7 +126,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_xpcom_nsID_NewIDPtr__Ljava_lang_String_2
|
|||
nsID *idptr = (nsID *)nsAllocator::Alloc(sizeof(nsID));
|
||||
|
||||
jboolean isCopy;
|
||||
const jbyte *utf = env->GetStringUTFChars(string, &isCopy);
|
||||
const char *utf = env->GetStringUTFChars(string, &isCopy);
|
||||
char *aIDStr;
|
||||
|
||||
if (isCopy) {
|
||||
|
@ -201,3 +206,7 @@ JNIEXPORT jint JNICALL Java_org_mozilla_xpcom_nsID_hashCode(JNIEnv *env, jobject
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -520,7 +520,7 @@ jboolean JObjectToVariant(JNIEnv *env,
|
|||
if (env->IsInstanceOf(elem, classString)) {
|
||||
jstring string = (jstring)elem;
|
||||
jsize jstrlen = env->GetStringUTFLength(string);
|
||||
const jbyte *utf = env->GetStringUTFChars(string, NULL);
|
||||
const char *utf = env->GetStringUTFChars(string, NULL);
|
||||
|
||||
// PENDING: copying every time is wasteful, but
|
||||
// we need to release `utf' before invocation loses it.
|
||||
|
|
|
@ -9,8 +9,9 @@ CFLAGS=-Wall -g -fno-rtti -fno-handle-exceptions -pipe
|
|||
SHLIB_FLAGS=-fpic
|
||||
SHLIB_LDFLAGS=-shared
|
||||
DEFINES=-DXP_UNIX
|
||||
INCLUDE=-I$(MOZILLA)/dist/include -I$(MOZILLA)/xpcom/public -I../src
|
||||
LIBS=-L$(MOZILLA)/dist/lib -lxptinfo -lxptcmd -lxptcall -lxpt -lxpcom -lxp -lreg -lplds3 -lplc3 -lnspr3 -lstdc++
|
||||
INCLUDE=-I$(MOZILLA)/dist/include -I$(MOZILLA)/xpcom/public -I../src -I$(JDKHOME)/include -I$(JDKHOME)/include/solaris -I$(JDKHOME)/include/linux
|
||||
#LIBS=-L$(MOZILLA)/dist/lib -lxptinfo -lxptcmd -lxptcall -lxpt -lxpcom -lxp -lreg -lplds3 -lplc3 -lnspr3 -lstdc++
|
||||
LIBS=-L$(MOZILLA)/dist/lib -lxptinfo -lxptcmd -lxptcall -lxpt -lxpcom -lxp -lplds3 -lplc3 -lnspr3 -lstdc++
|
||||
XPTDIR=$(MOZILLA)/dist/bin/components
|
||||
|
||||
XPIDL=$(MOZILLA)/dist/bin/xpidl
|
||||
|
|
Загрузка…
Ссылка в новой задаче