[PATCH] allow Package to install to other dir than $OUTDIR
David Tardon (via Code Review)
gerrit at gerrit.libreoffice.org
Wed Apr 3 08:50:51 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3189
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/89/3189/1
allow Package to install to other dir than $OUTDIR
This is preparatory work for creating installation directly by gbuild.
Change-Id: I1b11db37c76ff781731845650169f39cb78fe820
---
M config_host.mk.in
M configure.ac
M solenv/gbuild/Package.mk
M solenv/gbuild/TargetLocations.mk
4 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/config_host.mk.in b/config_host.mk.in
index 08fc52c9..48f9006 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -248,6 +248,7 @@
export ILIB=@ILIB@
export INPATH=@INPATH@
export INPATH_FOR_BUILD=@INPATH_FOR_BUILD@
+export INSTDIR=@INSTDIR@
export INSTALLDIR=@INSTALLDIR@
export INSTALLDIRNAME=@INSTALLDIRNAME@
export INTRO_BITMAP=@INTRO_BITMAP@
diff --git a/configure.ac b/configure.ac
index 66a5966..37197df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3967,11 +3967,14 @@
# IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
if echo ${formatted_path} | $GREP -q '/$'; then
WORKDIR=${formatted_path}workdir/${INPATH}
+ INSTDIR=${formatted_path}instdir/${INPATH}
else
WORKDIR=${formatted_path}/workdir/${INPATH}
+ INSTDIR=${formatted_path}/instdir/${INPATH}
fi
else
WORKDIR=${BUILDDIR}/workdir/${INPATH}
+ INSTDIR=${BUILDDIR}/instdir/${INPATH}
fi
OUTDIR="${SOLARVER}/${INPATH}"
SOLARINC="-I. -I${SOLARVER}/$INPATH/inc/external -I${SOLARVER}/$INPATH/inc -I$SRC_ROOT/solenv/inc $SOLARINC"
@@ -3984,6 +3987,7 @@
AC_SUBST(GUI)
AC_SUBST(GUIBASE)
AC_SUBST(INPATH)
+AC_SUBST([INSTDIR])
AC_SUBST(OS)
AC_SUBST(OUTDIR)
AC_SUBST(OUTPATH)
diff --git a/solenv/gbuild/Package.mk b/solenv/gbuild/Package.mk
index 6642a89..c239897 100644
--- a/solenv/gbuild/Package.mk
+++ b/solenv/gbuild/Package.mk
@@ -44,10 +44,13 @@
$(foreach destination,$(call gb_PackagePart_get_destinations),$(eval \
$(call gb_PackagePart__rule,$(destination))))
+# Deliver one file to the output dir.
+#
+# gb_PackagePart_PackagePart destfile source prep-target outdir
define gb_PackagePart_PackagePart
-$(OUTDIR)/$(1) : $(2) | $(dir $(OUTDIR)/$(1)).dir
+$(4)/$(1) : $(2) | $(dir $(4)/$(1)).dir
$(2) :| $(3)
-$(call gb_Deliver_add_deliverable,$(OUTDIR)/$(1),$(2),$(3))
+$(call gb_Deliver_add_deliverable,$(4)/$(1),$(2),$(3))
endef
@@ -70,6 +73,7 @@
# for other targets that want to create Packages, does not register at Module
define gb_Package_Package_internal
gb_Package_SOURCEDIR_$(1) := $(2)
+gb_Package_OUTDIR_$(1) := $(OUTDIR)
$(call gb_Package_get_clean_target,$(1)) : FILES := $(call gb_Package_get_target,$(1)) $(call gb_Package_get_preparation_target,$(1))
$(call gb_Package_get_target,$(1)) : $(call gb_Package_get_preparation_target,$(1))
@@ -83,10 +87,20 @@
endef
+# Set output dir for the package files.
+#
+# Default is $(OUTDIR).
+#
+# gb_Package_set_outdir package outdir
+define gb_Package_set_outdir
+gb_Package_OUTDIR_$(1) := $(2)
+
+endef
+
define gb_Package_add_file
-$(call gb_Package_get_target,$(1)) : $(OUTDIR)/$(2)
-$(call gb_Package_get_clean_target,$(1)) : FILES += $(OUTDIR)/$(2)
-$(call gb_PackagePart_PackagePart,$(2),$$(gb_Package_SOURCEDIR_$(1))/$(3),$(call gb_Package_get_preparation_target,$(1)))
+$(call gb_Package_get_target,$(1)) : $$(gb_Package_OUTDIR_$(1))/$(2)
+$(call gb_Package_get_clean_target,$(1)) : FILES += $$(gb_Package_OUTDIR_$(1))/$(2)
+$(call gb_PackagePart_PackagePart,$(2),$$(gb_Package_SOURCEDIR_$(1))/$(3),$(call gb_Package_get_preparation_target,$(1)),$$(gb_Package_OUTDIR_$(1)))
endef
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index b738b65..a8cf8a4 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -39,6 +39,7 @@
gb_HelpTarget_get_outdir_target = $(OUTDIR)/pck/$(1).zip
gb_Pagein_get_outdir_target = $(OUTDIR)/bin/pagein-$(1)
gb_PackagePart_get_destinations = \
+ $(INSTDIR) \
$(OUTDIR)/bin \
$(OUTDIR)/inc \
$(OUTDIR)/lib \
--
To view, visit https://gerrit.libreoffice.org/3189
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b11db37c76ff781731845650169f39cb78fe820
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: David Tardon <dtardon at redhat.com>
More information about the LibreOffice
mailing list