~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Main/webservice/Makefile.kmk

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: Makefile.kmk $
 
1
# $Id: Makefile.kmk 35559 2011-01-14 13:33:47Z vboxsync $
2
2
## @file
3
3
# Sub-Makefile for the VBox web service.
4
4
#
38
38
#    easily write a short script that connects to the web service properly.
39
39
#    This WSDL file ends up in $(VBOXWEB_OUT_DIR)/vboxweb.wsdl.
40
40
#
41
 
# 2) We use xsltproc and websrv-gsoapH.xsl to generate a so-called
42
 
#    "gSoap header file": $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h.
 
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.
43
44
#    This file looks like a C header file, but really isn't meant
44
45
#    to be included by a C compiler. Instead, it just happens to be the
45
46
#    format that gSOAP uses to specify SOAP interfaces instead of WSDL.
61
62
#    implementations with useful code that does something. This is where more
62
63
#    code generation via XSLT comes in:
63
64
#
64
 
# 4) We use xsltproc to generate tons of c++ code directly from the XIDL that
 
65
# 4) We use xsltproc to generate tons of C++ code directly from the XIDL that
65
66
#    maps each SOAP method to our COM methods. This large C++ file is
66
67
#    $(VBOXWEB_OUT_DIR)/methodmaps.cpp. The actual webservice executable (vboxwebsrv,
67
68
#    which acts as an HTTP server) is composed of this file, plus hard-coded
145
146
VBOX_PATH_WEBSERVICE          := $(PATH_SUB_CURRENT)
146
147
 
147
148
# If this is set, all webservice files are considered out-of-date every time
148
 
# this make file is touched. Otherwise, set this to empty.
 
149
# this makefile is touched. Otherwise, set this to empty.
149
150
RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT)
150
151
 
151
152
PATH_TARGET_SOAPDEMOXML       := $(VBOXWEB_OUT_DIR)/demo_soapxml
153
154
PATH_TARGET_SOAPDEMONSMAPS    := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
154
155
PATH_TARGET_WEBTEST           := $(VBOXWEB_OUT_DIR)/webtest
155
156
 
 
157
# platform-specific XIDL file generated from $(VBOXWEB_IDL_SRC):
156
158
VBOXWEB_IDL_SRC_ORIG          := $(VBOX_XIDL_FILE)
 
159
# the original XIDL file:
157
160
VBOXWEB_IDL_SRC               := $(VBOXWEB_OUT_DIR)/VirtualBox.xidl
158
161
 
 
162
VBOXWEB_WSDL                   = $(VBOX_PATH_SDK)/bindings/webservice/vboxweb.wsdl
 
163
VBOXWEBSERVICE_WSDL            = $(VBOX_PATH_SDK)/bindings/webservice/vboxwebService.wsdl
 
164
 
159
165
VBOXWEB_TYPEMAP               := $(VBOXWEB_OUT_DIR)/typemap.dat
160
166
 
161
167
VBOXWEB_GSOAPH_FROM_XSLT      := $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h
238
244
 ifn1of ($(KBUILD_TARGET), win)
239
245
  $(VBOX_GSOAP_CXX_SOURCES)_CXXFLAGS = -Wno-format
240
246
 endif
 
247
 $(VBOXWEB_OUT_DIR)/soapC-3.cpp_CXXFLAGS.win.x86 = -Og- # VCC70 says "function too large".
241
248
 
242
249
ifdef VBOX_SOAP_PRECOMPILED_HEADER
243
250
 # This'll save a few seconds, but the compiler invocation currently makes it impracticable. This will
283
290
        $(VBOXWEB_OUT_DIR)/methodmaps.cpp \
284
291
        $(VBOXWEB_OUT_DIR)/soapServer.cpp
285
292
 
 
293
 vboxweb.cpp_DEFS = \
 
294
        VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
 
295
        $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
 
296
 
286
297
 vboxwebsrv_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
287
298
 endif # !VBOX_ONLY_SDK
288
299
 
 
300
ifdef VBOX_WITH_JWS
 
301
INSTALLS += VBoxJWs-inst-jar
 
302
 
 
303
#
 
304
# Java glue JAR files
 
305
#
 
306
VBOX_JWS_JAR     = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws.jar
 
307
VBOX_JWS_TARGET := $(PATH_TARGET)/vboxjws-gen
 
308
VBOX_JWS_GEN     = $(VBOX_JWS_TARGET)/jwsgen
 
309
VBOX_JWS_JDEST  := $(VBOX_JWS_TARGET)/jdest
 
310
VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
 
311
VBOX_JAXLIB_DIR    := $(PATH_ROOT)/src/VBox/Main/webservice/jaxlibs
 
312
 
 
313
VBoxJWs-inst-jar_INST = $(INST_SDK)bindings/webservice/java/jax-ws
 
314
VBoxJWs-inst-jar_SOURCES = \
 
315
        $(VBOX_JWS_JAR)
 
316
VBoxJWs-inst-jar_CLEAN = \
 
317
        $(VBOX_JWS_JAR) \
 
318
        $(VBOX_JWS_GEN)/jwsglue.list \
 
319
        $(wildcard \
 
320
                $(VBOX_JWS_GEN)/java/*.java \
 
321
                $(VBOX_JWS_GEN)/java/jws/*/*/*/*.java \
 
322
                $(VBOX_JWS_JDEST)/*.class \
 
323
                $(VBOX_JWS_JDEST)/*/*.class \
 
324
                $(VBOX_JWS_JDEST)/*/*/*.class \
 
325
                $(VBOX_JWS_JDEST)/*/*/*/*.class \
 
326
        )
 
327
VBoxJWs-inst-jar_BLDDIRS += $(VBOX_JWS_GEN)/java $(VBOX_JWS_GEN)/java/jws
 
328
 
 
329
$(VBOX_JWS_GEN)/jwsglue.list:  \
 
330
                $(VBOX_XIDL_FILE)    \
 
331
                $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
 
332
                $(VBOX_FILESPLIT)    \
 
333
                $(VBOXWEBSERVICE_WSDL) \
 
334
                | $(VBOX_JWS_GEN)/java/jws/
 
335
        $(call MSG_L1,Generating JAX-WS Java glue files from XIDL)
 
336
        $(RM) -f $(wildcard $(VBOX_JWS_GEN)/java/*.java) $(wildcard $(VBOX_JWS_GEN)/java/jws/*/*/*/*.java)
 
337
        $(QUIET)$(VBOX_XSLTPROC) \
 
338
              --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
 
339
              --stringparam G_vboxGlueStyle jaxws              \
 
340
              -o $(VBOX_JWS_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
 
341
        $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JWS_GEN)/java/merged.file $(VBOX_JWS_GEN)/java
 
342
        $(call MSG_GENERATE,,$@,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL))
 
343
        $(VBOX_WSIMPORT) -Xnocompile -p $(VBOX_JAVA_PACKAGE).jaxws -d $(VBOX_JWS_GEN)/java/jws $(VBOXWEBSERVICE_WSDL)
 
344
        $(QUIET)echo $(VBOX_JWS_GEN)/java/*.java > $@
 
345
        $(QUIET)echo $(VBOX_JWS_GEN)/java/jws/*/*/*/*.java >> $@
 
346
 
 
347
$$(VBOX_JWS_JAR): $(VBOX_JWS_GEN)/jwsglue.list $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) | $$(dir $$@)
 
348
        $(call MSG_TOOL,javac,$(notdir $@),jwsgen.list,)
 
349
        $(QUIET)$(RM) -Rf $(VBOX_JWS_JDEST)
 
350
        $(QUIET)$(MKDIR) -p $(VBOX_JWS_JDEST)
 
351
        $(call MSG_L1,Compiling bridge code)
 
352
        $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
 
353
                @$(VBOX_JWS_GEN)/jwsglue.list \
 
354
                -d $(VBOX_JWS_JDEST) -classpath $(VBOX_JWS_JDEST)
 
355
        $(QUIET)$(SED) -e "s/vboxweb.wsdl/vboxweb$(VBOX_API_SUFFIX).wsdl/" <  $(VBOXWEBSERVICE_WSDL) > $(VBOX_JWS_JDEST)/vboxwebService$(VBOX_API_SUFFIX).wsdl
 
356
        $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOX_JWS_JDEST)/vboxweb$(VBOX_API_SUFFIX).wsdl
 
357
        $(call MSG_LINK,$(notdir $@),$@)
 
358
        $(VBOX_JAR) cf $@ -C $(VBOX_JWS_JDEST) .
 
359
 
 
360
endif # VBOX_WITH_JWS
289
361
 
290
362
 ifndef VBOX_ONLY_SDK
291
363
 #
343
415
 
344
416
ifdef VBOX_ONLY_SDK
345
417
 #
346
 
 # Global relevant to the SDK.
 
418
 # Globals relevant to the SDK.
347
419
 #
348
420
 VBOXWEB_GLUE_PYTHON           = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_wrappers.py
349
421
 VBOXWEB_WS_PYTHON             = $(VBOX_PATH_SDK)/bindings/webservice/python/lib/VirtualBox_services.py
371
443
        /usr/jdk/jdk1.5*/bin/java  \
372
444
        /opt/sun-jdk-1.5*/bin/java \
373
445
        /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/java))
374
 
 ifndef VBOX_JAVA15
 
446
 ifeq ($(strip $(VBOX_JAVA15)),)
375
447
  $(error Failed to autodetect VBOX_JAVA15, please set it manually)
376
448
 endif
377
449
 VBOX_JAVA16                   = java
382
454
        /usr/jdk/jdk1.6*/bin/wsimport \
383
455
        /usr/bin/wsimport \
384
456
        /opt/sun-jdk-1.6*/bin/wsimport))
385
 
 ifndef VBOX_WSIMPORT16
 
457
 ifeq ($(strip $(VBOX_WSIMPORT16)),)
386
458
  $(error Failed to autodetect VBOX_WSIMPORT16, please set it manually)
387
459
 endif
388
 
 VBOX_JAR                      = jar
389
460
 
390
461
 VBOXWEB_OTHERS               += \
391
 
        $(VBOXWEB_GLUE_JAVA_TMP) \
392
 
        $(VBOXWEB_GLUE_PYTHON) \
393
 
        $(VBOXWEB_WS_PYTHON) \
394
 
        $(VBOXWEB_WS_PERL) \
395
 
        $(VBOXWEB_WS_PHP) \
396
 
        $(VBOXWEB_PYTHONWSSAMPLE)\
397
 
        $(VBOXWEB_JAXWSSAMPLE) \
398
 
        $(VBOXWEB_METRICSAMPLE) \
399
 
        $(VBOXWEB_JAVA15_JAR) \
 
462
        $(VBOXWEB_GLUE_PYTHON)   \
 
463
        $(VBOXWEB_WS_PYTHON)     \
 
464
        $(VBOXWEB_WS_PERL)       \
 
465
        $(VBOXWEB_WS_PHP)        \
 
466
        $(VBOXWEB_PYTHONWSSAMPLE)
 
467
 
 
468
ifdef VBOX_WITH_OLD_JWS
 
469
  VBOXWEB_OTHERS               += \
 
470
        $(VBOXWEB_GLUE_JAVA_TMP)  \
 
471
        $(VBOXWEB_JAXWSSAMPLE)    \
 
472
        $(VBOXWEB_METRICSAMPLE)   \
 
473
        $(VBOXWEB_JAVA15_JAR)     \
400
474
        $(VBOXWEB_JAVA16_JAR)
 
475
endif
401
476
 
402
477
 #
403
478
 # Install sample code.
416
491
 
417
492
endif # VBOX_ONLY_SDK
418
493
 
419
 
VBOXWEB_WSDL                   = $(VBOX_PATH_SDK)/bindings/webservice/vboxweb.wsdl
420
 
VBOXWEBSERVICE_WSDL            = $(VBOX_PATH_SDK)/bindings/webservice/vboxwebService.wsdl
421
 
 
422
494
## @todo VBOXWEB_WSDL and VBOXWEBSERVICE_WSDL should be an install target.
423
495
VBOXWEB_OTHERS += \
424
496
        $(VBOXWEB_WSDL) \
428
500
# Update the OTHERS and OTHER_CLEAN lists with VBOXWEB_OTHERS and some more stuff.
429
501
#
430
502
# We can't just built up OTHERS and append it to OTHER_CLEAN because we're sharing
431
 
# OTHERS with all the other VBox makefiles (VBOX_SINGLE_MAKEFILE), thus VBOXWEB_OTHERS.
 
503
# OTHERS with all the other VBox makefiles, thus VBOXWEB_OTHERS.
432
504
#
433
505
OTHERS += $(VBOXWEB_OTHERS)
434
506
OTHER_CLEAN += \
436
508
        $(VBOXWEB_TYPEMAP) \
437
509
        $(VBOXWEB_IDL_SRC)
438
510
 
439
 
 
440
511
# generate platform-specific XIDL file from original XIDL file
441
512
$(VBOXWEB_IDL_SRC): $(VBOXWEB_IDL_SRC_ORIG) $(VBOX_PATH_WEBSERVICE)/platform-xidl.xsl | $$(dir $$@)
442
513
        $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using platform-xidl.xsl)
489
560
        $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $<
490
561
 
491
562
# generate gsoap pseudo-C header file from that WSDL; once via XSLT...
492
 
# $(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 $$@)
493
 
#       $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-gsoapH.xsl)
494
 
#       $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-gsoapH.xsl $<
495
563
$(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
496
564
        $(call MSG_GENERATE,,$@,$(VBOXWEB_WSDL) using websrv-wsdl2gsoapH.xsl)
497
565
        $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $<
502
570
        $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-nsmap.xsl)
503
571
        $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $<
504
572
 
505
 
 
506
 
 
507
573
ifdef VBOX_GSOAP_INSTALLED
508
574
# ... and once with the gSOAP tool (just for comparison, we don't use it for licensing reasons)
509
575
$(VBOXWEB_GSOAPH_FROM_GSOAP): $(VBOXWEB_WSDL) $(VBOXWEB_TYPEMAP) | $$(dir $$@)
510
576
        $(call MSG_GENERATE,,$@,)
511
577
        $(VBOX_WSDL2H) $(VBOXWEB_WSDL_VERBOSE) -t$(VBOXWEB_TYPEMAP) -nvbox -o $@ $<
512
578
 
 
579
# this sets the gsoap header that we use for further compilation; if stuff works, then the
 
580
# one we generate via XSLT produces the same end result as the one from the gSOAP tool;
 
581
# with this variable we can swap for testing, but shipped code must use VBOXWEB_GSOAPH_FROM_XSLT
513
582
GSOAPH_RELEVANT = $(VBOXWEB_GSOAPH_FROM_XSLT)
514
583
 
515
584
# wsdl2h -v: verbose
528
597
: $(VBOXWEB_GSOAPH_FROM_GSOAP) $(VBOXWEB_GSOAPH_FROM_XSLT) $(NSMAP) $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
529
598
        $(call MSG_GENERATE,,lots of files,$(GSOAPH_RELEVANT))
530
599
        $(RM) -f $@
531
 
        $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
 
600
        $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -2 -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
532
601
        $(APPEND) $@ done
533
602
 
534
 
# copy the generated headers and stuff. This has to be a seperate rule if we
 
603
# copy the generated headers and stuff. This has to be a separate rule if we
535
604
# want to use wildcard (all commands are expaned when the rule is evaluated).
536
605
$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
537
606
        $(RM) -f $@
578
647
+ $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
579
648
+ $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
580
649
+ $(VBOXWEB_OUT_DIR)/soapC-20.cpp \
581
 
: $(VBOXWEB_OUT_DIR)/soapC.cpp $$(TARGET_split-soapC) | $$(dir $$@)
 
650
: $(VBOXWEB_OUT_DIR)/soapC.cpp $$(split-soapC_1_TARGET) | $$(dir $$@)
582
651
        $(RM) -f $(wildcard $(VBOXWEB_OUT_DIR)/soapC-?.cpp $(VBOXWEB_OUT_DIR)/soapC-??.cpp)
583
 
        $(TARGET_split-soapC) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR) 20
 
652
        $(split-soapC_1_TARGET) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR) 20
584
653
endif # !VBOX_WITHOUT_SPLIT_SOAPC
585
654
 
586
655
endif # VBOX_GSOAP_INSTALLED
608
677
                $(VBOXWEB_IDL_SRC) \
609
678
                $(VBOX_PATH_WEBSERVICE)/glue-jaxws.xsl \
610
679
                $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl \
611
 
                $(VBOX_FILESPLIT) \
612
 
                $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
 
680
                $(RECOMPILE_ON_MAKEFILE_CURRENT) \
 
681
                | $$(dir $$@) \
 
682
                $(VBOX_FILESPLIT)
613
683
        $(QUIET)$(MKDIR) -p $(@D)
614
684
        $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using glue-jaxws.xsl)
615
685
        $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) \