xref: /aoo42x/main/solenv/gbuild/platform/linux.mk (revision 8e6bd3e9)
17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirGUI := UNX
25cdf0e10cSrcweir
26cdf0e10cSrcweirgb_MKTEMP := mktemp -t gbuild.XXXXXX
27cdf0e10cSrcweir
28cdf0e10cSrcweirgb_CC := gcc
29cdf0e10cSrcweirgb_CXX := g++
30cdf0e10cSrcweirgb_GCCP := gcc
31cdf0e10cSrcweirgb_AR := ar
32cdf0e10cSrcweirgb_AWK := awk
33cdf0e10cSrcweirgb_CLASSPATHSEP := :
34cdf0e10cSrcweir
35cdf0e10cSrcweir# normalize setsolar and configure env.
36cdf0e10cSrcweirifeq ($(CPU),X)
37cdf0e10cSrcweirCPUNAME := X86_64
38cdf0e10cSrcweirendif
39cdf0e10cSrcweir
40cdf0e10cSrcweir# use CC/CXX if they are nondefaults
41cdf0e10cSrcweirifneq ($(origin CC),default)
42cdf0e10cSrcweirgb_CC := $(CC)
43cdf0e10cSrcweirgb_GCCP := $(CC)
44cdf0e10cSrcweirendif
45cdf0e10cSrcweirifneq ($(origin CXX),default)
46cdf0e10cSrcweirgb_CXX := $(CXX)
47cdf0e10cSrcweirendif
48cdf0e10cSrcweir
49cdf0e10cSrcweirgb_OSDEFS := \
50cdf0e10cSrcweir	-D$(OS) \
51cdf0e10cSrcweir	-D_PTHREADS \
52cdf0e10cSrcweir	-DUNIX \
53cdf0e10cSrcweir	-DUNX \
54cdf0e10cSrcweir	$(PTHREAD_CFLAGS) \
55cdf0e10cSrcweir
56cdf0e10cSrcweirifeq ($(GXX_INCLUDE_PATH),)
57cdf0e10cSrcweirGXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion)
58cdf0e10cSrcweirendif
59cdf0e10cSrcweir
60cdf0e10cSrcweirgb_COMPILERDEFS := \
61cdf0e10cSrcweir	-D$(COM) \
62cdf0e10cSrcweir	-DHAVE_GCC_VISIBILITY_FEATURE \
63cdf0e10cSrcweir	-DCPPU_ENV=gcc3 \
64cdf0e10cSrcweir	-DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
65cdf0e10cSrcweir
66cdf0e10cSrcweirifeq ($(CPUNAME),X86_64)
67cdf0e10cSrcweirgb_CPUDEFS := -D$(CPUNAME)
68cdf0e10cSrcweirelse
69cdf0e10cSrcweirgb_CPUDEFS := -DX86
70cdf0e10cSrcweirendif
71cdf0e10cSrcweir
72cdf0e10cSrcweirgb_CFLAGS := \
73cdf0e10cSrcweir	-Wall \
74cdf0e10cSrcweir	-Wendif-labels \
75cdf0e10cSrcweir	-Wextra \
76cdf0e10cSrcweir	-Wshadow \
77cdf0e10cSrcweir	-fPIC \
78cdf0e10cSrcweir	-fmessage-length=0 \
79cdf0e10cSrcweir	-fno-common \
80cdf0e10cSrcweir	-fno-strict-aliasing \
81cdf0e10cSrcweir	-fvisibility=hidden \
82cdf0e10cSrcweir	-pipe \
83cdf0e10cSrcweir
84cdf0e10cSrcweirgb_CXXFLAGS := \
85cdf0e10cSrcweir	-Wall \
86cdf0e10cSrcweir	-Wendif-labels \
87cdf0e10cSrcweir	-Wextra \
88cdf0e10cSrcweir	-Wno-ctor-dtor-privacy \
89cdf0e10cSrcweir	-Wno-non-virtual-dtor \
90cdf0e10cSrcweir	-Wshadow \
91cdf0e10cSrcweir	-fPIC \
92cdf0e10cSrcweir	-fmessage-length=0 \
93cdf0e10cSrcweir	-fno-common \
94cdf0e10cSrcweir	-fno-strict-aliasing \
954d340eebSAndrea Pescetti	-fuse-cxa-atexit \
96cdf0e10cSrcweir	-fvisibility-inlines-hidden \
97cdf0e10cSrcweir	-fvisibility=hidden \
98cdf0e10cSrcweir	-pipe \
99cdf0e10cSrcweir
100cdf0e10cSrcweirifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
101cdf0e10cSrcweirgb_CFLAGS_WERROR := -Werror
102cdf0e10cSrcweirgb_CXXFLAGS_WERROR := -Werror
103cdf0e10cSrcweirendif
104cdf0e10cSrcweir
105cdf0e10cSrcweirifneq ($(strip $(SYSBASE)),)
106cdf0e10cSrcweirgb_CXXFLAGS += --sysroot=$(SYSBASE)
107cdf0e10cSrcweirgb_CFLAGS += --sysroot=$(SYSBASE)
10827520587SHerbert Dürrgb_LinkTarget_LDFLAGS := -Wl,--sysroot=$(SYSBASE)
109cdf0e10cSrcweirendif
110cdf0e10cSrcweirgb_LinkTarget_EXCEPTIONFLAGS := \
111cdf0e10cSrcweir	-DEXCEPTIONS_ON \
112bcc22a4cSDamjan Jovanovic	-fexceptions
113bcc22a4cSDamjan Jovanovicifeq ($(COM),GCC)
114bcc22a4cSDamjan Jovanovicgb_LinkTarget_EXCEPTIONFLAGS +=  -fno-enforce-eh-specs
115bcc22a4cSDamjan Jovanovicendif
116cdf0e10cSrcweir
117cdf0e10cSrcweirgb_LinkTarget_NOEXCEPTIONFLAGS := \
118cdf0e10cSrcweir	-DEXCEPTIONS_OFF \
119cdf0e10cSrcweir	-fno-exceptions \
120cdf0e10cSrcweir
12127520587SHerbert Dürrgb_LinkTarget_LDFLAGS += \
122cdf0e10cSrcweir	-Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
123cdf0e10cSrcweir	-Wl,-z,combreloc \
124cdf0e10cSrcweir	-Wl,-z,defs \
125cdf0e10cSrcweir	$(subst -L../lib , ,$(SOLARLIB)) \
126cdf0e10cSrcweir
127cdf0e10cSrcweirifeq ($(HAVE_LD_HASH_STYLE),TRUE)
128cdf0e10cSrcweirgb_LinkTarget_LDFLAGS += \
129cdf0e10cSrcweir	-Wl,--hash-style=both \
130cdf0e10cSrcweir
131cdf0e10cSrcweirendif
132cdf0e10cSrcweir
133cdf0e10cSrcweirifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),)
134cdf0e10cSrcweirgb_LinkTarget_LDFLAGS += \
135cdf0e10cSrcweir	-Wl,--dynamic-list-cpp-new \
136cdf0e10cSrcweir	-Wl,--dynamic-list-cpp-typeinfo \
137cdf0e10cSrcweir	-Wl,-Bsymbolic-functions \
138cdf0e10cSrcweir
139cdf0e10cSrcweirendif
140cdf0e10cSrcweir
141b63233d8Sdamjanifeq ($(gb_DEBUGLEVEL),0)
142b63233d8Sdamjangb_LinkTarget_LDFLAGS += -Wl,-O1
143b63233d8Sdamjanendif
144b63233d8Sdamjan
145bcc22a4cSDamjan Jovanovicifeq ($(COM),CLANG)
146bcc22a4cSDamjan Jovanovicifeq ($(ENABLE_SYMBOLS),SMALL)
147bcc22a4cSDamjan Jovanovicgb_DEBUG_CFLAGS := -ggdb1 -fno-inline
148bcc22a4cSDamjan Jovanovicelse
149bcc22a4cSDamjan Jovanovicgb_DEBUG_CFLAGS := -ggdb3 -fno-inline
150bcc22a4cSDamjan Jovanovicendif
151bcc22a4cSDamjan Jovanovicelse
1529e1b801eSDamjan Jovanovicifeq ($(ENABLE_SYMBOLS),SMALL)
1539e1b801eSDamjan Jovanovicgb_DEBUG_CFLAGS := -ggdb1 -finline-limit=0 -fno-inline -fno-default-inline
1549e1b801eSDamjan Jovanovicelse
155b63233d8Sdamjangb_DEBUG_CFLAGS := -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
1569e1b801eSDamjan Jovanovicendif
157bcc22a4cSDamjan Jovanovicendif
158b63233d8Sdamjan
159cdf0e10cSrcweirifeq ($(gb_DEBUGLEVEL),2)
160cdf0e10cSrcweirgb_COMPILEROPTFLAGS := -O0
161*8e6bd3e9SDon Lewisgb_COMPILEROPT1FLAGS := -O0
162cdf0e10cSrcweirelse
163cdf0e10cSrcweirgb_COMPILEROPTFLAGS := -Os
164*8e6bd3e9SDon Lewisgb_COMPILEROPT1FLAGS := -O1
165cdf0e10cSrcweirendif
166cdf0e10cSrcweir
167cdf0e10cSrcweirgb_COMPILERNOOPTFLAGS := -O0
168cdf0e10cSrcweir
169cdf0e10cSrcweir# Helper class
170cdf0e10cSrcweir
171cdf0e10cSrcweirgb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
172cdf0e10cSrcweir
173cdf0e10cSrcweir# convert parametters filesystem root to native notation
174cdf0e10cSrcweir# does some real work only on windows, make sure not to
175cdf0e10cSrcweir# break the dummy implementations on unx*
176cdf0e10cSrcweirdefine gb_Helper_convert_native
177cdf0e10cSrcweir$(1)
178cdf0e10cSrcweirendef
179cdf0e10cSrcweir
180cdf0e10cSrcweir# CObject class
181cdf0e10cSrcweir
182b63233d8Sdamjan# $(call gb_CObject__command,object,relative-source,source,dep-file)
183cdf0e10cSrcweirdefine gb_CObject__command
184cdf0e10cSrcweir$(call gb_Output_announce,$(2),$(true),C  ,3)
185cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
186b63233d8Sdamjan	mkdir -p $(dir $(1)) $(dir $(4)) && \
187cdf0e10cSrcweir	$(gb_CC) \
188b63233d8Sdamjan		$(DEFS) \
189b63233d8Sdamjan		$(T_CFLAGS) \
190*8e6bd3e9SDon Lewis		$(CFLAGS) \
191cdf0e10cSrcweir		-c $(3) \
192cdf0e10cSrcweir		-o $(1) \
193b63233d8Sdamjan		-MMD -MT $(1) \
194b63233d8Sdamjan		-MF $(4) \
195cdf0e10cSrcweir		-I$(dir $(3)) \
196cdf0e10cSrcweir		$(INCLUDE))
197cdf0e10cSrcweirendef
198cdf0e10cSrcweir
199b63233d8Sdamjan# convert parametters filesystem root to native notation
200b63233d8Sdamjan# does some real work only on windows, make sure not to
201b63233d8Sdamjan# break the dummy implementations on unx*
202b63233d8Sdamjandefine gb_Helper_convert_native
203b63233d8Sdamjan$(1)
204b63233d8Sdamjanendef
205cdf0e10cSrcweir
206cdf0e10cSrcweir# CxxObject class
207cdf0e10cSrcweir
208b63233d8Sdamjan# $(call gb_CxxObject__command,object,relative-source,source,dep-file)
209cdf0e10cSrcweirdefine gb_CxxObject__command
210cdf0e10cSrcweir$(call gb_Output_announce,$(2),$(true),CXX,3)
211cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
212b63233d8Sdamjan	mkdir -p $(dir $(1)) $(dir $(4)) && \
213cdf0e10cSrcweir	$(gb_CXX) \
214b63233d8Sdamjan		$(DEFS) \
215b63233d8Sdamjan		$(T_CXXFLAGS) \
216*8e6bd3e9SDon Lewis		$(CXXFLAGS) \
217cdf0e10cSrcweir		-c $(3) \
218cdf0e10cSrcweir		-o $(1) \
219b63233d8Sdamjan		-MMD -MT $(1) \
220b63233d8Sdamjan		-MF $(4) \
221cdf0e10cSrcweir		-I$(dir $(3)) \
222cdf0e10cSrcweir		$(INCLUDE_STL) $(INCLUDE))
223cdf0e10cSrcweirendef
224cdf0e10cSrcweir
225cdf0e10cSrcweir
226cdf0e10cSrcweir# LinkTarget class
227cdf0e10cSrcweir
228cdf0e10cSrcweirdefine gb_LinkTarget__get_rpath_for_layer
229cdf0e10cSrcweir$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
230cdf0e10cSrcweirendef
231cdf0e10cSrcweir
232cdf0e10cSrcweirgb_LinkTarget__RPATHS := \
233cdf0e10cSrcweir	URELIB:\dORIGIN \
234cdf0e10cSrcweir	UREBIN:\dORIGIN/../lib:\dORIGIN \
235cdf0e10cSrcweir	OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
236cdf0e10cSrcweir	BRAND:\dORIGIN:\dORIGIN/../basis-link/program:\dORIGIN/../basis-link/ure-link/lib \
237cdf0e10cSrcweir	SDKBIN:\dORIGIN/../../ure-link/lib \
238cdf0e10cSrcweir	NONEBIN:\dORIGIN/../lib:\dORIGIN \
239cdf0e10cSrcweir
240b63233d8Sdamjangb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
241cdf0e10cSrcweirgb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
242cdf0e10cSrcweir
243cdf0e10cSrcweir
244cdf0e10cSrcweirgb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC)))
245cdf0e10cSrcweirgb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
246cdf0e10cSrcweir
247cdf0e10cSrcweirdefine gb_LinkTarget__command_dynamiclink
248cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
249cdf0e10cSrcweir	mkdir -p $(dir $(1)) && \
250cdf0e10cSrcweir	$(gb_CXX) \
251dfce871fSDamjan Jovanovic		$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
2523b02a9c8SDamjan Jovanovic		$(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \
253b63233d8Sdamjan		$(subst \d,$$,$(RPATH)) \
254b63233d8Sdamjan		$(T_LDFLAGS) \
255cdf0e10cSrcweir		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
256cdf0e10cSrcweir		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
257cdf0e10cSrcweir		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
2589b09309dSdamjan		-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
25944c25570SAndre Fischer		$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
26044c25570SAndre Fischer		$(patsubst %,-l%,$(EXTERNAL_LIBS)) \
261b63233d8Sdamjan		$(LIBS) \
262c30f6fe3Sdamjan		-lc \
263cdf0e10cSrcweir		-o $(1))
264cdf0e10cSrcweirendef
265cdf0e10cSrcweir
266cdf0e10cSrcweirdefine gb_LinkTarget__command_staticlink
267cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
268cdf0e10cSrcweir	mkdir -p $(dir $(1)) && \
269cdf0e10cSrcweir	$(gb_AR) -rsu $(1) \
270cdf0e10cSrcweir		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
271cdf0e10cSrcweir		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
272cdf0e10cSrcweir		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
273cdf0e10cSrcweir		2> /dev/null)
274cdf0e10cSrcweirendef
275cdf0e10cSrcweir
276cdf0e10cSrcweirdefine gb_LinkTarget__command
277cdf0e10cSrcweir$(call gb_Output_announce,$(2),$(true),LNK,4)
278dfce871fSDamjan Jovanovic$(if $(filter Library GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1)))
279cdf0e10cSrcweir$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
280cdf0e10cSrcweirendef
281cdf0e10cSrcweir
282cdf0e10cSrcweir
283cdf0e10cSrcweir# Library class
284cdf0e10cSrcweir
285cdf0e10cSrcweirgb_Library_DEFS :=
286cdf0e10cSrcweirgb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack
287cdf0e10cSrcweirgb_Library_SYSPRE := lib
288cdf0e10cSrcweirgb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
289cdf0e10cSrcweirgb_Library_PLAINEXT := .so
290cdf0e10cSrcweirgb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
291cdf0e10cSrcweirifeq ($(gb_PRODUCT),$(true))
292cdf0e10cSrcweirgb_Library_STLEXT := port_gcc$(gb_Library_PLAINEXT)
293cdf0e10cSrcweirelse
294cdf0e10cSrcweirgb_Library_STLEXT := port_gcc_stldebug$(gb_Library_PLAINEXT)
295cdf0e10cSrcweirendif
2963b02a9c8SDamjan Jovanovicgb_Library_VERSIONMAPFLAG := -Wl,--version-script
297cdf0e10cSrcweir
298cdf0e10cSrcweirifeq ($(CPUNAME),X86_64)
2995f9a7a39SHerbert Dürrgb_Library_OOOEXT := $(gb_Library_PLAINEXT)
300cdf0e10cSrcweirgb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
301cdf0e10cSrcweirelse
3025f9a7a39SHerbert Dürrgb_Library_OOOEXT := $(gb_Library_PLAINEXT)
303cdf0e10cSrcweirgb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
304cdf0e10cSrcweirendif
305cdf0e10cSrcweir
306cdf0e10cSrcweirgb_Library_PLAINLIBS_NONE += \
307b63233d8Sdamjan	fontconfig \
308b63233d8Sdamjan	Xrender \
309cdf0e10cSrcweir	dl \
310828da808SPedro Giffuni	freetype \
311cdf0e10cSrcweir	m \
312cdf0e10cSrcweir	pthread \
313cdf0e10cSrcweir	X11 \
314828da808SPedro Giffuni	Xext \
315828da808SPedro Giffuni	SM \
316b63233d8Sdamjan	ICE
317cdf0e10cSrcweir
318cdf0e10cSrcweirgb_Library_FILENAMES := \
319cdf0e10cSrcweir	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
320cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
321cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
322cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
323cdf0e10cSrcweir	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
324cdf0e10cSrcweir	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
325cdf0e10cSrcweir	$(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
326cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
327cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
328cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
329cdf0e10cSrcweir
330cdf0e10cSrcweir
331cdf0e10cSrcweirgb_Library_LAYER := \
332cdf0e10cSrcweir	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
333cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
334cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
335cdf0e10cSrcweir	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
336cdf0e10cSrcweir	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
337cdf0e10cSrcweir	$(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
338cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
339cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
340cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
341cdf0e10cSrcweir
342cdf0e10cSrcweirdefine gb_Library_get_rpath
343cdf0e10cSrcweir'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \
344cdf0e10cSrcweir'-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)'
345cdf0e10cSrcweirendef
346cdf0e10cSrcweir
347cdf0e10cSrcweirdefine gb_Library_Library_platform
348cdf0e10cSrcweir$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1))
349cdf0e10cSrcweir
350cdf0e10cSrcweirendef
351cdf0e10cSrcweir
352cdf0e10cSrcweir
353cdf0e10cSrcweir# StaticLibrary class
354cdf0e10cSrcweir
355cdf0e10cSrcweirgb_StaticLibrary_DEFS :=
356cdf0e10cSrcweirgb_StaticLibrary_SYSPRE := lib
357cdf0e10cSrcweirgb_StaticLibrary_PLAINEXT := .a
358cdf0e10cSrcweirgb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
359cdf0e10cSrcweir
360cdf0e10cSrcweirgb_StaticLibrary_FILENAMES := \
361cdf0e10cSrcweir	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
362cdf0e10cSrcweir	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
363cdf0e10cSrcweir
364cdf0e10cSrcweirgb_StaticLibrary_StaticLibrary_platform =
365cdf0e10cSrcweir
366cdf0e10cSrcweir
367cdf0e10cSrcweir# Executable class
368cdf0e10cSrcweir
369cdf0e10cSrcweirgb_Executable_EXT :=
370cdf0e10cSrcweir
371cdf0e10cSrcweirgb_Executable_LAYER := \
372cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
373cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
374cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
375cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
376cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
377cdf0e10cSrcweir
378cdf0e10cSrcweir
379cdf0e10cSrcweirdefine gb_Executable_get_rpath
380cdf0e10cSrcweir'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))' \
381cdf0e10cSrcweir-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)
382cdf0e10cSrcweirendef
383cdf0e10cSrcweir
384cdf0e10cSrcweirdefine gb_Executable_Executable_platform
385cdf0e10cSrcweir$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1))
386cdf0e10cSrcweir
387cdf0e10cSrcweirendef
388cdf0e10cSrcweir
389cdf0e10cSrcweir
390e75d772dSDamjan Jovanovic# GoogleTest class
391e75d772dSDamjan Jovanovic
392e75d772dSDamjan Jovanovicgb_GoogleTest_GTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
393e75d772dSDamjan Jovanovicgb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT)
394e75d772dSDamjan Jovanovic
395e75d772dSDamjan Jovanovicdefine gb_GoogleTest_GoogleTest_platform
396e75d772dSDamjan Jovanovic$(call gb_LinkTarget_get_target,$(2)) : RPATH := -Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)
397e75d772dSDamjan Jovanovicendef
398e75d772dSDamjan Jovanovic
399cdf0e10cSrcweir# JunitTest class
400cdf0e10cSrcweir
401cdf0e10cSrcweirdefine gb_JunitTest_JunitTest_platform
402cdf0e10cSrcweir$(call gb_JunitTest_get_target,$(1)) : DEFS := \
40364c5c8b7SDamjan Jovanovic	-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(SRCDIR)/instsetoo_native/$(INPATH)/Apache_OpenOffice/installed/install/en-US/openoffice4/program/soffice}" \
404cdf0e10cSrcweir    -Dorg.openoffice.test.arg.env=LD_LIBRARY_PATH \
405cdf0e10cSrcweir    -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \
406cdf0e10cSrcweir
407cdf0e10cSrcweirendef
408cdf0e10cSrcweir
409cdf0e10cSrcweir# SdiTarget class
410cdf0e10cSrcweir
411cdf0e10cSrcweirgb_SdiTarget_SVIDLPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
412cdf0e10cSrcweir
413cdf0e10cSrcweir# SrsPartMergeTarget
414cdf0e10cSrcweir
415cdf0e10cSrcweirgb_SrsPartMergeTarget_TRANSEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
416cdf0e10cSrcweir
417cdf0e10cSrcweir# SrsPartTarget class
418cdf0e10cSrcweir
419cdf0e10cSrcweirgb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc
420cdf0e10cSrcweirgb_SrsPartTarget_RSCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
421cdf0e10cSrcweir
422cdf0e10cSrcweirdefine gb_SrsPartTarget__command_dep
423cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
424cdf0e10cSrcweir	$(gb_GCCP) \
425cdf0e10cSrcweir		-MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
426cdf0e10cSrcweir		$(INCLUDE) \
427cdf0e10cSrcweir		$(DEFS) \
428cdf0e10cSrcweir		-c -x c++-header $(2) \
429cdf0e10cSrcweir		-o $(call gb_SrsPartTarget_get_dep_target,$(1)))
430cdf0e10cSrcweirendef
431cdf0e10cSrcweir
432cdf0e10cSrcweir
433cdf0e10cSrcweir# ComponentTarget
434cdf0e10cSrcweir
435cdf0e10cSrcweirgb_XSLTPROCPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
436cdf0e10cSrcweirgb_Library_COMPONENTPREFIXES := \
437cdf0e10cSrcweir    OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \
438cdf0e10cSrcweir    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
439b63233d8Sdamjan    NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
440b63233d8Sdamjan
441b63233d8Sdamjan# UnoApiTarget
442b63233d8Sdamjan
443b63233d8Sdamjangb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc
444b63233d8Sdamjangb_UnoApiTarget_IDLCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET)
445b63233d8Sdamjangb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge
446b63233d8Sdamjangb_UnoApiTarget_REGMERGECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET)
447b63233d8Sdamjangb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare
448b63233d8Sdamjangb_UnoApiTarget_REGCOMPARECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET)
449b63233d8Sdamjangb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker
450b63233d8Sdamjangb_UnoApiTarget_CPPUMAKERCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET)
451b63233d8Sdamjangb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview
452b63233d8Sdamjangb_UnoApiTarget_REGVIEWCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET)
453cdf0e10cSrcweir
454cdf0e10cSrcweir# vim: set noet sw=4 ts=4:
455