VirtualBox

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

Last change on this file since 94370 was 93115, checked in by vboxsync, 3 years ago

scm --update-copyright-year

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