VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/java/Makefile.kmk@ 29119

Last change on this file since 29119 was 29119, checked in by vboxsync, 15 years ago

nit in disabled path

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.8 KB
Line 
1# $Id: Makefile.kmk 29119 2010-05-06 03:41:29Z vboxsync $
2## @file
3# Sub-Makefile for Java bindings
4#
5
6#
7# Copyright (C) 2010 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21VBOX_JXPCOM_SRC := $(PATH_SUB_CURRENT)
22
23ifeq ($(KBUILD_TARGET), darwin)
24 VBOX_JAVA_HOME = /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
25 VBOX_JAVAC = $(VBOX_JAVA_HOME)/Commands/javac
26 VBOX_JAVAH = $(VBOX_JAVA_HOME)/Commands/javah
27 VBOX_JAR = $(VBOX_JAVA_HOME)/Commands/jar
28 VBOX_JAVA_INC = $(VBOX_JAVA_HOME)/Headers
29else
30 ifeq ($(KBUILD_TARGET), linux)
31 VBOX_JAVA_HOME ?= /usr/lib/jvm/java-1.5.0-sun
32 endif
33 ifeq ($(KBUILD_TARGET), solaris)
34 # VBOX_JAVA_HOME ?= /usr/jdk/jdk1.5.0
35 VBOX_JAVA_HOME ?= /usr/java
36 endif
37 VBOX_JAVAC = $(VBOX_JAVA_HOME)/bin/javac
38 VBOX_JAVAH = $(VBOX_JAVA_HOME)/bin/javah
39 VBOX_JAR = $(VBOX_JAVA_HOME)/bin/jar
40 # correct for targets we care about
41 VBOX_MD_OS = $(KBUILD_TARGET)
42 VBOX_JAVA_INC = $(VBOX_JAVA_HOME)/include \
43 $(VBOX_JAVA_HOME)/include/$(VBOX_MD_OS)
44endif
45
46VBOX_JXPCOM_TARGET = $(PATH_TARGET)/vboxjxpcom
47VBOX_JXPCOM_JDEST := $(VBOX_JXPCOM_TARGET)/jdest
48
49VBOX_JXPCOM_GENH = \
50 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_XPCOMImpl.h \
51 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_GREImpl.h \
52 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_MozillaImpl.h \
53 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_XPCOMJavaProxy.h \
54 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_JavaXPCOMMethods.h \
55 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_ProfileLock.h
56
57VBoxJXpcom_TEMPLATE = XPCOM
58VBoxJXpcom_CXXFLAGS = -Wno-write-strings
59VBoxJXpcom_DEFS = \
60 EXPORT_XPTI_API \
61 EXPORT_XPT_API \
62 VBOX_WITH_XPCOM
63VBoxJXpcom_DEFS.darwin = XP_MACOSX
64VBoxJXpcom_NAME = libvboxjxpcom
65VBoxJXpcom_DLLSUFF.darwin = .jnilib
66VBoxJXpcom_INCS = \
67 src \
68 $(VBOX_JAVA_INC) \
69 $(VBOX_PATH_XPCOM_SRC)/xpcom/glue \
70 $(VBOX_PATH_XPCOM_SRC)/xpcom/build \
71 $(VBOX_JXPCOM_JDEST)
72VBoxJXpcom_SOURCES = \
73 src/nsAppFileLocProviderProxy.cpp \
74 src/nsJavaWrapper.cpp \
75 src/nsJavaXPCOMBindingUtils.cpp \
76 src/nsJavaXPTCStub.cpp \
77 src/nsJavaXPTCStubWeakRef.cpp \
78 src/nsJavaXPCOMGlue.cpp \
79 src/nsJavaInterfaces.cpp
80VBoxJXpcom_LIBS = \
81 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
82 $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
83
84#VBoxJXpcom_ORDERDEPS = $(VBOX_JXPCOM_GENH)
85
86DLLS += VBoxJXpcom
87
88ifndef VBOX_WITH_JAVA_SUPPORT_IN_XPIDL
89if 1
90 #
91 # genjifaces - using VBoxXPCOM and associates.
92 #
93 PROGRAMS += genjifaces
94 TEMPLATE_XPCOMEXEBLD = XPCOM Build executable
95 TEMPLATE_XPCOMEXEBLD_EXTENDS = XPCOMBLDPROG
96 TEMPLATE_XPCOMEXEBLD_EXTENDS_BY = appending
97 TEMPLATE_XPCOMEXEBLD_CXXFLAGS = $(TEMPLATE_XPCOM_CXXFLAGS)
98 TEMPLATE_XPCOMEXEBLD_INCS = \
99 $(TEMPLATE_XPCOM_INCS) \
100 $(VBOX_PATH_XPCOM_SRC) \
101 $(VBOX_PATH_XPCOM_SRC)/xpcom/build \
102 $(VBOX_PATH_XPCOM_SRC)/xpcom/ds
103 TEMPLATE_XPCOMEXEBLD_DEFS = VBOX_WITH_XPCOM
104 TEMPLATE_XPCOMEXEBLD_LIBS = $(VBoxXPCOM_LIBS) $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
105 TEMPLATE_XPCOMEXEBLD_INCS.darwin = $(TEMPLATE_XPCOM_INCS.darwin)
106 TEMPLATE_XPCOMEXEBLD_LDFLAGS.darwin = \
107 -framework CoreServices \
108 -framework CoreFoundation \
109 -framework Foundation \
110 -framework AppKit \
111 -framework Carbon
112
113 ifeq ($(KBUILD_TARGET),darwin)
114 define preprocess_exebld
115 $(shell install_name_tool -change $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxRT.dylib $(PATH_BIN)/VBoxRT.dylib $(1))
116 endef
117 else
118 define preprocess_exebld
119 endef
120 endif
121
122 genjifaces_TEMPLATE = XPCOMEXEBLD
123 genjifaces_INCS = \
124 src
125 genjifaces_DEFS = \
126 EXPORT_XPTI_API \
127 EXPORT_XPT_API
128
129 genjifaces_SOURCES = \
130 ../xpcom/build/nsStringAPI.cpp \
131 ../xpcom/build/nsXPComInit.cpp \
132 tools/genifaces/GenerateJavaInterfaces.cpp \
133 src/nsFileStreams.cpp
134 genjifaces_INST = $(INST_BIN)
135 genjifaces_DEPS = $(PATH_TARGET)/VBox-xpcom-idl-timestamp
136 GENJIFACES_BIN := $(PATH_BIN)/genjifaces$(HOSTSUFF_EXE)
137
138else
139 #
140 # genjifaces - as a build program. Eventually we should probably do it this way,
141 # unless the xpidl hack is preferred instead.
142 #
143 BLDPROGS += genjifaces
144 genjifaces_TEMPLATE = XPCOMBLDPROG
145 genjifaces_DEFS = \
146 EXPORT_XPTI_API \
147 EXPORT_XPT_API \
148 VBOX_WITH_XPCOM \
149 _IMPL_NS_COM \
150 XPCOM_GLUE \
151 XPCOM_GLUE_NO_DYNAMIC_LOADING \
152 $(filter-out VBOX_USE_IPRT_IN_NSPR,$(VBox-xpcom-nspr_DEFS))
153 genjifaces_DEFS.$(KBUILD_HOST) += \
154 $(VBox-xpcom-nspr_DEFS.$(KBUILD_HOST))
155 genjifaces_DEFS.$(KBUILD_HOST).$(KBUILD_HOST_ARCH) += \
156 $(VBox-xpcom-nspr_DEFS.$(KBUILD_HOST).$(KBUILD_HOST_ARCH))
157 genjifaces_DEFPATH := $(abspath $(PATH_SUB_CURRENT)/..)
158 genjifaces_INCS = \
159 java/src
160 genjifaces_INCS += \
161 $(TEMPLATE_XPCOM_INCS) \
162 $(VBox-xpcom-nspr_INCS) \
163 genjifaces_INCS.$(KBUILD_HOST) += \
164 $(TEMPLATE_XPCOM_INCS.$(KBUILD_HOST)) \
165 $(VBox-xpcom-nspr_INCS.$(KBUILD_HOST))
166 genjifaces_SOURCES = \
167 java/tools/genifaces/GenerateJavaInterfaces.cpp \
168 java/src/nsFileStreams.cpp
169 genjifaces_SOURCES += \
170 xpcom/build/nsXPComInit.cpp \
171 xpcom/build/nsStringAPI.cpp \
172 $(VBox-xpcom-string_SOURCES) \
173 $(VBox-xpcom-base_SOURCES) \
174 $(VBox-xpcom-ds_SOURCES) \
175 $(VBox-xpcom-threads_SOURCES) \
176 xpcom/io/nsNativeCharsetUtils.cpp \
177 xpcom/io/nsUnicharInputStream.cpp \
178 \
179 $(VBox-xpcom-nspr_SOURCES) \
180 \
181 $(VBoxXPCOMGlue_COMMON_SOURCES) \
182 xpcom/glue/standalone/nsXPCOMGlue.cpp \
183 xpcom/glue/standalone/nsGREDirServiceProvider.cpp
184 genjifaces_LDFLAGS.darwin = \
185 -framework CoreServices \
186 -framework CoreFoundation \
187 -framework Foundation \
188 -framework AppKit \
189 -framework Carbon
190 genjifaces_DEPS = $(PATH_TARGET)/VBox-xpcom-idl-timestamp
191endif
192endif # !VBOX_WITH_JAVA_SUPPORT_IN_XPIDL
193
194#
195# Install JAR files
196#
197INSTALLS += VBoxJXpcom-inst-jar
198
199VBOX_JXPCOM_JAR = $(VBOX_JXPCOM_TARGET)/vboxjxpcom.jar
200VBOX_JXPCOM_JSRC = $(VBOX_JXPCOM_SRC)/src/org/mozilla/xpcom
201VBOX_JXPCOM_JGEN = $(PATH_TARGET)/vboxjgen
202
203VBoxJXpcom-inst-jar_INST = $(INST_SDK)bindings/xpcom/java
204VBoxJXpcom-inst-jar_SOURCES = $(VBOX_JXPCOM_JAR)
205
206JXPCOM_JAR_SRC= $(VBOX_JXPCOM_JSRC)/IXPCOM.java \
207 $(VBOX_JXPCOM_JSRC)/Mozilla.java \
208 $(VBOX_JXPCOM_JSRC)/VersionComparator.java \
209 $(VBOX_JXPCOM_JSRC)/GREVersionRange.java \
210 $(VBOX_JXPCOM_JSRC)/IAppFileLocProvider.java \
211 $(VBOX_JXPCOM_JSRC)/ProfileLock.java \
212 $(VBOX_JXPCOM_JSRC)/IGRE.java \
213 $(VBOX_JXPCOM_JSRC)/IJavaXPCOMUtils.java \
214 $(VBOX_JXPCOM_JSRC)/XPCOMException.java \
215 $(VBOX_JXPCOM_JSRC)/IMozilla.java \
216 $(VBOX_JXPCOM_JSRC)/XPCOMInitializationException.java \
217 $(VBOX_JXPCOM_JSRC)/INIParser.java \
218 $(VBOX_JXPCOM_JSRC)/internal/GREImpl.java \
219 $(VBOX_JXPCOM_JSRC)/internal/JavaXPCOMMethods.java \
220 $(VBOX_JXPCOM_JSRC)/internal/MozillaImpl.java \
221 $(VBOX_JXPCOM_JSRC)/internal/XPCOMImpl.java \
222 $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxyBase.java \
223 $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxy.java
224
225ifndef VBOX_WITH_JAVA_SUPPORT_IN_XPIDL
226VBOX_JXPCOM_GEN = $(VBOX_JXPCOM_TARGET)/jxpcomgen
227else
228VBOX_JXPCOM_GEN = $(VBOX_JXPCOM_TARGET)/jxpcomgen-idl
229endif
230
231VBOX_JXPCOM_NSERROR = $(VBOX_JXPCOM_GEN)/java/XPCOMError.java
232VBOX_JXPCOM_MGR = $(VBOX_JXPCOM_SRC)/src/org/virtualbox/VirtualBoxManager.java
233
234$(VBOX_JXPCOM_GENH): $(VBOX_JXPCOM_JAR)
235 $(VBOX_JAVAH) -classpath $(VBOX_JXPCOM_JDEST) -d $(VBOX_JXPCOM_JDEST) \
236 org.mozilla.xpcom.internal.XPCOMImpl \
237 org.mozilla.xpcom.internal.GREImpl \
238 org.mozilla.xpcom.internal.MozillaImpl \
239 org.mozilla.xpcom.internal.XPCOMJavaProxy \
240 org.mozilla.xpcom.ProfileLock \
241 org.mozilla.xpcom.internal.JavaXPCOMMethods
242
243$(VBOX_JXPCOM_GEN)/java:
244 $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_GEN)/java
245
246$(VBOX_JXPCOM_NSERROR): $(VBOX_PATH_XPCOM_SRC)/xpcom/base/nsError.h $(VBOX_JXPCOM_SRC)/tools/gen-nsError.pl | $(VBOX_JXPCOM_GEN)/java
247 perl $(VBOX_JXPCOM_SRC)/tools/gen-nsError.pl < $< > $@
248
249ifndef VBOX_WITH_JAVA_SUPPORT_IN_XPIDL
250$(VBOX_JXPCOM_GEN)/jxpcomgen.list: $(GENJIFACES_BIN) $(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt | $(VBOX_JXPCOM_GEN)/java
251 $(QUIET)echo Generating Java interface files
252 $(call preprocess_exebld,$(GENJIFACES_BIN))
253 $(GENJIFACES_BIN) -d $(VBOX_JXPCOM_GEN)/java
254 $(QUIET)echo $$(ls $(VBOX_JXPCOM_GEN)/java/*.java) > $@
255else # VBOX_WITH_JAVA_SUPPORT_IN_XPIDL
256## @todo this doesn't work properly as a sub-makefile yet (XPIDL_INCS, XPCOM_IDLFILES).
257$(VBOX_JXPCOM_GEN)/jxpcomgen.list: \
258 $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl \
259 $$(XPCOM_IDLFILES) \
260 $(VBOX_XPIDL) \
261 | $(VBOX_JXPCOM_GEN)/java
262 $(call MSG_L1,Generating Java interface files from IDL)
263 $(QUIET)$(RM) -f $(filter-out %/XPCOMError.java, $(wildcard $(VBOX_JXPCOM_GEN)/java/*.java))
264 $(foreach idl, $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl $(XPCOM_IDLFILES)\
265 , $(NLTAB)$(TARGET_xpidl) -m java $(XPIDL_INCS) -e $(VBOX_JXPCOM_GEN)/java/$(basename $(notdir $(idl))).java $(idl) )
266 $(ECHO_EXT) $(VBOX_JXPCOM_GEN)/java/*.java > $@
267endif # VBOX_WITH_JAVA_SUPPORT_IN_XPIDL
268
269$(VBOX_JXPCOM_JAR): $(JXPCOM_JAR_SRC) $(VBOX_JXPCOM_GEN)/jxpcomgen.list $(VBOX_JXPCOM_NSERROR) $(VBOX_JXPCOM_MGR)
270 $(QUIET)$(RM) -Rf $(VBOX_JXPCOM_JDEST)
271 $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_JDEST)
272 $(VBOX_JAVAC) @$ $(VBOX_JXPCOM_GEN)/jxpcomgen.list \
273 -d $(VBOX_JXPCOM_JDEST) -classpath $(VBOX_JXPCOM_JDEST)
274 $(VBOX_JAVAC) $(JXPCOM_JAR_SRC) \
275 $(VBOX_JXPCOM_NSERROR) $(VBOX_JXPCOM_MGR) \
276 -d $(VBOX_JXPCOM_JDEST) -classpath $(VBOX_JXPCOM_JDEST)
277 $(VBOX_JAR) cf $@ -C $(VBOX_JXPCOM_TARGET)/jdest .
278
279
280ifdef VBOX_ONLY_SDK
281 #
282 # Install sample code.
283 #
284 INSTALLS += jxpcomsample
285 jxpcomsample_INST = $(INST_SDK)bindings/xpcom/java
286 jxpcomsample_MODE = a+rx,u+w
287 jxpcomsample_SOURCES = \
288 tests/TestVBox.java=>samples/TestVBox.java \
289 tests/Makefile=>samples/Makefiles
290endif
291
292include $(KBUILD_PATH)/subfooter.kmk
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette