[PATCH] use Package for unowinreg

David Tardon (via Code Review) gerrit at gerrit.libreoffice.org
Sun Apr 21 09:16:07 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3531

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/31/3531/1

use Package for unowinreg

Change-Id: I7546e8938ba41e1462e704bd0405c5a887151d7b
---
M odk/CustomTarget_check.mk
M odk/CustomTarget_classes.mk
M odk/CustomTarget_unowinreg.mk
M odk/Module_odk.mk
A odk/Package_unowinreg.mk
M odk/Zip_uno_loader_classes.mk
M scp2/source/sdkoo/module_sdkoo.scp
M scp2/source/sdkoo/sdkoo.scp
8 files changed, 42 insertions(+), 20 deletions(-)



diff --git a/odk/CustomTarget_check.mk b/odk/CustomTarget_check.mk
index 15a651a..29b2776 100644
--- a/odk/CustomTarget_check.mk
+++ b/odk/CustomTarget_check.mk
@@ -30,6 +30,7 @@
 		$(call gb_Package_get_target,odk_bin) \
 		$(if $(filter WNT,$(OS)),$(call gb_Package_get_target,odk_cli)) \
 		$(if $(filter MACOSX,$(OS)),macosx,$(call gb_Package_get_target,odk_macosx)) \
+		$(if $(SOLAR_JAVA),$(call gb_Package_get_target,odk_unowinreg)) \
 		$(call gb_CustomTarget_get_target,odk/odkcommon)
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CHK,1)
 	touch $@
diff --git a/odk/CustomTarget_classes.mk b/odk/CustomTarget_classes.mk
index b009a58..ad59a4a 100644
--- a/odk/CustomTarget_classes.mk
+++ b/odk/CustomTarget_classes.mk
@@ -28,11 +28,4 @@
 	cp -a $(call gb_JavaClassSet_get_classdir,loader)/com $(dir $@)
 	touch $@
 
-odkcommon_ZIPLIST += classes/win/unowinreg.dll
-$(eval $(call gb_CustomTarget_register_target,odk/odkcommon/classes,win/unowinreg.dll))
-$(odk_WORKDIR)/classes/win/unowinreg.dll: $(call gb_CustomTarget_get_workdir,odk/unowinreg)/unowinreg.dll
-	mkdir -p $(dir $@)
-	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,CPY,1)
-	cp $< $@
-
 # vim: set noet sw=4 ts=4:
diff --git a/odk/CustomTarget_unowinreg.mk b/odk/CustomTarget_unowinreg.mk
index 76fe2f9..3a46ddf 100644
--- a/odk/CustomTarget_unowinreg.mk
+++ b/odk/CustomTarget_unowinreg.mk
@@ -11,11 +11,6 @@
 
 $(eval $(call gb_CustomTarget_register_target,odk/unowinreg,unowinreg.dll))
 
-ifeq ($(BUILD_UNOWINREG),YES)
-ifeq ($(COM),MSC)
-$(call gb_CustomTarget_get_workdir,odk/unowinreg)/unowinreg.dll: $(call gb_Library_get_target,unowinreg)
-	cp $< $@
-else # COM=GCC
 $(call gb_CustomTarget_get_workdir,odk/unowinreg)/unowinreg.dll : \
 		$(SRCDIR)/odk/source/unowinreg/win/unowinreg.cxx
 	$(MINGWCXX) -Wall -D_JNI_IMPLEMENTATION_ \
@@ -25,12 +20,7 @@
 		-I$(JAVA_HOME)/include/bsd -I$(JAVA_HOME)/include/linux,\
 		$(if $(filter NETBSD,$(OS)),-I$(JAVA_HOME)/include/netbsd))) \
 		-shared -o $@ $< \
-		-Wl,--kill-at -lkernel32 -ladvapi32
+		-Wl,--kill-at -lkernel32 -ladvapi32 && \
 	$(MINGWSTRIP) $@
-endif
-else # BUILD_UNOWINREG=NO
-$(call gb_CustomTarget_get_workdir,odk/unowinreg)/unowinreg.dll: $(TARFILE_LOCATION)/$(UNOWINREG_DLL)
-	cp $< $@
-endif
 
 # vim: set noet sw=4 ts=4:
diff --git a/odk/Module_odk.mk b/odk/Module_odk.mk
index a7ccf52..531fdbe 100644
--- a/odk/Module_odk.mk
+++ b/odk/Module_odk.mk
@@ -30,10 +30,11 @@
 
 ifneq ($(SOLAR_JAVA),)
 $(eval $(call gb_Module_add_targets,odk,\
-	CustomTarget_unowinreg \
+	$(if $(filter YESGCC,$(BUILD_UNOWINREG)$(COM)),CustomTarget_unowinreg) \
 	CustomTarget_classes \
 	CustomTarget_javadoc \
 	$(if $(filter WNT,$(OS)),Library_unowinreg) \
+	Package_unowinreg \
 	Zip_uno_loader_classes \
 ))
 endif
diff --git a/odk/Package_unowinreg.mk b/odk/Package_unowinreg.mk
new file mode 100644
index 0000000..0fd0928
--- /dev/null
+++ b/odk/Package_unowinreg.mk
@@ -0,0 +1,28 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+ifeq ($(BUILD_UNOWINREG),YES)
+ifeq ($(COM),MSC)
+odk_unowinreg_DIR := $(OUTDIR)/bin
+else
+odk_unowinreg_DIR := $(call gb_CustomTarget_get_workdir,odk/unowinreg)
+endif
+odk_unowinreg_FILE := unowinreg.dll
+else # BUILD_UNOWINREG=NO
+odk_unowinreg_DIR := $(TARFILE_LOCATION)
+odk_unowinreg_FILE := $(UNOWINREG_DLL)
+endif
+
+$(eval $(call gb_Package_Package,odk_unowinreg,$(odk_unowinreg_DIR)))
+
+$(eval $(call gb_Package_set_outdir,odk_unowinreg,$(INSTDIR)))
+
+$(eval $(call gb_Package_add_file,odk_unowinreg,$(gb_Package_SDKDIRNAME)/classes/win/unowinreg.dll,$(odk_unowinreg_FILE)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/odk/Zip_uno_loader_classes.mk b/odk/Zip_uno_loader_classes.mk
index b22aa4d..6cf0bf1 100644
--- a/odk/Zip_uno_loader_classes.mk
+++ b/odk/Zip_uno_loader_classes.mk
@@ -13,7 +13,6 @@
 
 $(eval $(call gb_Zip_add_files,uno_loader_classes,\
 		com/sun/star/lib/loader \
-		win/unowinreg.dll \
 ))
 
 $(call gb_Zip_get_target,uno_loader_classes) : $(call gb_CustomTarget_get_target,odk/odkcommon/classes)
diff --git a/scp2/source/sdkoo/module_sdkoo.scp b/scp2/source/sdkoo/module_sdkoo.scp
index 28ab105..40316cc 100644
--- a/scp2/source/sdkoo/module_sdkoo.scp
+++ b/scp2/source/sdkoo/module_sdkoo.scp
@@ -37,6 +37,7 @@
         gid_File_Package_odk_bin,
         gid_File_Package_odk_cli,
         gid_File_Package_odk_macosx,
+        gid_File_Package_odk_unowinreg,
         gid_File_Zip_Odkexamples,
         gid_File_Zip_Odkcommon,
         gid_File_Zip_OdkIdl_udkapi,
diff --git a/scp2/source/sdkoo/sdkoo.scp b/scp2/source/sdkoo/sdkoo.scp
index 1c7f68f..4ad8f95 100644
--- a/scp2/source/sdkoo/sdkoo.scp
+++ b/scp2/source/sdkoo/sdkoo.scp
@@ -141,6 +141,15 @@
 End
 #endif
 
+#if defined(SOLAR_JAVA)
+File gid_File_Package_odk_unowinreg
+    TXT_FILE_BODY;
+    Dir = FILELIST_SDK_DIR;
+    Name = "odk_unowinreg.filelist";
+    Styles = (FILELIST,USE_INTERNAL_RIGHTS);
+End
+#endif
+
 File gid_File_Zip_Odkexamples
     TXT_FILE_BODY;
     Dir = FILELIST_SDK_DIR;

-- 
To view, visit https://gerrit.libreoffice.org/3531
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7546e8938ba41e1462e704bd0405c5a887151d7b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: David Tardon <dtardon at redhat.com>



More information about the LibreOffice mailing list