50 null derefs seen in crashreporting report
[LibreOffice.git] / instsetoo_native / CustomTarget_setup.mk
blobed27e27f8278abbd96beecd6b6e1b414c02025d0
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_CustomTarget_CustomTarget,instsetoo_native/setup))
12 $(eval $(call gb_CustomTarget_register_targets,instsetoo_native/setup,\
13 $(call gb_Helper_get_rcfile,bootstrap) \
14 $(call gb_Helper_get_rcfile,fundamental) \
15 $(call gb_Helper_get_rcfile,louno) \
16 $(if $(filter DESKTOP,$(BUILD_TYPE)),$(if $(filter-out MACOSX,$(OS)), \
17 $(call gb_Helper_get_rcfile,redirect))) \
18 $(call gb_Helper_get_rcfile,setup) \
19 $(call gb_Helper_get_rcfile,soffice) \
20 $(call gb_Helper_get_rcfile,uno) \
21 $(call gb_Helper_get_rcfile,version) \
22 $(call gb_Helper_get_rcfile,crashreport) \
25 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,bootstrap) \
26 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,fundamental) \
27 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,louno) \
28 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,redirect) \
29 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,setup) \
30 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,soffice) \
31 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,uno) \
32 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,version) \
33 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,crashreport) \
34 : $(SRCDIR)/instsetoo_native/CustomTarget_setup.mk
36 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,bootstrap) :
37 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
38 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
39 ( \
40 echo '[Bootstrap]' \
41 && echo 'InstallMode=<installmode>' \
42 && echo 'ProductKey=$(PRODUCTNAME) $(PRODUCTVERSION)' \
43 $(if $(ENABLE_RELEASE_BUILD),\
44 && echo 'UserInstallation=$$SYSUSERCONFIG/$(shell echo $(PRODUCTNAME) | sed -e 's/ /%20/g' $(if $(filter-out HAIKU MACOSX WNT,$(OS)),| tr "[:upper:]" "[:lower:]"))/4', \
45 && echo 'UserInstallation=$$ORIGIN/..') \
46 ) > $@
47 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
49 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,fundamental) :
50 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
51 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
52 ( \
53 echo '[Bootstrap]' \
54 && echo 'BRAND_BASE_DIR=$${ORIGIN}/..' \
55 && echo 'BRAND_INI_DIR=$${ORIGIN}' \
56 && echo 'BRAND_SHARE_SUBDIR=$(LIBO_SHARE_FOLDER)' \
57 && echo 'BRAND_SHARE_RESOURCE_SUBDIR=$(LIBO_SHARE_RESOURCE_FOLDER)' \
58 && echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry' \
59 'res:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry' \
60 $(if $(ENABLE_DCONF),'dconf:* ') \
61 $(if $(filter WNT,$(OS)),'winreg:LOCAL_MACHINE ') \
62 'bundledext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini' \
63 'sharedext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini' \
64 'userext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini' \
65 $(if $(filter WNT,$(OS)),'winreg:CURRENT_USER ') \
66 'user:!$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/registrymodifications.xcu' \
67 && echo 'LO_JAVA_DIR=$${BRAND_BASE_DIR}/$(LIBO_SHARE_JAVA_FOLDER)' \
68 && echo 'LO_LIB_DIR=$${BRAND_BASE_DIR}/$(LIBO_LIB_FOLDER)' \
69 && echo 'BAK_EXTENSIONS=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):TMP_EXTENSIONS}' \
70 && echo 'BUNDLED_EXTENSIONS=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):BUNDLED_EXTENSIONS}' \
71 && echo 'BUNDLED_EXTENSIONS_USER=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):BUNDLED_EXTENSIONS_USER}' \
72 && echo 'SHARED_EXTENSIONS_USER=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):SHARED_EXTENSIONS_USER}' \
73 && echo 'UNO_SHARED_PACKAGES_CACHE=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):UNO_SHARED_PACKAGES_CACHE}' \
74 && echo 'TMP_EXTENSIONS=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):TMP_EXTENSIONS}' \
75 && echo 'UNO_USER_PACKAGES_CACHE=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):UNO_USER_PACKAGES_CACHE}' \
76 && echo 'URE_BIN_DIR=$${BRAND_BASE_DIR}/$(LIBO_URE_BIN_FOLDER)' \
77 && echo 'URE_MORE_JAVA_CLASSPATH_URLS=$(if $(SYSTEM_HSQLDB),$(HSQLDB_JAR))' \
78 && echo 'URE_OVERRIDE_JAVA_JFW_SHARED_DATA=$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/config/javasettings_$${_OS}_$${_ARCH}.xml' \
79 && echo 'URE_OVERRIDE_JAVA_JFW_USER_DATA=$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/config/javasettings_$${_OS}_$${_ARCH}.xml' \
80 && echo 'URE_MORE_JAVA_TYPES=$${BRAND_BASE_DIR}/$(LIBO_SHARE_JAVA_FOLDER)/libreoffice.jar $${BRAND_BASE_DIR}/$(LIBO_SHARE_JAVA_FOLDER)/ScriptFramework.jar $${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_UserUnoFile}:UNO_JAVA_CLASSPATH} $${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_SharedUnoFile}:UNO_JAVA_CLASSPATH} $${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_BundledUnoFile}:UNO_JAVA_CLASSPATH}' \
81 && echo 'URE_MORE_SERVICES=$${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_UserUnoFile}:UNO_SERVICES} $${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_SharedUnoFile}:UNO_SERVICES} $${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_BundledUnoFile}:UNO_SERVICES} <$$ORIGIN/services>*' \
82 && echo 'URE_MORE_TYPES=<$$ORIGIN/types>* $${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_UserUnoFile}:UNO_TYPES} $${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_SharedUnoFile}:UNO_TYPES} $${$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):PKG_BundledUnoFile}:UNO_TYPES}' \
83 ) > $@
84 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
86 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,louno) :
87 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
88 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
89 ( \
90 echo '[Bootstrap]' \
91 && echo 'PKG_BundledUnoFile=$$BUNDLED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc' \
92 && echo 'PKG_SharedUnoFile=$$SHARED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc' \
93 && echo 'PKG_UserUnoFile=$$UNO_USER_PACKAGES_CACHE/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc' \
94 && echo 'BAK_EXTENSIONS=$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/extensions/bak' \
95 && echo 'BUNDLED_EXTENSIONS=$$BRAND_BASE_DIR/$(LIBO_SHARE_FOLDER)/extensions' \
96 && echo 'BUNDLED_EXTENSIONS_USER=$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/extensions/bundled' \
97 && echo 'TMP_EXTENSIONS=$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/extensions/tmp' \
98 && echo 'SHARED_EXTENSIONS_USER=$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/extensions/shared' \
99 && echo 'UNO_SHARED_PACKAGES=$$BRAND_BASE_DIR/$(LIBO_SHARE_FOLDER)/uno_packages' \
100 && echo 'UNO_SHARED_PACKAGES_CACHE=$$UNO_SHARED_PACKAGES/cache' \
101 && echo 'UNO_USER_PACKAGES=$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/uno_packages' \
102 && echo 'UNO_USER_PACKAGES_CACHE=$$UNO_USER_PACKAGES/cache' \
103 ) > $@
104 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
106 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,redirect) :
107 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
108 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
110 echo '[Bootstrap]' \
111 && echo 'URE_BOOTSTRAP=$${ORIGIN}/$(call gb_Helper_get_rcfile,fundamental)' \
112 ) > $@
113 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
115 .PHONY: $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,setup)
116 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,setup) :
117 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
118 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
120 echo '[Bootstrap]' \
121 && echo 'buildid=$(shell cd $(SRCDIR) && git log -1 --format=%H)' \
122 ) > $@
123 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
125 # for release-builds (building installers) adjust values in openoffice.lst.in
126 # Added 'SecureUserConfig' flags to enable and safe user config files
127 # SecureUserConfig : boolean - switches securing on/off - default false
128 # SecureUserConfigCompress : boolean - defines if backup data will be compressed - default true
129 # SecureUserConfigNumCopies : integer - defines how many compressed copies of saved content will be kept - default 2
130 # SecureUserConfigMode: integer - defines what to secure, default is 1
131 # 0 : only registrymodifications.xcu
132 # 1 : a selected amount of user-defined configs
133 # 2 : everything in the user config directory
134 # SecureUserConfigExtensions: boolean - defines to also safe the extension configuration (which extensions
135 # are installed, which are activated) - default is true
136 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,soffice) :
137 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
138 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
140 echo '[Bootstrap]' \
141 && echo 'CrashDirectory=$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/crash' \
142 && echo 'CrashDumpEnable=$(DEFAULT_CRASHDUMP_VALUE)' \
143 && echo 'HideEula=1' \
144 && echo 'Logo=1' \
145 && echo 'NativeProgress=false' \
146 && echo 'ProgressBarColor=0,0,0' \
147 && echo 'ProgressFrameColor=102,102,102' \
148 && echo 'ProgressPosition=30,145' \
149 && echo 'ProgressSize=385,8' \
150 && echo 'ProgressPositionHigh=30,200' \
151 && echo 'ProgressSizeHigh=650,12' \
152 && echo 'ProgressTextBaseline=170' \
153 && echo 'ProgressTextColor=0,0,0' \
154 && echo 'SecureUserConfig=true' \
155 && echo 'SecureUserConfigCompress=true' \
156 && echo 'SecureUserConfigExtensions=true' \
157 && echo 'SecureUserConfigMode=1' \
158 && echo 'SecureUserConfigNumCopies=2' \
159 && echo 'URE_BOOTSTRAP=$${ORIGIN}/$(call gb_Helper_get_rcfile,fundamental)' \
160 ) > $@
161 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
163 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,uno) :
164 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
165 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
167 echo '[Bootstrap]' \
168 && echo 'URE_INTERNAL_LIB_DIR=$${ORIGIN}$(if $(filter MACOSX,$(OS)),/../../../Frameworks)' \
169 && echo 'URE_INTERNAL_JAVA_DIR=$(if $(filter MACOSX,$(OS)),$${ORIGIN}/../../java,$${ORIGIN}/classes)' \
170 && echo 'URE_INTERNAL_JAVA_CLASSPATH=$${URE_MORE_JAVA_TYPES}' \
171 && echo 'UNO_TYPES=$(if $(filter MACOSX,$(OS)),$${ORIGIN}/../share/misc/,$${ORIGIN}/)types.rdb $${URE_MORE_TYPES}' \
172 && echo 'UNO_SERVICES=$(if $(filter MACOSX,$(OS)),$${ORIGIN}/../share/misc/,$${ORIGIN}/)services.rdb $${URE_MORE_SERVICES}' \
173 ) > $@
174 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
180 define instsetoo_native_genversionini
181 [Version]
182 AllLanguages=$(if $(gb_WITH_LANG),$(gb_WITH_LANG),en-US)
183 buildid=$(shell cd $(SRCDIR) && git log -1 --format=%H)
184 ExtensionUpdateURL=https://updateexte.libreoffice.org/ExtensionUpdateService/check.Update
185 UpdateChannel=$(if $(ENABLE_ONLINE_UPDATE_MAR),$(shell cd $(SRCDIR) && bin/update/get_update_channel.py $(UPDATE_CONFIG)))
186 ReferenceOOoMajorMinor=4.1
187 UpdateID=$(PRODUCTNAME)_$(LIBO_VERSION_MAJOR)_en-US
188 UpdateURL=$(if $(ENABLE_ONLINE_UPDATE),https://update.libreoffice.org/check.php$(if $(filter-out WNT,$(OS)),?pkgfmt=$(PKGFORMAT)))
189 UpdateUserAgent=<PRODUCT> ($${buildid}; $${_OS}; $${_ARCH}; <OPTIONAL_OS_HW_DATA>)
190 Vendor=$(OOO_VENDOR)
191 endef
195 .PHONY: $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,version)
196 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,version) :
197 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
198 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
199 ifeq ($(HAVE_GNUMAKE_FILE_FUNC),)
200 printf '[Version]\n' > $@ && \
201 printf 'AllLanguages=$(if $(gb_WITH_LANG),$(gb_WITH_LANG),en-US)\n' >> $@ && \
202 printf 'buildid=$(shell cd $(SRCDIR) && git log -1 --format=%H)\n' >> $@ && \
203 printf 'ExtensionUpdateURL=https://updateexte.libreoffice.org/ExtensionUpdateService/check.Update\n' >> $@ && \
204 printf 'UpdateChannel=$(if $(ENABLE_ONLINE_UPDATE_MAR),$(shell cd $(SRCDIR) && bin/update/get_update_channel.py $(UPDATE_CONFIG)))\n' >> $@ && \
205 printf 'ReferenceOOoMajorMinor=4.1\n' >> $@ && \
206 printf 'UpdateID=$(PRODUCTNAME)_$(LIBO_VERSION_MAJOR)_en-US\n' >> $@ && \
207 printf 'UpdateURL=$(if $(ENABLE_ONLINE_UPDATE),https://update.libreoffice.org/check.php$(if $(filter-out WNT,$(OS)),?pkgfmt=$(PKGFORMAT)))\n' >> $@ && \
208 printf 'UpdateUserAgent=<PRODUCT> ($${buildid}; $${_OS}; $${_ARCH}; <OPTIONAL_OS_HW_DATA>)\n' >> $@ && \
209 printf 'Vendor=$(OOO_VENDOR)\n' >> $@
210 else
211 $(file > $@,$(call instsetoo_native_genversionini))
212 endif
213 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
215 # vim: set noet sw=4 ts=4: