[Libreoffice-commits] core.git: Repository.mk scp2/AutoInstallLibs_ooo.mk scp2/InstallModule_ooo.mk scp2/Module_scp2.mk scp2/source solenv/gbuild

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Fri Feb 15 10:32:12 PST 2013


 Repository.mk                         |    7 +++++-
 scp2/AutoInstallLibs_ooo.mk           |   12 ++++++++++
 scp2/InstallModule_ooo.mk             |    2 +
 scp2/Module_scp2.mk                   |    1 
 scp2/source/ooo/file_library_ooo.scp  |    3 --
 scp2/source/ooo/module_hidden_ooo.scp |    2 -
 solenv/gbuild/AutoInstallLibs.mk      |   38 ++++++++++++++++++++++++++++++++++
 solenv/gbuild/Helper.mk               |   13 +++++++++++
 solenv/gbuild/InstallModule.mk        |    5 ++++
 solenv/gbuild/InstallModuleTarget.mk  |    7 +++++-
 solenv/gbuild/TargetLocations.mk      |    2 +
 solenv/gbuild/gbuild.mk               |    1 
 12 files changed, 88 insertions(+), 5 deletions(-)

New commits:
commit c743324292a9994e20353734846b5045199d8e93
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Wed Feb 13 23:38:59 2013 +0100

    Remove the need to manually register libs in scp2
    
    - we have all the needed information in gbuild
    - reduce the amount of double and triple bookkeeping
    - hopefully the generated files for scp2 are only a intermediate step
      and we can do whatever perl voodoo scp2 does directly in gbuild
    - currently using basctl as an example
    - this also means we have to be more strict in Repository.mk with what
      we register:
      - if we dont build a libs, it shouldnt be registered (otherwise scp2
        will want the nonexisting lib)
      - in the end, this is a Good Thing(tm): we dont want anyone trying to
        e.g. link against a lib we dont build
    - should now hopefully work on all platforms
    - added module bookkeeping to gbuild
    
    Change-Id: I241ca67edbfabae83859274f9aa35d2d26165ef6

diff --git a/Repository.mk b/Repository.mk
index d0307f5..a488a46 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -222,6 +222,12 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE, \
 
 endif
 
+ifeq ($(DISABLE_SCRIPTING),)
+$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,OOO, \
+    basctl \
+))
+endif
+
 $(eval $(call gb_Helper_register_libraries,OOOLIBS, \
     abp \
     acc \
@@ -231,7 +237,6 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \
     agg \
     analysis \
     animcore \
-    basctl \
     $(if $(filter $(OS),ANDROID),, \
 		basebmp \
     ) \
diff --git a/scp2/AutoInstallLibs_ooo.mk b/scp2/AutoInstallLibs_ooo.mk
new file mode 100644
index 0000000..c3544c2
--- /dev/null
+++ b/scp2/AutoInstallLibs_ooo.mk
@@ -0,0 +1,12 @@
+# -*- 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/.
+#
+
+$(eval $(call gb_AutoInstallLibs_AutoInstallLibs,ooo,OOO,STD_LIB_FILE(gid_File_Lib_$$(1)_auto_installed,$$(1))))
+
+# vim: set noet sw=4 ts=4:
diff --git a/scp2/InstallModule_ooo.mk b/scp2/InstallModule_ooo.mk
index 985865b..c1915b6 100644
--- a/scp2/InstallModule_ooo.mk
+++ b/scp2/InstallModule_ooo.mk
@@ -27,6 +27,8 @@
 
 $(eval $(call gb_InstallModule_InstallModule,scp2/ooo))
 
+$(eval $(call gb_InstallModule_use_auto_install_libs,scp2/ooo,ooolibs))
+
 $(eval $(call gb_InstallModule_define_if_set,scp2/ooo,\
 	DISABLE_ATL \
 	DISABLE_NEON \
diff --git a/scp2/Module_scp2.mk b/scp2/Module_scp2.mk
index 0339ec3..8052b91 100644
--- a/scp2/Module_scp2.mk
+++ b/scp2/Module_scp2.mk
@@ -28,6 +28,7 @@
 $(eval $(call gb_Module_Module,scp2))
 
 $(eval $(call gb_Module_add_targets,scp2,\
+	AutoInstallLibs_ooo \
 	CustomTarget_langmacros \
 	InstallModule_accessories \
 	InstallModule_base \
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index 8feb75d..2859a32 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -25,6 +25,7 @@
  *
  ************************************************************************/
 #include "macros.inc"
+#include "AutoInstallLibs/ooo"
 
 #if defined SOLAR_JAVA && defined WNT
 File gid_File_Lib_Accessbridge
@@ -41,8 +42,6 @@ STD_LIB_FILE( gid_File_Lib_Ado, ado)
 
 #ifndef DISABLE_SCRIPTING
 
-STD_LIB_FILE( gid_File_Lib_Basctl, basctl)
-
 File gid_File_Lib_Basprov
     LIB_FILE_BODY;
     Styles = (PACKED);
diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp
index 195a3fd..41124fc 100644
--- a/scp2/source/ooo/module_hidden_ooo.scp
+++ b/scp2/source/ooo/module_hidden_ooo.scp
@@ -180,6 +180,7 @@ Module gid_Module_Root_Files_4
 	gid_File_Filter_Ira,
 	gid_File_Filter_Itg,
 	gid_File_Filter_Iti,
+	gid_File_Lib_basctl_auto_installed,
 	gid_File_Lib_Bib,
 	gid_File_Lib_Chartcore,
 	gid_File_Lib_Chartcontroller,
@@ -255,7 +256,6 @@ Module gid_Module_Root_Files_4
 	gid_File_Lib_Vclplug_Kde,
 	gid_File_Lib_Vclplug_Kde4,
 	gid_File_Lib_Vclplug_Svp,
-	gid_File_Lib_Basctl,
 	gid_File_Lib_CanvasTools,
 	gid_File_Lib_CppCanvas,
 	gid_File_Lib_Fwm,
diff --git a/solenv/gbuild/AutoInstallLibs.mk b/solenv/gbuild/AutoInstallLibs.mk
new file mode 100644
index 0000000..d1b67f1
--- /dev/null
+++ b/solenv/gbuild/AutoInstallLibs.mk
@@ -0,0 +1,38 @@
+# -*- 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/.
+#
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+
+# AutoInstallLibs class
+
+$(dir $(call gb_AutoInstallLibs_get_target,%)).dir :
+	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+
+$(call gb_AutoInstallLibs_get_target,%) :
+	$(call gb_Output_announce,$*,$(true),AIL,3)
+	echo "/* autogenerated library installs for group $(INSTALLMODULE) */" > $@
+	$(call gb_Output_info,install module: $(INSTALLMODULE) contents: $(gb_Library_MODULE_$(INSTALLMODULE)))
+	$(foreach lib,$(gb_Library_MODULE_$(INSTALLMODULE)),\
+		echo "$(call SCP2TEMPLATE,$(lib))" >> $@)
+
+
+$(call gb_AutoInstallLibs_get_clean_target,%) :
+	$(call gb_Output_announce,$*,$(false),AIL,3)
+	rm -f $(call gb_AutoInstallLibs_get_target,$*)
+
+define gb_AutoInstallLibs_AutoInstallLibs
+$(call gb_AutoInstallLibs_get_target,$(1)) : $(gb_Helper_PHONY) | $(dir $(call gb_AutoInstallLibs_get_target,$(1))).dir
+$(call gb_AutoInstallLibs_get_target,$(1)) : INSTALLMODULE = $(2)
+$(call gb_AutoInstallLibs_get_target,$(1)) : SCP2TEMPLATE = $(3)
+
+$$(eval $$(call gb_Module_register_target,$(call gb_AutoInstallLibs_get_target,$(1)),$(call gb_AutoInstallLibs_get_clean_target,$(1))))
+$(call gb_Helper_make_userfriendly_targets,$(1),AutoInstallLibs)
+
+endef
+
+# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index d013d14..8f49e20 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -115,6 +115,7 @@ endef
 define gb_Helper_init_registries
 gb_Executable_VALIDGROUPS := UREBIN SDK OOO NONE
 gb_Library_VALIDGROUPS := OOOLIBS PLAINLIBS_NONE PLAINLIBS_URE PLAINLIBS_OOO RTLIBS RTVERLIBS UNOLIBS_URE UNOLIBS_OOO UNOVERLIBS EXTENSIONLIBS
+gb_Library_VALIDINSTALLMODULES := OOO
 gb_StaticLibrary_VALIDGROUPS := PLAINLIBS
 gb_Jar_VALIDGROUPS := URE OOO OXT
 
@@ -171,6 +172,18 @@ gb_Library_$(1) += $(2)
 
 endef
 
+# the first argument is the group, which sets rpaths etc.
+# the second argument is the install module, which describes in which distro package/msi a lib should show up
+define gb_Helper_register_libraries_for_install
+ifeq ($$(filter $(2),$$(gb_Library_VALIDINSTALLMODULES)),)
+$$(eval $$(call gb_Output_error,$(2) is not a valid install module for libraries. Valid groups are: $$(gb_Library_VALIDINSTALLMODULES)))
+endif
+$(call gb_Helper_register_libraries,$(1),$(3))
+
+gb_Library_MODULE_$(2) += $(3)
+
+endef
+
 define gb_Helper_register_static_libraries
 ifeq ($$(filter $(1),$$(gb_StaticLibrary_VALIDGROUPS)),)
 $$(eval $$(call gb_Output_error,$(1) is not a valid group for static libraries. Valid groups are: $$(gb_StaticLibrary_VALIDGROUPS)))
diff --git a/solenv/gbuild/InstallModule.mk b/solenv/gbuild/InstallModule.mk
index e172156..803511a 100644
--- a/solenv/gbuild/InstallModule.mk
+++ b/solenv/gbuild/InstallModule.mk
@@ -50,6 +50,11 @@ $(call gb_Helper_make_userfriendly_targets,$(1),InstallModule)
 
 endef
 
+define gb_InstallModule_use_auto_install_libs
+$(call gb_InstallModuleTarget_use_auto_install_libs,$(1),$(2))
+
+endef
+
 define gb_InstallModule_add_defs
 $(call gb_InstallModuleTarget_add_defs,$(1),$(2))
 
diff --git a/solenv/gbuild/InstallModuleTarget.mk b/solenv/gbuild/InstallModuleTarget.mk
index fca80c1..dbdd1d7 100644
--- a/solenv/gbuild/InstallModuleTarget.mk
+++ b/solenv/gbuild/InstallModuleTarget.mk
@@ -281,7 +281,7 @@ $(call gb_InstallModuleTarget_get_external_target,$(1)) :| \
 
 $(call gb_InstallModuleTarget_get_target,$(1)) : SCP_FILES :=
 $(call gb_InstallModuleTarget_get_target,$(1)) : SCP_DEFS :=
-$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_INCLUDE := -I$(SRCDIR)/scp2/inc
+$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_INCLUDE := -I$(SRCDIR)/scp2/inc -I$(WORKDIR)
 $(call gb_InstallModuleTarget_get_target,$(1)) : SCP_TEMPLATE_INCLUDE :=
 $(call gb_InstallModuleTarget_use_custom_headers,$(1),scp2/macros)
 
@@ -315,6 +315,11 @@ $(call gb_InstallModuleTarget_add_defs,$(1),\
 
 endef
 
+define gb_InstallModuleTarget_use_auto_install_libs
+$(call gb_InstallModuleTarget_get_external_target,$(1)) : $(call gb_AutoInstallLibs_get_target,$(2))
+
+endef
+
 define gb_InstallModuleTarget_use_custom_header
 $(call gb_InstallModuleTarget_get_external_target,$(1)) :| $(call gb_CustomTarget_get_target,$(2))
 $(call gb_InstallModuleTarget_get_target,$(1)) : SCP_INCLUDE += -I$(call gb_CustomTarget_get_workdir,$(2)) \
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 3887b53..0dbb6c1 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -83,6 +83,7 @@ endef
 
 # workdir target patterns
 
+gb_AutoInstallLibs_get_target = $(WORKDIR)/AutoInstallLibs/$(1)
 gb_AllLangResTarget_get_target = $(WORKDIR)/AllLangRes/$(1)
 gb_AllLangZip_get_target = $(WORKDIR)/AllLangZip/$(1)
 gb_AsmObject_get_target = $(WORKDIR)/AsmObject/$(1).o
@@ -237,6 +238,7 @@ $(patsubst $(1):%,$(WORKDIR)/Headers/StaticLibrary/%,$(filter $(1):%,$(gb_Static
 endef
 
 $(eval $(call gb_Helper_make_clean_targets,\
+	AutoInstallLibs \
 	AllLangResTarget \
 	AllLangZip \
 	CliAssembly \
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 090f5c3..9ef8d53 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -336,6 +336,7 @@ include $(foreach class, \
 	InstallModuleTarget \
 	InstallModule \
 	InstallScript \
+	AutoInstallLibs \
 ,$(GBUILDDIR)/$(class).mk)
 
 $(eval $(call gb_Helper_process_executable_registrations))


More information about the Libreoffice-commits mailing list