Bump version to 6.4.7.2.M8
[LibreOffice.git] / solenv / gbuild / platform / solaris.mk
blobe386601996f27537ac75c58c5092c23d73d2ce2c
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/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 include $(GBUILDDIR)/platform/com_GCC_defs.mk
22 gb_MKTEMP := mktemp -t gbuild.XXXXXX
24 ifneq ($(origin AR),default)
25 gb_AR := $(AR)
26 endif
28 # do not define SOLARIS - use #ifdef __sun instead
29 # -D$(OS) \
31 gb_OSDEFS := \
32 -DSYSV \
33 -DSUN \
34 -DSUN4 \
35 -D_REENTRANT \
36 -D_POSIX_PTHREAD_SEMANTICS \
37 -D_PTHREADS \
38 -DUNIX \
39 -DUNX \
40 $(PTHREAD_CFLAGS) \
41 $(LFS_CFLAGS) \
43 gb_CFLAGS := \
44 $(gb_CFLAGS_COMMON) \
45 -fPIC \
46 -Wdeclaration-after-statement \
47 -Wshadow \
49 gb_CXXFLAGS := \
50 $(gb_CXXFLAGS_COMMON) \
51 -fPIC \
52 -Wshadow \
53 -Woverloaded-virtual \
54 $(CXXFLAGS_CXX11) \
56 # enable debug STL
57 ifeq ($(gb_ENABLE_DBGUTIL),$(true))
58 gb_COMPILERDEFS += \
59 -D_GLIBCXX_DEBUG \
61 endif
63 ifneq ($(strip $(SYSBASE)),)
64 gb_CXXFLAGS += --sysroot=$(SYSBASE)
65 gb_CFLAGS += --sysroot=$(SYSBASE)
66 gb_LinkTarget_LDFLAGS += \
67 -Wl,--sysroot=$(SYSBASE)
68 endif
70 gb_LinkTarget_LDFLAGS += \
71 -L$(SYSBASE)/lib \
72 -L$(SYSBASE)/usr/lib \
73 -Wl,-B,direct \
74 -Wl,-z,defs \
75 -Wl,-z,combreloc \
77 ifeq ($(HAVE_LD_HASH_STYLE),TRUE)
78 gb_LinkTarget_LDFLAGS += \
79 -Wl,--hash-style=$(WITH_LINKER_HASH_STYLE) \
81 endif
83 ifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),)
84 gb_LinkTarget_LDFLAGS += -Wl,-Bsymbolic-functions
85 endif
87 # sun ld doesn't understand -O1 optimize flag
88 gb_LINKEROPTFLAGS :=
89 gb_LINKERSTRIPDEBUGFLAGS := -Wl,-zredlocsym -Wl,-znoldynsym
91 # LinkTarget class
93 define gb_LinkTarget__get_rpath_for_layer
94 $(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
95 endef
97 gb_LinkTarget__RPATHS := \
98 URELIB:\dORIGIN \
99 UREBIN:\dORIGIN \
100 OOO:\dORIGIN \
101 SDKBIN:\dORIGIN/../../program \
102 OXT: \
103 NONE:\dORIGIN/../Library \
105 gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
106 gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CFLAGS_WERROR)
108 # note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10
109 # we want to use @$(extraobjectlist) in the long run
110 # link with C compiler if there are no C++ files (pyuno_wrapper depends on this)
111 define gb_LinkTarget__command_dynamiclink
112 $(call gb_Helper_abbreviate_dirs,\
113 $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \
114 $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
115 $(gb_LTOFLAGS) \
116 $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)-soname=$(notdir $(1)) \
118 $(subst \d,$$,$(RPATH)) \
119 $(T_LDFLAGS) \
120 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
121 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
122 $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
123 $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
124 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
125 $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
126 -Wl$(COMMA)--start-group \
127 $(foreach lib,$(LINKED_STATIC_LIBS),\
128 $(call gb_StaticLibrary_get_target,$(lib))) \
129 $(T_LIBS) \
130 -Wl$(COMMA)--end-group \
131 -Wl$(COMMA)-zrecord \
132 $(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \
133 -o $(1) \
134 $(if $(SOVERSIONSCRIPT),&& ln -sf ../../program/$(notdir $(1)) $(ILIBTARGET)))
135 $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
136 $(READELF) -d $(1) | grep SONAME > $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
137 $(NM) --dynamic --extern-only --defined-only --format=posix $(1) \
138 | cut -d' ' -f1-2 \
139 >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
140 $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \
141 $(WORKDIR)/LinkTarget/$(2).exports,$(1))))
142 endef
144 define gb_LinkTarget__command_staticlink
145 $(call gb_Helper_abbreviate_dirs,\
146 rm -f $(1) && \
147 $(gb_AR) -rsu $(1) \
148 $(if $(LD_PLUGIN),--plugin $(LD_PLUGIN)) \
149 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
150 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
151 $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
152 $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
153 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
154 $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \
155 $(if $(findstring s,$(MAKEFLAGS)),2> /dev/null))
156 endef
158 define gb_LinkTarget__command
159 $(call gb_Output_announce,$(2),$(true),LNK,4)
160 $(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2)))
161 $(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
162 endef
165 # Library class
167 gb_Library_DEFS :=
168 gb_Library_TARGETTYPEFLAGS := -shared -Wl,-M/usr/lib/ld/map.noexstk -mimpure-text
169 gb_Library_UDK_MAJORVER := 3
170 gb_Library_SYSPRE := lib
171 gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
172 gb_Library_PLAINEXT := .so
173 gb_Library_DLLEXT := .so
174 gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
176 gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT)
177 gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
179 gb_STDLIBS := \
180 -lm \
181 -lnsl \
182 -lsocket \
184 gb_Library_FILENAMES := \
185 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
186 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
187 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
188 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
189 $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
190 $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
191 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT).$(gb_Library_UDK_MAJORVER)) \
192 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT).$(gb_Library_UDK_MAJORVER)) \
193 $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \
196 gb_Library_LAYER := \
197 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
198 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
199 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
200 $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
201 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
202 $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \
203 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
204 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
205 $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \
207 define gb_Library__get_rpath
208 $(if $(1),$(strip -Wl,-z,origin '-Wl,-rpath,$(1)' -L$(INSTDIR)/program))
209 endef
211 define gb_Library_get_rpath
212 $(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1))))
213 endef
215 define gb_Library_Library_platform
216 $(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1))
218 endef
220 gb_Library__set_soversion_script_platform = $(gb_Library__set_soversion_script)
222 gb_Library_get_sdk_link_dir = $(INSTDIR)/$(SDKDIRNAME)/lib
224 gb_Library_get_sdk_link_lib = $(gb_Library_get_versionlink_target)
226 # Executable class
228 gb_Executable_EXT :=
230 gb_Executable_LAYER := \
231 $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
232 $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
233 $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
234 $(foreach exe,$(gb_Executable_NONE),$(exe):NONE) \
237 define gb_Executable__get_rpath
238 $(strip -Wl,-z,origin $(if $(1),'-Wl$(COMMA)-rpath$(COMMA)$(1)') -L$(INSTDIR)/program)
239 endef
241 define gb_Executable_get_rpath
242 $(call gb_Executable__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1))))
243 endef
245 define gb_Executable_Executable_platform
246 $(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1))
248 endef
251 # CppunitTest class
253 gb_CppunitTest_CPPTESTPRECOMMAND := \
254 $(call gb_Helper_extend_ld_path,$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs)
255 gb_CppunitTest_get_filename = libtest_$(1).so
256 gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename)
258 define gb_CppunitTest_CppunitTest_platform
259 $(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,NONE))
261 endef
263 define gb_CppunitTest_postprocess
264 $(SRCDIR)/solenv/bin/gdb-core-bt.sh $(1) $(2) $(3)
265 endef
267 # JunitTest class
269 ifneq ($(OOO_TEST_SOFFICE),)
270 gb_JunitTest_SOFFICEARG:=$(OOO_TEST_SOFFICE)
271 else
272 ifneq ($(gb_JunitTest_DEBUGRUN),)
273 gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER)
274 else
275 gb_JunitTest_SOFFICEARG:=path:$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice
276 endif
277 endif
279 define gb_JunitTest_JunitTest_platform
280 $(call gb_JunitTest_get_target,$(1)) : DEFS := \
281 -Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
282 -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \
283 -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \
284 -Dorg.openoffice.test.arg.postprocesscommand=$(SRCDIR)/solenv/bin/gdb-core-bt.sh \
285 -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \
287 endef
289 # PythonTest class
291 gb_PythonTest_PRECOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND)
293 # Module class
295 define gb_Module_DEBUGRUNCOMMAND
296 OFFICESCRIPT=`mktemp` && \
297 printf ". $(INSTROOT)/program/ooenv\\n" > $${OFFICESCRIPT} && \
298 printf "gdb --tui $(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice.bin" >> $${OFFICESCRIPT} && \
299 printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' \"" >> $${OFFICESCRIPT} && \
300 printf " -ex \"r\"\\n" >> $${OFFICESCRIPT} && \
301 $(SHELL) $${OFFICESCRIPT} && \
302 rm $${OFFICESCRIPT}
303 endef
305 # InstallModuleTarget class
307 define gb_InstallModuleTarget_InstallModuleTarget_platform
308 $(call gb_InstallModuleTarget_add_defs,$(1),\
309 $(gb_CPUDEFS) \
310 $(gb_OSDEFS) \
311 -DCOMID=gcc3 \
312 -D_gcc3 \
315 endef
317 # InstallScript class
319 gb_InstallScript_EXT := .ins
321 # CliAssemblyTarget class
323 gb_CliAssemblyTarget_POLICYEXT :=
324 gb_CliAssemblyTarget_get_dll :=
326 # Extension class
328 gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/LICENSE
330 # UnpackedTarget class
332 gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
334 # UnoApiHeadersTarget class
336 ifeq ($(DISABLE_DYNLOADING),TRUE)
337 gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
338 else
339 gb_UnoApiHeadersTarget_select_variant = $(2)
340 endif
342 # UIMenubarTarget class
344 define gb_UIMenubarTarget__command
345 $(call gb_Output_announce,$(2),$(true),UIM,1)
346 cp $(3) $(1)
348 endef
350 gb_UIMenubarTarget_UIMenubarTarget_platform :=
352 # Python
353 gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload:$(INSTDIR)/program"
354 gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(INSTROOT)/program/python
355 # this is passed to gdb as executable when running tests
356 gb_Python_INSTALLED_EXECUTABLE_GDB := $(INSTROOT)/program/python.bin
358 include $(GBUILDDIR)/platform/com_GCC_class.mk
360 # vim: set noet sw=4: