summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2012-10-07 08:49:26 +0200
committerDavid Tardon <dtardon@redhat.com>2012-10-07 10:42:05 +0200
commit86f4727920ae515987005e3c414f1d6056079be1 (patch)
treebe26c544920703ae34b040fdcc7f2add4c9b1ea2
parent5d83f67e060cb540345463d1762cc87d282e9566 (diff)
move selection of UNO header variant to platform
Change-Id: Ic06deb22da77428ef88c1071af5d7b8bf9dc77f7
-rw-r--r--solenv/gbuild/TargetLocations.mk18
-rw-r--r--solenv/gbuild/UnoApiTarget.mk116
-rw-r--r--solenv/gbuild/platform/IOS_ARM_GCC.mk8
-rw-r--r--solenv/gbuild/platform/WNT_INTEL_GCC.mk8
-rw-r--r--solenv/gbuild/platform/WNT_INTEL_MSC.mk8
-rw-r--r--solenv/gbuild/platform/macosx.mk12
-rw-r--r--solenv/gbuild/platform/solaris.mk8
-rw-r--r--solenv/gbuild/platform/unxgcc.mk8
8 files changed, 121 insertions, 65 deletions
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 785df59e43d7..514c7f361807 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -163,12 +163,18 @@ gb_UITarget_get_target = $(WORKDIR)/UITarget/$(1).done
gb_UnoApiTarget_get_external_headers_target = $(WORKDIR)/UnoApiTarget/$(1).external
gb_UnoApiTarget_get_headers_target = $(WORKDIR)/UnoApiTarget/$(1).headers
gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).rdb
-gb_UnoApiHeadersTarget_get_bootstrap_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/bootstrap
-gb_UnoApiHeadersTarget_get_comprehensive_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive
-gb_UnoApiHeadersTarget_get_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/normal
-gb_UnoApiHeadersTarget_get_bootstrap_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/bootstrap.done
-gb_UnoApiHeadersTarget_get_comprehensive_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive.done
-gb_UnoApiHeadersTarget_get_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/normal.done
+gb_UnoApiHeadersTarget_get_bootstrap_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),bootstrap)
+gb_UnoApiHeadersTarget_get_comprehensive_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),comprehensive)
+gb_UnoApiHeadersTarget_get_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),normal)
+gb_UnoApiHeadersTarget_get_real_bootstrap_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/bootstrap
+gb_UnoApiHeadersTarget_get_real_comprehensive_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive
+gb_UnoApiHeadersTarget_get_real_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/normal
+gb_UnoApiHeadersTarget_get_real_bootstrap_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/bootstrap.done
+gb_UnoApiHeadersTarget_get_real_comprehensive_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive.done
+gb_UnoApiHeadersTarget_get_real_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/normal.done
+gb_UnoApiHeadersTarget_get_bootstrap_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),bootstrap).done
+gb_UnoApiHeadersTarget_get_comprehensive_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),comprehensive).done
+gb_UnoApiHeadersTarget_get_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),normal).done
gb_UnoApiPartTarget_get_target = $(WORKDIR)/UnoApiPartTarget/$(1)
gb_UnpackedTarball_get_dir = $(WORKDIR)/UnpackedTarball/$(1)
gb_UnpackedTarball_get_pristine_dir = $(WORKDIR)/UnpackedTarball/$(1).org
diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk
index f4b6781b5c42..022f3941e312 100644
--- a/solenv/gbuild/UnoApiTarget.mk
+++ b/solenv/gbuild/UnoApiTarget.mk
@@ -253,6 +253,43 @@ 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
+# define gb_UnoApiHeadersTarget_select_variant
+
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)
@@ -268,71 +305,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.)
-
-# We are experimenting with static linking on Android, too. There for
-# technical reasons to get around silly limitations in the OS, sigh.
-
-ifeq ($(DISABLE_DYNLOADING),TRUE)
-gb_UnoApiHeadersTarget_UDKAPI_always_comprehensive = TRUE
-endif
-
-# It seems that when using the latest Xcode and Clang for OS X, we
-# also neeed to always generate comprehensive headers for
-# udkapi. Otherwise we get assertion failures in saxparser when doing
-# i18npool, at least.
-
-ifeq ($(OS),MACOSX)
-ifeq ($(COM_GCC_IS_CLANG),TRUE)
-gb_UnoApiHeadersTarget_UDKAPI_always_comprehensive = TRUE
-endif
-endif
-
-
-$(call gb_UnoApiHeadersTarget_get_bootstrap_target,%) : \
+$(call gb_UnoApiHeadersTarget_get_real_bootstrap_target,%) : \
$(gb_UnoApiHeadersTarget_CPPUMAKERTARGET)
- $(if $(filter TRUEudkapi,$(gb_UnoApiHeadersTarget_UDKAPI_always_comprehensive)$*), \
- $(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,$(gb_UnoApiHeadersTarget_UDKAPI_always_comprehensive)$*), \
- $(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))
@@ -347,22 +345,22 @@ $(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 :
+$(call gb_UnoApiHeadersTarget_get_real_comprehensive_dir,$(1))/%.hdl :
mkdir -p `dirname $$@` && touch $$@
-$(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$(1))/%.hpp :
+$(call gb_UnoApiHeadersTarget_get_real_comprehensive_dir,$(1))/%.hpp :
mkdir -p `dirname $$@` && touch $$@
endef
diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index fb4ba18a8dc0..c7d40d34bed9 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -318,6 +318,14 @@ gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE
gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
+# UnoApiHeadersTarget class
+
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
+else
+gb_UnoApiHeadersTarget_select_variant = $(2)
+endif
+
# Python
gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib
diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
index 427c622326ad..46f4e70d2462 100644
--- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
@@ -420,6 +420,14 @@ gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/license.txt
gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
+# UnoApiHeadersTarget class
+
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
+else
+gb_UnoApiHeadersTarget_select_variant = $(2)
+endif
+
# Python
gb_PYTHON_PRECOMMAND := PATH="$${PATH}:$(OUTDIR_FOR_BUILD)/bin" PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload"
diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
index a232b661eb93..9683de9ec935 100644
--- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
@@ -713,6 +713,14 @@ gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/license.txt
gb_UnpackedTarget_TARFILE_LOCATION := $(shell cygpath -u $(TARFILE_LOCATION))
+# UnoApiHeadersTarget class
+
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
+else
+gb_UnoApiHeadersTarget_select_variant = $(2)
+endif
+
# Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload"
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index ecb7d71076ff..c013bf57ab96 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -409,6 +409,18 @@ gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE
gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
+# UnoApiHeadersTarget class
+
+# It seems that when using the latest Xcode and Clang for OS X, we
+# also neeed to always generate comprehensive headers for
+# udkapi. Otherwise we get assertion failures in saxparser when doing
+# i18npool, at least.
+ifneq ($(filter TRUE,$(COM_GCC_IS_CLANG) $(DISABLE_DYNLOADING)),)
+gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
+else
+gb_UnoApiHeadersTarget_select_variant = $(2)
+endif
+
# Python
gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 6c0bded557d8..2abac87c6b4c 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -400,6 +400,14 @@ gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE
gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
+# UnoApiHeadersTarget class
+
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
+else
+gb_UnoApiHeadersTarget_select_variant = $(2)
+endif
+
# Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 73a354cc63ea..2b0612080a3b 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -402,6 +402,14 @@ gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE
gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
+# UnoApiHeadersTarget class
+
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
+else
+gb_UnoApiHeadersTarget_select_variant = $(2)
+endif
+
# Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload