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