VirtualBox

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

Last change on this file since 69111 was 69111, checked in by vboxsync, 7 years ago

(C) year

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