VirtualBox

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

Last change on this file since 78493 was 77066, checked in by vboxsync, 6 years ago

Config.kmk, webservice/Makefile.kmk: more Java webservice fixing for Java 11 (cannot put -classpath in VBOX_JAVA_WS_OPTS since it would be overridden by the later option), and prepare for wsimport being hopefully in the search path, if it's not included in Java.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 37.3 KB
Line 
1# $Id: Makefile.kmk 77066 2019-01-31 10:53: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) 2007-2019 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-wsdl2gsoapH.xsl to generate a so-called
42# "gSoap header file": $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h from
43# the WSDL previously generated.
44# This file looks like a C header file, but really isn't meant
45# to be included by a C compiler. Instead, it just happens to be the
46# format that gSOAP uses to specify SOAP interfaces instead of WSDL.
47# (The reason for this appears to be that gSOAP predates WSDL and
48# thus needed some format to describe the syntax of a web service.)
49#
50# Note that gSOAP now also comes with its own WSDL-to-gsoap.h converter,
51# but the readme mentions some funny license restrictions, so instead we
52# have our own converter in XSLT.
53#
54# 3) We then feed that pseudo-header file to gSOAP's soapcpp2 compiler,
55# which generates a ton of files in $(VBOXWEB_OUT_DIR), most importantly:
56#
57# SOAP_CLIENT_H = $(VBOXWEB_OUT_DIR)/soapStub.h (header file for webservice clients)
58# SOAP_SERVER_H = $(VBOXWEB_OUT_DIR)/soapH.h (header file for webservice servers)
59#
60# These are "real" header files that one can use to program a) a webservice client
61# and b) a webservice server. Of course to build b) one will have to write method
62# implementations with useful code that does something. This is where more
63# code generation via XSLT comes in:
64#
65# 4) We use xsltproc to generate tons of C++ code directly from the XIDL that
66# maps each SOAP method to our COM methods. This large C++ file is
67# $(VBOXWEB_OUT_DIR)/methodmaps.cpp. The actual webservice executable (vboxwebsrv,
68# which acts as an HTTP server) is composed of this file, plus hard-coded
69# method implementations in vboxweb.cpp, plus gSOAP library code for the HTTP
70# server.
71#
72
73SUB_DEPTH = ../../../..
74include $(KBUILD_PATH)/subheader.kmk
75
76#
77# Find the gSOAP toolkit.
78#
79# Note! We're not using the gSOAP toolkit correctly. The main issue is that
80# compiling soapcpp2.cpp instead of using the library. So, in order
81# to make this work with a locally installed gSOAP toolkit there are
82# some hoops to jump thru to say the least... Shipping soapcpp2.cpp/h
83# is out of the question without also including the two soap tools.
84#
85# Some observations on distros for OSE / configure:
86# The proposed gentoo ebuild screws up several things in the install phase
87# and thus fails to ship stdsoap2.cpp and relatives.
88#
89# debian (2.7.9l-0.2) stuffs stdsoap2.cpp and a handful of the import files
90# into /usr/include/gsoap.
91#
92# fedora (2.7.12-fc10.x86_64) uses the default install layout and does not
93# ship stdsoap2.cpp and friends.
94#
95ifeq ($(VBOX_GSOAP_INSTALLED),)
96 VBOX_GSOAP_INSTALLED = 1
97 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS)/common/gsoap/*)))
98 ifeq ($(VBOX_PATH_GSOAP),)
99 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST)/gsoap/*)))
100 endif
101 if "$(VBOX_PATH_GSOAP)" == "" && defined(KBUILD_DEVTOOLS_HST)
102 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/gsoap/*)))
103 endif
104 ifeq ($(VBOX_PATH_GSOAP),)
105 $(warning VBOX_PATH_GSOAP not found...)
106 VBOX_GSOAP_INSTALLED =
107 endif
108else
109 VBOX_PATH_GSOAP := $(VBOX_PATH_GSOAP)
110endif
111VBOX_PATH_GSOAP_BIN := $(strip $(VBOX_PATH_GSOAP_BIN))
112if "$(VBOX_PATH_GSOAP_BIN)" == ""
113 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin
114 if "$(KBUILD_HOST)" == "darwin"
115 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/macosx
116 else if "$(KBUILD_HOST)" == "win"
117 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/win32
118 else
119 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/$(KBUILD_HOST).x86
120 endif
121 if !exists($(VBOX_PATH_GSOAP_BIN))
122 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin
123 endif
124endif
125VBOX_SOAPCPP2 := $(VBOX_PATH_GSOAP_BIN)/soapcpp2$(HOSTSUFF_EXE)
126VBOX_WSDL2H := $(VBOX_PATH_GSOAP_BIN)/wsdl2h$(HOSTSUFF_EXE)
127VBOX_STUBMAKER = $(firstword $(which stubmaker stubmaker.pl) stubmaker_not_found)
128# Keep in mind that Python ZSI only exists for Python 2.x, so this hardcodes
129# some things. If you want to build using Python 3.x only you need to disable
130# the creation of the Python webservice bindings anyway.
131if "$(KBUILD_HOST)" != "win"
132VBOX_WSDL2PY = $(firstword $(which wsdl2py) wsdl2py_not_found)
133else
134VBOX_WSDL2PY = $(firstword $(wildcard C:/Python27/Scripts/wsdl2py.exe) wsdl2py_not_found)
135endif
136
137VBOX_PATH_GSOAP_IMPORT := $(strip $(if $(VBOX_PATH_GSOAP_IMPORT),$(VBOX_PATH_GSOAP_IMPORT),$(VBOX_PATH_GSOAP)/import))
138VBOX_GSOAP_INCS := $(strip $(if $(VBOX_GSOAP_INCS),$(VBOX_GSOAP_INCS),$(VBOX_PATH_GSOAP) $(VBOX_PATH_GSOAP_IMPORT) ))
139# note: $(if $(defined FOO)) does not work here!
140VBOX_GSOAP_CXX_SOURCES := $(strip $(if-expr "$(origin VBOX_GSOAP_CXX_SOURCES)" != "undefined",$(VBOX_GSOAP_CXX_SOURCES),$(VBOX_PATH_GSOAP)/stdsoap2.cpp))
141VBOX_GSOAP_CXX_LIBS := $(strip $(if-expr "$(origin VBOX_GSOAP_CXX_LIBS)" != "undefined",$(VBOX_GSOAP_CXX_LIBS),))
142
143
144#
145# Globals
146#
147VBOXWEB_OUT_DIR := $(PATH_TARGET)/webservice
148BLDDIRS += $(VBOXWEB_OUT_DIR)
149
150# The webservice location
151VBOX_PATH_WEBSERVICE := $(PATH_SUB_CURRENT)
152
153# The IDL subdirectory (contains some XSLT files)
154VBOX_PATH_IDL := $(abspath $(PATH_SUB_CURRENT)/../idl)
155
156# If this is set, all webservice files are considered out-of-date every time
157# this makefile is touched. Otherwise, set this to empty.
158RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT)
159
160PATH_TARGET_SOAPDEMOXML := $(VBOXWEB_OUT_DIR)/demo_soapxml
161PATH_TARGET_SOAPDEMOHEADERS := $(VBOXWEB_OUT_DIR)/demo_headers
162PATH_TARGET_SOAPDEMONSMAPS := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
163PATH_TARGET_WEBTEST := $(VBOXWEB_OUT_DIR)/webtest
164
165# the original XIDL file (has to include documentation as we need it):
166VBOXWEB_IDL_SRC_ORIG := $(VBOX_XIDL_FILE_SRC)
167# the original XIDL file without documentation
168VBOXWEB_IDL_SRC_STRIPPED := $(VBOX_XIDL_FILE)
169# platform-specific XIDL file generated from $(VBOXWEB_IDL_SRC_STRIPPED):
170VBOXWEB_IDL_SRC := $(VBOXWEB_OUT_DIR)/VirtualBox.xidl
171
172VBOXWEB_WSDL = $(VBOXWEB_OUT_DIR)/vboxweb.wsdl
173VBOXWEBSERVICE_WSDL = $(VBOXWEB_OUT_DIR)/vboxwebService.wsdl
174
175VBOXWEB_TYPEMAP := $(VBOXWEB_OUT_DIR)/typemap.dat
176
177VBOXWEB_GSOAPH_FROM_XSLT := $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h
178ifdef VBOX_GSOAP_INSTALLED
179 VBOXWEB_GSOAPH_FROM_GSOAP := $(VBOXWEB_OUT_DIR)/gsoapH_from_gsoap.h
180else
181 VBOXWEB_GSOAPH_FROM_GSOAP :=
182endif
183VBOXWEB_SOAP_CLIENT_H := $(VBOXWEB_OUT_DIR)/soapStub.h
184VBOXWEB_SOAP_SERVER_H := $(VBOXWEB_OUT_DIR)/soapH.h
185
186
187ifdef VBOX_GSOAP_VERBOSE
188 VBOXWEB_XSLTPROC_VERBOSE = --stringparam G_argDebug '1'
189 VBOXWEB_WSDL_VERBOSE = -v
190else
191 VBOXWEB_SOAPCPP2_SKIP_FILES = -x
192endif
193
194
195## @todo VBOXWEB_GSOAPH_FROM_XSLT should probably be a indirect dep of something.
196VBOXWEB_OTHERS += \
197 $(VBOXWEB_GSOAPH_FROM_XSLT)
198
199
200# disable -fvisibility=hidden as the SOAP stuff does not properly set the visibility attributes
201TEMPLATE_VBOXWEBR3EXE = Webservices without -fvisibility
202TEMPLATE_VBOXWEBR3EXE_EXTENDS = VBOXR3EXE
203TEMPLATE_VBOXWEBR3EXE_DEFS.win += WIN32_LEAN_AND_MEAN $(TEMPLATE_VBOXR3EXE_DEFS.win) # Makes the redefinition warnings go away.
204TEMPLATE_VBOXWEBR3EXE_CXXFLAGS = $(filter-out $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden),\
205 $(TEMPLATE_VBOXR3EXE_CXXFLAGS))
206
207ifdef VBOX_GSOAP_INSTALLED
208 ifndef VBOX_ONLY_SDK
209 #
210 # vboxsoap - Library used by both the programs (save build time).
211 #
212 LIBRARIES += vboxsoap
213 vboxsoap_TEMPLATE = VBOXWEBR3EXE
214 ifeq ($(KBUILD_TARGET),win)
215 vboxsoap_USES = vccprecomp
216 vboxsoap_PCH_HDR := $(VBOXWEB_SOAP_SERVER_H)
217 endif
218 vboxsoap_CXXFLAGS += $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS)
219 vboxsoap_CXXFLAGS.win += -bigobj
220 vboxsoap_CXXFLAGS.win += -wd4702 # soapc-4.cpp(16) : warning C4702: unreachable code
221 ifn1of ($(KBUILD_TARGET), win)
222 vboxsoap_CXXFLAGS += -Wno-shadow -Wno-parentheses $(VBOX_GCC_Wno-literal-suffix) $(VBOX_GCC_Wno-stringop-overflow) $(VBOX_GCC_Wno-stringop-truncation)
223 ifn1of ($(KBUILD_TYPE), debug) # Save time+memory by using -O0 instead of -O2.
224 vboxsoap_CXXFLAGS += -O0 ## @todo this could be interesting for g++ (not clang++): -fcprop-registers
225 endif
226 endif
227 vboxsoap_INCS := \
228 $(VBOX_GSOAP_INCS) \
229 $(VBOXWEB_OUT_DIR) \
230 $(PATH_SUB_CURRENT)
231 ifdef VBOX_WITH_WEBSERVICES_SSL
232 vboxsoap_DEFS += WITH_OPENSSL
233 vboxsoap_SDKS += VBOX_OPENSSL2
234 endif
235 ifdef VBOX_WITHOUT_SPLIT_SOAPC
236 vboxsoap_SOURCES = \
237 $(VBOXWEB_OUT_DIR)/soapC.cpp
238 else
239 BLDPROGS += split-soapC
240 split-soapC_TEMPLATE = VBoxBldProg
241 split-soapC_SOURCES = split-soapC.cpp
242
243 vboxsoap_SOURCES = \
244 $(VBOXWEB_OUT_DIR)/soapC-1.cpp \
245 $(VBOXWEB_OUT_DIR)/soapC-2.cpp \
246 $(VBOXWEB_OUT_DIR)/soapC-3.cpp \
247 $(VBOXWEB_OUT_DIR)/soapC-4.cpp \
248 $(VBOXWEB_OUT_DIR)/soapC-5.cpp \
249 $(VBOXWEB_OUT_DIR)/soapC-6.cpp \
250 $(VBOXWEB_OUT_DIR)/soapC-7.cpp \
251 $(VBOXWEB_OUT_DIR)/soapC-8.cpp \
252 $(VBOXWEB_OUT_DIR)/soapC-9.cpp \
253 $(VBOXWEB_OUT_DIR)/soapC-10.cpp \
254 $(VBOXWEB_OUT_DIR)/soapC-11.cpp \
255 $(VBOXWEB_OUT_DIR)/soapC-12.cpp \
256 $(VBOXWEB_OUT_DIR)/soapC-13.cpp \
257 $(VBOXWEB_OUT_DIR)/soapC-14.cpp \
258 $(VBOXWEB_OUT_DIR)/soapC-15.cpp \
259 $(VBOXWEB_OUT_DIR)/soapC-16.cpp \
260 $(VBOXWEB_OUT_DIR)/soapC-17.cpp \
261 $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
262 $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
263 $(VBOXWEB_OUT_DIR)/soapC-20.cpp \
264 $(VBOXWEB_OUT_DIR)/soapC-21.cpp \
265 $(VBOXWEB_OUT_DIR)/soapC-22.cpp \
266 $(VBOXWEB_OUT_DIR)/soapC-23.cpp \
267 $(VBOXWEB_OUT_DIR)/soapC-24.cpp \
268 $(VBOXWEB_OUT_DIR)/soapC-25.cpp \
269 $(VBOXWEB_OUT_DIR)/soapC-26.cpp \
270 $(VBOXWEB_OUT_DIR)/soapC-27.cpp \
271 $(VBOXWEB_OUT_DIR)/soapC-28.cpp \
272 $(VBOXWEB_OUT_DIR)/soapC-29.cpp
273 vboxsoap_CXXFLAGS += \
274 $(VBOX_GCC_Wno-vla) \
275 $(if-expr $(KBUILD_TARGET) == "win",,-Wno-format) \
276 $(if-expr $(KBUILD_TARGET) == "win",,-Wno-deprecated-declarations)
277 endif
278 vboxsoap_CLEAN := $(vboxsoap_SOURCES) # lazy bird
279 vboxsoap_SOURCES <= \
280 $(VBOX_GSOAP_CXX_SOURCES)
281 vboxsoap_ORDERDEPS = \
282 $(VBOXWEB_IDL_SRC) \
283 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
284 ifn1of ($(KBUILD_TARGET), win)
285 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS = \
286 -Wno-format \
287 $(VBOX_GCC_Wno-int-in-bool-context) \
288 $(if $(VBOX_GCC_Wlogical-op),-Wno-error=logical-op,)
289 # currently necessary when compiling against OpenSSL 1.0 due to a missing
290 # typecase from 'const v3_ext_method*' to 'aka v3_ext_method*'.
291 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS += -fpermissive
292
293 endif
294
295 if "$(KBUILD_TARGET)" == "win" && "$(VBOX_GSOAP_CXX_SOURCES)" != ""
296 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4668 # preprocessor / windows.h
297 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4211 # nonstandard extension used: redefined extern to static
298 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4310 # cast truncates constant value
299 if1of ($(VBOX_VCC_TOOL_STEM), VCC120)
300 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4056 # v2.8.36/stdsoap2.cpp(14008) : warning C4056: overflow in floating-point constant arithmetic
301 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4756 # v2.8.36/stdsoap2.cpp(14008) : warning C4756: overflow in constant arithmetic
302 endif
303 endif
304
305 ifdef VBOX_SOAP_PRECOMPILED_HEADER
306 # This'll save a few seconds, but the compiler invocation currently makes it impracticable. This will
307 # be addressed in a future kBuild version, by adding PCH support or/and by adding some helpers to
308 # gather the required data (DEFS,INCS,CXXTOOL,CXXFLAGS).
309 vboxsoap_INTERMEDIATES += $(VBOXWEB_OUT_DIR)/soapH.h.gch
310 vboxsoap_CXXFLAGS += -Winvalid-pch -H
311 vboxsoap_CLEAN += $(VBOXWEB_OUT_DIR)/soapH.h.gch
312
313 $(VBOXWEB_OUT_DIR)/soapH.h.gch: $(VBOXWEB_OUT_DIR)/soapH.h
314 g++ -x c++-header -g -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -Wno-variadic-macros -pipe -O0 -fno-omit-frame-pointer \
315 -fno-strict-aliasing -fvisibility-inlines-hidden -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN \
316 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -m32 \
317 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/src/VBox/Main/webservice/gsoap \
318 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/out/darwin.x86/debug/obj/src/VBox/Main \
319 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/src/VBox/Main/webservice \
320 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/include -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/out/darwin.x86/debug
321 \-DVBOX -DVBOX_WITH_DEBUGGER -DVBOX_WITH_DEBUGGER_GUI -DDEBUG -DDEBUG_bird -DDEBUG_USERNAME=bird -DRT_OS_DARWIN \
322 -D__DARWIN__ -DRT_ARCH_X86 -D__X86__ -DVBOX_WITH_HYBRID_32BIT_KERNEL -DIN_RING3 -DHC_ARCH_BITS=32 -DGC_ARCH_BITS=32 \
323 -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -DMAC_OS_X_VERSION_MAX_ALLOWED=1040 \
324 $< -o $@
325 endif
326
327 # Tweak for systems with too many CPUs compared to memory.
328 ifdef VBOX_WITH_SOAP_NOT_PARALLEL
329 .NOTPARALLEL: $$(vboxsoap_2_OBJS)
330 endif
331 endif # !VBOX_ONLY_SDK
332
333
334 ifndef VBOX_ONLY_SDK
335 #
336 # vboxwebsrv - webservice server process
337 #
338 PROGRAMS += vboxwebsrv
339 vboxwebsrv_TEMPLATE = VBOXMAINCLIENTEXE
340 vboxwebsrv_DEFS += SOCKET_CLOSE_ON_EXEC
341 vboxwebsrv_DEFS.win += WIN32_LEAN_AND_MEAN
342 vboxwebsrv_INCS = \
343 $(VBOX_GSOAP_INCS) \
344 $(VBOXWEB_OUT_DIR) \
345 .
346 vboxwebsrv_CXXFLAGS.win += -bigobj
347 ifn1of ($(KBUILD_TARGET), win)
348 vboxwebsrv_CXXFLAGS += -Wno-shadow $(VBOX_GCC_Wno-literal-suffix)
349 ifn1of ($(KBUILD_TYPE), debug) # Save time+memory by using -O1 instead of -O2.
350 vboxwebsrv_CXXFLAGS += -O0
351 endif
352 endif
353 vboxwebsrv_LIBS += \
354 $(PATH_STAGE_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
355 $(VBOX_GSOAP_CXX_LIBS) \
356 $(LIB_RUNTIME)
357 vboxwebsrv_LIBS.solaris += socket nsl
358 ifdef VBOX_WITH_WEBSERVICES_SSL
359 vboxwebsrv_DEFS += WITH_OPENSSL
360 vboxwebsrv_SDKS += VBOX_OPENSSL2
361 endif
362 vboxwebsrv_SOURCES = \
363 vboxweb.cpp \
364 $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
365 $(VBOXWEB_OUT_DIR)/soapServer.cpp \
366 $(VBOXWEB_OUT_DIR)/vboxweb-wsdl.c
367 vboxwebsrv_SOURCES.win = \
368 VBoxWebSrv.rc
369 vboxwebsrv_CLEAN = \
370 $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
371 $(VBOXWEB_OUT_DIR)/soapServer.cpp \
372 $(VBOXWEB_OUT_DIR)/vboxweb-wsdl.c
373 # gcc 6.2 warns about aborting misleading indentation detection (too much code)
374 vboxweb.cpp_CXXFLAGS = \
375 $(VBOX_GCC_Wno-misleading-indentation)
376 vboxwebsrv_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
377 endif # !VBOX_ONLY_SDK
378
379 ifdef VBOX_WITH_JWS
380INSTALLS += VBoxJWs-inst-jar
381
382#
383# Java glue JAR files
384#
385VBOX_JWS_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws.jar
386VBOX_JWSDOC_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws-doc.jar
387VBOX_JWSSRC_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws-src.jar
388VBOX_JWS_TARGET := $(PATH_TARGET)/vboxjws-gen
389VBOX_JWS_GEN = $(VBOX_JWS_TARGET)/jwsgen
390VBOX_JWS_GEN_RAWSRC = $(VBOX_JWS_GEN)/merged.file
391VBOX_JWS_JDEST := $(VBOX_JWS_TARGET)/jdest
392VBOX_JWSDOC_JDEST := $(VBOX_JWS_TARGET)/jdest-doc
393VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
394VBOX_JAXLIB_DIR := $(PATH_ROOT)/src/VBox/Main/webservice/jaxlibs
395
396VBoxJWs-inst-jar_INST = $(INST_SDK)bindings/webservice/java/jax-ws/
397VBoxJWs-inst-jar_MODE = a+r,u+w
398VBoxJWs-inst-jar_SOURCES = \
399 $(VBOX_JWS_JAR) \
400 $(VBOX_JWSDOC_JAR) \
401 $(VBOX_JWSSRC_JAR)
402VBoxJWs-inst-jar_CLEAN = \
403 $(VBOX_JWS_JAR) \
404 $(VBOX_JWSDOC_JAR) \
405 $(VBOX_JWSSRC_JAR) \
406 $(VBOX_JWS_GEN)/jwsglue.list \
407 $(VBOX_JWSDOC_JDEST)/package-list \
408 $(wildcard \
409 $(VBOX_JWS_GEN)/java/*/*/*.java \
410 $(VBOX_JWS_GEN)/java/*/*/*/*.java \
411 $(VBOX_JWS_JDEST)/*.class \
412 $(VBOX_JWS_JDEST)/*/*.class \
413 $(VBOX_JWS_JDEST)/*/*/*.class \
414 $(VBOX_JWS_JDEST)/*/*/*/*.class \
415 $(VBOX_JWSDOC_JDEST)/*.html \
416 $(VBOX_JWSDOC_JDEST)/*.css \
417 $(VBOX_JWSDOC_JDEST)/*/*.gif \
418 $(VBOX_JWSDOC_JDEST)/*/*/*.html \
419 $(VBOX_JWSDOC_JDEST)/*/*/*/*.html \
420 )
421VBoxJWs-inst-jar_BLDDIRS += $(VBOX_JWS_GEN)/java
422VBoxJWs-inst-jar_GENERATEDSOURCES = $(addprefix $(VBoxJWs-inst-jar_BLDDIRS)/,$(VBoxJWS_VBOX_JWSGLUEFILES))
423
424VBoxJWSGlue_KMK = $(PATH_OUT)/vboxjwsglue.kmk
425include $(VBoxJWSGlue_KMK)
426
427$(VBoxJWSGlue_KMK).ts +| $(VBoxJWSGlue_KMK): $(VBOXWEB_IDL_SRC_ORIG) $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $(VBOX_VERSION_STAMP)
428 $(call MSG_GENERATE,,$(VBoxJWSGlue_KMK))
429 $(QUIET)$(RM) -f $@
430 $(QUIET)$(MKDIR) -p $(@D)
431 $(QUIET)$(VBOX_XSLTPROC) \
432 --stringparam filelistonly VBoxJWS_VBOX_JWSGLUEFILES \
433 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
434 --stringparam G_vboxGlueStyle jaxws \
435 --stringparam G_vboxDirPrefix org/virtualbox$(VBOX_API_SUFFIX)/ \
436 -o $@ $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
437 $(QUIET)$(CP) --changed -fv $@ $(VBoxJWSGlue_KMK)
438
439$(VBOX_JWS_GEN_RAWSRC) \
440+| $(VBoxJWs-inst-jar_GENERATEDSOURCES): \
441 $(VBOXWEB_IDL_SRC_ORIG) \
442 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
443 $(VBOX_FILESPLIT) \
444 $(VBOX_VERSION_STAMP)
445 $(call MSG_L1,Generating JAX-WS Java glue files from XIDL)
446 $(QUIET)$(RM) -f $(filter-out $(VBoxJWs-inst-jar_GENERATEDSOURCES),$(wildcard $(VBOX_JWS_GEN)/java/*/*/*.java))
447 $(QUIET)$(MKDIR) -p $(@D)
448 $(QUIET)$(VBOX_XSLTPROC) \
449 --stringparam filelistonly "" \
450 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
451 --stringparam G_vboxGlueStyle jaxws \
452 --stringparam G_vboxDirPrefix org/virtualbox$(VBOX_API_SUFFIX)/ \
453 -o $(VBOX_JWS_GEN_RAWSRC) $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
454 $(QUIET)$(MKDIR) -p $(VBOX_JWS_GEN)/java/org/virtualbox$(VBOX_API_SUFFIX)
455 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JWS_GEN_RAWSRC) $(VBOX_JWS_GEN)/java
456
457## @todo somehow also find out the authoritative list of files generated by
458# wsimport (before running it), then we could rely on proper dependencies
459# instead of creating jwsglue.list. Would allow avoiding a lot of unnecessary
460# compilation with incremental builds, when almost nothing changed in the IDL
461# file. Currently everything is recompiled if only one file is changed.
462$(VBOX_JWS_GEN)/jwsglue.list.ts +| $(VBOX_JWS_GEN)/jwsglue.list: \
463 $(VBOXWEB_IDL_SRC) \
464 $(VBOX_FILESPLIT) \
465 $(VBOXWEBSERVICE_WSDL) \
466 $(VBOXWEB_WSDL) \
467 $(VBoxJWs-inst-jar_GENERATEDSOURCES) \
468 | $(VBOX_JWS_GEN)/java/
469 $(QUIET)$(RM) -f -- $(wildcard $(VBOX_JWS_GEN)/java/*/*/*/*.java)
470 $(call MSG_GENERATE,,$(VBOX_JWS_GEN)/jwsglue.list,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL))
471 $(VBOX_WSIMPORT) -Xnocompile -p $(VBOX_JAVA_PACKAGE).jaxws -d $(VBOX_JWS_GEN)/java $(VBOXWEBSERVICE_WSDL)
472 $(QUIET)echo $(VBoxJWs-inst-jar_GENERATEDSOURCES) > $@
473 $(QUIET)echo $(VBOX_JWS_GEN)/java/*/*/*/*.java >> $@
474 $(QUIET)$(CP) --changed -fv $@ $(VBOX_JWS_GEN)/jwsglue.list
475
476$$(VBOX_JWS_JAR): $(VBOX_JWS_GEN)/jwsglue.list $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOX_JWS_GEN)/MANIFEST.MF | $$(dir $$@)
477 $(call MSG_TOOL,javac,$(notdir $@),jwsgen.list,)
478 $(QUIET)$(RM) -Rf $(VBOX_JWS_JDEST)
479 $(QUIET)$(MKDIR) -p $(VBOX_JWS_JDEST)
480 $(call MSG_L1,Compiling bridge code)
481 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) $(VBOX_JAVA_WS_OPTS) \
482 @$(VBOX_JWS_GEN)/jwsglue.list \
483 -d $(VBOX_JWS_JDEST) -classpath $(VBOX_JWS_JDEST)$(VBOX_SEP)$(VBOX_JAVA_WS_EXTRA_JARS)
484 $(QUIET)$(SED) -e "s/vboxweb.wsdl/vboxweb$(VBOX_API_SUFFIX).wsdl/" < $(VBOXWEBSERVICE_WSDL) > $(VBOX_JWS_JDEST)/vboxwebService$(VBOX_API_SUFFIX).wsdl
485 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOX_JWS_JDEST)/vboxweb$(VBOX_API_SUFFIX).wsdl
486 $(call MSG_LINK,$(notdir $@),$@)
487 $(VBOX_JAR) cfm $@ $(VBOX_JWS_GEN)/MANIFEST.MF -C $(VBOX_JWS_JDEST) .
488
489$(VBOX_JWS_GEN)/MANIFEST.MF: $(VBOX_PATH_WEBSERVICE)/MANIFEST.MF.in
490 $(QUIET)$(RM) -f -- $@
491 $(QUIET)$(MKDIR) -p $(VBOX_JWS_GEN)
492 $(QUIET)$(SED) \
493 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/' \
494 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/' \
495 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/' \
496 -e 's/@VBOX_API_SUFFIX@/$(VBOX_API_SUFFIX)/' \
497 < $< > $@
498
499$$(VBOX_JWSDOC_JAR): $(VBOX_JWS_GEN)/jwsglue.list $$(VBoxJWs-inst-jar_GENERATEDSOURCES) $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $$(VBOX_JWS_JAR) | $$(dir $$@)
500 $(call MSG_TOOL,javadoc,$(notdir $@),jwsgen.list,)
501 $(QUIET)$(RM) -Rf $(VBOX_JWSDOC_JDEST)
502 $(QUIET)$(MKDIR) -p $(VBOX_JWSDOC_JDEST)
503 $(call MSG_L1,Generating javadoc html documentation)
504 $(VBOX_JAVADOC) $(VBOX_JAVADOC_OPTS) $(VBOX_JAVA_WS_OPTS) -quiet \
505 -sourcepath $(VBOX_JWS_GEN)/java org.virtualbox$(VBOX_API_SUFFIX) \
506 -d $(VBOX_JWSDOC_JDEST) -classpath $(VBOX_SEP)$(VBOX_JAVA_WS_EXTRA_JARS)
507 $(call MSG_LINK,$(notdir $@),$@)
508 $(VBOX_JAR) cf $@ -C $(VBOX_JWSDOC_JDEST) .
509
510$$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | $$(dir $$@)
511 $(call MSG_LINK,$(notdir $@),$@)
512 $(VBOX_JAR) cf $@ -C $(VBOX_JWS_GEN)/java .
513
514## @todo compile ../glue/tests/TestVBox.java to have sanity checking
515
516 endif # VBOX_WITH_JWS
517
518 ifndef VBOX_ONLY_SDK
519 #
520 # webtest - webservice sample client in C++
521 #
522 PROGRAMS += webtest
523 webtest_TEMPLATE = VBOXWEBR3EXE
524 webtest_CXXFLAGS.win += -bigobj
525 ifn1of ($(KBUILD_TARGET), win)
526 webtest_CXXFLAGS += -Wno-shadow
527 endif
528 webtest_INCS := \
529 $(VBOX_GSOAP_INCS) \
530 $(VBOXWEB_OUT_DIR) \
531 .
532 webtest_LIBS += \
533 $(PATH_STAGE_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
534 $(VBOX_GSOAP_CXX_LIBS) \
535 $(LIB_RUNTIME)
536 webtest_LIBS.solaris += nsl
537 ifdef VBOX_WITH_WEBSERVICES_SSL
538 webtest_DEFS += WITH_OPENSSL
539 webtest_SDKS += VBOX_OPENSSL2
540 endif
541 webtest_SOURCES = \
542 webtest.cpp \
543 $(VBOXWEB_OUT_DIR)/soapClient.cpp
544 webtest_CLEAN = \
545 $(VBOXWEB_OUT_DIR)/soapClient.cpp
546
547 webtest_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
548 endif # !VBOX_ONLY_SDK
549
550
551 #
552 # Additional mess to cleanup (applies to both webtest and vboxwebsrv).
553 #
554 ## @todo figure out whether the SDK really needs this or not...
555 OTHER_CLEAN += \
556 $(wildcard $(VBOXWEB_OUT_DIR)/soap*.h) \
557 $(wildcard $(VBOXWEB_OUT_DIR)/soap*.cpp) \
558 $(wildcard $(VBOXWEB_OUT_DIR)/*.nsmap) \
559 $(VBOXWEB_GSOAPH_FROM_XSLT) \
560 $(VBOXWEB_GSOAPH_FROM_GSOAP) \
561 $(VBOXWEB_SOAP_CLIENT_H) \
562 $(VBOXWEB_SOAP_SERVER_H) \
563 $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
564 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \
565 $(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \
566 $(PATH_TARGET_SOAPDEMOXML)/dummy_file \
567 $(wildcard $(PATH_TARGET_SOAPDEMOHEADERS)/*) \
568 $(PATH_TARGET_SOAPDEMOHEADERS)/dummy_file \
569 $(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \
570 $(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file
571
572endif # VBOX_GSOAP_INSTALLED
573
574
575if defined(VBOX_ONLY_SDK) && ("$(KBUILD_TARGET)" != "win" || defined(VBOX_FORCE_SDK))
576 #
577 # Globals relevant to the SDK.
578 #
579 VBOXWEB_GLUE_PYTHON = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_wrappers.py
580 # The following 3 files are generated by Python ZSI 2.1_a1 (alpha version
581 # shipped by many Linux distributions). Only the first two are actually used.
582 # The 4th and 5th file is created by ZSI 2.0 (released in 2007), and gets
583 # renamed to the 1st/2nd file for simplicity reasons.
584 # ZSI 1.x used different file names. Not worth supporting any more. If you're
585 # curious, check the VirtualBox 4.3 sources.
586 VBOXWEB_WS_PYTHON = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_client.py
587 VBOXWEB_WS_PYTHON_TYPES = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_types.py
588 VBOXWEB_WS_PYTHON_SERVER = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_server.py
589 VBOXWEB_WS_PYTHON_ALTERNATIVE = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_services.py
590 VBOXWEB_WS_PERL = $(VBOX_PATH_SDK)/bindings/webservice/perl/lib/vboxService.pm
591 VBOXWEB_WS_PHP = $(VBOX_PATH_SDK)/bindings/webservice/php/lib/vboxServiceWrappers.php
592 VBOXWEB_SAMPLES_JAXWS_DIR = $(VBOX_PATH_SDK)/bindings/webservice/java/jax-ws/samples
593 VBOXWEB_JAXWSSAMPLE = $(VBOXWEB_SAMPLES_JAXWS_DIR)/clienttest.java
594 VBOXWEB_METRICSAMPLE = $(VBOXWEB_SAMPLES_JAXWS_DIR)/metrictest.java
595
596 define find_java_files
597 $(shell find $(1) -name \*.java)
598 endef
599
600 VBOXWEB_OTHERS += \
601 $(if $(VBOX_WITH_PYTHON),$(VBOXWEB_GLUE_PYTHON),) \
602 $(if $(VBOX_WITH_PYTHON),$(VBOXWEB_WS_PYTHON),) \
603 $(if $(VBOX_WITH_PYTHON),$(VBOXWEB_WS_PYTHON_TYPES),) \
604 $(if $(VBOX_WITH_PERL),$(VBOXWEB_WS_PERL),) \
605 $(if $(VBOX_WITH_PHP),$(VBOXWEB_WS_PHP),) \
606 $(PATH_ROOT)
607
608
609 #
610 # Install sample code.
611 #
612 INSTALLS += vboxwebinst
613 vboxwebinst_INST = $(INST_SDK)bindings/webservice/
614 vboxwebinst_MODE = a+rx,u+w
615 vboxwebinst_SOURCES = \
616 $(if $(VBOX_WITH_PERL),samples/perl/clienttest.pl=>perl/samples/clienttest.pl,) \
617 $(if $(VBOX_WITH_PHP),samples/php/clienttest.php=>php/samples/clienttest.php,) \
618 $(if $(VBOX_WITH_PYTHON),samples/python/clienttest.py=>python/samples/clienttest.py,)
619
620 INSTALLS += vboxwebinst_nox
621 vboxwebinst_nox_INST = $(INST_SDK)bindings/webservice/
622 vboxwebinst_nox_MODE = a+r,u+w
623 vboxwebinst_nox_SOURCES = \
624 $(if $(VBOX_WITH_PYTHON),samples/python/Makefile=>python/samples/Makefile,) \
625 $(if $(VBOX_WITH_PYTHON),samples/python/Makefile.glue=>python/lib/Makefile,) \
626 $(if ($VBOX_WITH_JWS),$(PATH_ROOT)/COPYING.LIB=>java/jax-ws/COPYING.LIB,)
627
628 INSTALLS += vboxwebinst_wsdl
629 vboxwebinst_wsdl_INST = $(INST_SDK)bindings/webservice/
630 vboxwebinst_wsdl_MODE = a+r,u+w
631 vboxwebinst_wsdl_SOURCES = \
632 $(VBOXWEB_WSDL)=>vboxweb.wsdl \
633 $(VBOXWEBSERVICE_WSDL)=>vboxwebService.wsdl
634
635 INSTALLS += vboxwebinst_webtest
636 vboxwebinst_webtest_INST = $(INST_SDK)bindings/webservice/
637 vboxwebinst_webtest_MODE = a+r,u+w
638 vboxwebinst_webtest_SOURCES = \
639 $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl=>xsl/websrv-wsdl2gsoapH.xsl \
640 $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl=>xsl/websrv-nsmap.xsl \
641 $(VBOX_PATH_IDL)/typemap-shared.inc.xsl=>idl/typemap-shared.inc.xsl \
642 $(VBOX_PATH_WEBSERVICE)/split-soapC.cpp=>tools/split-soapC.cpp \
643 $(VBOX_PATH_WEBSERVICE)/webtest.cpp=>cpp/samples/webtest/webtest.cpp \
644 $(VBOX_PATH_WEBSERVICE)/Makefile.webtest=>cpp/samples/webtest/Makefile
645
646endif # VBOX_ONLY_SDK
647
648#
649# Update the OTHERS and OTHER_CLEAN lists with VBOXWEB_OTHERS and some more stuff.
650#
651# We can't just built up OTHERS and append it to OTHER_CLEAN because we're sharing
652# OTHERS with all the other VBox makefiles, thus VBOXWEB_OTHERS.
653#
654OTHERS += $(VBOXWEB_OTHERS)
655OTHER_CLEAN += \
656 $(VBOXWEB_OTHERS) \
657 $(if $(VBOX_WITH_PYTHON),$(VBOXWEB_WS_PYTHON_SERVER),) \
658 $(VBOXWEB_WSDL) \
659 $(VBOXWEBSERVICE_WSDL) \
660 $(VBOXWEB_TYPEMAP) \
661 $(VBOXWEB_IDL_SRC)
662
663# generate platform-specific XIDL file from original XIDL file
664$(VBOXWEB_IDL_SRC): $(VBOXWEB_IDL_SRC_STRIPPED) $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl | $$(dir $$@)
665 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using platform-xidl.xsl)
666 $(QUIET)$(RM) -f -- $@
667 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl $<
668
669# generate WSDL from main XIDL file
670$(VBOXWEB_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
671 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl.xsl)
672 $(QUIET)$(RM) -f -- $@
673 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $<
674
675$(VBOXWEBSERVICE_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
676 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl-service.xsl)
677 $(QUIET)$(RM) -f -- $@
678 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $<
679
680ifdef VBOX_ONLY_SDK
681
682$(VBOXWEB_GLUE_PYTHON): $(VBOXWEB_IDL_SRC) $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-python.xsl
683 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-python.xsl)
684 $(QUIET)$(RM) -f -- $@
685 $(QUIET)$(MKDIR) -p $(@D)
686 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-python.xsl $<
687
688$(VBOXWEB_WS_PYTHON) \
689+ $(VBOXWEB_WS_PYTHON_TYPES): $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
690 $(call MSG_GENERATE,,$@, WS Python bindings)
691 $(QUIET)$(RM) -f -- $@
692 $(QUIET)$(MKDIR) -p $(@D)
693# Change directory to the "source", as otherwise ZSI 2.0 has trouble finding
694# the 2nd WSDL file included in the main one. ZSI 2.1 is smarter, but some
695# versions floating around (especially on Linux) lack the --file option.
696if "$(KBUILD_HOST)" != "win"
697 $(QUIET)$(REDIRECT) -C $(dir $(VBOXWEBSERVICE_WSDL)) -- $(SHELL) -c "$(VBOX_WSDL2PY) -b --output-dir $(@D) $(VBOXWEBSERVICE_WSDL) || $(VBOX_WSDL2PY) -b --file $(VBOXWEBSERVICE_WSDL) --output-dir $(@D)"
698else
699 $(QUIET)$(REDIRECT) -C $(dir $(VBOXWEBSERVICE_WSDL)) -- $(VBOX_WSDL2PY) -b --file $(subst /,\\\\,$(VBOXWEBSERVICE_WSDL)) --output-dir $(@D)
700endif
701# Hack: some wsdl2py versions generate VirtualBox_client.py, some generate
702# VirtualBox_services.py. Standardize on the former.
703 -$(QUIET)$(MV) -f $(VBOXWEB_WS_PYTHON_ALTERNATIVE) $(VBOXWEB_WS_PYTHON)
704# We do not ever need the VirtualBox_server.py file. Delete it immediately
705# so that it will not get packaged in the SDK.
706 $(QUIET)$(RM) -f -- $(VBOXWEB_WS_PYTHON_SERVER)
707 $(QUIET)$(APPEND) $@ ''
708
709$(VBOXWEB_WS_PERL): $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
710 $(call MSG_GENERATE,,$@, WS Perl bindings)
711 $(QUIET)$(MKDIR) -p $(@D)
712 $(QUIET)$(REDIRECT) -C $(@D) -- $(VBOX_STUBMAKER) file://$(VBOXWEBSERVICE_WSDL)
713# Ugly, ugly, ugly, make me right once
714 $(QUIET)$(SED) -e "s+http://www.virtualbox.org/Service+http://www.virtualbox.org/+" --output $(VBOXWEB_WS_PERL).tmp $(VBOXWEB_WS_PERL)
715 $(QUIET)$(MV) $(VBOXWEB_WS_PERL).tmp $(VBOXWEB_WS_PERL)
716 $(QUIET)$(APPEND) $@ ''
717
718$(VBOXWEB_WS_PHP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-php.xsl
719 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-php.xsl)
720 $(QUIET)$(RM) -f -- $@
721 $(QUIET)$(MKDIR) -p $(@D)
722 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-php.xsl $<
723
724endif # VBOX_ONLY_SDK
725
726# generate typemap.dat (used by wsdl2h) from main XIDL file
727$(VBOXWEB_TYPEMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
728 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-typemap.xsl)
729 $(QUIET)$(RM) -f -- $@
730 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $<
731
732# generate gsoap pseudo-C header file from that WSDL; once via XSLT...
733$(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
734 $(call MSG_GENERATE,,$@,$(VBOXWEB_WSDL) using websrv-wsdl2gsoapH.xsl)
735 $(QUIET)$(RM) -f -- $@
736 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $<
737
738VBOX_NSMAP = $(VBOXWEB_OUT_DIR)/vboxwebsrv.nsmap
739$(VBOX_NSMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
740 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-nsmap.xsl)
741 $(QUIET)$(RM) -f -- $@
742 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $<
743
744ifdef VBOX_GSOAP_INSTALLED
745# ... and once with the gSOAP tool (just for comparison, we don't use it for licensing reasons)
746$(VBOXWEB_GSOAPH_FROM_GSOAP): $(VBOXWEB_WSDL) $(VBOXWEB_TYPEMAP) | $$(dir $$@)
747 $(call MSG_GENERATE,,$@,)
748 $(QUIET)$(RM) -f -- $@
749 $(VBOX_WSDL2H) $(VBOXWEB_WSDL_VERBOSE) -t$(VBOXWEB_TYPEMAP) -nvbox -o $@ $<
750
751# this sets the gsoap header that we use for further compilation; if stuff works, then the
752# one we generate via XSLT produces the same end result as the one from the gSOAP tool;
753# with this variable we can swap for testing, but shipped code must use VBOXWEB_GSOAPH_FROM_XSLT
754GSOAPH_RELEVANT = $(VBOXWEB_GSOAPH_FROM_XSLT)
755
756# wsdl2h -v: verbose
757# wsdl2h -e: don't qualify enum names
758# wsdl2h -n<prefix>: namespace header prefix
759
760## @todo change this to state explicitly what will be generated?
761
762# generate server and client code from gsoap pseudo-C header file
763$(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
764+ $(VBOXWEB_OUT_DIR)/soapH.h \
765+ $(VBOXWEB_SOAP_CLIENT_H) \
766+ $(VBOXWEB_OUT_DIR)/soapC.cpp \
767+ $(VBOXWEB_OUT_DIR)/soapClient.cpp \
768+ $(VBOXWEB_OUT_DIR)/soapServer.cpp \
769: $(VBOXWEB_GSOAPH_FROM_GSOAP) $(VBOXWEB_GSOAPH_FROM_XSLT) $(VBOX_NSMAP) $(VBOX_PATH_WEBSERVICE)/stdsoap2.sed \
770 $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
771 $(call MSG_GENERATE,,lots of files,$(GSOAPH_RELEVANT))
772 $(RM) -f $@
773 $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -2 -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
774ifeq ($(KBUILD_TARGET),win) # MSC -Wall workaround.
775 $(CP) -f "$(VBOXWEB_SOAP_CLIENT_H)" "$(VBOXWEB_SOAP_CLIENT_H).tmp"
776 $(SED) -f $(VBOX_PATH_WEBSERVICE)/stdsoap2.sed --output "$(VBOXWEB_SOAP_CLIENT_H)" "$(VBOXWEB_SOAP_CLIENT_H).tmp"
777 $(RM) -f "$(VBOXWEB_SOAP_CLIENT_H).tmp"
778endif
779 $(APPEND) $@ done
780
781# Copy the generated headers and stuff. This was split into a separate rule
782# way back because we thought we could use $(wildcard ) and avoid the shell,
783# however we cannot as it is subject to caching. Let the shell do the globbing.
784# GSOAP versions 2.8 and later do not generate the unneeded soapvbox*.h files
785# any more. Ignoring the exit code is the simple solution, accepting the error.
786$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
787 $(RM) -f $@
788 $(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMOHEADERS) $(PATH_TARGET_SOAPDEMONSMAPS)
789ifdef VBOX_GSOAP_VERBOSE
790 $(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/*.req.xml $(VBOXWEB_OUT_DIR)/*.res.xml $(PATH_TARGET_SOAPDEMOXML)/
791endif
792 -$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/soapvbox*.h $(PATH_TARGET_SOAPDEMOHEADERS)/
793 $(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/vboxBinding.nsmap $(PATH_TARGET_SOAPDEMONSMAPS)/
794 $(APPEND) $@ done
795
796$(PATH_TARGET_SOAPDEMONSMAPS) \
797$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingProxy.h \
798$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingObject.h: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
799
800# soapcpp2 -2: generate SOAP 1.2 calls
801# soapcpp2 -S: server-side code only
802# soapcpp2 -L: don't generate soapClientLib/soapServerLib
803# soapcpp2 -w: don't generate WSDL and schema files
804# soapcpp2 -x: don't generate sample XML files
805
806ifndef VBOX_WITHOUT_SPLIT_SOAPC
807#
808# Split up the soapC.cpp monster into manageable bits that can be
809# built in parallel and without exhausting all available memory.
810#
811$(VBOXWEB_OUT_DIR)/soapC-1.cpp \
812+ $(VBOXWEB_OUT_DIR)/soapC-2.cpp \
813+ $(VBOXWEB_OUT_DIR)/soapC-3.cpp \
814+ $(VBOXWEB_OUT_DIR)/soapC-4.cpp \
815+ $(VBOXWEB_OUT_DIR)/soapC-5.cpp \
816+ $(VBOXWEB_OUT_DIR)/soapC-6.cpp \
817+ $(VBOXWEB_OUT_DIR)/soapC-7.cpp \
818+ $(VBOXWEB_OUT_DIR)/soapC-8.cpp \
819+ $(VBOXWEB_OUT_DIR)/soapC-9.cpp \
820+ $(VBOXWEB_OUT_DIR)/soapC-10.cpp \
821+ $(VBOXWEB_OUT_DIR)/soapC-11.cpp \
822+ $(VBOXWEB_OUT_DIR)/soapC-12.cpp \
823+ $(VBOXWEB_OUT_DIR)/soapC-13.cpp \
824+ $(VBOXWEB_OUT_DIR)/soapC-14.cpp \
825+ $(VBOXWEB_OUT_DIR)/soapC-15.cpp \
826+ $(VBOXWEB_OUT_DIR)/soapC-16.cpp \
827+ $(VBOXWEB_OUT_DIR)/soapC-17.cpp \
828+ $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
829+ $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
830+ $(VBOXWEB_OUT_DIR)/soapC-20.cpp \
831+ $(VBOXWEB_OUT_DIR)/soapC-21.cpp \
832+ $(VBOXWEB_OUT_DIR)/soapC-22.cpp \
833+ $(VBOXWEB_OUT_DIR)/soapC-23.cpp \
834+ $(VBOXWEB_OUT_DIR)/soapC-24.cpp \
835+ $(VBOXWEB_OUT_DIR)/soapC-25.cpp \
836+ $(VBOXWEB_OUT_DIR)/soapC-26.cpp \
837+ $(VBOXWEB_OUT_DIR)/soapC-27.cpp \
838+ $(VBOXWEB_OUT_DIR)/soapC-28.cpp \
839+ $(VBOXWEB_OUT_DIR)/soapC-29.cpp \
840: $(VBOXWEB_OUT_DIR)/soapC.cpp $$(split-soapC_1_TARGET) | $$(dir $$@)
841 $(RM) -f -- $(wildcard $(VBOXWEB_OUT_DIR)/soapC-?.cpp $(VBOXWEB_OUT_DIR)/soapC-??.cpp)
842 $(split-soapC_1_TARGET) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR) 29
843endif # !VBOX_WITHOUT_SPLIT_SOAPC
844
845endif # VBOX_GSOAP_INSTALLED
846
847
848
849# generate method maps in server: map wsdl operations to com/xpcom method calls
850$(VBOXWEB_OUT_DIR)/methodmaps.cpp: $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
851 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-cpp.xsl)
852 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $<
853
854# generate C file which contains vboxweb.wsdl
855$$(VBOXWEB_OUT_DIR)/vboxweb-wsdl.c: $(VBOXWEB_WSDL) $(VBOX_BIN2C)
856 $(call MSG_TOOL,bin2c,vboxweb-wsdl,$<,$@)
857 $(QUIET)$(VBOX_BIN2C) -ascii VBoxWebWSDL $< $@
858
859
860ifdef VBOX_ONLY_SDK
861
862$(VBOXWEB_JAXWSSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/clienttest.java
863 $(QUIET)$(RM) -f -- $@
864 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_JAXWS_DIR)
865 $(QUIET)$(SED) -e 's/{VBOX_API_SUFFIX}/$(VBOX_API_SUFFIX)/' < $< > $@
866
867$(VBOXWEB_METRICSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/metrictest.java
868 $(QUIET)$(RM) -f -- $@
869 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_JAXWS_DIR)
870 $(QUIET)$(SED) -e 's/{VBOX_API_SUFFIX}/$(VBOX_API_SUFFIX)/' < $< > $@
871
872endif # VBOX_ONLY_SDK
873
874include $(FILE_KBUILD_SUB_FOOTER)
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