From df4d2e3aae3a455f0a2426ad23600703528091fc Mon Sep 17 00:00:00 2001 From: "pedemont%us.ibm.com" Date: Thu, 28 Sep 2006 18:41:55 +0000 Subject: [PATCH] Bug 322727 - JavaXPCOM on OS/2. patch by abwillis, r=jhpedemonte/mkaply. XULRunner only. --- extensions/java/xpcom/glue/Makefile.in | 7 +++++++ extensions/java/xpcom/src/Makefile.in | 4 ++++ .../src/org/mozilla/xpcom/internal/JavaXPCOMMethods.java | 8 +++++++- extensions/java/xpcom/tests/Makefile.in | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/extensions/java/xpcom/glue/Makefile.in b/extensions/java/xpcom/glue/Makefile.in index 3d74f400da0..98ac1d644f9 100644 --- a/extensions/java/xpcom/glue/Makefile.in +++ b/extensions/java/xpcom/glue/Makefile.in @@ -44,6 +44,9 @@ include $(DEPTH)/config/autoconf.mk MODULE = javaxpcomglue LIBRARY_NAME = javaxpcomglue +ifeq ($(OS_ARCH),OS2) +SHORT_LIBNAME = jxpcmglu +endif # On Mac OS X, JNI libraries must end with a '.jnilib' extension ifeq ($(OS_ARCH),Darwin) @@ -59,8 +62,12 @@ LOCAL_INCLUDES = -I$(JAVA_INCLUDE_PATH) ifeq ($(OS_ARCH),WINNT) LOCAL_INCLUDES += -I$(JAVA_INCLUDE_PATH)/win32 else +ifeq ($(OS_ARCH),OS2) +LOCAL_INCLUDES += -I$(JAVA_INCLUDE_PATH)/OS2 +else LOCAL_INCLUDES += -I$(JAVA_INCLUDE_PATH)/linux endif +endif LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build diff --git a/extensions/java/xpcom/src/Makefile.in b/extensions/java/xpcom/src/Makefile.in index a338d598cc7..3bf58758d7f 100755 --- a/extensions/java/xpcom/src/Makefile.in +++ b/extensions/java/xpcom/src/Makefile.in @@ -69,8 +69,12 @@ LOCAL_INCLUDES = -I$(JAVA_INCLUDE_PATH) ifeq ($(OS_ARCH),WINNT) LOCAL_INCLUDES += -I$(JAVA_INCLUDE_PATH)/win32 else +ifeq ($(OS_ARCH),OS2) +LOCAL_INCLUDES += -I$(JAVA_INCLUDE_PATH)/OS2 +else LOCAL_INCLUDES += -I$(JAVA_INCLUDE_PATH)/linux endif +endif # Don't set JAVA_LIBRARY_NAME, since we don't want to build during 'libs' # stage, but rather when explicitly called. diff --git a/extensions/java/xpcom/src/org/mozilla/xpcom/internal/JavaXPCOMMethods.java b/extensions/java/xpcom/src/org/mozilla/xpcom/internal/JavaXPCOMMethods.java index 668cf9cb50b..098352aa5e5 100644 --- a/extensions/java/xpcom/src/org/mozilla/xpcom/internal/JavaXPCOMMethods.java +++ b/extensions/java/xpcom/src/org/mozilla/xpcom/internal/JavaXPCOMMethods.java @@ -47,7 +47,13 @@ public class JavaXPCOMMethods { if (aLibXULDirectory != null) { path = aLibXULDirectory + File.separator; } - System.load(path + System.mapLibraryName("javaxpcomglue")); + + String osName = System.getProperty("os.name").toLowerCase(); + if (osName.startsWith("os/2")) { + System.load(path + System.mapLibraryName("jxpcmglu")); + } else { + System.load(path + System.mapLibraryName("javaxpcomglue")); + } registerJavaXPCOMMethodsNative(aLibXULDirectory); } diff --git a/extensions/java/xpcom/tests/Makefile.in b/extensions/java/xpcom/tests/Makefile.in index dbc922015af..b3ed2319765 100644 --- a/extensions/java/xpcom/tests/Makefile.in +++ b/extensions/java/xpcom/tests/Makefile.in @@ -61,7 +61,7 @@ JAVA_SRCS = \ DIRS += dll -ifeq ($(OS_ARCH),WINNT) +ifneq (,$(filter WINNT OS2,$(OS_ARCH))) SEP = \; else SEP = :