VirtualBox

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

Last change on this file since 17467 was 16993, checked in by vboxsync, 16 years ago

webservices: Added VBOX_GSOAP_CXX_LIBS for OSE/configure and notes about what some of the distros does. Note: Our build shall never use the host gSOAP, this is only for the purpose of making OSE happy.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 26.8 KB
Line 
1# $Id: Makefile.kmk 16993 2009-02-22 02:57:56Z 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) 2006-2007 Sun Microsystems, Inc.
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# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20# Clara, CA 95054 USA or visit http://www.sun.com if you need
21# additional information or have any questions.
22#
23
24# Define VBOX_GSOAP_INSTALLED to something if you have gSOAP's
25# "wsdl2h" and "soapcpp2" executables on your PATH somewhere.
26
27#
28# Here's a temporary outline how all this works.
29
30# 1) We use xsltproc and websrv-wsdl.xsl to generate a WSDL file from
31# our XML IDL file (../idl/VirtualBox.xidl). This WSDL describes the
32# web service to third-party clients; for example, one can feed it to
33# perl and thus easily write a short script that connects to the web
34# service properly.
35# This WSDL file ends up in $(VBOXWEB_OUT_DIR)/vboxweb.wsdl.
36#
37# 2) We use xsltproc and websrv-gsoapH.xsl to generate a gSoap header
38# file: $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h.
39# This file looks like a C header file, but really isn't meant
40# to be included by a C compiler. Instead, it just happens to be the
41# format that gSOAP uses to specify SOAP interfaces instead of WSDL
42# (apparently because gSOAP was written before the advent of WSDL).
43#
44# Note that gSOAP comes with its own WSDL-to-gsoap.h converter, but
45# the readme mentions some funny license restrictions, so instead we
46# have our own converter in XSLT.
47#
48# 3) We then feed that header file to gsoap's soapcpp2, which generates
49# a ton of files in $(VBOXWEB_OUT_DIR), most importantly:
50#
51# SOAP_CLIENT_H = $(VBOXWEB_OUT_DIR)/soapStub.h (header file for webservice clients)
52# SOAP_SERVER_H = $(VBOXWEB_OUT_DIR)/soapH.h (header file for webservice servers)
53#
54# These are "real" header files that one can use to program a) a webservice client
55# and b) a webservice server. Of course to build b) one will have to write method
56# implementations with useful code that does something. This is where more
57# code generation via XSLT comes in:
58#
59# 4) We use xsltproc to generate tons of c++ code directly from the XIDL that
60# maps each soap method to our COM methods. This large c++ file is
61# $(VBOXWEB_OUT_DIR)/methodmaps.cpp. The actual webservice executable (vboxwebsrv,
62# which acts as an http server) is composed of this file, plus hard-coded
63# method implementations in vboxweb.cpp, plus gSOAP library code for the HTTP
64# server.
65#
66
67SUB_DEPTH = ../../../..
68include $(KBUILD_PATH)/subheader.kmk
69
70#
71# Find the gSOAP toolkit.
72#
73# Note! We're not using the gSOAP toolkit correctly. The main issue is that
74# compiling soapcpp2.cpp instead of using the library. So, in order
75# to make this work with a locally installed gSOAP toolkit there are
76# some hoops to jump thru to say the least... Shipping soapcpp2.cpp/h
77# is out of the question without also including the two soap tools.
78#
79# Some observations on distros for OSE / configure:
80# The proposed gentoo ebuild screws up several things in the install phase
81# and thus fails to ship stdsoap2.cpp and relatives.
82#
83# debian (2.7.9l-0.2) stuffs stdsoap2.cpp and a handful of the import files
84# into /usr/include/gsoap.
85#
86# fedora (2.7.12-fc10.x86_64) uses the default install layout and does not
87# ship stdsoap2.cpp and friends.
88#
89ifeq ($(VBOX_GSOAP_INSTALLED),)
90 VBOX_GSOAP_INSTALLED = 1
91 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS)/common/gsoap/*)))
92 ifeq ($(VBOX_PATH_GSOAP),)
93 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST)/gsoap/*)))
94 endif
95 if "$(VBOX_PATH_GSOAP)" == "" && defined(KBUILD_DEVTOOLS_HST)
96 VBOX_PATH_GSOAP := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/gsoap/*)))
97 endif
98 ifeq ($(VBOX_PATH_GSOAP),)
99 $(warning VBOX_PATH_GSOAP not found...)
100 VBOX_GSOAP_INSTALLED =
101 endif
102else
103 VBOX_PATH_GSOAP := $(VBOX_PATH_GSOAP)
104endif
105VBOX_PATH_GSOAP_BIN := $(strip $(VBOX_PATH_GSOAP_BIN))
106if "$(VBOX_PATH_GSOAP_BIN)" == ""
107 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin
108 if "$(KBUILD_HOST)" == "darwin"
109 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/macosx
110 else if "$(KBUILD_HOST)" == "win"
111 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/win32
112 else if "$(KBUILD_HOST)" == "linux"
113 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/linux386
114 else
115 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/$(KBUILD_HOST).x86
116 endif
117 if !exists($(VBOX_PATH_GSOAP_BIN))
118 VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin
119 endif
120endif
121VBOX_SOAPCPP2 := $(VBOX_PATH_GSOAP_BIN)/soapcpp2$(HOSTSUFF_EXE)
122VBOX_WSDL2H := $(VBOX_PATH_GSOAP_BIN)/wsdl2h$(HOSTSUFF_EXE)
123
124VBOX_PATH_GSOAP_IMPORT := $(strip $(if $(VBOX_PATH_GSOAP_IMPORT),$(VBOX_PATH_GSOAP_IMPORT),$(VBOX_PATH_GSOAP)/import))
125VBOX_GSOAP_INCS := $(strip $(if $(VBOX_GSOAP_INCS), $(VBOX_GSOAP_INCS), $(VBOX_PATH_GSOAP) $(VBOX_PATH_GSOAP_IMPORT) ))
126VBOX_GSOAP_CXX_SOURCES := $(strip $(if $(VBOX_GSOAP_CXX_SOURCES),$(VBOX_GSOAP_CXX_SOURCES),$(VBOX_PATH_GSOAP)/stdsoap2.cpp))
127VBOX_GSOAP_CXX_LIBS := $(strip $(if $(VBOX_GSOAP_CXX_LIBS), $(VBOX_GSOAP_CXX_LIBS),))
128
129
130#
131# Globals
132#
133VBOXWEB_OUT_DIR := $(PATH_TARGET)/webservice
134BLDDIRS += $(VBOXWEB_OUT_DIR)
135
136# The webservice location
137VBOX_PATH_WEBSERVICE := $(PATH_SUB_CURRENT)
138
139# If this is set, all webservice files are considered out-of-date every time
140# this make file is touched. Otherwise, set this to empty.
141RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT)
142
143PATH_TARGET_SOAPDEMOXML := $(VBOXWEB_OUT_DIR)/demo_soapxml
144PATH_TARGET_SOAPDEMOHEADERS := $(VBOXWEB_OUT_DIR)/demo_headers
145PATH_TARGET_SOAPDEMONSMAPS := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
146PATH_TARGET_WEBTEST := $(VBOXWEB_OUT_DIR)/webtest
147
148VBOXWEB_IDL_SRC_ORIG := $(VBOX_XIDL_FILE)
149VBOXWEB_IDL_SRC := $(VBOXWEB_OUT_DIR)/VirtualBox.xidl
150
151VBOXWEB_TYPEMAP := $(VBOXWEB_OUT_DIR)/typemap.dat
152
153VBOXWEB_GSOAPH_FROM_XSLT := $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h
154ifdef VBOX_GSOAP_INSTALLED
155 VBOXWEB_GSOAPH_FROM_GSOAP := $(VBOXWEB_OUT_DIR)/gsoapH_from_gsoap.h
156else
157 VBOXWEB_GSOAPH_FROM_GSOAP :=
158endif
159VBOXWEB_SOAP_CLIENT_H := $(VBOXWEB_OUT_DIR)/soapStub.h
160VBOXWEB_SOAP_SERVER_H := $(VBOXWEB_OUT_DIR)/soapH.h
161
162
163ifdef VBOX_GSOAP_VERBOSE
164 VBOXWEB_XSLTPROC_VERBOSE = --stringparam G_argDebug '1'
165 VBOXWEB_WSDL_VERBOSE = -v
166else
167 VBOXWEB_SOAPCPP2_SKIP_FILES = -x
168endif
169
170
171## @todo VBOXWEB_GSOAPH_FROM_XSLT should probably be a indirect dep of something.
172VBOXWEB_OTHERS += \
173 $(VBOXWEB_GSOAPH_FROM_XSLT)
174
175
176
177ifdef VBOX_GSOAP_INSTALLED
178 ifndef VBOX_ONLY_SDK
179 #
180 # vboxsoap - Library used by both the programs (save build time).
181 #
182 LIBRARIES += vboxsoap
183 vboxsoap_TEMPLATE = VBOXR3EXE
184 vboxsoap_CXXFLAGS.win = -EHsc
185 ifdef VBOX_USE_VCC80
186 vboxsoap_CXXFLAGS.win += -bigobj
187 endif
188 vboxsoap_INCS := \
189 $(VBOX_GSOAP_INCS) \
190 $(VBOXWEB_OUT_DIR) \
191 $(PATH_SUB_CURRENT)
192 ifdef VBOX_WITHOUT_SPLIT_SOAPC
193 vboxsoap_SOURCES = \
194 $(VBOXWEB_OUT_DIR)/soapC.cpp
195 else
196 vboxsoap_SOURCES = \
197 $(VBOXWEB_OUT_DIR)/soapC-1.cpp \
198 $(VBOXWEB_OUT_DIR)/soapC-2.cpp \
199 $(VBOXWEB_OUT_DIR)/soapC-3.cpp \
200 $(VBOXWEB_OUT_DIR)/soapC-4.cpp \
201 $(VBOXWEB_OUT_DIR)/soapC-5.cpp \
202 $(VBOXWEB_OUT_DIR)/soapC-6.cpp \
203 $(VBOXWEB_OUT_DIR)/soapC-7.cpp \
204 $(VBOXWEB_OUT_DIR)/soapC-8.cpp \
205 $(VBOXWEB_OUT_DIR)/soapC-9.cpp \
206 $(VBOXWEB_OUT_DIR)/soapC-10.cpp \
207 $(VBOXWEB_OUT_DIR)/soapC-11.cpp \
208 $(VBOXWEB_OUT_DIR)/soapC-12.cpp \
209 $(VBOXWEB_OUT_DIR)/soapC-13.cpp \
210 $(VBOXWEB_OUT_DIR)/soapC-14.cpp \
211 $(VBOXWEB_OUT_DIR)/soapC-15.cpp \
212 $(VBOXWEB_OUT_DIR)/soapC-16.cpp \
213 $(VBOXWEB_OUT_DIR)/soapC-17.cpp \
214 $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
215 $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
216 $(VBOXWEB_OUT_DIR)/soapC-20.cpp
217 endif
218 vboxsoap_CLEAN := $(vboxsoap_SOURCES) # lazy bird
219 vboxsoap_SOURCES += \
220 $(VBOX_GSOAP_CXX_SOURCES)
221 vboxsoap_LIBS += \
222 $(VBOX_GSOAP_CXX_LIBS)
223 vboxsoap_ORDERDEPS = \
224 $(VBOXWEB_IDL_SRC) \
225 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
226
227ifdef VBOX_SOAP_PRECOMPILED_HEADER
228 # This'll save a few seconds, but the compiler invocation currently makes it impracticable. This will
229 # be addressed in a future kBuild version, by adding PCH support or/and by adding some helpers to
230 # gather the required data (DEFS,INCS,CXXTOOL,CXXFLAGS).
231 vboxsoap_INTERMEDIATES += $(VBOXWEB_OUT_DIR)/soapH.h.gch
232 vboxsoap_CXXFLAGS += -Winvalid-pch -H
233 vboxsoap_CLEAN += $(VBOXWEB_OUT_DIR)/soapH.h.gch
234
235$(VBOXWEB_OUT_DIR)/soapH.h.gch: $(VBOXWEB_OUT_DIR)/soapH.h
236 g++ -x c++-header -g -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -Wno-variadic-macros -pipe -O0 -fno-omit-frame-pointer -fno-strict-aliasing -fvisibility-inlines-hidden -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -m32 -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/src/VBox/Main/webservice/gsoap -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/out/darwin.x86/debug/obj/src/VBox/Main -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/src/VBox/Main/webservice -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/include -I/Volumes/ScratchHFS/bird/vbox/svn/trunk/out/darwin.x86/debug -DVBOX -DVBOX_WITH_DEBUGGER -DVBOX_WITH_DEBUGGER_GUI -DDEBUG -DDEBUG_bird -DDEBUG_USERNAME=bird -DRT_OS_DARWIN -D__DARWIN__ -DRT_ARCH_X86 -D__X86__ -DVBOX_WITH_HYBRID_32BIT_KERNEL -DIN_RING3 -DHC_ARCH_BITS=32 -DGC_ARCH_BITS=32 -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -DMAC_OS_X_VERSION_MAX_ALLOWED=1040 \
237 $< -o $@
238endif
239 endif # !VBOX_ONLY_SDK
240
241
242 ifndef VBOX_ONLY_SDK
243 #
244 # vboxwebsrv - webservice server process
245 #
246 PROGRAMS += vboxwebsrv
247 vboxwebsrv_TEMPLATE = VBOXMAINCLIENTEXE
248 vboxwebsrv_DEFS += SOCKET_CLOSE_ON_EXEC
249 vboxwebsrv_INCS = \
250 $(VBOX_GSOAP_INCS) \
251 $(VBOXWEB_OUT_DIR) \
252 .
253 vboxwebsrv_CXXFLAGS.win = -EHsc ## @todo need to fix this template one day
254 ifdef VBOX_USE_VCC80
255 vboxwebsrv_CXXFLAGS.win += -bigobj
256 endif
257 vboxwebsrv_LIBS += \
258 $(PATH_LIB)/vboxsoap$(VBOX_SUFF_LIB)
259 vboxwebsrv_LIBS.solaris += socket nsl
260 vboxwebsrv_SOURCES = \
261 vboxweb.cpp \
262 $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
263 $(VBOXWEB_OUT_DIR)/soapServer.cpp
264 vboxwebsrv_CLEAN = \
265 $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
266 $(VBOXWEB_OUT_DIR)/soapServer.cpp
267
268 vboxwebsrv_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
269 endif # !VBOX_ONLY_SDK
270
271
272 ifndef VBOX_ONLY_SDK
273 #
274 # webtest - webservice sample client in C++
275 #
276 PROGRAMS += webtest
277 webtest_TEMPLATE = VBOXR3EXE
278 webtest_CXXFLAGS.win = -EHsc
279 ifdef VBOX_USE_VCC80
280 webtest_CXXFLAGS.win += -bigobj
281 endif
282 webtest_INCS := \
283 $(VBOX_GSOAP_INCS) \
284 $(VBOXWEB_OUT_DIR) \
285 .
286 webtest_LIBS += \
287 $(PATH_LIB)/vboxsoap$(VBOX_SUFF_LIB)
288 webtest_LIBS.solaris += nsl
289 webtest_SOURCES = \
290 webtest.cpp \
291 $(VBOXWEB_OUT_DIR)/soapClient.cpp
292 webtest_CLEAN = \
293 $(VBOXWEB_OUT_DIR)/soapClient.cpp
294
295 webtest_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
296 endif # !VBOX_ONLY_SDK
297
298
299 #
300 # Additional mess to cleanup (applies to both webtest and vboxwebsrv).
301 #
302 ## @todo figure out whether the SDK really needs this or not...
303 OTHER_CLEAN += \
304 $(wildcard $(VBOXWEB_OUT_DIR)/soap*.h) \
305 $(wildcard $(VBOXWEB_OUT_DIR)/soap*.cpp) \
306 $(wildcard $(VBOXWEB_OUT_DIR)/*.nsmap) \
307 $(VBOXWEB_GSOAPH_FROM_XSLT) \
308 $(VBOXWEB_GSOAPH_FROM_GSOAP) \
309 $(VBOXWEB_SOAP_CLIENT_H) \
310 $(VBOXWEB_SOAP_SERVER_H) \
311 $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
312 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \
313 $(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \
314 $(PATH_TARGET_SOAPDEMOXML)/dummy_file \
315 $(wildcard $(PATH_TARGET_SOAPDEMOHEADERS)/*) \
316 $(PATH_TARGET_SOAPDEMOHEADERS)/dummy_file \
317 $(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \
318 $(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file
319
320endif # VBOX_GSOAP_INSTALLED
321
322
323ifdef VBOX_ONLY_SDK
324 #
325 # Global relevant to the SDK.
326 #
327 VBOXWEB_GLUE_PYTHON = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_wrappers.py
328 VBOXWEB_WS_PYTHON = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_service.py
329 VBOXWEB_SAMPLES_AXIS_DIR = $(VBOX_PATH_SDK)/bindings/webservice/java/axis/samples
330 VBOXWEB_AXISSAMPLE = $(VBOXWEB_SAMPLES_AXIS_DIR)/clienttest.java
331 VBOXWEB_SAMPLES_JAXWS_DIR = $(VBOX_PATH_SDK)/bindings/webservice/java/jax-ws/samples
332 VBOXWEB_JAXWSSAMPLE = $(VBOXWEB_SAMPLES_JAXWS_DIR)/clienttest.java
333 VBOXWEB_METRICSAMPLE = $(VBOXWEB_SAMPLES_JAXWS_DIR)/metrictest.java
334 VBOXWEB_SAMPLES_PERL_DIR = $(VBOX_PATH_SDK)/bindings/webservice/perl/samples
335 VBOXWEB_PERLSAMPLE = $(VBOXWEB_SAMPLES_PERL_DIR)/clienttest.pl
336 VBOXWEB_SAMPLES_PYTHONWS_DIR = $(VBOX_PATH_SDK)/bindings/webservice/python/samples
337 VBOXWEB_PYTHONWSSAMPLE = $(VBOXWEB_SAMPLES_PYTHONWS_DIR)/vboxshell.py
338 VBOXWEB_SHELLCOMMON = $(VBOXWEB_SAMPLES_PYTHONWS_DIR)/shellcommon.py
339
340 VBOXWEB_GLUE_JAVA_TMP = $(VBOXWEB_OUT_DIR)/glue-jaxws.java.tmp
341 VBOXWEB_PATH_SDK_GLUE_JAVA = $(VBOX_PATH_SDK)/bindings/webservice/java/jax-ws/src
342 VBOXWEB_JAVALIB = $(VBOX_PATH_SDK)/bindings/webservice/java/jax-ws/lib
343 VBOXWEB_JAVA15_JAR = $(VBOXWEB_JAVALIB)/vboxws_java15.jar
344 VBOXWEB_JAVA16_JAR = $(VBOXWEB_JAVALIB)/vboxws_java16.jar
345
346
347 VBOX_JAXWS_LIBDIR = $(VBOX_PATH_WEBSERVICE)/jaxlibs
348 # well, not really good
349 VBOX_JAVA15 = $(firstword $(wildcard \
350 /usr/lib/jvm/java-1.5.0-sun/bin/java \
351 /usr/jdk/jdk1.5*/bin/java \
352 /opt/sun-jdk-1.5*/bin/java))
353 ifndef VBOX_JAVA15
354 $(error Failed to autodetect VBOX_JAVA15, please set it manually)
355 endif
356 VBOX_JAVA16 = java
357 VBOX_JAVAC15 = javac -target 1.5
358 VBOX_JAVAC16 = javac -target 1.6
359 VBOX_WSIMPORT15 = $(VBOX_JAVA15) -jar $(VBOX_JAXWS_LIBDIR)/jaxws-tools.jar
360 VBOX_WSIMPORT16 = $(firstword $(wildcard \
361 /usr/jdk/jdk1.6*/bin/wsimport \
362 /usr/bin/wsimport \
363 /opt/sun-jdk-1.6*/bin/wsimport))
364 ifndef VBOX_WSIMPORT16
365 $(error Failed to autodetect VBOX_WSIMPORT16, please set it manually)
366 endif
367 VBOX_JAR = jar
368
369 VBOXWEB_OTHERS += \
370 $(VBOXWEB_GLUE_JAVA_TMP) \
371 $(VBOXWEB_GLUE_PYTHON)\
372 $(VBOXWEB_WS_PYTHON) \
373 $(VBOXWEB_PYTHONWSSAMPLE)\
374 $(VBOXWEB_SHELLCOMMON)\
375 $(VBOXWEB_AXISSAMPLE) \
376 $(VBOXWEB_JAXWSSAMPLE)\
377 $(VBOXWEB_METRICSAMPLE)\
378 $(VBOXWEB_PERLSAMPLE) \
379 $(VBOXWEB_PATH_SDK_GLUE_JAVA)/Makefile \
380 $(VBOXWEB_SAMPLES_PYTHONWS_DIR)/Makefile\
381 $(VBOXWEB_SAMPLES_JAXWS_DIR)/Makefile \
382 $(VBOXWEB_JAVA15_JAR) \
383 $(VBOXWEB_JAVA16_JAR)
384
385 #
386 # filesplitter - build helper, splits up the java classes.
387 #
388 BLDPROGS += filesplitter
389 filesplitter_TEMPLATE = VBOXBLDPROG
390 filesplitter_SOURCES = filesplitter.c
391
392endif # VBOX_ONLY_SDK
393
394VBOXWEB_WSDL = $(VBOX_PATH_SDK)/bindings/webservice/vboxweb.wsdl
395VBOXWEBSERVICE_WSDL = $(VBOX_PATH_SDK)/bindings/webservice/vboxwebService.wsdl
396
397## @todo VBOXWEB_WSDL and VBOXWEBSERVICE_WSDL should be an install target.
398VBOXWEB_OTHERS += \
399 $(VBOXWEB_WSDL) \
400 $(VBOXWEBSERVICE_WSDL)
401
402#
403# Update the OTHERS and OTHER_CLEAN lists with VBOXWEB_OTHERS and some more stuff.
404#
405# We can't just built up OTHERS and append it to OTHER_CLEAN because we're sharing
406# OTHERS with all the other VBox makefiles (VBOX_SINGLE_MAKEFILE), thus VBOXWEB_OTHERS.
407#
408OTHERS += $(VBOXWEB_OTHERS)
409OTHER_CLEAN += \
410 $(VBOXWEB_OTHERS) \
411 $(VBOXWEB_TYPEMAP) \
412 $(VBOXWEB_IDL_SRC)
413
414
415
416# generate platform-specific XIDL file from original XIDL file
417$(VBOXWEB_IDL_SRC): $(VBOXWEB_IDL_SRC_ORIG) $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl | $$(dir $$@)
418 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using platform-xidl.xsl)
419 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl $<
420
421# generate WSDL from main XIDL file
422$(VBOXWEB_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) ## @todo | $$(dir $$@)
423 $(QUIET)$(MKDIR) -p $(@D)
424 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl.xsl)
425 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $<
426
427$(VBOXWEBSERVICE_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) ## @todo | $$(dir $$@)
428 $(QUIET)$(MKDIR) -p $(@D)
429 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl-service.xsl)
430 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $<
431
432ifdef VBOX_ONLY_SDK
433
434$(VBOXWEB_GLUE_PYTHON): $(VBOXWEB_IDL_SRC) $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-python.xsl
435 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-python.xsl)
436 $(QUIET)$(MKDIR) -p $(@D)
437 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-python.xsl $<
438 $(QUIET)$(CP) -f $(VBOX_PATH_WEBSERVICE)/samples/python/Makefile.glue $(@D)/Makefile
439
440$(VBOXWEB_WS_PYTHON): $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
441 $(call MSG_GENERATE,,$@, WS Python bindings)
442 $(QUIET)$(MKDIR) -p $(@D)
443 $(QUIET)$(REDIRECT) -C $(@D) -- wsdl2py -b --file $(VBOXWEBSERVICE_WSDL)
444 $(QUIET)$(APPEND) $@ ''
445
446endif # VBOX_ONLY_SDK
447
448# generate typemap.dat (used by wsdl2h) from main XIDL file
449$(VBOXWEB_TYPEMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
450 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-typemap.xsl)
451 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $<
452
453# generate gsoap pseudo-C header file from that WSDL; once via XSLT...
454# $(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-gsoapH.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
455# $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-gsoapH.xsl)
456# $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-gsoapH.xsl $<
457$(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
458 $(call MSG_GENERATE,,$@,$(VBOXWEB_WSDL) using websrv-wsdl2gsoapH.xsl)
459 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $<
460
461NSMAP = $(VBOXWEB_OUT_DIR)/vboxwebsrv.nsmap
462
463$(NSMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
464 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-nsmap.xsl)
465 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $<
466
467
468
469ifdef VBOX_GSOAP_INSTALLED
470# ... and once with the gSOAP tool (just for comparison, we don't use it for licensing reasons)
471$(VBOXWEB_GSOAPH_FROM_GSOAP): $(VBOXWEB_WSDL) $(VBOXWEB_TYPEMAP) | $$(dir $$@)
472 $(call MSG_GENERATE,,$@,)
473 $(VBOX_WSDL2H) $(VBOXWEB_WSDL_VERBOSE) -t$(VBOXWEB_TYPEMAP) -nvbox -o $@ $<
474
475GSOAPH_RELEVANT = $(VBOXWEB_GSOAPH_FROM_XSLT)
476
477# wsdl2h -v: verbose
478# wsdl2h -e: don't qualify enum names
479# wsdl2h -n<prefix>: namespace header prefix
480
481## @todo change this to state explicitly what will be generated?
482
483# generate server and client code from gsoap pseudo-C header file
484$(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts \
485+ $(VBOXWEB_OUT_DIR)/soapH.h \
486+ $(VBOXWEB_OUT_DIR)/soapStub.h \
487+ $(VBOXWEB_OUT_DIR)/soapC.cpp \
488+ $(VBOXWEB_OUT_DIR)/soapClient.cpp \
489+ $(VBOXWEB_OUT_DIR)/soapServer.cpp \
490: $(VBOXWEB_GSOAPH_FROM_GSOAP) $(VBOXWEB_GSOAPH_FROM_XSLT) $(NSMAP) $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
491 $(call MSG_GENERATE,,lots of files,$(GSOAPH_RELEVANT))
492 $(RM) -f $@
493 $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
494 $(APPEND) $@ done
495
496# copy the generated headers and stuff. This has to be a seperate rule if we
497# want to use wildcard (all commands are expaned when the rule is evaluated).
498$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
499 $(RM) -f $@
500 $(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMOHEADERS) $(PATH_TARGET_SOAPDEMONSMAPS)
501ifdef VBOX_GSOAP_VERBOSE
502 $(MV) -f $(wildcard $(VBOXWEB_OUT_DIR)/*.req.xml $(VBOXWEB_OUT_DIR)/*.res.xml) $(PATH_TARGET_SOAPDEMOXML)
503endif
504 $(MV) -f $(wildcard $(VBOXWEB_OUT_DIR)/soapvbox*.h) $(PATH_TARGET_SOAPDEMOHEADERS)
505 $(MV) -f $(VBOXWEB_OUT_DIR)/vboxBinding.nsmap $(PATH_TARGET_SOAPDEMONSMAPS)
506 $(APPEND) $@ done
507
508$(PATH_TARGET_SOAPDEMONSMAPS) \
509$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingProxy.h \
510$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingObject.h: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
511
512# soapcpp2 -2: generate SOAP 1.2 calls
513# soapcpp2 -S: server-side code only
514# soapcpp2 -L: don't generate soapClientLib/soapServerLib
515# soapcpp2 -w: don't generate WSDL and schema files
516# soapcpp2 -x: don't generate sample XML files
517
518ifndef VBOX_WITHOUT_SPLIT_SOAPC
519#
520# Split up the soapC.cpp monster into manageable bits that can be
521# built in parallel and without exhausting all available memory.
522#
523$(VBOXWEB_OUT_DIR)/soapC-1.cpp \
524+ $(VBOXWEB_OUT_DIR)/soapC-2.cpp \
525+ $(VBOXWEB_OUT_DIR)/soapC-3.cpp \
526+ $(VBOXWEB_OUT_DIR)/soapC-4.cpp \
527+ $(VBOXWEB_OUT_DIR)/soapC-5.cpp \
528+ $(VBOXWEB_OUT_DIR)/soapC-6.cpp \
529+ $(VBOXWEB_OUT_DIR)/soapC-7.cpp \
530+ $(VBOXWEB_OUT_DIR)/soapC-8.cpp \
531+ $(VBOXWEB_OUT_DIR)/soapC-9.cpp \
532+ $(VBOXWEB_OUT_DIR)/soapC-10.cpp \
533+ $(VBOXWEB_OUT_DIR)/soapC-11.cpp \
534+ $(VBOXWEB_OUT_DIR)/soapC-12.cpp \
535+ $(VBOXWEB_OUT_DIR)/soapC-13.cpp \
536+ $(VBOXWEB_OUT_DIR)/soapC-14.cpp \
537+ $(VBOXWEB_OUT_DIR)/soapC-15.cpp \
538+ $(VBOXWEB_OUT_DIR)/soapC-16.cpp \
539+ $(VBOXWEB_OUT_DIR)/soapC-17.cpp \
540+ $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
541+ $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
542+ $(VBOXWEB_OUT_DIR)/soapC-20.cpp \
543: $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOX_PATH_WEBSERVICE)/split-soapC.sed | $$(dir $$@)
544 $(RM) -f $(wildcard $(VBOXWEB_OUT_DIR)/soapC-?.cpp $(VBOXWEB_OUT_DIR)/soapC-??.cpp)
545 $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- \
546 $(SED) -f $(VBOX_PATH_WEBSERVICE)/split-soapC.sed soapC.cpp
547endif # !VBOX_WITHOUT_SPLIT_SOAPC
548
549endif # VBOX_GSOAP_INSTALLED
550
551
552
553# generate method maps in server: map wsdl operations to com/xpcom method calls
554$(VBOXWEB_OUT_DIR)/methodmaps.cpp: $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
555 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-cpp.xsl)
556 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $<
557
558
559ifdef VBOX_ONLY_SDK
560
561## @todo Use an install target for these simple copy operations?
562$(VBOXWEB_AXISSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/axis/clienttest.java
563 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_AXIS_DIR)
564 $(QUIET)$(CP) -f $< $@
565
566$(VBOXWEB_JAXWSSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/clienttest.java
567 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_JAXWS_DIR)
568 $(QUIET)$(CP) -f $< $@
569
570$(VBOXWEB_METRICSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/metrictest.java
571 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_JAXWS_DIR)
572 $(QUIET)$(CP) -f $< $@
573
574$(VBOXWEB_PERLSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/perl/clienttest.pl
575 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_PERL_DIR)
576 $(QUIET)$(CP) -f $< $@
577
578$(VBOXWEB_PYTHONWSSAMPLE): $(VBOX_PATH_WEBSERVICE)/samples/python/vboxshell.py
579 $(QUIET)$(MKDIR) -p $(VBOXWEB_SAMPLES_PYTHONWS_DIR)
580 $(QUIET)$(CP) -f $< $@
581
582# somewhat hackish rule
583$(VBOXWEB_SHELLCOMMON): $(PATH_ROOT)/src/libs/xpcom18a4/python/sample/shellcommon.py $(VBOXWEB_PYTHONWSSAMPLE)
584 $(QUIET)$(CP) -f $< $@
585
586# generate jax-ws wrapper for java client code
587$(VBOXWEB_GLUE_JAVA_TMP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/glue-jaxws.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $$(TARGET_filesplitter) $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
588 $(QUIET)$(MKDIR) -p $(@D)
589 $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using glue-jaxws.xsl)
590 $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/glue-jaxws.xsl $<
591 $(call MSG_GENERATE,,java client glue files in $(VBOXWEB_PATH_SDK_GLUE_JAVA))
592 $(RM) -R -f $(VBOXWEB_PATH_SDK_GLUE_JAVA)
593 $(QUIET)$(MKDIR) -p $(VBOXWEB_PATH_SDK_GLUE_JAVA)
594 $(QUIET)$(TARGET_filesplitter) $@ $(VBOXWEB_PATH_SDK_GLUE_JAVA)
595
596# likely those 4 rules can be changed to INSTALLS
597$(VBOXWEB_PATH_SDK_GLUE_JAVA)/Makefile: $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/Makefile.glue $(VBOXWEB_GLUE_JAVA_TMP)
598 $(QUIET)$(CP) $< $@
599
600$(VBOXWEB_SAMPLES_PYTHONWS_DIR)/Makefile: $(VBOX_PATH_WEBSERVICE)/samples/python/Makefile $(VBOXWEB_PERLSAMPLE)
601 $(QUIET)$(CP) $< $@
602
603$(VBOXWEB_SAMPLES_JAXWS_DIR)/Makefile: $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/Makefile $(VBOXWEB_JAXWSSAMPLE)
604 $(QUIET)$(CP) $< $@
605
606## @todo r=bird: What is this for? It's not referenced by anyone.
607$(VBOXWEB_JAVALIB)/Makefile: $(VBOX_PATH_WEBSERVICE)/samples/java/jax-ws/Makefile.glue $(VBOXWEB_JAVA16_JAR)
608 $(QUIET)$(CP) $< $@
609
610$(VBOXWEB_JAVA15_JAR): $(VBOXWEB_GLUE_JAVA_TMP) $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
611 $(QUIET)$(RM) -Rf $(VBOXWEB_JAVALIB)/gen15
612 $(QUIET)$(MKDIR) -p $(VBOXWEB_JAVALIB)/gen15
613 $(call MSG_GENERATE,,$@,JAX-WS for Java 1.5 bindings using $(VBOXWEBSERVICE_WSDL))
614 $(QUIET)$(VBOX_WSIMPORT15) -d $(VBOXWEB_JAVALIB)/gen15 $(VBOXWEBSERVICE_WSDL)
615 $(call MSG_L1,Compiling bridge code)
616 $(QUIET)$(VBOX_JAVAC15) -cp \
617 $(VBOXWEB_JAVALIB)/gen15:$(VBOX_JAXWS_LIBDIR)/jaxws-api.jar:$(VBOX_JAXWS_LIBDIR)/lib/jaxb-api.jar:$(VBOX_JAXWS_LIBDIR)/jsr181-api.jar \
618 $(VBOXWEB_PATH_SDK_GLUE_JAVA)/*.java -d $(VBOXWEB_JAVALIB)/gen15
619 $(QUIET)$(CP) -f $(VBOXWEBSERVICE_WSDL) $(VBOXWEB_JAVALIB)/gen15/
620 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOXWEB_JAVALIB)/gen15/
621 $(QUIET)$(RM) -f $(VBOXWEB_JAVALIB)/gen15/*.java
622 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOXWEB_JAVALIB)/gen15
623 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOXWEB_JAVALIB)/gen15 .
624
625$(VBOXWEB_JAVA16_JAR): $(VBOXWEB_GLUE_JAVA_TMP) $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL)
626 $(QUIET)$(RM) -Rf $(VBOXWEB_JAVALIB)/gen16
627 $(MKDIR) -p $(VBOXWEB_JAVALIB)/gen16
628 $(call MSG_GENERATE,,$@,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL))
629 $(QUIET)$(VBOX_WSIMPORT16) -d $(VBOXWEB_JAVALIB)/gen16 $(VBOXWEBSERVICE_WSDL)
630 $(call MSG_L1,Compiling bridge code)
631 $(QUIET)$(VBOX_JAVAC16) -cp $(VBOXWEB_JAVALIB)/gen16 \
632 $(VBOXWEB_PATH_SDK_GLUE_JAVA)/*.java -d $(VBOXWEB_JAVALIB)/gen16
633 $(QUIET)$(CP) -f $(VBOXWEBSERVICE_WSDL) $(VBOXWEB_JAVALIB)/gen16/
634 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOXWEB_JAVALIB)/gen16/
635 $(QUIET)$(RM) -f $(VBOXWEB_JAVALIB)/gen16/*.java
636 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOXWEB_JAVALIB)/gen16
637 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOXWEB_JAVALIB)/gen16 .
638
639endif # VBOX_ONLY_SDK
640
641include $(KBUILD_PATH)/subfooter.kmk
642
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