VirtualBox

source: vbox/trunk/src/VBox/Main/webservice/Makefile.kmk@ 29698

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

Java glue: intermediate

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 27.7 KB
Line 
1# $Id: Makefile.kmk 29673 2010-05-20 07:52:31Z vboxsync $
2## @file
3# Sub-Makefile for the VBox web service.
4#
5# Warning! This is a seriously complicated makefile!
6#
7
8#
9# Copyright (C) 2006-2010 Oracle Corporation
10#
11# This file is part of VirtualBox Open Source Edition (OSE), as
12# available from http://www.virtualbox.org. This file is free software;
13# you can redistribute it and/or modify it under the terms of the GNU
14# General Public License (GPL) as published by the Free Software
15# Foundation, in version 2 as it comes in the "COPYING" file of the
16# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18#
19
20# Define VBOX_GSOAP_INSTALLED to something if you have gSOAP's
21# "wsdl2h" and "soapcpp2" executables on your PATH somewhere.
22
23#
24# Here's an overview how all this works. It's complicated. Essentially,
25# lots of files get generated automatically from our XML XIDL file that
26# describes the VirtualBox API (../idl/VirtualBox.xidl); as a result,
27# no manual coding is necessary when the API changes. All generated
28# web service code gets adjusted automatically.
29#
30# In more detail:
31#
32# 1) We use xsltproc and websrv-wsdl.xsl to generate a WSDL file from
33# our XML IDL file. WSDL (Web Service Description language) is an XML
34# industry standard that publicly describes a web service.
35# So, the WSDL generated here describes the VirtualBox web
36# service to third-party clients; for example, one can feed it to
37# Java or Perl or some other toolkit that understands WSDL and thus
38# easily write a short script that connects to the web service properly.
39# This WSDL file ends up in $(VBOXWEB_OUT_DIR)/vboxweb.wsdl.
40#
41# 2) We use xsltproc and websrv-gsoapH.xsl to generate a so-called
42# "gSoap header file": $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h.
43# This file looks like a C header file, but really isn't meant
44# to be included by a C compiler. Instead, it just happens to be the
45# format that gSOAP uses to specify SOAP interfaces instead of WSDL.
46# (The reason for this appears to be that gSOAP predates WSDL and
47# thus needed some format to describe the syntax of a web service.)
48#
49# Note that gSOAP now also comes with its own WSDL-to-gsoap.h converter,
50# but the readme mentions some funny license restrictions, so instead we
51# have our own converter in XSLT.
52#
53# 3) We then feed that pseudo-header file to gSOAP's soapcpp2 compiler,
54# which generates a ton of files in $(VBOXWEB_OUT_DIR), most importantly:
55#
56# SOAP_CLIENT_H = $(VBOXWEB_OUT_DIR)/soapStub.h (header file for webservice clients)
57# SOAP_SERVER_H = $(VBOXWEB_OUT_DIR)/soapH.h (header file for webservice servers)
58#
59# These are "real" header files that one can use to program a) a webservice client
60# and b) a webservice server. Of course to build b) one will have to write method
61# implementations with useful code that does something. This is where more
62# code generation via XSLT comes in:
63#
64# 4) We use xsltproc to generate tons of c++ code directly from the XIDL that
65# maps each SOAP method to our COM methods. This large C++ file is
66# $(VBOXWEB_OUT_DIR)/methodmaps.cpp. The actual webservice executable (vboxwebsrv,
67# which acts as an HTTP server) is composed of this file, plus hard-coded
68# method implementations in vboxweb.cpp, plus gSOAP library code for the HTTP
69# server.
70#
71
72SUB_DEPTH = ../../../..
73include $(KBUILD_PATH)/subheader.kmk
74
75#
76# Find the gSOAP toolkit.
77#
78# Note! We're not using the gSOAP toolkit correctly. The main issue is that
79# compiling soapcpp2.cpp instead of using the library. So, in order
80# to make this work with a locally installed gSOAP toolkit there are
81# some hoops to jump thru to say the least... Shipping soapcpp2.cpp/h
82# is out of the question without also including the two soap tools.
83#
84# Some observations on distros for OSE / configure:
85# The proposed gentoo ebuild screws up several things in the install phase
86# and thus fails to ship stdsoap2.cpp and relatives.
87#
88# debian (2.7.9l-0.2) stuffs stdsoap2.cpp and a handful of the import files
89# into /usr/include/gsoap.
90#
91# fedora (2.7.12-fc10.x86_64) uses the default install layout and does not
92# ship stdsoap2.cpp and friends.
93#
94ifeq ($(VBOX_GSOAP_INSTALLED),)
95 VBOX_GSOAP_INSTALLED = 1
96 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS)/common/gsoap/*)))
97 ifeq ($(VBOX_PATH_GSOAP),)
98 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST)/gsoap/*)))
99 endif
100 if "$(VBOX_PATH_GSOAP)" == "" && defined(KBUILD_DEVTOOLS_HST)
101 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/gsoap/*)))
102 endif
103 ifeq ($(VBOX_PATH_GSOAP),)
104 $(warning VBOX_PATH_GSOAP not found...)
105 VBOX_GSOAP_INSTALLED =
106 endif
107else
108 VBOX_PATH_GSOAP := $(VBOX_PATH_GSOAP)
109endif
110VBOX_PATH_GSOAP_BIN := $(strip $(VBOX_PATH_GSOAP_BIN))
111if "$(VBOX_PATH_GSOAP_BIN)" == ""
112 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin
113 if "$(KBUILD_HOST)" == "darwin"
114 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/macosx
115 else if "$(KBUILD_HOST)" == "win"
116 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/win32
117 else if "$(KBUILD_HOST)" == "linux"
118 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/linux386
119 else
120 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/$(KBUILD_HOST).x86
121 endif
122 if !exists($(VBOX_PATH_GSOAP_BIN))
123 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin
124 endif
125endif
126VBOX_SOAPCPP2 := $(VBOX_PATH_GSOAP_BIN)/soapcpp2$(HOSTSUFF_EXE)
127VBOX_WSDL2H := $(VBOX_PATH_GSOAP_BIN)/wsdl2h$(HOSTSUFF_EXE)
128VBOX_STUBMAKER = $(firstword $(which stubmaker stubmaker.pl) stubmaker_not_found)
129VBOX_WSDL2PY = $(firstword $(which wsdl2py) wsdl2py_not_found)
130
131VBOX_PATH_GSOAP_IMPORT := $(strip $(if $(VBOX_PATH_GSOAP_IMPORT),$(VBOX_PATH_GSOAP_IMPORT),$(VBOX_PATH_GSOAP)/import))
132VBOX_GSOAP_INCS := $(strip $(if $(VBOX_GSOAP_INCS),$(VBOX_GSOAP_INCS),$(VBOX_PATH_GSOAP) $(VBOX_PATH_GSOAP_IMPORT) ))
133# note: $(if $(defined FOO)) does not work here!
134VBOX_GSOAP_CXX_SOURCES := $(strip $(if-expr "$(origin VBOX_GSOAP_CXX_SOURCES)" != "undefined",$(VBOX_GSOAP_CXX_SOURCES),$(VBOX_PATH_GSOAP)/stdsoap2.cpp))
135VBOX_GSOAP_CXX_LIBS := $(strip $(if-expr "$(origin VBOX_GSOAP_CXX_LIBS)" != "undefined",$(VBOX_GSOAP_CXX_LIBS),))
136
137
138#
139# Globals
140#
141VBOXWEB_OUT_DIR := $(PATH_TARGET)/webservice
142BLDDIRS += $(VBOXWEB_OUT_DIR)
143
144# The webservice location
145VBOX_PATH_WEBSERVICE := $(PATH_SUB_CURRENT)
146
147# If this is set, all webservice files are considered out-of-date every time
148# this make file is touched. Otherwise, set this to empty.
149RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT)
150
151PATH_TARGET_SOAPDEMOXML := $(VBOXWEB_OUT_DIR)/demo_soapxml
152PATH_TARGET_SOAPDEMOHEADERS := $(VBOXWEB_OUT_DIR)/demo_headers
153PATH_TARGET_SOAPDEMONSMAPS := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
154PATH_TARGET_WEBTEST := $(VBOXWEB_OUT_DIR)/webtest
155
156VBOXWEB_IDL_SRC_ORIG := $(VBOX_XIDL_FILE)
157VBOXWEB_IDL_SRC := $(VBOXWEB_OUT_DIR)/VirtualBox.xidl
158
159VBOXWEB_TYPEMAP := $(VBOXWEB_OUT_DIR)/typemap.dat
160
161VBOXWEB_GSOAPH_FROM_XSLT := $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h
162ifdef VBOX_GSOAP_INSTALLED
163 VBOXWEB_GSOAPH_FROM_GSOAP := $(VBOXWEB_OUT_DIR)/gsoapH_from_gsoap.h
164else
165 VBOXWEB_GSOAPH_FROM_GSOAP :=
166endif
167VBOXWEB_SOAP_CLIENT_H := $(VBOXWEB_OUT_DIR)/soapStub.h
168VBOXWEB_SOAP_SERVER_H := $(VBOXWEB_OUT_DIR)/soapH.h
169
170
171ifdef VBOX_GSOAP_VERBOSE
172 VBOXWEB_XSLTPROC_VERBOSE = --stringparam G_argDebug '1'
173 VBOXWEB_WSDL_VERBOSE = -v
174else
175 VBOXWEB_SOAPCPP2_SKIP_FILES = -x
176endif
177
178
179## @todo VBOXWEB_GSOAPH_FROM_XSLT should probably be a indirect dep of something.
180VBOXWEB_OTHERS += \
181 $(VBOXWEB_GSOAPH_FROM_XSLT)
182
183
184
185ifdef VBOX_GSOAP_INSTALLED
186 ifndef VBOX_ONLY_SDK
187 #
188 # vboxsoap - Library used by both the programs (save build time).
189 #
190 LIBRARIES += vboxsoap
191 vboxsoap_TEMPLATE = VBOXR3EXE
192 ifdef VBOX_USE_VCC80
193 vboxsoap_CXXFLAGS.win += -bigobj
194 endif
195 ifn1of ($(KBUILD_TARGET), win)
196 vboxsoap_CXXFLAGS += -Wno-shadow
197 endif
198 vboxsoap_INCS := \
199 $(VBOX_GSOAP_INCS) \
200 $(VBOXWEB_OUT_DIR) \
201 $(PATH_SUB_CURRENT)
202 ifdef VBOX_WITHOUT_SPLIT_SOAPC
203 vboxsoap_SOURCES = \
204 $(VBOXWEB_OUT_DIR)/soapC.cpp
205 else
206 BLDPROGS += split-soapC
207 split-soapC_TEMPLATE = VBOXBLDPROG
208 split-soapC_SOURCES = split-soapC.cpp
209
210 vboxsoap_SOURCES = \
211 $(VBOXWEB_OUT_DIR)/soapC-1.cpp \
212 $(VBOXWEB_OUT_DIR)/soapC-2.cpp \
213 $(VBOXWEB_OUT_DIR)/soapC-3.cpp \
214 $(VBOXWEB_OUT_DIR)/soapC-4.cpp \
215 $(VBOXWEB_OUT_DIR)/soapC-5.cpp \
216 $(VBOXWEB_OUT_DIR)/soapC-6.cpp \
217 $(VBOXWEB_OUT_DIR)/soapC-7.cpp \
218 $(VBOXWEB_OUT_DIR)/soapC-8.cpp \
219 $(VBOXWEB_OUT_DIR)/soapC-9.cpp \
220 $(VBOXWEB_OUT_DIR)/soapC-10.cpp \
221 $(VBOXWEB_OUT_DIR)/soapC-11.cpp \
222 $(VBOXWEB_OUT_DIR)/soapC-12.cpp \
223 $(VBOXWEB_OUT_DIR)/soapC-13.cpp \
224 $(VBOXWEB_OUT_DIR)/soapC-14.cpp \
225 $(VBOXWEB_OUT_DIR)/soapC-15.cpp \
226 $(VBOXWEB_OUT_DIR)/soapC-16.cpp \
227 $(VBOXWEB_OUT_DIR)/soapC-17.cpp \
228 $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
229 $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
230 $(VBOXWEB_OUT_DIR)/soapC-20.cpp
231 endif
232 vboxsoap_CLEAN := $(vboxsoap_SOURCES) # lazy bird
233 vboxsoap_SOURCES += \
234 $(VBOX_GSOAP_CXX_SOURCES)
235 vboxsoap_ORDERDEPS = \
236 $(VBOXWEB_IDL_SRC) \
237 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
238 ifn1of ($(KBUILD_TARGET), win)
239 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS = -Wno-format
240 endif
241
242ifdef VBOX_SOAP_PRECOMPILED_HEADER
243 # This'll save a few seconds, but the compiler invocation currently makes it impracticable. This will
244 # be addressed in a future kBuild version, by adding PCH support or/and by adding some helpers to
245 # gather the required data (DEFS,INCS,CXXTOOL,CXXFLAGS).
246 vboxsoap_INTERMEDIATES += $(VBOXWEB_OUT_DIR)/soapH.h.gch
247 vboxsoap_CXXFLAGS += -Winvalid-pch -H
248 vboxsoap_CLEAN += $(VBOXWEB_OUT_DIR)/soapH.h.gch
249
250$(VBOXWEB_OUT_DIR)/soapH.h.gch: $(VBOXWEB_OUT_DIR)/soapH.h
251 g++ -x c++-header -g -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -Wno-variadic-macros -pipe -O0 -fno-omit-frame-pointer -fno-strict-aliasing -fvisibility-inlines-hidden -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -m32 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/src/VBox/Main/webservice/gsoap -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/out/darwin.x86/debug/obj/src/VBox/Main -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/src/VBox/Main/webservice -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/include -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/out/darwin.x86/debug -DVBOX -DVBOX_WITH_DEBUGGER -DVBOX_WITH_DEBUGGER_GUI -DDEBUG -DDEBUG_bird -DDEBUG_USERNAME=bird -DRT_OS_DARWIN -D__DARWIN__ -DRT_ARCH_X86 -D__X86__ -DVBOX_WITH_HYBRID_32BIT_KERNEL -DIN_RING3 -DHC_ARCH_BITS=32 -DGC_ARCH_BITS=32 -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -DMAC_OS_X_VERSION_MAX_ALLOWED=1040 \
252 $< -o $@
253endif
254 endif # !VBOX_ONLY_SDK
255
256
257 ifndef VBOX_ONLY_SDK
258 #
259 # vboxwebsrv - webservice server process
260 #
261 PROGRAMS += vboxwebsrv
262 vboxwebsrv_TEMPLATE = VBOXMAINCLIENTEXE
263 vboxwebsrv_DEFS += SOCKET_CLOSE_ON_EXEC
264 vboxwebsrv_INCS = \
265 $(VBOX_GSOAP_INCS) \
266 $(VBOXWEB_OUT_DIR) \
267 .
268 ifdef VBOX_USE_VCC80
269 vboxwebsrv_CXXFLAGS.win += -bigobj
270 endif
271 ifn1of ($(KBUILD_TARGET), win)
272 vboxwebsrv_CXXFLAGS += -Wno-shadow
273 endif
274 vboxwebsrv_LIBS += \
275 $(PATH_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
276 $(VBOX_GSOAP_CXX_LIBS)
277 vboxwebsrv_LIBS.solaris += socket nsl
278 vboxwebsrv_SOURCES = \
279 vboxweb.cpp \
280 $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
281 $(VBOXWEB_OUT_DIR)/soapServer.cpp
282 vboxwebsrv_CLEAN = \
283 $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
284 $(VBOXWEB_OUT_DIR)/soapServer.cpp
285
286 vboxwebsrv_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
287 endif # !VBOX_ONLY_SDK
288
289
290 ifndef VBOX_ONLY_SDK
291 #
292 # webtest - webservice sample client in C++
293 #
294 PROGRAMS += webtest
295 webtest_TEMPLATE = VBOXR3EXE
296 ifdef VBOX_USE_VCC80
297 webtest_CXXFLAGS.win += -bigobj
298 endif
299 ifn1of ($(KBUILD_TARGET), win)
300 webtest_CXXFLAGS += -Wno-shadow
301 endif
302 webtest_INCS := \
303 $(VBOX_GSOAP_INCS) \
304 $(VBOXWEB_OUT_DIR) \
305 .
306 webtest_LIBS += \
307 $(PATH_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
308 $(VBOX_GSOAP_CXX_LIBS)
309 webtest_LIBS.solaris += nsl
310 webtest_SOURCES = \
311 webtest.cpp \
312 $(VBOXWEB_OUT_DIR)/soapClient.cpp
313 webtest_CLEAN = \
314 $(VBOXWEB_OUT_DIR)/soapClient.cpp
315
316 webtest_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
317 endif # !VBOX_ONLY_SDK
318
319
320 #
321 # Additional mess to cleanup (applies to both webtest and vboxwebsrv).
322 #
323 ## @todo figure out whether the SDK really needs this or not...
324 OTHER_CLEAN += \
325 $(wildcard $(VBOXWEB_OUT_DIR)/soap*.h) \
326 $(wildcard $(VBOXWEB_OUT_DIR)/soap*.cpp) \
327 $(wildcard $(VBOXWEB_OUT_DIR)/*.nsmap) \
328 $(VBOXWEB_GSOAPH_FROM_XSLT) \
329 $(VBOXWEB_GSOAPH_FROM_GSOAP) \
330 $(VBOXWEB_SOAP_CLIENT_H) \
331 $(VBOXWEB_SOAP_SERVER_H) \
332 $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
333 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \
334 $(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \
335 $(PATH_TARGET_SOAPDEMOXML)/dummy_file \
336 $(wildcard $(PATH_TARGET_SOAPDEMOHEADERS)/*) \
337 $(PATH_TARGET_SOAPDEMOHEADERS)/dummy_file \
338 $(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \
339 $(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file
340
341endif # VBOX_GSOAP_INSTALLED
342
343
344ifdef VBOX_ONLY_SDK
345 #
346 # Global relevant to the SDK.
347 #
348 VBOXWEB_GLUE_PYTHON = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_wrappers.py
349 VBOXWEB_WS_PYTHON = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_services.py
350 VBOXWEB_WS_PERL = $(VBOX_PATH_SDK)/bindings/webservice/perl/lib/vboxService.pm
351 VBOXWEB_WS_PHP = $(VBOX_PATH_SDK)/bindings/webservice/php/lib/vboxServiceWrappers.php
352 VBOXWEB_SAMPLES_AXIS_DIR = $(VBOX_PATH_SDK)/bindings/webservice/java/axis/samples
353 VBOXWEB_SAMPLES_JAXWS_DIR = $(VBOX_PATH_SDK)/bindings/webservice/java/jax-ws/samples
354 VBOXWEB_JAXWSSAMPLE = $(VBOXWEB_SAMPLES_JAXWS_DIR)/clienttest.java
355 VBOXWEB_METRICSAMPLE = $(VBOXWEB_SAMPLES_JAXWS_DIR)/metrictest.java
356
357 VBOXWEB_GLUE_JAVA_TMP = $(VBOXWEB_OUT_DIR)/glue-jaxws.java.tmp
358 VBOXWEB_PATH_SDK_GLUE_JAVA = $(VBOX_PATH_SDK)/bindings/webservice/java/jax-ws/src
359 VBOXWEB_JAVALIB = $(VBOX_PATH_SDK)/bindings/webservice/java/jax-ws/lib
360 VBOXWEB_JAVA15_JAR = $(VBOXWEB_JAVALIB)/vboxws_java15.jar
361 VBOXWEB_JAVA16_JAR = $(VBOXWEB_JAVALIB)/vboxws_java16.jar
362
363define find_java_files
364 $(shell find $(1) -name \*.java)
365endef
366
367 VBOX_JAXWS_LIBDIR = $(VBOX_PATH_WEBSERVICE)/jaxlibs
368 # well, not really good
369 VBOX_JAVA15 = $(firstword $(wildcard \
370 /usr/lib/jvm/java-1.5.0-sun/bin/java \
371 /usr/jdk/jdk1.5*/bin/java \
372 /opt/sun-jdk-1.5*/bin/java))
373 ifndef VBOX_JAVA15
374 $(error Failed to autodetect VBOX_JAVA15, please set it manually)
375 endif
376 VBOX_JAVA16 = java
377 VBOX_JAVAC15 = javac -target 1.5
378 VBOX_JAVAC16 = javac -target 1.6
379 VBOX_WSIMPORT15 = $(VBOX_JAVA15) -jar $(VBOX_JAXWS_LIBDIR)/jaxws-tools.jar
380 VBOX_WSIMPORT16 = $(firstword $(wildcard \
381 /usr/jdk/jdk1.6*/bin/wsimport \
382 /usr/bin/wsimport \
383 /opt/sun-jdk-1.6*/bin/wsimport))
384 ifndef VBOX_WSIMPORT16
385 $(error Failed to autodetect VBOX_WSIMPORT16, please set it manually)
386 endif
387 VBOX_JAR = jar
388
389 VBOXWEB_OTHERS += \
390 $(VBOXWEB_GLUE_JAVA_TMP) \
391 $(VBOXWEB_GLUE_PYTHON) \
392 $(VBOXWEB_WS_PYTHON) \
393 $(VBOXWEB_WS_PERL) \
394 $(VBOXWEB_WS_PHP) \
395 $(VBOXWEB_PYTHONWSSAMPLE)\
396 $(VBOXWEB_JAXWSSAMPLE) \
397 $(VBOXWEB_METRICSAMPLE) \
398 $(VBOXWEB_JAVA15_JAR) \
399 $(VBOXWEB_JAVA16_JAR)
400
401 #
402 # Install sample code.
403 #
404 INSTALLS += vboxwebinst
405 vboxwebinst_INST = $(INST_SDK)bindings/webservice/
406 vboxwebinst_MODE = a+rx,u+w
407 vboxwebinst_SOURCES = \
408 samples/java/axis/clienttest.java=>java/axis/samples/clienttest.java \
409 samples/java/jax-ws/Makefile.glue=>java/jax-ws/src/Makefile \
410 samples/java/jax-ws/Makefile=>java/jax-ws/samples/Makefile \
411 samples/perl/clienttest.pl=>perl/samples/clienttest.pl \
412 samples/php/clienttest.php=>php/samples/clienttest.php \
413 samples/python/Makefile=>python/samples/Makefile \
414 samples/python/Makefile.glue=>python/lib/Makefile
415
416 #
417 # filesplitter - build helper, splits up the java classes.
418 #
419 BLDPROGS += filesplitter
420 filesplitter_TEMPLATE = VBOXBLDPROG
421 filesplitter_SOURCES = filesplitter.cpp
422
423endif # VBOX_ONLY_SDK
424
425VBOXWEB_WSDL = $(VBOX_PATH_SDK)/bindings/webservice/vboxweb.wsdl
426VBOXWEBSERVICE_WSDL = $(VBOX_PATH_SDK)/bindings/webservice/vboxwebService.wsdl
427
428## @todo VBOXWEB_WSDL and VBOXWEBSERVICE_WSDL should be an install target.
429VBOXWEB_OTHERS += \
430 $(VBOXWEB_WSDL) \
431 $(VBOXWEBSERVICE_WSDL)
432
433#
434# Update the OTHERS and OTHER_CLEAN lists with VBOXWEB_OTHERS and some more stuff.
435#
436# We can't just built up OTHERS and append it to OTHER_CLEAN because we're sharing
437# OTHERS with all the other VBox makefiles (VBOX_SINGLE_MAKEFILE), thus VBOXWEB_OTHERS.
438#
439OTHERS += $(VBOXWEB_OTHERS)
440OTHER_CLEAN += \
441 $(VBOXWEB_OTHERS) \
442 $(VBOXWEB_TYPEMAP) \
443 $(VBOXWEB_IDL_SRC)
444
445
446# generate platform-specific XIDL file from original XIDL file
447$(VBOXWEB_IDL_SRC): $(VBOXWEB_IDL_SRC_ORIG) $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl | $$(dir $$@)
448 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using platform-xidl.xsl)
449 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl $<
450
451# generate WSDL from main XIDL file
452$(VBOXWEB_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) ## @todo | $$(dir $$@)
453 $(QUIET)$(MKDIR) -p $(@D)
454 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl.xsl)
455 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $<
456
457$(VBOXWEBSERVICE_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) ## @todo | $$(dir $$@)
458 $(QUIET)$(MKDIR) -p $(@D)
459 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl-service.xsl)
460 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $<
461
462ifdef VBOX_ONLY_SDK
463
464$(VBOXWEB_GLUE_PYTHON): $(VBOXWEB_IDL_SRC) $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-python.xsl
465 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-python.xsl)
466 $(QUIET)$(MKDIR) -p $(@D)
467 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-python.xsl $<
468
469$(VBOXWEB_WS_PYTHON): $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
470 $(call MSG_GENERATE,,$@, WS Python bindings)
471 $(QUIET)$(MKDIR) -p $(@D)
472# Try both w/o and with --file option
473 $(QUIET)$(REDIRECT) -C $(@D) -- bash -c "$(VBOX_WSDL2PY) -b $(VBOXWEBSERVICE_WSDL) || $(VBOX_WSDL2PY) -b --file $(VBOXWEBSERVICE_WSDL)"
474 $(QUIET)$(APPEND) $@ ''
475
476$(VBOXWEB_WS_PERL): $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
477 $(call MSG_GENERATE,,$@, WS Perl bindings)
478 $(QUIET)$(MKDIR) -p $(@D)
479 $(QUIET)$(REDIRECT) -C $(@D) -- $(VBOX_STUBMAKER) file://$(VBOXWEBSERVICE_WSDL)
480# Ugly, ugly, ugly, make me right once
481 $(QUIET)$(SED) -e "s+http://www.virtualbox.org/Service+http://www.virtualbox.org/+" < $(VBOXWEB_WS_PERL) > $(VBOXWEB_WS_PERL).tmp
482 $(QUIET)$(MV) $(VBOXWEB_WS_PERL).tmp $(VBOXWEB_WS_PERL)
483 $(QUIET)$(APPEND) $@ ''
484
485$(VBOXWEB_WS_PHP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-php.xsl
486 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-php.xsl)
487 $(QUIET)$(MKDIR) -p $(@D)
488 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-php.xsl $<
489
490endif # VBOX_ONLY_SDK
491
492# generate typemap.dat (used by wsdl2h) from main XIDL file
493$(VBOXWEB_TYPEMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
494 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-typemap.xsl)
495 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $<
496
497# generate gsoap pseudo-C header file from that WSDL; once via XSLT...
498# $(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-gsoapH.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
499# $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-gsoapH.xsl)
500# $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-gsoapH.xsl $<
501$(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
502 $(call MSG_GENERATE,,$@,$(VBOXWEB_WSDL) using websrv-wsdl2gsoapH.xsl)
503 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $<
504
505NSMAP = $(VBOXWEB_OUT_DIR)/vboxwebsrv.nsmap
506
507$(NSMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
508 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-nsmap.xsl)
509 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $<
510
511
512
513ifdef VBOX_GSOAP_INSTALLED
514# ... and once with the gSOAP tool (just for comparison, we don't use it for licensing reasons)
515$(VBOXWEB_GSOAPH_FROM_GSOAP): $(VBOXWEB_WSDL) $(VBOXWEB_TYPEMAP) | $$(dir $$@)
516 $(call MSG_GENERATE,,$@,)
517 $(VBOX_WSDL2H) $(VBOXWEB_WSDL_VERBOSE) -t$(VBOXWEB_TYPEMAP) -nvbox -o $@ $<
518
519GSOAPH_RELEVANT = $(VBOXWEB_GSOAPH_FROM_XSLT)
520
521# wsdl2h -v: verbose
522# wsdl2h -e: don't qualify enum names
523# wsdl2h -n<prefix>: namespace header prefix
524
525## @todo change this to state explicitly what will be generated?
526
527# generate server and client code from gsoap pseudo-C header file
528$(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
529+ $(VBOXWEB_OUT_DIR)/soapH.h \
530+ $(VBOXWEB_OUT_DIR)/soapStub.h \
531+ $(VBOXWEB_OUT_DIR)/soapC.cpp \
532+ $(VBOXWEB_OUT_DIR)/soapClient.cpp \
533+ $(VBOXWEB_OUT_DIR)/soapServer.cpp \
534: $(VBOXWEB_GSOAPH_FROM_GSOAP) $(VBOXWEB_GSOAPH_FROM_XSLT) $(NSMAP) $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
535 $(call MSG_GENERATE,,lots of files,$(GSOAPH_RELEVANT))
536 $(RM) -f $@
537 $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
538 $(APPEND) $@ done
539
540# copy the generated headers and stuff. This has to be a seperate rule if we
541# want to use wildcard (all commands are expaned when the rule is evaluated).
542$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
543 $(RM) -f $@
544 $(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMOHEADERS) $(PATH_TARGET_SOAPDEMONSMAPS)
545ifdef VBOX_GSOAP_VERBOSE
546 $(MV) -f $(wildcard $(VBOXWEB_OUT_DIR)/*.req.xml $(VBOXWEB_OUT_DIR)/*.res.xml) $(PATH_TARGET_SOAPDEMOXML)
547endif
548 $(MV) -f $(wildcard $(VBOXWEB_OUT_DIR)/soapvbox*.h) $(PATH_TARGET_SOAPDEMOHEADERS)
549 $(MV) -f $(VBOXWEB_OUT_DIR)/vboxBinding.nsmap $(PATH_TARGET_SOAPDEMONSMAPS)
550 $(APPEND) $@ done
551
552$(PATH_TARGET_SOAPDEMONSMAPS) \
553$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingProxy.h \
554$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingObject.h: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
555
556# soapcpp2 -2: generate SOAP 1.2 calls
557# soapcpp2 -S: server-side code only
558# soapcpp2 -L: don't generate soapClientLib/soapServerLib
559# soapcpp2 -w: don't generate WSDL and schema files
560# soapcpp2 -x: don't generate sample XML files
561
562ifndef VBOX_WITHOUT_SPLIT_SOAPC
563#
564# Split up the soapC.cpp monster into manageable bits that can be
565# built in parallel and without exhausting all available memory.
566#
567$(VBOXWEB_OUT_DIR)/soapC-1.cpp \
568+ $(VBOXWEB_OUT_DIR)/soapC-2.cpp \
569+ $(VBOXWEB_OUT_DIR)/soapC-3.cpp \
570+ $(VBOXWEB_OUT_DIR)/soapC-4.cpp \
571+ $(VBOXWEB_OUT_DIR)/soapC-5.cpp \
572+ $(VBOXWEB_OUT_DIR)/soapC-6.cpp \
573+ $(VBOXWEB_OUT_DIR)/soapC-7.cpp \
574+ $(VBOXWEB_OUT_DIR)/soapC-8.cpp \
575+ $(VBOXWEB_OUT_DIR)/soapC-9.cpp \
576+ $(VBOXWEB_OUT_DIR)/soapC-10.cpp \
577+ $(VBOXWEB_OUT_DIR)/soapC-11.cpp \
578+ $(VBOXWEB_OUT_DIR)/soapC-12.cpp \
579+ $(VBOXWEB_OUT_DIR)/soapC-13.cpp \
580+ $(VBOXWEB_OUT_DIR)/soapC-14.cpp \
581+ $(VBOXWEB_OUT_DIR)/soapC-15.cpp \
582+ $(VBOXWEB_OUT_DIR)/soapC-16.cpp \
583+ $(VBOXWEB_OUT_DIR)/soapC-17.cpp \
584+ $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
585+ $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
586+ $(VBOXWEB_OUT_DIR)/soapC-20.cpp \
587: $(VBOXWEB_OUT_DIR)/soapC.cpp $$(TARGET_split-soapC) | $$(dir $$@)
588 $(RM) -f $(wildcard $(VBOXWEB_OUT_DIR)/soapC-?.cpp $(VBOXWEB_OUT_DIR)/soapC-??.cpp)
589 $(TARGET_split-soapC) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR) 20
590endif # !VBOX_WITHOUT_SPLIT_SOAPC
591
592endif # VBOX_GSOAP_INSTALLED
593
594
595
596# generate method maps in server: map wsdl operations to com/xpcom method calls
597$(VBOXWEB_OUT_DIR)/methodmaps.cpp: $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
598 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-cpp.xsl)
599 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $<
600
601
602ifdef VBOX_ONLY_SDK
603
604$(VBOXWEB_JAXWSSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/clienttest.java
605 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_JAXWS_DIR)
606 $(QUIET)$(SED) -e 's/{VBOX_API_SUFFIX}/$(VBOX_API_SUFFIX)/' < $< > $@
607
608$(VBOXWEB_METRICSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/metrictest.java
609 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_JAXWS_DIR)
610 $(QUIET)$(SED) -e 's/{VBOX_API_SUFFIX}/$(VBOX_API_SUFFIX)/' < $< > $@
611
612# generate jax-ws wrapper for java client code
613$(VBOXWEB_GLUE_JAVA_TMP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/glue-jaxws.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $$(TARGET_filesplitter) $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
614 $(QUIET)$(MKDIR) -p $(@D)
615 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using glue-jaxws.xsl)
616 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) \
617 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
618 -o $@ $(VBOX_PATH_WEBSERVICE)/glue-jaxws.xsl $<
619 $(call MSG_GENERATE,,java client glue files in $(VBOXWEB_PATH_SDK_GLUE_JAVA))
620 $(RM) -R -f $(VBOXWEB_PATH_SDK_GLUE_JAVA)
621 $(QUIET)$(MKDIR) -p $(VBOXWEB_PATH_SDK_GLUE_JAVA)
622 $(QUIET)$(TARGET_filesplitter) $@ $(VBOXWEB_PATH_SDK_GLUE_JAVA)
623 $(QUIET)$(CP) -f $(VBOX_PATH_WEBSERVICE)/../../../../COPYING.LIB $(VBOXWEB_PATH_SDK_GLUE_JAVA)
624
625$(VBOXWEB_GLUE_JAVA_TMP).done: $(VBOXWEB_GLUE_JAVA_TMP)
626 $(QUIET)$(APPEND) $@ ''
627
628$(VBOXWEB_JAVA15_JAR): $(VBOXWEB_GLUE_JAVA_TMP).done $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
629 $(QUIET)$(RM) -Rf $(VBOXWEB_JAVALIB)/gen15
630 $(QUIET)$(MKDIR) -p $(VBOXWEB_JAVALIB)/gen15
631 $(call MSG_GENERATE,,$@,JAX-WS for Java 1.5 bindings using $(VBOXWEBSERVICE_WSDL))
632 $(QUIET)$(VBOX_WSIMPORT15) -p $(VBOX_JAVA_PACKAGE) -d $(VBOXWEB_JAVALIB)/gen15 $(VBOXWEBSERVICE_WSDL)
633 $(call MSG_L1,Compiling bridge code)
634 $(QUIET)$(VBOX_JAVAC15) -cp \
635 $(VBOXWEB_JAVALIB)/gen15:$(VBOX_JAXWS_LIBDIR)/jaxws-api.jar:$(VBOX_JAXWS_LIBDIR)/lib/jaxb-api.jar:$(VBOX_JAXWS_LIBDIR)/jsr181-api.jar \
636 $(call find_java_files,$(VBOXWEB_PATH_SDK_GLUE_JAVA)) -d $(VBOXWEB_JAVALIB)/gen15
637 $(QUIET)$(SED) -e "s/vboxweb.wsdl/vboxweb$(VBOX_API_SUFFIX).wsdl/" < $(VBOXWEBSERVICE_WSDL) > $(VBOXWEB_JAVALIB)/gen15/vboxwebService$(VBOX_API_SUFFIX).wsdl
638 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOXWEB_JAVALIB)/gen15/vboxweb$(VBOX_API_SUFFIX).wsdl
639 $(QUIET)$(RM) -f $(call find_java_files,$(VBOXWEB_JAVALIB))
640 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOXWEB_JAVALIB)/gen15 .
641
642$(VBOXWEB_JAVA16_JAR): $(VBOXWEB_GLUE_JAVA_TMP).done $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
643 $(QUIET)$(RM) -Rf $(VBOXWEB_JAVALIB)/gen16
644 $(MKDIR) -p $(VBOXWEB_JAVALIB)/gen16
645 $(call MSG_GENERATE,,$@,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL))
646 $(QUIET)$(VBOX_WSIMPORT16) -p $(VBOX_JAVA_PACKAGE) -d $(VBOXWEB_JAVALIB)/gen16 $(VBOXWEBSERVICE_WSDL)
647 $(call MSG_L1,Compiling bridge code)
648 $(QUIET)$(VBOX_JAVAC16) -cp $(VBOXWEB_JAVALIB)/gen16 \
649 $(VBOXWEB_PATH_SDK_GLUE_JAVA)/*.java -d $(VBOXWEB_JAVALIB)/gen16
650 $(QUIET)$(SED) -e "s/vboxweb.wsdl/vboxweb$(VBOX_API_SUFFIX).wsdl/" < $(VBOXWEBSERVICE_WSDL) > $(VBOXWEB_JAVALIB)/gen16/vboxwebService$(VBOX_API_SUFFIX).wsdl
651 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOXWEB_JAVALIB)/gen16/vboxweb$(VBOX_API_SUFFIX).wsdl
652 $(QUIET)$(RM) -f $(call find_java_files,$(VBOXWEB_JAVALIB)/gen16)
653 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOXWEB_JAVALIB)/gen16 .
654
655endif # VBOX_ONLY_SDK
656
657include $(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