xref: /aoo42x/main/solenv/gbuild/platform/linux.mk (revision 1bb309c6)
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
56cdf0e10cSrcweirgb_COMPILERDEFS := \
57cdf0e10cSrcweir	-D$(COM) \
58cdf0e10cSrcweir	-DHAVE_GCC_VISIBILITY_FEATURE \
59386ca866SDon Lewis	-DCPPU_ENV=$(COMNAME) \
60cdf0e10cSrcweir
61787e1130SDon Lewisgb_CPUDEFS := -D$(ALIGN) -D$(CPUNAME)
628cb913c4SDamjan Jovanovicifeq ($(CPUNAME),INTEL)
638cb913c4SDamjan Jovanovicgb_CPUDEFS += -DX86
64cdf0e10cSrcweirendif
65cdf0e10cSrcweir
66cdf0e10cSrcweirgb_CFLAGS := \
67cdf0e10cSrcweir	-Wall \
68cdf0e10cSrcweir	-Wendif-labels \
69cdf0e10cSrcweir	-Wextra \
70cdf0e10cSrcweir	-Wshadow \
71cdf0e10cSrcweir	-fPIC \
72cdf0e10cSrcweir	-fmessage-length=0 \
73cdf0e10cSrcweir	-fno-common \
74cdf0e10cSrcweir	-fno-strict-aliasing \
75cdf0e10cSrcweir	-fvisibility=hidden \
76cdf0e10cSrcweir	-pipe \
77cdf0e10cSrcweir
78cdf0e10cSrcweirgb_CXXFLAGS := \
79cdf0e10cSrcweir	-Wall \
80cdf0e10cSrcweir	-Wendif-labels \
81cdf0e10cSrcweir	-Wextra \
82cdf0e10cSrcweir	-Wno-ctor-dtor-privacy \
83cdf0e10cSrcweir	-Wno-non-virtual-dtor \
84cdf0e10cSrcweir	-Wshadow \
85cdf0e10cSrcweir	-fPIC \
86cdf0e10cSrcweir	-fmessage-length=0 \
87cdf0e10cSrcweir	-fno-common \
88cdf0e10cSrcweir	-fno-strict-aliasing \
894d340eebSAndrea Pescetti	-fuse-cxa-atexit \
90cdf0e10cSrcweir	-fvisibility-inlines-hidden \
91cdf0e10cSrcweir	-fvisibility=hidden \
92cdf0e10cSrcweir	-pipe \
93cdf0e10cSrcweir
94cdf0e10cSrcweirifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
95cdf0e10cSrcweirgb_CFLAGS_WERROR := -Werror
96cdf0e10cSrcweirgb_CXXFLAGS_WERROR := -Werror
97cdf0e10cSrcweirendif
98cdf0e10cSrcweir
99cdf0e10cSrcweirifneq ($(strip $(SYSBASE)),)
100cdf0e10cSrcweirgb_CXXFLAGS += --sysroot=$(SYSBASE)
101cdf0e10cSrcweirgb_CFLAGS += --sysroot=$(SYSBASE)
10227520587SHerbert Dürrgb_LinkTarget_LDFLAGS := -Wl,--sysroot=$(SYSBASE)
103cdf0e10cSrcweirendif
104cdf0e10cSrcweirgb_LinkTarget_EXCEPTIONFLAGS := \
105cdf0e10cSrcweir	-DEXCEPTIONS_ON \
106bcc22a4cSDamjan Jovanovic	-fexceptions
107bcc22a4cSDamjan Jovanovicifeq ($(COM),GCC)
108bcc22a4cSDamjan Jovanovicgb_LinkTarget_EXCEPTIONFLAGS +=  -fno-enforce-eh-specs
109bcc22a4cSDamjan Jovanovicendif
110cdf0e10cSrcweir
111cdf0e10cSrcweirgb_LinkTarget_NOEXCEPTIONFLAGS := \
112cdf0e10cSrcweir	-DEXCEPTIONS_OFF \
113cdf0e10cSrcweir	-fno-exceptions \
114cdf0e10cSrcweir
11527520587SHerbert Dürrgb_LinkTarget_LDFLAGS += \
116cdf0e10cSrcweir	-Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
117cdf0e10cSrcweir	-Wl,-z,combreloc \
118cdf0e10cSrcweir	-Wl,-z,defs \
119cdf0e10cSrcweir	$(subst -L../lib , ,$(SOLARLIB)) \
120cdf0e10cSrcweir
121cdf0e10cSrcweirifeq ($(HAVE_LD_HASH_STYLE),TRUE)
122cdf0e10cSrcweirgb_LinkTarget_LDFLAGS += \
123cdf0e10cSrcweir	-Wl,--hash-style=both \
124cdf0e10cSrcweir
125cdf0e10cSrcweirendif
126cdf0e10cSrcweir
127cdf0e10cSrcweirifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),)
128cdf0e10cSrcweirgb_LinkTarget_LDFLAGS += \
129cdf0e10cSrcweir	-Wl,--dynamic-list-cpp-new \
130cdf0e10cSrcweir	-Wl,--dynamic-list-cpp-typeinfo \
131cdf0e10cSrcweir	-Wl,-Bsymbolic-functions \
132cdf0e10cSrcweir
133cdf0e10cSrcweirendif
134cdf0e10cSrcweir
135b63233d8Sdamjanifeq ($(gb_DEBUGLEVEL),0)
136b63233d8Sdamjangb_LinkTarget_LDFLAGS += -Wl,-O1
137b63233d8Sdamjanendif
138b63233d8Sdamjan
139bcc22a4cSDamjan Jovanovicifeq ($(COM),CLANG)
140bcc22a4cSDamjan Jovanovicifeq ($(ENABLE_SYMBOLS),SMALL)
141bcc22a4cSDamjan Jovanovicgb_DEBUG_CFLAGS := -ggdb1 -fno-inline
142bcc22a4cSDamjan Jovanovicelse
143bcc22a4cSDamjan Jovanovicgb_DEBUG_CFLAGS := -ggdb3 -fno-inline
144bcc22a4cSDamjan Jovanovicendif
145bcc22a4cSDamjan Jovanovicelse
1469e1b801eSDamjan Jovanovicifeq ($(ENABLE_SYMBOLS),SMALL)
1479e1b801eSDamjan Jovanovicgb_DEBUG_CFLAGS := -ggdb1 -finline-limit=0 -fno-inline -fno-default-inline
1489e1b801eSDamjan Jovanovicelse
149b63233d8Sdamjangb_DEBUG_CFLAGS := -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
1509e1b801eSDamjan Jovanovicendif
151bcc22a4cSDamjan Jovanovicendif
152b63233d8Sdamjan
153cdf0e10cSrcweirifeq ($(gb_DEBUGLEVEL),2)
154cdf0e10cSrcweirgb_COMPILEROPTFLAGS := -O0
1558e6bd3e9SDon Lewisgb_COMPILEROPT1FLAGS := -O0
156cdf0e10cSrcweirelse
157cdf0e10cSrcweirgb_COMPILEROPTFLAGS := -Os
1588e6bd3e9SDon Lewisgb_COMPILEROPT1FLAGS := -O1
159cdf0e10cSrcweirendif
160cdf0e10cSrcweir
161cdf0e10cSrcweirgb_COMPILERNOOPTFLAGS := -O0
162cdf0e10cSrcweir
163cdf0e10cSrcweir# Helper class
164cdf0e10cSrcweir
165cdf0e10cSrcweirgb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
166cdf0e10cSrcweir
167cdf0e10cSrcweir# convert parametters filesystem root to native notation
168cdf0e10cSrcweir# does some real work only on windows, make sure not to
169cdf0e10cSrcweir# break the dummy implementations on unx*
170cdf0e10cSrcweirdefine gb_Helper_convert_native
171cdf0e10cSrcweir$(1)
172cdf0e10cSrcweirendef
173cdf0e10cSrcweir
174*1bb309c6SDamjan Jovanovic# AsmObject class
175*1bb309c6SDamjan Jovanovic
176*1bb309c6SDamjan Jovanovicgb_AsmObject_EXT := .s
177*1bb309c6SDamjan Jovanovic
178*1bb309c6SDamjan Jovanovicdefine gb_AsmObject__command
179*1bb309c6SDamjan Jovanovic$(call gb_Output_announce,$(2),$(true),ASM,3)
180*1bb309c6SDamjan Jovanovic$(call gb_Helper_abbreviate_dirs,\
181*1bb309c6SDamjan Jovanovic	mkdir -p $(dir $(1)) && \
182*1bb309c6SDamjan Jovanovic	$(gb_CC) \
183*1bb309c6SDamjan Jovanovic		$(DEFS) \
184*1bb309c6SDamjan Jovanovic		$(T_CFLAGS) \
185*1bb309c6SDamjan Jovanovic		$(CFLAGS) \
186*1bb309c6SDamjan Jovanovic		-c $(3) \
187*1bb309c6SDamjan Jovanovic		-o $(1) \
188*1bb309c6SDamjan Jovanovic		-MT $(1) \
189*1bb309c6SDamjan Jovanovic		-I$(dir $(3)) \
190*1bb309c6SDamjan Jovanovic		$(INCLUDE))
191*1bb309c6SDamjan Jovanovicendef
192*1bb309c6SDamjan Jovanovic
193cdf0e10cSrcweir# CObject class
194cdf0e10cSrcweir
195b63233d8Sdamjan# $(call gb_CObject__command,object,relative-source,source,dep-file)
196cdf0e10cSrcweirdefine gb_CObject__command
197cdf0e10cSrcweir$(call gb_Output_announce,$(2),$(true),C  ,3)
198cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
199b63233d8Sdamjan	mkdir -p $(dir $(1)) $(dir $(4)) && \
200cdf0e10cSrcweir	$(gb_CC) \
201b63233d8Sdamjan		$(DEFS) \
202b63233d8Sdamjan		$(T_CFLAGS) \
2038e6bd3e9SDon Lewis		$(CFLAGS) \
204cdf0e10cSrcweir		-c $(3) \
205cdf0e10cSrcweir		-o $(1) \
206b63233d8Sdamjan		-MMD -MT $(1) \
207b63233d8Sdamjan		-MF $(4) \
208cdf0e10cSrcweir		-I$(dir $(3)) \
209cdf0e10cSrcweir		$(INCLUDE))
210cdf0e10cSrcweirendef
211cdf0e10cSrcweir
212b63233d8Sdamjan# convert parametters filesystem root to native notation
213b63233d8Sdamjan# does some real work only on windows, make sure not to
214b63233d8Sdamjan# break the dummy implementations on unx*
215b63233d8Sdamjandefine gb_Helper_convert_native
216b63233d8Sdamjan$(1)
217b63233d8Sdamjanendef
218cdf0e10cSrcweir
219cdf0e10cSrcweir# CxxObject class
220cdf0e10cSrcweir
221b63233d8Sdamjan# $(call gb_CxxObject__command,object,relative-source,source,dep-file)
222cdf0e10cSrcweirdefine gb_CxxObject__command
223cdf0e10cSrcweir$(call gb_Output_announce,$(2),$(true),CXX,3)
224cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
225b63233d8Sdamjan	mkdir -p $(dir $(1)) $(dir $(4)) && \
226cdf0e10cSrcweir	$(gb_CXX) \
227b63233d8Sdamjan		$(DEFS) \
228b63233d8Sdamjan		$(T_CXXFLAGS) \
2298e6bd3e9SDon Lewis		$(CXXFLAGS) \
230cdf0e10cSrcweir		-c $(3) \
231cdf0e10cSrcweir		-o $(1) \
232b63233d8Sdamjan		-MMD -MT $(1) \
233b63233d8Sdamjan		-MF $(4) \
234cdf0e10cSrcweir		-I$(dir $(3)) \
235cdf0e10cSrcweir		$(INCLUDE_STL) $(INCLUDE))
236cdf0e10cSrcweirendef
237cdf0e10cSrcweir
238cdf0e10cSrcweir
239cdf0e10cSrcweir# LinkTarget class
240cdf0e10cSrcweir
241cdf0e10cSrcweirdefine gb_LinkTarget__get_rpath_for_layer
242cdf0e10cSrcweir$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
243cdf0e10cSrcweirendef
244cdf0e10cSrcweir
245cdf0e10cSrcweirgb_LinkTarget__RPATHS := \
246cdf0e10cSrcweir	URELIB:\dORIGIN \
247cdf0e10cSrcweir	UREBIN:\dORIGIN/../lib:\dORIGIN \
248cdf0e10cSrcweir	OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
249cdf0e10cSrcweir	BRAND:\dORIGIN:\dORIGIN/../basis-link/program:\dORIGIN/../basis-link/ure-link/lib \
250cdf0e10cSrcweir	SDKBIN:\dORIGIN/../../ure-link/lib \
251cdf0e10cSrcweir	NONEBIN:\dORIGIN/../lib:\dORIGIN \
252cdf0e10cSrcweir
253b63233d8Sdamjangb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
254cdf0e10cSrcweirgb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
255cdf0e10cSrcweir
256cdf0e10cSrcweir
257cdf0e10cSrcweirgb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC)))
258cdf0e10cSrcweirgb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
259cdf0e10cSrcweir
260cdf0e10cSrcweirdefine gb_LinkTarget__command_dynamiclink
261cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
262cdf0e10cSrcweir	mkdir -p $(dir $(1)) && \
263cdf0e10cSrcweir	$(gb_CXX) \
264dfce871fSDamjan Jovanovic		$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
2653b02a9c8SDamjan Jovanovic		$(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \
266f006f9b4SDamjan Jovanovic		$(if $(call gb_Library_is_udk_versioned,$(1)),-Wl$(COMMA)-h$(notdir $(1)).$(gb_UDK_MAJOR)) \
267b63233d8Sdamjan		$(subst \d,$$,$(RPATH)) \
268b63233d8Sdamjan		$(T_LDFLAGS) \
269cdf0e10cSrcweir		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
270cdf0e10cSrcweir		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
271cdf0e10cSrcweir		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
2729b09309dSdamjan		-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
27344c25570SAndre Fischer		$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
27444c25570SAndre Fischer		$(patsubst %,-l%,$(EXTERNAL_LIBS)) \
275b63233d8Sdamjan		$(LIBS) \
276c30f6fe3Sdamjan		-lc \
277f006f9b4SDamjan Jovanovic		-o $(if $(call gb_Library_is_udk_versioned,$(1)),$(1).$(gb_UDK_MAJOR),$(1)))
278f006f9b4SDamjan Jovanovicendef
279f006f9b4SDamjan Jovanovic
280f006f9b4SDamjan Jovanovicdefine gb_LinkTarget__command_symlink_udk_versioned_library
281f006f9b4SDamjan Jovanovic	$(if $(call gb_Library_is_udk_versioned,$(1)),
282f006f9b4SDamjan Jovanovic		$(call gb_Helper_abbreviate_dirs,\
283f006f9b4SDamjan Jovanovic			rm -f $(1) && ln -s $(notdir $(1)).$(gb_UDK_MAJOR) $(1)))
284cdf0e10cSrcweirendef
285cdf0e10cSrcweir
286cdf0e10cSrcweirdefine gb_LinkTarget__command_staticlink
287cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
288cdf0e10cSrcweir	mkdir -p $(dir $(1)) && \
289cdf0e10cSrcweir	$(gb_AR) -rsu $(1) \
290cdf0e10cSrcweir		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
291cdf0e10cSrcweir		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
292cdf0e10cSrcweir		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
293cdf0e10cSrcweir		2> /dev/null)
294cdf0e10cSrcweirendef
295cdf0e10cSrcweir
296cdf0e10cSrcweirdefine gb_LinkTarget__command
297cdf0e10cSrcweir$(call gb_Output_announce,$(2),$(true),LNK,4)
298dfce871fSDamjan Jovanovic$(if $(filter Library GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1)))
299f006f9b4SDamjan Jovanovic$(if $(filter Library,$(TARGETTYPE)),$(call gb_LinkTarget__command_symlink_udk_versioned_library,$(1)))
300cdf0e10cSrcweir$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
301cdf0e10cSrcweirendef
302cdf0e10cSrcweir
303cdf0e10cSrcweir
304cdf0e10cSrcweir# Library class
305cdf0e10cSrcweir
306cdf0e10cSrcweirgb_Library_DEFS :=
307cdf0e10cSrcweirgb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack
308cdf0e10cSrcweirgb_Library_SYSPRE := lib
309cdf0e10cSrcweirgb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
310cdf0e10cSrcweirgb_Library_PLAINEXT := .so
311cdf0e10cSrcweirgb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
312cdf0e10cSrcweirifeq ($(gb_PRODUCT),$(true))
313cdf0e10cSrcweirgb_Library_STLEXT := port_gcc$(gb_Library_PLAINEXT)
314cdf0e10cSrcweirelse
315cdf0e10cSrcweirgb_Library_STLEXT := port_gcc_stldebug$(gb_Library_PLAINEXT)
316cdf0e10cSrcweirendif
3173b02a9c8SDamjan Jovanovicgb_Library_VERSIONMAPFLAG := -Wl,--version-script
318cdf0e10cSrcweir
319cdf0e10cSrcweirifeq ($(CPUNAME),X86_64)
3205f9a7a39SHerbert Dürrgb_Library_OOOEXT := $(gb_Library_PLAINEXT)
321cdf0e10cSrcweirgb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
322cdf0e10cSrcweirelse
3235f9a7a39SHerbert Dürrgb_Library_OOOEXT := $(gb_Library_PLAINEXT)
324cdf0e10cSrcweirgb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
325cdf0e10cSrcweirendif
326cdf0e10cSrcweir
327cdf0e10cSrcweirgb_Library_PLAINLIBS_NONE += \
328b63233d8Sdamjan	fontconfig \
329b63233d8Sdamjan	Xrender \
330cdf0e10cSrcweir	dl \
331828da808SPedro Giffuni	freetype \
332cdf0e10cSrcweir	m \
333cdf0e10cSrcweir	pthread \
334cdf0e10cSrcweir	X11 \
335828da808SPedro Giffuni	Xext \
336828da808SPedro Giffuni	SM \
337b63233d8Sdamjan	ICE
338cdf0e10cSrcweir
339cdf0e10cSrcweirgb_Library_FILENAMES := \
340cdf0e10cSrcweir	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
341cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
342cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
343cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
344cdf0e10cSrcweir	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
345cdf0e10cSrcweir	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
346cdf0e10cSrcweir	$(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
347cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
348cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
349cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
350cdf0e10cSrcweir
351cdf0e10cSrcweir
352cdf0e10cSrcweirgb_Library_LAYER := \
353cdf0e10cSrcweir	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
354cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
355cdf0e10cSrcweir	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
356cdf0e10cSrcweir	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
357cdf0e10cSrcweir	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
358cdf0e10cSrcweir	$(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
359cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
360cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
361cdf0e10cSrcweir	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
362cdf0e10cSrcweir
363cdf0e10cSrcweirdefine gb_Library_get_rpath
364cdf0e10cSrcweir'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \
365cdf0e10cSrcweir'-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)'
366cdf0e10cSrcweirendef
367cdf0e10cSrcweir
368cdf0e10cSrcweirdefine gb_Library_Library_platform
369cdf0e10cSrcweir$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1))
370cdf0e10cSrcweir
371f006f9b4SDamjan Jovanovicifneq (,$(call gb_Library_is_udk_versioned,$(call gb_Library_get_target,$(1))))
372f006f9b4SDamjan Jovanovic$(call gb_Library_get_target,$(1)) \
373f006f9b4SDamjan Jovanovic$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS +=  \
374f006f9b4SDamjan Jovanovic	$(call gb_Library_get_target,$(1)).$(gb_UDK_MAJOR)
375f006f9b4SDamjan Jovanovicendif
376cdf0e10cSrcweirendef
377cdf0e10cSrcweir
378cdf0e10cSrcweir
379cdf0e10cSrcweir# StaticLibrary class
380cdf0e10cSrcweir
381cdf0e10cSrcweirgb_StaticLibrary_DEFS :=
382cdf0e10cSrcweirgb_StaticLibrary_SYSPRE := lib
383cdf0e10cSrcweirgb_StaticLibrary_PLAINEXT := .a
384cdf0e10cSrcweirgb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
385cdf0e10cSrcweir
386cdf0e10cSrcweirgb_StaticLibrary_FILENAMES := \
387cdf0e10cSrcweir	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
388cdf0e10cSrcweir	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
389cdf0e10cSrcweir
390cdf0e10cSrcweirgb_StaticLibrary_StaticLibrary_platform =
391cdf0e10cSrcweir
392cdf0e10cSrcweir
393cdf0e10cSrcweir# Executable class
394cdf0e10cSrcweir
395cdf0e10cSrcweirgb_Executable_EXT :=
396cdf0e10cSrcweir
397cdf0e10cSrcweirgb_Executable_LAYER := \
398cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
399cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
400cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
401cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
402cdf0e10cSrcweir	$(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
403cdf0e10cSrcweir
404cdf0e10cSrcweir
405cdf0e10cSrcweirdefine gb_Executable_get_rpath
406cdf0e10cSrcweir'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))' \
407cdf0e10cSrcweir-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)
408cdf0e10cSrcweirendef
409cdf0e10cSrcweir
410cdf0e10cSrcweirdefine gb_Executable_Executable_platform
411cdf0e10cSrcweir$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1))
412cdf0e10cSrcweir
413cdf0e10cSrcweirendef
414cdf0e10cSrcweir
415cdf0e10cSrcweir
416e75d772dSDamjan Jovanovic# GoogleTest class
417e75d772dSDamjan Jovanovic
418e75d772dSDamjan Jovanovicgb_GoogleTest_GTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
419e75d772dSDamjan Jovanovicgb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT)
420e75d772dSDamjan Jovanovic
421e75d772dSDamjan Jovanovicdefine gb_GoogleTest_GoogleTest_platform
422e75d772dSDamjan Jovanovic$(call gb_LinkTarget_get_target,$(2)) : RPATH := -Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)
423e75d772dSDamjan Jovanovicendef
424e75d772dSDamjan Jovanovic
425cdf0e10cSrcweir# JunitTest class
426cdf0e10cSrcweir
427cdf0e10cSrcweirdefine gb_JunitTest_JunitTest_platform
428cdf0e10cSrcweir$(call gb_JunitTest_get_target,$(1)) : DEFS := \
42964c5c8b7SDamjan Jovanovic	-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(SRCDIR)/instsetoo_native/$(INPATH)/Apache_OpenOffice/installed/install/en-US/openoffice4/program/soffice}" \
430cdf0e10cSrcweir    -Dorg.openoffice.test.arg.env=LD_LIBRARY_PATH \
431cdf0e10cSrcweir    -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \
432cdf0e10cSrcweir
433cdf0e10cSrcweirendef
434cdf0e10cSrcweir
435cdf0e10cSrcweir# SdiTarget class
436cdf0e10cSrcweir
437cdf0e10cSrcweirgb_SdiTarget_SVIDLPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
438cdf0e10cSrcweir
439cdf0e10cSrcweir# SrsPartMergeTarget
440cdf0e10cSrcweir
441cdf0e10cSrcweirgb_SrsPartMergeTarget_TRANSEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
442cdf0e10cSrcweir
443cdf0e10cSrcweir# SrsPartTarget class
444cdf0e10cSrcweir
445cdf0e10cSrcweirgb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc
446cdf0e10cSrcweirgb_SrsPartTarget_RSCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
447cdf0e10cSrcweir
448cdf0e10cSrcweirdefine gb_SrsPartTarget__command_dep
449cdf0e10cSrcweir$(call gb_Helper_abbreviate_dirs,\
450cdf0e10cSrcweir	$(gb_GCCP) \
451cdf0e10cSrcweir		-MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
452cdf0e10cSrcweir		$(INCLUDE) \
453cdf0e10cSrcweir		$(DEFS) \
454cdf0e10cSrcweir		-c -x c++-header $(2) \
455cdf0e10cSrcweir		-o $(call gb_SrsPartTarget_get_dep_target,$(1)))
456cdf0e10cSrcweirendef
457cdf0e10cSrcweir
458cdf0e10cSrcweir
459cdf0e10cSrcweir# ComponentTarget
460cdf0e10cSrcweir
461cdf0e10cSrcweirgb_XSLTPROCPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
462cdf0e10cSrcweirgb_Library_COMPONENTPREFIXES := \
463cdf0e10cSrcweir    OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \
464cdf0e10cSrcweir    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
465b63233d8Sdamjan    NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
466b63233d8Sdamjan
467b63233d8Sdamjan# UnoApiTarget
468b63233d8Sdamjan
469b63233d8Sdamjangb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc
470b63233d8Sdamjangb_UnoApiTarget_IDLCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET)
471b63233d8Sdamjangb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge
472b63233d8Sdamjangb_UnoApiTarget_REGMERGECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET)
473b63233d8Sdamjangb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare
474b63233d8Sdamjangb_UnoApiTarget_REGCOMPARECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET)
475b63233d8Sdamjangb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker
476b63233d8Sdamjangb_UnoApiTarget_CPPUMAKERCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET)
477b63233d8Sdamjangb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview
478b63233d8Sdamjangb_UnoApiTarget_REGVIEWCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET)
479cdf0e10cSrcweir
480cdf0e10cSrcweir# vim: set noet sw=4 ts=4:
481