summaryrefslogtreecommitdiff
path: root/solenv/gbuild/UnoApiTarget.mk
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2012-10-13 17:41:05 +0200
committerAndras Timar <atimar@suse.com>2012-10-13 17:41:05 +0200
commite5ce011c3f32f53ef073aec5485450b2588b656a (patch)
tree8a838a53bcdd70cc3d4cdbca0ebe07504790952e /solenv/gbuild/UnoApiTarget.mk
parentc6b26144c93aa5222e4260c5b0ef45ce5bdc18d2 (diff)
parente74fc93e4aba7887e6a278cc44c4bc0962471065 (diff)
Merge branch 'master' into feature/killsdf
Conflicts: Makefile.top Module_tail_build.mk RepositoryExternal.mk RepositoryFixes.mk accessibility/source/standard/vclxaccessibletoolbox.cxx basic/source/uno/dlgcont.cxx connectivity/Library_ado.mk cross_tail_build/prj/build.lst desktop/source/offacc/acceptor.cxx filter/Library_PptImporter.mk filter/source/t602/filterenv.cxx i18npool/Library_textconv_dict.mk ooo.lst.in saxon/ExternalProject_saxon.mk saxon/build.xml sc/sdi/scalc.sdi sc/source/filter/xml/xmlstyli.cxx sc/source/ui/condformat/condformatdlg.cxx sc/source/ui/condformat/condformatmgr.cxx sc/source/ui/view/cellsh1.cxx sdext/source/pdfimport/misc/pwdinteract.cxx shell/qa/zip/makefile.mk shell/qa/zip/testimpl/makefile.mk solenv/gbuild/CppunitTest.mk solenv/gbuild/gbuild.mk solenv/gbuild/platform/android.mk solenv/gbuild/platform/com_GCC_defs.mk solenv/gbuild/platform/macosx.mk soltools/Executable_adjustvisibility.mk soltools/Executable_checkdll.mk soltools/Executable_cpp.mk soltools/Executable_javadep.mk soltools/Executable_makedepend.mk sw/qa/extras/rtfimport/rtfimport.cxx tail_build/prj/build.lst tomcat/ExternalProject_tomcat.mk ucb/source/ucp/webdav/webdavcontent.cxx xml2cmp/Executable_xml2cmp.mk
Diffstat (limited to 'solenv/gbuild/UnoApiTarget.mk')
-rw-r--r--solenv/gbuild/UnoApiTarget.mk161
1 files changed, 74 insertions, 87 deletions
diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk
index fd7a0a333a59..98734ab34b75 100644
--- a/solenv/gbuild/UnoApiTarget.mk
+++ b/solenv/gbuild/UnoApiTarget.mk
@@ -82,46 +82,25 @@ endif
# UnoApiTarget
-gb_UnoApiTarget_RDBMAKERTARGET := $(call gb_Executable_get_target_for_build,rdbmaker)
-gb_UnoApiTarget_RDBMAKERCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_RDBMAKERTARGET)
gb_UnoApiTarget_REGCOMPARETARGET := $(call gb_Executable_get_target_for_build,regcompare)
gb_UnoApiTarget_REGCOMPARECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGCOMPARETARGET)
gb_UnoApiTarget_REGMERGETARGET := $(call gb_Executable_get_target_for_build,regmerge)
gb_UnoApiTarget_REGMERGECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGMERGETARGET)
-gb_UnoApiTarget_XML2CMPTARGET := $(call gb_Executable_get_target_for_build,xml2cmp)
-gb_UnoApiTarget_XML2CMPCOMMAND := $(gb_Helper_set_ld_path) $(gb_UnoApiTarget_XML2CMPTARGET)
-gb_UnoApiTarget_XMLRDB := $(call gb_UnoApiTarget_get_target,types)
-
-define gb_UnoApiTarget__get_types
-$(if $(1),$(foreach type,$(shell $(gb_UnoApiTarget_XML2CMPCOMMAND) -types stdout $(1)),$(addprefix -T,$(type))))
-endef
+gb_UnoApiTarget_TYPESRDB := $(call gb_UnoApiTarget_get_target,types)
define gb_UnoApiTarget__command_impl
-RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(2)) && \
-$(1) @$${RESPONSEFILE} && \
+RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(1) $(2) $(3)) && \
+$(gb_UnoApiTarget_REGMERGECOMMAND) @$${RESPONSEFILE} && \
rm -f $${RESPONSEFILE}
endef
-define gb_UnoApiTarget__regmerge_command_impl
-$(call gb_UnoApiTarget__command_impl,$(gb_UnoApiTarget_REGMERGECOMMAND),$(1) $(2) $(3))
-endef
-
-define gb_UnoApiTarget__rdbmaker_command_impl
-$(call gb_UnoApiTarget__command_impl,$(gb_UnoApiTarget_RDBMAKERCOMMAND),-O$(1) -B$(2) -b$(3) $(4) $(5))
-endef
-
define gb_UnoApiTarget__command
-$(call gb_Output_announce,$*,$(true),UNO,4)
+$(call gb_Output_announce,$(2),$(true),UNO,4)
mkdir -p $(dir $(1)) && \
-$(if $(UNOAPI_FILES),\
- $(call gb_UnoApiTarget__regmerge_command_impl,$(1),$(UNOAPI_ROOT),$(UNOAPI_FILES)),\
- $(if $(UNOAPI_MERGE),\
- $(call gb_UnoApiTarget__regmerge_command_impl,$(1),$(UNOAPI_ROOT),$(UNOAPI_MERGE)),\
- $(call gb_UnoApiTarget__rdbmaker_command_impl,$(1),UCR,$(UNOAPI_ROOT),\
- $(call gb_UnoApiTarget__get_types,$(UNOAPI_XML)),$(gb_UnoApiTarget_XMLRDB)))) \
+$(call gb_UnoApiTarget__command_impl,$(1),$(UNOAPI_ROOT),$(if $(UNOAPI_FILES),$(UNOAPI_FILES),$(UNOAPI_MERGE))) \
$(if $(UNOAPI_REFERENCE), \
- $(call gb_Output_announce,$*,$(true),DBc,3) \
+ $(call gb_Output_announce,$(2),$(true),DBc,3) \
&& $(gb_UnoApiTarget_REGCOMPARECOMMAND) \
-f -t \
-r1 $(UNOAPI_REFERENCE) \
@@ -129,11 +108,11 @@ $(if $(UNOAPI_REFERENCE), \
endef
define gb_UnoApiTarget__check_mode
-$(if $(or $(and $(1),$(2),$(3)),$(and $(1),$(2)),$(and $(2),$(3)),$(and $(1),$(3))),\
- $(error More than one mode of function of UnoApiTarget used: this is not supported),\
- $(if $(or $(1),$(2),$(3)),,\
- $(error Neither IDL files nor merged RDBs nor XML desc. were used: nothing will be produced)))
-$(if $(4),,$(error No root has been set for the rdb file))
+$(if $(and $(UNOAPI_FILES),$(UNOAPI_MERGE)),\
+ $(error Both IDL files and merged RDBs were used: this is not supported))
+$(if $(or $(UNOAPI_FILES),$(UNOAPI_MERGE)),,\
+ $(error Neither IDL files nor merged RDBs were used: nothing will be produced))
+$(if $(UNOAPI_ROOT),,$(error No root has been set for the rdb file))
endef
$(call gb_UnoApiTarget_get_external_headers_target,%) :
@@ -143,7 +122,7 @@ $(call gb_UnoApiTarget_get_headers_target,%) : $(call gb_UnoApiTarget_get_extern
mkdir -p $(dir $@) && touch $@
$(call gb_UnoApiTarget_get_target,%) :
- $(call gb_UnoApiTarget__check_mode,$(UNOAPI_FILES),$(UNOAPI_MERGE),$(UNOAPI_XML),$(UNOAPI_ROOT))
+ $(call gb_UnoApiTarget__check_mode)
$(call gb_UnoApiTarget__command,$@,$*)
.PHONY : $(call gb_UnoApiTarget_get_clean_target,%)
@@ -180,7 +159,6 @@ define gb_UnoApiTarget_UnoApiTarget
$(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE :=
$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_FILES :=
$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_MERGE :=
-$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_XML :=
$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_REFERENCE :=
$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_ROOT :=
@@ -253,16 +231,6 @@ $(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(2)
endef
-# Set XML component dependencies description.
-define gb_UnoApiTarget_set_xmlfile
-$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_XML := $(SRCDIR)/$(2)
-$(call gb_UnoApiTarget_get_target,$(1)) : $(SRCDIR)/$(2)
-$(call gb_UnoApiTarget_get_target,$(1)) : $(gb_UnoApiTarget_XMLRDB)
-$(call gb_UnoApiTarget_get_target,$(1)) : $(gb_UnoApiTarget_XML2CMPTARGET)
-$(call gb_UnoApiTarget_get_target,$(1)) : $(gb_UnoApiTarget_RDBMAKERTARGET)
-
-endef
-
define gb_UnoApiTarget_add_reference_rdbfile
$$(call gb_Output_error,gb_UnoApiTarget_add_reference_rdbfile: use gb_UnoApiTarget_set_reference_rdbfile instead.)
endef
@@ -285,6 +253,45 @@ endef
# UnoApiHeadersTarget
+# defined by platform
+# gb_UnoApiHeadersTarget_select_variant
+
+# Allow to redefine header variant.
+#
+# On iOS we use static linking because dynamic loading of own code
+# isn't allowed by the iOS App Store rules, and we want our code to be
+# eventually distributable there as part of apps.
+#
+# To avoid problems that this causes together with the lovely
+# intentional breaking of the One Definition Rule, for iOS we always
+# generate comprehensive headers for certain type RDBS. (The ODR
+# breakage doesn't harm, by accident or careful design, on platforms
+# where shared libraries are used.) To avoid generating the same headers
+# more than once, we are silently "redirecting" the target to point to
+# comprehensive headers instead.
+#
+# Example:
+# If gb_UnoApiHeadersTarget_select_variant is defined as
+#
+# ifeq ($(DISABLE_DYNLOADING),YES)
+# gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
+# else
+# gb_UnoApiHeadersTarget_select_variant = $(2)
+# endif
+#
+# then, for the DISABLE_DYNLOADING case, whenever a makefile uses
+# $(call gb_UnoApiHeadersTarget_get_target,udkapi) or $(call
+# gb_UnoApiHeadersTarget_get_dir,udkapi), it will get target or dir for
+# comprehensive headers instead.
+#
+# We are experimenting with static linking on Android, too. There for
+# technical reasons to get around silly limitations in the OS, sigh.
+#
+# gb_UnoApiHeadersTarget_select_variant api default-variant
+ifeq ($(origin gb_UnoApiHeadersTarget_select_variant),undefined)
+$(eval $(call gb_Output_error,gb_UnoApiHeadersTarget_select_variant must be defined by platform))
+endif
+
gb_UnoApiHeadersTarget_CPPUMAKERTARGET := $(call gb_Executable_get_target_for_build,cppumaker)
gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiHeadersTarget_CPPUMAKERTARGET)
@@ -300,52 +307,32 @@ define gb_UnoApiHeadersTarget__command
endef
-# On iOS we use static linking because dynamic loading of own code
-# isn't allowed by the iOS App Store rules, and we want our code to be
-# eventually distributable there as part of apps.
-
-# To avoid problems that this causes together with the lovely
-# intentional breaking of the One Definition Rule, for iOS we always
-# generate comprehensive headers for udkapi. (The ODR breakage doesn't
-# harm, by accident or careful design, on platforms where shared
-# libraries are used.)
-
-$(call gb_UnoApiHeadersTarget_get_bootstrap_target,%) : \
+$(call gb_UnoApiHeadersTarget_get_real_bootstrap_target,%) : \
$(gb_UnoApiHeadersTarget_CPPUMAKERTARGET)
- $(if $(filter TRUEudkapi,$(DISABLE_DYNLOADING)$*), \
- $(call gb_Output_announce,$*,$(true),HPB,3) \
- $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_bootstrap_dir,$*),-C), \
- \
- $(call gb_Output_announce,$*,$(true),HPB,3) \
- $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_bootstrap_dir,$*)) \
- )
-
-$(call gb_UnoApiHeadersTarget_get_comprehensive_target,%) : \
+ $(call gb_Output_announce,$*,$(true),HPB,3) \
+ $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_bootstrap_dir,$*))
+
+$(call gb_UnoApiHeadersTarget_get_real_comprehensive_target,%) : \
$(gb_UnoApiHeadersTarget_CPPUMAKERTARGET)
$(call gb_Output_announce,$*,$(true),HPC,3)
$(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$*),-C)
-$(call gb_UnoApiHeadersTarget_get_target,%) : \
+$(call gb_UnoApiHeadersTarget_get_real_target,%) : \
$(gb_UnoApiHeadersTarget_CPPUMAKERTARGET)
- $(if $(filter TRUEudkapi,$(DISABLE_DYNLOADING)$*), \
- $(call gb_Output_announce,$*,$(true),HPP,3) \
- $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_dir,$*),-C), \
- \
- $(call gb_Output_announce,$*,$(true),HPP,3) \
- $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_dir,$*),-L) \
- )
+ $(call gb_Output_announce,$*,$(true),HPP,3) \
+ $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_dir,$*),-L)
.PHONY : $(call gb_UnoApiHeadersTarget_get_clean_target,%)
$(call gb_UnoApiHeadersTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),HPP,3)
$(call gb_Helper_abbreviate_dirs,\
rm -rf \
- $(call gb_UnoApiHeadersTarget_get_dir,$*) \
- $(call gb_UnoApiHeadersTarget_get_bootstrap_dir,$*) \
- $(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$*) \
- $(call gb_UnoApiHeadersTarget_get_target,$*) \
- $(call gb_UnoApiHeadersTarget_get_bootstrap_target,$*)) \
- $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$*)
+ $(call gb_UnoApiHeadersTarget_get_real_dir,$*) \
+ $(call gb_UnoApiHeadersTarget_get_real_bootstrap_dir,$*) \
+ $(call gb_UnoApiHeadersTarget_get_real_comprehensive_dir,$*) \
+ $(call gb_UnoApiHeadersTarget_get_real_target,$*) \
+ $(call gb_UnoApiHeadersTarget_get_real_bootstrap_target,$*)) \
+ $(call gb_UnoApiHeadersTarget_get_real_comprehensive_target,$*)
define gb_UnoApiHeadersTarget_UnoApiHeadersTarget
$(call gb_UnoApiHeadersTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1))
@@ -360,29 +347,29 @@ $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$(1)) : UNOAPI_DEPS :=
# need dummy recipes so that header files are delivered in Package_inc;
# otherwise make will consider the header to be up-to-date because it was
# actually built by the recipe for gb_UnoApiHeadersTarget_get_target
-$(call gb_UnoApiHeadersTarget_get_dir,$(1),/%.hdl) :
+$(call gb_UnoApiHeadersTarget_get_real_dir,$(1))/%.hdl :
touch $$@
-$(call gb_UnoApiHeadersTarget_get_dir,$(1),/%.hpp) :
+$(call gb_UnoApiHeadersTarget_get_real_dir,$(1))/%.hpp :
touch $$@
-$(call gb_UnoApiHeadersTarget_get_bootstrap_dir,$(1),/%.hdl) :
+$(call gb_UnoApiHeadersTarget_get_real_bootstrap_dir,$(1))/%.hdl :
touch $$@
-$(call gb_UnoApiHeadersTarget_get_bootstrap_dir,$(1),/%.hpp) :
+$(call gb_UnoApiHeadersTarget_get_real_bootstrap_dir,$(1))/%.hpp :
touch $$@
-$(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$(1),/%.hdl) :
- touch $$@
+$(call gb_UnoApiHeadersTarget_get_real_comprehensive_dir,$(1))/%.hdl :
+ mkdir -p `dirname $$@` && touch $$@
-$(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$(1),/%.hpp) :
- touch $$@
+$(call gb_UnoApiHeadersTarget_get_real_comprehensive_dir,$(1))/%.hpp :
+ mkdir -p `dirname $$@` && touch $$@
endef
# ensure that new urd triggers the dummy rule to rebuild the headers
define gb_UnoApiHeadersTarget_add_headerfile
-$(call gb_UnoApiHeadersTarget_get_dir,$(1),/$(3)) : \
+$(call gb_UnoApiHeadersTarget_get_dir,$(1))/$(3) : \
$(call gb_UnoApiPartTarget_get_target,$(basename $(2)).urd)
endef