VirtualBox

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

Last change on this file was 108715, checked in by vboxsync, 5 weeks ago

Main/webservice/Makefile.kmk: Temporary fix to get webservices building on win.arm64 hosts again, bugref:10391 [regression from r168108]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 42.7 KB
Line 
1# $Id: Makefile.kmk 108715 2025-03-24 12:06:59Z 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-2024 Oracle and/or its affiliates.
10#
11# This file is part of VirtualBox base platform packages, as
12# available from https://www.virtualbox.org.
13#
14# This program is free software; you can redistribute it and/or
15# modify it under the terms of the GNU General Public License
16# as published by the Free Software Foundation, in version 3 of the
17# License.
18#
19# This program is distributed in the hope that it will be useful, but
20# WITHOUT ANY WARRANTY; without even the implied warranty of
21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22# General Public License for more details.
23#
24# You should have received a copy of the GNU General Public License
25# along with this program; if not, see <https://www.gnu.org/licenses>.
26#
27# SPDX-License-Identifier: GPL-3.0-only
28#
29
30# Define VBOX_GSOAP_INSTALLED to something if you have gSOAP's
31# "wsdl2h" and "soapcpp2" executables on your PATH somewhere.
32
33#
34# Here's an overview how all this works. It's complicated. Essentially,
35# lots of files get generated automatically from our XML XIDL file that
36# describes the VirtualBox API (../idl/VirtualBox.xidl); as a result,
37# no manual coding is necessary when the API changes. All generated
38# web service code gets adjusted automatically.
39#
40# In more detail:
41#
42# 1) We use xsltproc and websrv-wsdl.xsl to generate a WSDL file from
43# our XML IDL file. WSDL (Web Service Description language) is an XML
44# industry standard that publicly describes a web service.
45# So, the WSDL generated here describes the VirtualBox web
46# service to third-party clients; for example, one can feed it to
47# Java or Perl or some other toolkit that understands WSDL and thus
48# easily write a short script that connects to the web service properly.
49# This WSDL file ends up in $(VBOXWEB_OUT_DIR)/vboxweb.wsdl.
50#
51# 2) We use xsltproc and websrv-wsdl2gsoapH.xsl to generate a so-called
52# "gSoap header file": $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h from
53# the WSDL previously generated.
54# This file looks like a C header file, but really isn't meant
55# to be included by a C compiler. Instead, it just happens to be the
56# format that gSOAP uses to specify SOAP interfaces instead of WSDL.
57# (The reason for this appears to be that gSOAP predates WSDL and
58# thus needed some format to describe the syntax of a web service.)
59#
60# Note that gSOAP now also comes with its own WSDL-to-gsoap.h converter,
61# but the readme mentions some funny license restrictions, so instead we
62# have our own converter in XSLT.
63#
64# 3) We then feed that pseudo-header file to gSOAP's soapcpp2 compiler,
65# which generates a ton of files in $(VBOXWEB_OUT_DIR), most importantly:
66#
67# SOAP_CLIENT_H = $(VBOXWEB_OUT_DIR)/soapStub.h (header file for webservice clients)
68# SOAP_SERVER_H = $(VBOXWEB_OUT_DIR)/soapH.h (header file for webservice servers)
69#
70# These are "real" header files that one can use to program a) a webservice client
71# and b) a webservice server. Of course to build b) one will have to write method
72# implementations with useful code that does something. This is where more
73# code generation via XSLT comes in:
74#
75# 4) We use xsltproc to generate tons of C++ code directly from the XIDL that
76# maps each SOAP method to our COM methods. This large C++ file is
77# $(VBOXWEB_OUT_DIR)/methodmaps.cpp. The actual webservice executable (vboxwebsrv,
78# which acts as an HTTP server) is composed of this file, plus hard-coded
79# method implementations in vboxweb.cpp, plus gSOAP library code for the HTTP
80# server.
81#
82
83SUB_DEPTH = ../../../..
84include $(KBUILD_PATH)/subheader.kmk
85
86#
87# Find the gSOAP toolkit.
88#
89# Note! We're not using the gSOAP toolkit correctly. The main issue is that
90# compiling soapcpp2.cpp instead of using the library. So, in order
91# to make this work with a locally installed gSOAP toolkit there are
92# some hoops to jump thru to say the least... Shipping soapcpp2.cpp/h
93# is out of the question without also including the two soap tools.
94#
95# Some observations on distros for OSE / configure:
96# The proposed gentoo ebuild screws up several things in the install phase
97# and thus fails to ship stdsoap2.cpp and relatives.
98#
99# debian (2.7.9l-0.2) stuffs stdsoap2.cpp and a handful of the import files
100# into /usr/include/gsoap.
101#
102# fedora (2.7.12-fc10.x86_64) uses the default install layout and does not
103# ship stdsoap2.cpp and friends.
104#
105ifeq ($(VBOX_GSOAP_INSTALLED),)
106 VBOX_GSOAP_INSTALLED = 1
107 VBOX_PATH_GSOAP := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/common/gsoap/*)))
108 ifeq ($(VBOX_PATH_GSOAP),)
109 VBOX_PATH_GSOAP := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/gsoap/*)))
110 endif
111 if "$(VBOX_PATH_GSOAP)" == "" && defined(KBUILD_DEVTOOLS_HST)
112 VBOX_PATH_GSOAP := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/gsoap/*)))
113 endif
114 ifeq ($(VBOX_PATH_GSOAP),)
115 $(warning VBOX_PATH_GSOAP not found...)
116 VBOX_GSOAP_INSTALLED =
117 endif
118else
119 VBOX_PATH_GSOAP := $(VBOX_PATH_GSOAP)
120endif
121VBOX_PATH_GSOAP_BIN := $(strip $(VBOX_PATH_GSOAP_BIN))
122if "$(VBOX_PATH_GSOAP_BIN)" == ""
123 if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "win.arm64"
124 # Reuse amd64 binaries
125 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin/win.amd64
126 else
127 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin/$(KBUILD_HOST).$(KBUILD_HOST_ARCH)
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"
140 VBOX_WSDL2PY = $(firstword $(which wsdl2py) wsdl2py_not_found)
141else
142 VBOX_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# GCC 9.2 doesn't cope ver well with the split soapC.cpp files (internal error).
209# Seemingly, the issue goes away when we strip inline functions from soapH.h.
210ifdef VBOX_WITHOUT_NOINLINE_SOAPH
211 if !defined(VBOX_WITHOUT_SPLIT_SOAPC) && !defined(VBOX_WITH_SPLIT_SOAPC) && $(VBOX_GCC_VERSION_CXX) >= 90200
212 $(info Triggering VBOX_WITHOUT_SPLIT_SOAPC because of VBOX_GCC_VERSION_CXX=$(VBOX_GCC_VERSION_CXX) and VBOX_WITHOUT_NOINLINE_SOAPH)
213 VBOX_WITHOUT_SPLIT_SOAPC := 1
214 endif
215endif
216
217#
218# Template that disables -fvisibility=hidden as the SOAP stuff does not
219# properly set the visibility attributes (or at least it didn't).
220#
221TEMPLATE_VBoxWebR3Exe = Webservices without -fvisibility=hidden
222TEMPLATE_VBoxWebR3Exe_EXTENDS = VBoxR3Exe
223TEMPLATE_VBoxWebR3Exe_DEFS.win += WIN32_LEAN_AND_MEAN $(TEMPLATE_VBoxR3Exe_DEFS.win) # Makes the redefinition warnings go away.
224ifn1of ($(KBUILD_TARGET), win)
225 TEMPLATE_VBoxWebR3Exe_CXXFLAGS = $(filter-out $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden), \
226 $(TEMPLATE_VBoxR3Exe_CXXFLAGS))
227 TEMPLATE_VBoxWebR3Exe_CXXFLAGS += $(VBOX_GCC_Wno-misleading-indentation)
228else if1of ($(KBUILD_TARGET_ARCH), arm64) # RTCsu blows up on arm64 with fatal error C1053: function too big (soapC-4.cpp).
229 TEMPLATE_VBoxWebR3Exe_PCHFLAGS.debug = $(filter-out -RTC%,$(TEMPLATE_VBoxR3Exe_PCHFLAGS.debug))
230 TEMPLATE_VBoxWebR3Exe_CXXFLAGS.debug = $(filter-out -RTC%,$(TEMPLATE_VBoxR3Exe_CXXFLAGS.debug))
231endif
232if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140"
233 # -wd4774: string(532): warning C4774: 'sprintf_s' : format string expected in argument 3 is not a string literal
234 # -wd4458: stdsoap2.h(2644): warning C4458: declaration of 'type' hides class member
235 # -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.
236 # soapc-1.cpp(182) : warning C4883: 'soap_getelement': function size suppresses optimizations
237 TEMPLATE_VBoxWebR3Exe_CXXFLAGS.win = $(TEMPLATE_VBoxR3Exe_CXXFLAGS.win) -wd4774 -wd4458 -wd4883 -wd5039
238endif
239if "$(VBOX_VCC_TOOL_STEM)" >= "VCC143"
240 # -wd5267: soapStub.h(8118): warning C5267: definition of implicit assignment operator for 'vbox__IPCIDeviceAttachment' is deprecated because it has a user-provided destructor
241 TEMPLATE_VBoxWebR3Exe_CXXFLAGS.win += -wd5267
242endif
243
244ifdef VBOX_GSOAP_INSTALLED
245 ifndef VBOX_ONLY_SDK
246 #
247 # soapC and soapH-noinline file splitter.
248 #
249 BLDPROGS += split-soapC
250 split-soapC_TEMPLATE = VBoxBldProg
251 split-soapC_SOURCES = split-soapC.cpp
252
253 #
254 # vboxsoap - Library used by both the programs (save build time).
255 #
256 LIBRARIES += vboxsoap
257 vboxsoap_TEMPLATE = VBoxWebR3Exe
258 ifndef VBOX_WITHOUT_PRECOMPILED_HEADERS
259 ifeq ($(KBUILD_TARGET),win)
260 vboxsoap_USES = vccprecomp
261 vboxsoap_PCH_HDR := $(VBOXWEB_SOAP_SERVER_H)
262 vboxsoap_CXXFLAGS += -Zm127
263 endif
264 endif
265 vboxsoap_CXXFLAGS += $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS)
266 vboxsoap_CXXFLAGS.win += -bigobj
267 vboxsoap_CXXFLAGS.win += -wd4702 # soapc-4.cpp(16) : warning C4702: unreachable code
268 ifn1of ($(KBUILD_TARGET), win)
269 vboxsoap_CXXFLAGS += -Wno-shadow -Wno-parentheses $(VBOX_GCC_Wno-literal-suffix) \
270 $(VBOX_GCC_Wno-stringop-overflow) $(VBOX_GCC_Wno-stringop-truncation) \
271 $(VBOX_GCC_Wno-vla) -Wno-format -Wno-deprecated-declarations $(VBOX_GCC_fno-printf-return-value)
272 ifn1of ($(KBUILD_TYPE), debug) # Save time+memory by using -O0 instead of -O2.
273 vboxsoap_CXXFLAGS += -O0 ## @todo this could be interesting for g++ (not clang++): -fcprop-registers
274 endif
275 endif
276 vboxsoap_INCS := \
277 $(VBOX_GSOAP_INCS) \
278 $(VBOXWEB_OUT_DIR) \
279 $(PATH_SUB_CURRENT)
280 ifdef VBOX_WITH_WEBSERVICES_SSL
281 vboxsoap_DEFS += WITH_OPENSSL
282 vboxsoap_SDKS += VBoxOpenSsl
283 endif
284 ifdef VBOX_WITHOUT_SPLIT_SOAPC
285 vboxsoap_SOURCES = \
286 $(VBOXWEB_OUT_DIR)/soapC.cpp
287 else
288 vboxsoap_SOURCES = \
289 $(VBOXWEB_OUT_DIR)/soapC-1.cpp \
290 $(VBOXWEB_OUT_DIR)/soapC-2.cpp \
291 $(VBOXWEB_OUT_DIR)/soapC-3.cpp \
292 $(VBOXWEB_OUT_DIR)/soapC-4.cpp \
293 $(VBOXWEB_OUT_DIR)/soapC-5.cpp \
294 $(VBOXWEB_OUT_DIR)/soapC-6.cpp \
295 $(VBOXWEB_OUT_DIR)/soapC-7.cpp \
296 $(VBOXWEB_OUT_DIR)/soapC-8.cpp \
297 $(VBOXWEB_OUT_DIR)/soapC-9.cpp \
298 $(VBOXWEB_OUT_DIR)/soapC-10.cpp \
299 $(VBOXWEB_OUT_DIR)/soapC-11.cpp \
300 $(VBOXWEB_OUT_DIR)/soapC-12.cpp \
301 $(VBOXWEB_OUT_DIR)/soapC-13.cpp \
302 $(VBOXWEB_OUT_DIR)/soapC-14.cpp \
303 $(VBOXWEB_OUT_DIR)/soapC-15.cpp \
304 $(VBOXWEB_OUT_DIR)/soapC-16.cpp \
305 $(VBOXWEB_OUT_DIR)/soapC-17.cpp \
306 $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
307 $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
308 $(VBOXWEB_OUT_DIR)/soapC-20.cpp \
309 $(VBOXWEB_OUT_DIR)/soapC-21.cpp \
310 $(VBOXWEB_OUT_DIR)/soapC-22.cpp \
311 $(VBOXWEB_OUT_DIR)/soapC-23.cpp \
312 $(VBOXWEB_OUT_DIR)/soapC-24.cpp \
313 $(VBOXWEB_OUT_DIR)/soapC-25.cpp \
314 $(VBOXWEB_OUT_DIR)/soapC-26.cpp \
315 $(VBOXWEB_OUT_DIR)/soapC-27.cpp \
316 $(VBOXWEB_OUT_DIR)/soapC-28.cpp \
317 $(VBOXWEB_OUT_DIR)/soapC-29.cpp
318 endif
319 ifndef VBOX_WITHOUT_NOINLINE_SOAPH
320 vboxsoap_SOURCES += \
321 $(VBOXWEB_OUT_DIR)/soapH-noinline-1.cpp \
322 $(VBOXWEB_OUT_DIR)/soapH-noinline-2.cpp \
323 $(VBOXWEB_OUT_DIR)/soapH-noinline-3.cpp \
324 $(VBOXWEB_OUT_DIR)/soapH-noinline-4.cpp \
325 $(VBOXWEB_OUT_DIR)/soapH-noinline-5.cpp \
326 $(VBOXWEB_OUT_DIR)/soapH-noinline-6.cpp \
327 $(VBOXWEB_OUT_DIR)/soapH-noinline-7.cpp \
328 $(VBOXWEB_OUT_DIR)/soapH-noinline-8.cpp \
329 $(VBOXWEB_OUT_DIR)/soapH-noinline-9.cpp \
330 $(VBOXWEB_OUT_DIR)/soapH-noinline-10.cpp \
331 $(VBOXWEB_OUT_DIR)/soapH-noinline-11.cpp \
332 $(VBOXWEB_OUT_DIR)/soapH-noinline-12.cpp
333 endif
334 vboxsoap_CLEAN := $(vboxsoap_SOURCES) # lazy bird
335 vboxsoap_SOURCES <= \
336 $(VBOX_GSOAP_CXX_SOURCES)
337 vboxsoap_ORDERDEPS = \
338 $(VBOXWEB_IDL_SRC) \
339 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
340 ifn1of ($(KBUILD_TARGET), win)
341 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS = \
342 -Wno-format \
343 $(VBOX_GCC_Wno-int-in-bool-context) \
344 $(VBOX_GCC_Wno-logical-op)
345 # currently necessary when compiling against OpenSSL 1.0 due to a missing
346 # typecase from 'const v3_ext_method*' to 'aka v3_ext_method*'.
347 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS += -fpermissive
348 # Necessary with gcc 9.2.1 for some reason:
349 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS += -Wno-deprecated-declarations
350 endif
351
352 if "$(KBUILD_TARGET)" == "win" && "$(VBOX_GSOAP_CXX_SOURCES)" != ""
353 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4668 # preprocessor / windows.h
354 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4211 # nonstandard extension used: redefined extern to static
355 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4310 # cast truncates constant value
356 if1of ($(VBOX_VCC_TOOL_STEM), VCC120)
357 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4056 # v2.8.36/stdsoap2.cpp(14008) : warning C4056: overflow in floating-point constant arithmetic
358 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4756 # v2.8.36/stdsoap2.cpp(14008) : warning C4756: overflow in constant arithmetic
359 endif
360 if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140"
361 $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS.win += -wd4456 # stdsoap2.cpp(3127): warning C4456: declaration of 'i' hides previous local declaration
362 endif
363 endif
364
365 ifdef VBOX_SOAP_PRECOMPILED_HEADER
366 # This'll save a few seconds, but the compiler invocation currently makes it impracticable. This will
367 # be addressed in a future kBuild version, by adding PCH support or/and by adding some helpers to
368 # gather the required data (DEFS,INCS,CXXTOOL,CXXFLAGS).
369 vboxsoap_INTERMEDIATES += $(VBOXWEB_OUT_DIR)/soapH.h.gch
370 vboxsoap_CXXFLAGS += -Winvalid-pch -H
371 vboxsoap_CLEAN += $(VBOXWEB_OUT_DIR)/soapH.h.gch
372
373 $(VBOXWEB_OUT_DIR)/soapH.h.gch: $(VBOXWEB_OUT_DIR)/soapH.h
374 g++ -x c++-header -g -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -Wno-variadic-macros -pipe -O0 -fno-omit-frame-pointer \
375 -fno-strict-aliasing -fvisibility-inlines-hidden -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN \
376 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -m32 \
377 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/src/VBox/Main/webservice/gsoap \
378 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/out/darwin.x86/debug/obj/src/VBox/Main \
379 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/src/VBox/Main/webservice \
380 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/include -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/out/darwin.x86/debug
381 \-DVBOX -DVBOX_WITH_DEBUGGER -DVBOX_WITH_DEBUGGER_GUI -DDEBUG -DDEBUG_bird -DDEBUG_USERNAME=bird -DRT_OS_DARWIN \
382 -D__DARWIN__ -DRT_ARCH_X86 -D__X86__ -DVBOX_WITH_HYBRID_32BIT_KERNEL -DIN_RING3 -DHC_ARCH_BITS=32 -DGC_ARCH_BITS=32 \
383 -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -DMAC_OS_X_VERSION_MAX_ALLOWED=1040 \
384 $< -o $@
385 endif
386
387 # Tweak for systems with too many CPUs compared to memory.
388 ifdef VBOX_WITH_SOAP_NOT_PARALLEL
389 .NOTPARALLEL: $$(vboxsoap_2_OBJS)
390 endif
391 endif # !VBOX_ONLY_SDK
392
393
394 ifndef VBOX_ONLY_SDK
395 #
396 # vboxwebsrv - webservice server process
397 #
398 PROGRAMS += vboxwebsrv
399 vboxwebsrv_TEMPLATE = VBoxMainClientExe
400 vboxwebsrv_DEFS += SOCKET_CLOSE_ON_EXEC
401 vboxwebsrv_DEFS.win += WIN32_LEAN_AND_MEAN
402 vboxwebsrv_INCS = \
403 $(VBOX_GSOAP_INCS) \
404 $(VBOXWEB_OUT_DIR) \
405 .
406 vboxwebsrv_CXXFLAGS.win += -bigobj
407 if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140"
408 vboxwebsrv_CXXFLAGS.win += -wd4774 # string(532): warning C4774: 'sprintf_s' : format string expected in argument 3 is not a string literal
409 vboxwebsrv_CXXFLAGS.win += -wd4458 # stdsoap2.h(2644): warning C4458: declaration of 'type' hides class member
410 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.
411 endif
412 ifn1of ($(KBUILD_TARGET), win)
413 vboxwebsrv_CXXFLAGS += -Wno-shadow $(VBOX_GCC_Wno-literal-suffix) $(VBOX_GCC_Wno-misleading-indentation)
414 ifn1of ($(KBUILD_TYPE), debug) # Save time+memory by using -O1 instead of -O2.
415 vboxwebsrv_CXXFLAGS += -O0
416 endif
417 endif
418 vboxwebsrv_LIBS += \
419 $(PATH_STAGE_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
420 $(VBOX_GSOAP_CXX_LIBS) \
421 $(LIB_RUNTIME)
422 vboxwebsrv_LIBS.solaris += socket nsl
423 ifdef VBOX_WITH_WEBSERVICES_SSL
424 vboxwebsrv_DEFS += WITH_OPENSSL
425 vboxwebsrv_SDKS += VBoxOpenSsl
426 endif
427 vboxwebsrv_SOURCES = \
428 vboxweb.cpp \
429 $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
430 $(VBOXWEB_OUT_DIR)/soapServer.cpp \
431 $(VBOXWEB_OUT_DIR)/vboxweb-wsdl.c
432 vboxwebsrv_SOURCES.win = \
433 VBoxWebSrv.rc
434 vboxwebsrv_CLEAN = \
435 $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
436 $(VBOXWEB_OUT_DIR)/soapServer.cpp \
437 $(VBOXWEB_OUT_DIR)/vboxweb-wsdl.c
438 vboxwebsrv_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
439 endif # !VBOX_ONLY_SDK
440
441 ifdef VBOX_WITH_JWS
442 INSTALLS += VBoxJWs-inst-jar
443
444 #
445 # Java glue JAR files
446 #
447 VBOX_JWS_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws.jar
448 VBOX_JWSDOC_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws-doc.jar
449 VBOX_JWSSRC_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws-src.jar
450 VBOX_JWS_TARGET := $(PATH_TARGET)/vboxjws-gen
451 VBOX_JWS_GEN = $(VBOX_JWS_TARGET)/jwsgen
452 VBOX_JWS_GEN_RAWSRC = $(VBOX_JWS_GEN)/merged.file
453 VBOX_JWS_JDEST := $(VBOX_JWS_TARGET)/jdest
454 VBOX_JWSDOC_JDEST := $(VBOX_JWS_TARGET)/jdest-doc
455 VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
456 VBOX_JAXLIB_DIR := $(PATH_ROOT)/src/VBox/Main/webservice/jaxlibs
457
458 VBoxJWs-inst-jar_INST = $(INST_SDK)bindings/webservice/java/jax-ws/
459 VBoxJWs-inst-jar_MODE = a+r,u+w
460 VBoxJWs-inst-jar_SOURCES = \
461 $(VBOX_JWS_JAR) \
462 $(VBOX_JWSDOC_JAR) \
463 $(VBOX_JWSSRC_JAR)
464 VBoxJWs-inst-jar_CLEAN = \
465 $(VBOX_JWS_JAR) \
466 $(VBOX_JWSDOC_JAR) \
467 $(VBOX_JWSSRC_JAR) \
468 $(VBOX_JWS_GEN)/jwsglue.list \
469 $(VBOX_JWSDOC_JDEST)/package-list \
470 $(wildcard \
471 $(VBOX_JWS_GEN)/java/*/*/*.java \
472 $(VBOX_JWS_GEN)/java/*/*/*/*.java \
473 $(VBOX_JWS_JDEST)/*.class \
474 $(VBOX_JWS_JDEST)/*/*.class \
475 $(VBOX_JWS_JDEST)/*/*/*.class \
476 $(VBOX_JWS_JDEST)/*/*/*/*.class \
477 $(VBOX_JWSDOC_JDEST)/*.html \
478 $(VBOX_JWSDOC_JDEST)/*.css \
479 $(VBOX_JWSDOC_JDEST)/*/*.gif \
480 $(VBOX_JWSDOC_JDEST)/*/*/*.html \
481 $(VBOX_JWSDOC_JDEST)/*/*/*/*.html \
482 )
483 VBoxJWs-inst-jar_BLDDIRS += $(VBOX_JWS_GEN)/java
484 VBoxJWs-inst-jar_GENERATEDSOURCES = $(addprefix $(VBoxJWs-inst-jar_BLDDIRS)/,$(VBoxJWS_VBOX_JWSGLUEFILES))
485
486 VBoxJWSGlue_KMK = $(PATH_OUT)/vboxjwsglue.kmk
487 include $(VBoxJWSGlue_KMK)
488
489 $(VBoxJWSGlue_KMK).ts +| $(VBoxJWSGlue_KMK): $(VBOXWEB_IDL_SRC_ORIG) $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $(VBOX_VERSION_STAMP)
490 $(call MSG_GENERATE,,$(VBoxJWSGlue_KMK))
491 $(QUIET)$(RM) -f $@
492 $(QUIET)$(MKDIR) -p $(@D)
493 $(QUIET)$(VBOX_XSLTPROC) \
494 --stringparam filelistonly VBoxJWS_VBOX_JWSGLUEFILES \
495 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
496 --stringparam G_vboxGlueStyle jaxws \
497 --stringparam G_vboxDirPrefix org/virtualbox$(VBOX_API_SUFFIX)/ \
498 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
499 -o $@ $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
500 $(QUIET)$(CP) --changed -fv $@ $(VBoxJWSGlue_KMK)
501
502 $(VBOX_JWS_GEN_RAWSRC) \
503 +| $(VBoxJWs-inst-jar_GENERATEDSOURCES): \
504 $(VBOXWEB_IDL_SRC_ORIG) \
505 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
506 $(VBOX_FILESPLIT) \
507 $(VBOX_VERSION_STAMP)
508 $(call MSG_L1,Generating JAX-WS Java glue files from XIDL)
509 $(QUIET)$(RM) -f $(filter-out $(VBoxJWs-inst-jar_GENERATEDSOURCES),$(wildcard $(VBOX_JWS_GEN)/java/*/*/*.java))
510 $(QUIET)$(MKDIR) -p $(@D)
511 $(QUIET)$(VBOX_XSLTPROC) \
512 --stringparam filelistonly "" \
513 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
514 --stringparam G_vboxGlueStyle jaxws \
515 --stringparam G_vboxDirPrefix org/virtualbox$(VBOX_API_SUFFIX)/ \
516 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
517 -o $(VBOX_JWS_GEN_RAWSRC) $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
518 $(QUIET)$(MKDIR) -p $(VBOX_JWS_GEN)/java/org/virtualbox$(VBOX_API_SUFFIX)
519 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JWS_GEN_RAWSRC) $(VBOX_JWS_GEN)/java
520
521 ## @todo somehow also find out the authoritative list of files generated by
522 # wsimport (before running it), then we could rely on proper dependencies
523 # instead of creating jwsglue.list. Would allow avoiding a lot of unnecessary
524 # compilation with incremental builds, when almost nothing changed in the IDL
525 # file. Currently everything is recompiled if only one file is changed.
526 $(VBOX_JWS_GEN)/jwsglue.list.ts +| $(VBOX_JWS_GEN)/jwsglue.list: \
527 $(VBOXWEB_IDL_SRC) \
528 $(VBOX_FILESPLIT) \
529 $(VBOXWEBSERVICE_WSDL) \
530 $(VBOXWEB_WSDL) \
531 $(VBoxJWs-inst-jar_GENERATEDSOURCES) \
532 | $(VBOX_JWS_GEN)/java/
533 $(QUIET)$(RM) -f -- $(wildcard $(VBOX_JWS_GEN)/java/*/*/*/*.java)
534 $(call MSG_GENERATE,,$(VBOX_JWS_GEN)/jwsglue.list,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL))
535 $(VBOX_WSIMPORT) -Xnocompile -p $(VBOX_JAVA_PACKAGE).jaxws -d $(VBOX_JWS_GEN)/java $(VBOXWEBSERVICE_WSDL)
536 $(QUIET)echo $(VBoxJWs-inst-jar_GENERATEDSOURCES) > $@
537 $(QUIET)echo $(VBOX_JWS_GEN)/java/*/*/*/*.java >> $@
538 $(QUIET)$(CP) --changed -fv $@ $(VBOX_JWS_GEN)/jwsglue.list
539
540 $$(VBOX_JWS_JAR): $(VBOX_JWS_GEN)/jwsglue.list $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOX_JWS_GEN)/MANIFEST.MF | $$(dir $$@)
541 $(call MSG_TOOL,javac,$(notdir $@),jwsgen.list,)
542 $(QUIET)$(RM) -Rf $(VBOX_JWS_JDEST)
543 $(QUIET)$(MKDIR) -p $(VBOX_JWS_JDEST)
544 $(call MSG_L1,Compiling bridge code)
545 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) $(VBOX_JAVA_WS_OPTS) \
546 @$(VBOX_JWS_GEN)/jwsglue.list \
547 -d $(VBOX_JWS_JDEST) -classpath $(VBOX_JWS_JDEST)$(VBOX_SEP)$(VBOX_JAVA_WS_EXTRA_JARS)
548 $(QUIET)$(SED) -e "s/vboxweb.wsdl/vboxweb$(VBOX_API_SUFFIX).wsdl/" < $(VBOXWEBSERVICE_WSDL) > $(VBOX_JWS_JDEST)/vboxwebService$(VBOX_API_SUFFIX).wsdl
549 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOX_JWS_JDEST)/vboxweb$(VBOX_API_SUFFIX).wsdl
550 $(call MSG_LINK,$(notdir $@),$@)
551 $(VBOX_JAR) cfm $@ $(VBOX_JWS_GEN)/MANIFEST.MF -C $(VBOX_JWS_JDEST) .
552
553 $(VBOX_JWS_GEN)/MANIFEST.MF: $(VBOX_PATH_WEBSERVICE)/MANIFEST.MF.in
554 $(QUIET)$(RM) -f -- $@
555 $(QUIET)$(MKDIR) -p $(VBOX_JWS_GEN)
556 $(QUIET)$(SED) \
557 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/' \
558 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/' \
559 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/' \
560 -e 's/@VBOX_API_SUFFIX@/$(VBOX_API_SUFFIX)/' \
561 < $< > $@
562
563 $$(VBOX_JWSDOC_JAR): $(VBOX_JWS_GEN)/jwsglue.list $$(VBoxJWs-inst-jar_GENERATEDSOURCES) $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $$(VBOX_JWS_JAR) | $$(dir $$@)
564 $(call MSG_TOOL,javadoc,$(notdir $@),jwsgen.list,)
565 $(QUIET)$(RM) -Rf $(VBOX_JWSDOC_JDEST)
566 $(QUIET)$(MKDIR) -p $(VBOX_JWSDOC_JDEST)
567 $(call MSG_L1,Generating javadoc html documentation)
568 $(VBOX_JAVADOC) $(VBOX_JAVADOC_OPTS) $(VBOX_JAVA_WS_OPTS) -quiet \
569 -sourcepath $(VBOX_JWS_GEN)/java org.virtualbox$(VBOX_API_SUFFIX) \
570 -d $(VBOX_JWSDOC_JDEST) -classpath $(VBOX_SEP)$(VBOX_JAVA_WS_EXTRA_JARS)
571 $(call MSG_LINK,$(notdir $@),$@)
572 $(VBOX_JAR) cf $@ -C $(VBOX_JWSDOC_JDEST) .
573
574 $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | $$(dir $$@)
575 $(call MSG_LINK,$(notdir $@),$@)
576 $(VBOX_JAR) cf $@ -C $(VBOX_JWS_GEN)/java .
577
578 ## @todo compile ../glue/tests/TestVBox.java to have sanity checking
579
580 endif # VBOX_WITH_JWS
581
582 ifndef VBOX_ONLY_SDK
583 #
584 # webtest - webservice sample client in C++
585 #
586 PROGRAMS += webtest
587 webtest_TEMPLATE = VBoxWebR3Exe
588 webtest_CXXFLAGS.win += -bigobj
589 ifn1of ($(KBUILD_TARGET), win)
590 webtest_CXXFLAGS += -Wno-shadow
591 endif
592 webtest_INCS := \
593 $(VBOX_GSOAP_INCS) \
594 $(VBOXWEB_OUT_DIR) \
595 .
596 webtest_LIBS += \
597 $(PATH_STAGE_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
598 $(VBOX_GSOAP_CXX_LIBS) \
599 $(LIB_RUNTIME)
600 webtest_LIBS.solaris += nsl
601 ifdef VBOX_WITH_WEBSERVICES_SSL
602 webtest_DEFS += WITH_OPENSSL
603 webtest_SDKS += VBoxOpenSsl
604 endif
605 webtest_SOURCES = \
606 webtest.cpp \
607 $(VBOXWEB_OUT_DIR)/soapClient.cpp
608 webtest_CLEAN = \
609 $(VBOXWEB_OUT_DIR)/soapClient.cpp
610
611 webtest_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
612 endif # !VBOX_ONLY_SDK
613
614
615 #
616 # Additional mess to cleanup (applies to both webtest and vboxwebsrv).
617 #
618 ## @todo figure out whether the SDK really needs this or not...
619 OTHER_CLEAN += \
620 $(wildcard $(VBOXWEB_OUT_DIR)/soap*.h) \
621 $(wildcard $(VBOXWEB_OUT_DIR)/soap*.cpp) \
622 $(wildcard $(VBOXWEB_OUT_DIR)/*.nsmap) \
623 $(VBOXWEB_GSOAPH_FROM_XSLT) \
624 $(VBOXWEB_GSOAPH_FROM_GSOAP) \
625 $(VBOXWEB_SOAP_CLIENT_H) \
626 $(VBOXWEB_SOAP_SERVER_H) \
627 $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
628 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \
629 $(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \
630 $(PATH_TARGET_SOAPDEMOXML)/dummy_file \
631 $(wildcard $(PATH_TARGET_SOAPDEMOHEADERS)/*) \
632 $(PATH_TARGET_SOAPDEMOHEADERS)/dummy_file \
633 $(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \
634 $(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file
635
636endif # VBOX_GSOAP_INSTALLED
637
638
639if defined(VBOX_ONLY_SDK) && ("$(KBUILD_TARGET)" != "win" || defined(VBOX_FORCE_SDK))
640 #
641 # Globals relevant to the SDK.
642 #
643 VBOXWEB_GLUE_PYTHON = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_wrappers.py
644 # The following 3 files are generated by Python ZSI 2.1_a1 (alpha version
645 # shipped by many Linux distributions). Only the first two are actually used.
646 # The 4th and 5th file is created by ZSI 2.0 (released in 2007), and gets
647 # renamed to the 1st/2nd file for simplicity reasons.
648 # ZSI 1.x used different file names. Not worth supporting any more. If you're
649 # curious, check the VirtualBox 4.3 sources.
650 VBOXWEB_WS_PYTHON = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_client.py
651 VBOXWEB_WS_PYTHON_TYPES = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_types.py
652 VBOXWEB_WS_PYTHON_SERVER = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_server.py
653 VBOXWEB_WS_PYTHON_ALTERNATIVE = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_services.py
654 VBOXWEB_WS_PERL = $(VBOX_PATH_SDK)/bindings/webservice/perl/lib/vboxService.pm
655 VBOXWEB_WS_PHP = $(VBOX_PATH_SDK)/bindings/webservice/php/lib/vboxServiceWrappers.php
656 VBOXWEB_SAMPLES_JAXWS_DIR = $(VBOX_PATH_SDK)/bindings/webservice/java/jax-ws/samples
657 VBOXWEB_JAXWSSAMPLE = $(VBOXWEB_SAMPLES_JAXWS_DIR)/clienttest.java
658 VBOXWEB_METRICSAMPLE = $(VBOXWEB_SAMPLES_JAXWS_DIR)/metrictest.java
659
660 VBOXWEB_OTHERS += \
661 $(if $(VBOX_WITH_PYTHON),$(VBOXWEB_GLUE_PYTHON),) \
662 $(if $(VBOX_WITH_PYTHON),$(VBOXWEB_WS_PYTHON),) \
663 $(if $(VBOX_WITH_PYTHON),$(VBOXWEB_WS_PYTHON_TYPES),) \
664 $(if $(VBOX_WITH_PERL),$(VBOXWEB_WS_PERL),) \
665 $(if $(VBOX_WITH_PHP),$(VBOXWEB_WS_PHP),)
666
667
668 #
669 # Install sample code.
670 #
671 INSTALLS += vboxwebinst
672 vboxwebinst_INST = $(INST_SDK)bindings/webservice/
673 vboxwebinst_MODE = a+rx,u+w
674 vboxwebinst_SOURCES = \
675 $(if $(VBOX_WITH_PERL),samples/perl/clienttest.pl=>perl/samples/clienttest.pl,) \
676 $(if $(VBOX_WITH_PHP),samples/php/clienttest.php=>php/samples/clienttest.php,) \
677 $(if $(VBOX_WITH_PYTHON),samples/python/clienttest.py=>python/samples/clienttest.py,)
678
679 INSTALLS += vboxwebinst_nox
680 vboxwebinst_nox_INST = $(INST_SDK)bindings/webservice/
681 vboxwebinst_nox_MODE = a+r,u+w
682 vboxwebinst_nox_SOURCES = \
683 $(if $(VBOX_WITH_PYTHON),samples/python/Makefile=>python/samples/Makefile,) \
684 $(if $(VBOX_WITH_PYTHON),samples/python/Makefile.glue=>python/lib/Makefile,) \
685 $(if ($VBOX_WITH_JWS),$(PATH_ROOT)/COPYING.LIB=>java/jax-ws/COPYING.LIB,)
686
687 INSTALLS += vboxwebinst_wsdl
688 vboxwebinst_wsdl_INST = $(INST_SDK)bindings/webservice/
689 vboxwebinst_wsdl_MODE = a+r,u+w
690 vboxwebinst_wsdl_SOURCES = \
691 $(VBOXWEB_WSDL)=>vboxweb.wsdl \
692 $(VBOXWEBSERVICE_WSDL)=>vboxwebService.wsdl
693
694 INSTALLS += vboxwebinst_webtest
695 vboxwebinst_webtest_INST = $(INST_SDK)bindings/webservice/
696 vboxwebinst_webtest_MODE = a+r,u+w
697 vboxwebinst_webtest_SOURCES = \
698 $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl=>xsl/websrv-wsdl2gsoapH.xsl \
699 $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl=>xsl/websrv-nsmap.xsl \
700 $(VBOX_PATH_IDL)/typemap-shared.inc.xsl=>idl/typemap-shared.inc.xsl \
701 $(VBOX_PATH_WEBSERVICE)/split-soapC.cpp=>tools/split-soapC.cpp \
702 $(VBOX_PATH_WEBSERVICE)/webtest.cpp=>cpp/samples/webtest/webtest.cpp \
703 $(VBOX_PATH_WEBSERVICE)/Makefile.webtest=>cpp/samples/webtest/Makefile
704
705endif # VBOX_ONLY_SDK
706
707#
708# Update the OTHERS and OTHER_CLEAN lists with VBOXWEB_OTHERS and some more stuff.
709#
710# We can't just built up OTHERS and append it to OTHER_CLEAN because we're sharing
711# OTHERS with all the other VBox makefiles, thus VBOXWEB_OTHERS.
712#
713OTHERS += $(VBOXWEB_OTHERS)
714OTHER_CLEAN += \
715 $(VBOXWEB_OTHERS) \
716 $(if $(VBOX_WITH_PYTHON),$(VBOXWEB_WS_PYTHON_SERVER),) \
717 $(VBOXWEB_WSDL) \
718 $(VBOXWEBSERVICE_WSDL) \
719 $(VBOXWEB_TYPEMAP) \
720 $(VBOXWEB_IDL_SRC)
721
722# generate platform-specific XIDL file from original XIDL file
723$(VBOXWEB_IDL_SRC): $(VBOXWEB_IDL_SRC_STRIPPED) $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl | $$(dir $$@)
724 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using platform-xidl.xsl)
725 $(QUIET)$(RM) -f -- $@
726 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl $<
727
728# generate WSDL from main XIDL file
729$(VBOXWEB_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
730 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl.xsl)
731 $(QUIET)$(RM) -f -- $@
732 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $<
733
734$(VBOXWEBSERVICE_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
735 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl-service.xsl)
736 $(QUIET)$(RM) -f -- $@
737 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $<
738
739ifdef VBOX_ONLY_SDK
740
741 $(VBOXWEB_GLUE_PYTHON): $(VBOXWEB_IDL_SRC) $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-python.xsl
742 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-python.xsl)
743 $(QUIET)$(RM) -f -- $@
744 $(QUIET)$(MKDIR) -p $(@D)
745 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) \
746 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
747 -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-python.xsl $<
748
749 $(VBOXWEB_WS_PYTHON) \
750 + $(VBOXWEB_WS_PYTHON_TYPES): $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
751 $(call MSG_GENERATE,,$@, WS Python bindings)
752 $(QUIET)$(RM) -f -- $@
753 $(QUIET)$(MKDIR) -p $(@D)
754 # Change directory to the "source", as otherwise ZSI 2.0 has trouble finding
755 # the 2nd WSDL file included in the main one. ZSI 2.1 is smarter, but some
756 # versions floating around (especially on Linux) lack the --file option.
757 if "$(KBUILD_HOST)" != "win"
758 $(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)"
759 else
760 $(QUIET)$(REDIRECT) -C $(dir $(VBOXWEBSERVICE_WSDL)) -- $(VBOX_WSDL2PY) -b --file $(subst /,\\\\,$(VBOXWEBSERVICE_WSDL)) --output-dir $(@D)
761 endif
762 # Hack: some wsdl2py versions generate VirtualBox_client.py, some generate
763 # VirtualBox_services.py. Standardize on the former.
764 -$(QUIET)$(MV) -f $(VBOXWEB_WS_PYTHON_ALTERNATIVE) $(VBOXWEB_WS_PYTHON)
765 # We do not ever need the VirtualBox_server.py file. Delete it immediately
766 # so that it will not get packaged in the SDK.
767 $(QUIET)$(RM) -f -- $(VBOXWEB_WS_PYTHON_SERVER)
768 $(QUIET)$(APPEND) $@ ''
769
770 $(VBOXWEB_WS_PERL): $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
771 $(call MSG_GENERATE,,$@, WS Perl bindings)
772 $(QUIET)$(MKDIR) -p $(@D)
773 $(QUIET)$(REDIRECT) -C $(@D) -- $(VBOX_STUBMAKER) file://$(VBOXWEBSERVICE_WSDL)
774 # Ugly, ugly, ugly, make me right once
775 $(QUIET)$(SED) -e "s+http://www.virtualbox.org/Service+http://www.virtualbox.org/+" --output $(VBOXWEB_WS_PERL).tmp $(VBOXWEB_WS_PERL)
776 $(QUIET)$(MV) $(VBOXWEB_WS_PERL).tmp $(VBOXWEB_WS_PERL)
777 $(QUIET)$(APPEND) $@ ''
778
779 $(VBOXWEB_WS_PHP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-php.xsl
780 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-php.xsl)
781 $(QUIET)$(RM) -f -- $@
782 $(QUIET)$(MKDIR) -p $(@D)
783 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) \
784 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
785 -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-php.xsl $<
786
787endif # VBOX_ONLY_SDK
788
789# generate typemap.dat (used by wsdl2h) from main XIDL file
790$(VBOXWEB_TYPEMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
791 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-typemap.xsl)
792 $(QUIET)$(RM) -f -- $@
793 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $<
794
795# generate gsoap pseudo-C header file from that WSDL; once via XSLT...
796$(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
797 $(call MSG_GENERATE,,$@,$(VBOXWEB_WSDL) using websrv-wsdl2gsoapH.xsl)
798 $(QUIET)$(RM) -f -- $@
799 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $<
800
801VBOX_NSMAP = $(VBOXWEB_OUT_DIR)/vboxwebsrv.nsmap
802$(VBOX_NSMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
803 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-nsmap.xsl)
804 $(QUIET)$(RM) -f -- $@
805 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $<
806
807ifdef VBOX_GSOAP_INSTALLED
808 # ... and once with the gSOAP tool (just for comparison, we don't use it for licensing reasons)
809 $(VBOXWEB_GSOAPH_FROM_GSOAP): $(VBOXWEB_WSDL) $(VBOXWEB_TYPEMAP) | $$(dir $$@)
810 $(call MSG_GENERATE,,$@,)
811 $(QUIET)$(RM) -f -- $@
812 $(VBOX_WSDL2H) $(VBOXWEB_WSDL_VERBOSE) -t$(VBOXWEB_TYPEMAP) -nvbox -o $@ $<
813
814 # this sets the gsoap header that we use for further compilation; if stuff works, then the
815 # one we generate via XSLT produces the same end result as the one from the gSOAP tool;
816 # with this variable we can swap for testing, but shipped code must use VBOXWEB_GSOAPH_FROM_XSLT
817 GSOAPH_RELEVANT = $(VBOXWEB_GSOAPH_FROM_XSLT)
818
819 # wsdl2h -v: verbose
820 # wsdl2h -e: don't qualify enum names
821 # wsdl2h -n<prefix>: namespace header prefix
822
823 ## @todo change this to state explicitly what will be generated?
824
825 #
826 # Generate server and client code from gsoap pseudo-C header file.
827 #
828 # Options for soapcpp2:
829 # -2: generate SOAP 1.2 calls
830 # -L: don't generate soapClientLib/soapServerLib
831 # -w: don't generate WSDL and schema files
832 # -x: don't generate sample XML files (VBOXWEB_SOAPCPP2_SKIP_FILES).
833 #
834 $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
835 + $(VBOXWEB_OUT_DIR)/soapH.h \
836 $(if-expr !defined(VBOX_WITHOUT_NOINLINE_SOAPH), \
837 + $(VBOXWEB_OUT_DIR)/soapH-noinline-1.cpp \
838 + $(VBOXWEB_OUT_DIR)/soapH-noinline-2.cpp \
839 + $(VBOXWEB_OUT_DIR)/soapH-noinline-3.cpp \
840 + $(VBOXWEB_OUT_DIR)/soapH-noinline-4.cpp \
841 + $(VBOXWEB_OUT_DIR)/soapH-noinline-5.cpp \
842 + $(VBOXWEB_OUT_DIR)/soapH-noinline-6.cpp \
843 + $(VBOXWEB_OUT_DIR)/soapH-noinline-7.cpp \
844 + $(VBOXWEB_OUT_DIR)/soapH-noinline-8.cpp \
845 + $(VBOXWEB_OUT_DIR)/soapH-noinline-9.cpp \
846 + $(VBOXWEB_OUT_DIR)/soapH-noinline-10.cpp \
847 + $(VBOXWEB_OUT_DIR)/soapH-noinline-11.cpp \
848 + $(VBOXWEB_OUT_DIR)/soapH-noinline-12.cpp,) \
849 + $(VBOXWEB_SOAP_CLIENT_H) \
850 + $(VBOXWEB_OUT_DIR)/soapC.cpp \
851 + $(VBOXWEB_OUT_DIR)/soapClient.cpp \
852 + $(VBOXWEB_OUT_DIR)/soapServer.cpp: \
853 $(VBOXWEB_GSOAPH_FROM_GSOAP) $(VBOXWEB_GSOAPH_FROM_XSLT) $(VBOX_NSMAP) \
854 $(VBOX_PATH_WEBSERVICE)/stdsoap2.sed \
855 $(VBOX_PATH_WEBSERVICE)/soap-header-to-inline-source-file.sed \
856 $(VBOX_PATH_WEBSERVICE)/soap-header-strip-inline.sed \
857 $$(split-soapC_1_TARGET) \
858 $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
859 $(call MSG_GENERATE,,lots of files,$(GSOAPH_RELEVANT))
860 $(RM) -f $@
861 $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -2 -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
862 ifeq ($(KBUILD_TARGET),win) # MSC -Wall workaround.
863 $(CP) -f "$(VBOXWEB_SOAP_CLIENT_H)" "$(VBOXWEB_SOAP_CLIENT_H).tmp"
864 $(SED) -f $(VBOX_PATH_WEBSERVICE)/stdsoap2.sed --output "$(VBOXWEB_SOAP_CLIENT_H)" "$(VBOXWEB_SOAP_CLIENT_H).tmp"
865 $(RM) -f "$(VBOXWEB_SOAP_CLIENT_H).tmp"
866 endif
867 ifndef VBOX_WITHOUT_NOINLINE_SOAPH
868 $(MV) -f -- "$(VBOXWEB_OUT_DIR)/soapH.h" "$(VBOXWEB_OUT_DIR)/soapH.h.tmp"
869 $(SED) -f $(VBOX_PATH_WEBSERVICE)/soap-header-to-inline-source-file.sed \
870 --output "$(VBOXWEB_OUT_DIR)/soapH-noinline.cpp" \
871 "$(VBOXWEB_OUT_DIR)/soapH.h.tmp"
872 $(split-soapC_1_TARGET) $(VBOXWEB_OUT_DIR)/soapH-noinline.cpp $(VBOXWEB_OUT_DIR)/soapH-noinline- 12
873 $(SED) -f $(VBOX_PATH_WEBSERVICE)/soap-header-strip-inline.sed \
874 --output "$(VBOXWEB_OUT_DIR)/soapH.h" \
875 "$(VBOXWEB_OUT_DIR)/soapH.h.tmp"
876 $(RM) -f -- "$(VBOXWEB_OUT_DIR)/soapH.h.tmp" "$(VBOXWEB_OUT_DIR)/soapH-noinline.cpp"
877 endif
878 $(APPEND) $@ done
879
880 # Copy the generated headers and stuff. This was split into a separate rule
881 # way back because we thought we could use $(wildcard ) and avoid the shell,
882 # however we cannot as it is subject to caching. Let the shell do the globbing.
883 # GSOAP versions 2.8 and later do not generate the unneeded soapvbox*.h files
884 # any more. Ignoring the exit code is the simple solution, accepting the error.
885 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
886 $(RM) -f $@
887 $(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMOHEADERS) $(PATH_TARGET_SOAPDEMONSMAPS)
888 ifdef VBOX_GSOAP_VERBOSE
889 $(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/*.req.xml $(VBOXWEB_OUT_DIR)/*.res.xml $(PATH_TARGET_SOAPDEMOXML)/
890 endif
891 -$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/soapvbox*.h $(PATH_TARGET_SOAPDEMOHEADERS)/
892 $(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/vboxBinding.nsmap $(PATH_TARGET_SOAPDEMONSMAPS)/
893 $(APPEND) $@ done
894
895 $(PATH_TARGET_SOAPDEMONSMAPS) \
896 $(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingProxy.h \
897 $(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingObject.h: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
898
899 hack: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
900
901 ifndef VBOX_WITHOUT_SPLIT_SOAPC
902 #
903 # Split up the soapC.cpp monster into manageable bits that can be
904 # built in parallel and without exhausting all available memory.
905 #
906 $(VBOXWEB_OUT_DIR)/soapC-1.cpp \
907 + $(VBOXWEB_OUT_DIR)/soapC-2.cpp \
908 + $(VBOXWEB_OUT_DIR)/soapC-3.cpp \
909 + $(VBOXWEB_OUT_DIR)/soapC-4.cpp \
910 + $(VBOXWEB_OUT_DIR)/soapC-5.cpp \
911 + $(VBOXWEB_OUT_DIR)/soapC-6.cpp \
912 + $(VBOXWEB_OUT_DIR)/soapC-7.cpp \
913 + $(VBOXWEB_OUT_DIR)/soapC-8.cpp \
914 + $(VBOXWEB_OUT_DIR)/soapC-9.cpp \
915 + $(VBOXWEB_OUT_DIR)/soapC-10.cpp \
916 + $(VBOXWEB_OUT_DIR)/soapC-11.cpp \
917 + $(VBOXWEB_OUT_DIR)/soapC-12.cpp \
918 + $(VBOXWEB_OUT_DIR)/soapC-13.cpp \
919 + $(VBOXWEB_OUT_DIR)/soapC-14.cpp \
920 + $(VBOXWEB_OUT_DIR)/soapC-15.cpp \
921 + $(VBOXWEB_OUT_DIR)/soapC-16.cpp \
922 + $(VBOXWEB_OUT_DIR)/soapC-17.cpp \
923 + $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
924 + $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
925 + $(VBOXWEB_OUT_DIR)/soapC-20.cpp \
926 + $(VBOXWEB_OUT_DIR)/soapC-21.cpp \
927 + $(VBOXWEB_OUT_DIR)/soapC-22.cpp \
928 + $(VBOXWEB_OUT_DIR)/soapC-23.cpp \
929 + $(VBOXWEB_OUT_DIR)/soapC-24.cpp \
930 + $(VBOXWEB_OUT_DIR)/soapC-25.cpp \
931 + $(VBOXWEB_OUT_DIR)/soapC-26.cpp \
932 + $(VBOXWEB_OUT_DIR)/soapC-27.cpp \
933 + $(VBOXWEB_OUT_DIR)/soapC-28.cpp \
934 + $(VBOXWEB_OUT_DIR)/soapC-29.cpp: \
935 $(VBOXWEB_OUT_DIR)/soapC.cpp $$(split-soapC_1_TARGET) | $$(dir $$@)
936 $(RM) -f -- $(wildcard $(VBOXWEB_OUT_DIR)/soapC-?.cpp $(VBOXWEB_OUT_DIR)/soapC-??.cpp)
937 $(split-soapC_1_TARGET) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR)/soapC- 29
938 endif # !VBOX_WITHOUT_SPLIT_SOAPC
939
940endif # VBOX_GSOAP_INSTALLED
941
942
943
944# generate method maps in server: map wsdl operations to com/xpcom method calls
945$(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 $$@)
946 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-cpp.xsl)
947 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $<
948
949# generate C file which contains vboxweb.wsdl
950$$(VBOXWEB_OUT_DIR)/vboxweb-wsdl.c: $(VBOXWEB_WSDL) $(VBOX_BIN2C)
951 $(call MSG_TOOL,bin2c,vboxweb-wsdl,$<,$@)
952 $(QUIET)$(VBOX_BIN2C) -ascii VBoxWebWSDL $< $@
953
954
955ifdef VBOX_ONLY_SDK
956
957 $(VBOXWEB_JAXWSSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/clienttest.java
958 $(QUIET)$(RM) -f -- $@
959 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_JAXWS_DIR)
960 $(QUIET)$(SED) -e 's/{VBOX_API_SUFFIX}/$(VBOX_API_SUFFIX)/' < $< > $@
961
962 $(VBOXWEB_METRICSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/metrictest.java
963 $(QUIET)$(RM) -f -- $@
964 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_JAXWS_DIR)
965 $(QUIET)$(SED) -e 's/{VBOX_API_SUFFIX}/$(VBOX_API_SUFFIX)/' < $< > $@
966
967endif # VBOX_ONLY_SDK
968
969include $(FILE_KBUILD_SUB_FOOTER)
970
Note: See TracBrowser for help on using the repository browser.

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