xref: /aoo42x/main/solenv/gbuild/platform/freebsd.mk (revision 1bb309c6)
1ead13252SPedro Giffuni#*************************************************************************
2ead13252SPedro Giffuni#
37fcdd55bSPedro Giffuni#  Licensed to the Apache Software Foundation (ASF) under one
47fcdd55bSPedro Giffuni#  or more contributor license agreements.  See the NOTICE file
57fcdd55bSPedro Giffuni#  distributed with this work for additional information
67fcdd55bSPedro Giffuni#  regarding copyright ownership.  The ASF licenses this file
77fcdd55bSPedro Giffuni#  to you under the Apache License, Version 2.0 (the
87fcdd55bSPedro Giffuni#  "License"); you may not use this file except in compliance
97fcdd55bSPedro Giffuni#  with the License.  You may obtain a copy of the License at
107fcdd55bSPedro Giffuni#
117fcdd55bSPedro Giffuni#    http://www.apache.org/licenses/LICENSE-2.0
127fcdd55bSPedro Giffuni#
137fcdd55bSPedro Giffuni#  Unless required by applicable law or agreed to in writing,
147fcdd55bSPedro Giffuni#  software distributed under the License is distributed on an
157fcdd55bSPedro Giffuni#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167fcdd55bSPedro Giffuni#  KIND, either express or implied.  See the License for the
177fcdd55bSPedro Giffuni#  specific language governing permissions and limitations
187fcdd55bSPedro Giffuni#  under the License.
19ead13252SPedro Giffuni#
20ead13252SPedro Giffuni#*************************************************************************
21ead13252SPedro Giffuni
22ead13252SPedro GiffuniGUI := UNX
23ead13252SPedro Giffuni
2437816a14SPedro Giffuni# BSD mktemp -t expects a prefix, not a pattern
2537816a14SPedro Giffunigb_MKTEMP ?= /usr/bin/mktemp -t gbuild.
26ead13252SPedro Giffuni
27ead13252SPedro Giffunigb_CC := cc
288969592bSPedro Giffunigb_CXX := c++
298969592bSPedro Giffunigb_GCCP := cc
30ead13252SPedro Giffunigb_AR := ar
31ead13252SPedro Giffunigb_AWK := awk
32ead13252SPedro Giffunigb_CLASSPATHSEP := :
33ead13252SPedro Giffuni
34ead13252SPedro Giffuni# normalize setsolar and configure env.
35ead13252SPedro Giffuniifeq ($(CPU),X)
36ead13252SPedro GiffuniCPUNAME := X86_64
37ead13252SPedro Giffuniendif
38ead13252SPedro Giffuni
39e15a4534Spfgifeq ($(CPU),P)
40e15a4534SpfgCPUNAME := POWERPC64
41e15a4534Spfgendif
42e15a4534Spfg
43ead13252SPedro Giffuni# use CC/CXX if they are nondefaults
44ead13252SPedro Giffuniifneq ($(origin CC),default)
45ead13252SPedro Giffunigb_CC := $(CC)
46ead13252SPedro Giffunigb_GCCP := $(CC)
47ead13252SPedro Giffuniendif
48ead13252SPedro Giffuniifneq ($(origin CXX),default)
49ead13252SPedro Giffunigb_CXX := $(CXX)
50ead13252SPedro Giffuniendif
51ead13252SPedro Giffuni
52ead13252SPedro Giffunigb_OSDEFS := \
53ead13252SPedro Giffuni	-D$(OS) \
54ead13252SPedro Giffuni	-D_PTHREADS \
55ead13252SPedro Giffuni	-DUNIX \
56ead13252SPedro Giffuni	-DUNX \
57ead13252SPedro Giffuni	$(PTHREAD_CFLAGS) \
58ead13252SPedro Giffuni
59ead13252SPedro Giffunigb_COMPILERDEFS := \
60ead13252SPedro Giffuni	-D$(COM) \
61ead13252SPedro Giffuni	-DHAVE_GCC_VISIBILITY_FEATURE \
62386ca866SDon Lewis	-DCPPU_ENV=$(COMNAME) \
63ead13252SPedro Giffuni
64787e1130SDon Lewisgb_CPUDEFS := -D$(ALIGN) -D$(CPUNAME)
658cb913c4SDamjan Jovanovicifeq ($(CPUNAME),INTEL)
668cb913c4SDamjan Jovanovicgb_CPUDEFS += -DX86
67e15a4534Spfgendif
68e15a4534Spfg
69ead13252SPedro Giffunigb_CFLAGS := \
70ead13252SPedro Giffuni	-Wall \
71ead13252SPedro Giffuni	-Wendif-labels \
72ead13252SPedro Giffuni	-Wextra \
73ead13252SPedro Giffuni	-Wshadow \
74ead13252SPedro Giffuni	-fPIC \
75ead13252SPedro Giffuni	-fmessage-length=0 \
76ead13252SPedro Giffuni	-fno-common \
77ead13252SPedro Giffuni	-fno-strict-aliasing \
78ead13252SPedro Giffuni	-fvisibility=hidden \
79ead13252SPedro Giffuni	-pipe \
80ead13252SPedro Giffuni
81ead13252SPedro Giffunigb_CXXFLAGS := \
82ead13252SPedro Giffuni	-Wall \
83ead13252SPedro Giffuni	-Wendif-labels \
84ead13252SPedro Giffuni	-Wextra \
85ead13252SPedro Giffuni	-Wno-ctor-dtor-privacy \
86ead13252SPedro Giffuni	-Wno-non-virtual-dtor \
87ead13252SPedro Giffuni	-Wshadow \
88ead13252SPedro Giffuni	-fPIC \
89ead13252SPedro Giffuni	-fmessage-length=0 \
90ead13252SPedro Giffuni	-fno-common \
91ead13252SPedro Giffuni	-fno-strict-aliasing \
92ead13252SPedro Giffuni	-fno-use-cxa-atexit \
93ead13252SPedro Giffuni	-fvisibility-inlines-hidden \
94ead13252SPedro Giffuni	-fvisibility=hidden \
95e3393df0SDon Lewis	-std=gnu++98 \
96c25219e0SPedro Giffuni	-pipe
97c25219e0SPedro Giffuniifeq ($(COM),CLANG)
98c25219e0SPedro Giffunigb_CXXFLAGS += -DHAVE_STL_INCLUDE_PATH
99c25219e0SPedro Giffunielse
100c25219e0SPedro Giffunigb_CXXFLAGS += -DBOOST_TR1_DISABLE_INCLUDE_NEXT -DBOOST_TR1_GCC_INCLUDE_PATH=c++
101c25219e0SPedro Giffuniendif
102ead13252SPedro Giffuni
103ead13252SPedro Giffuniifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
104ead13252SPedro Giffunigb_CFLAGS_WERROR := -Werror
105ead13252SPedro Giffunigb_CXXFLAGS_WERROR := -Werror
106ead13252SPedro Giffuniendif
107ead13252SPedro Giffuni
108ead13252SPedro Giffuniifneq ($(strip $(SYSBASE)),)
10971df68dcSPedro Giffunigb_CXXFLAGS += --sysroot=$(SYSBASE)
11071df68dcSPedro Giffunigb_CFLAGS += --sysroot=$(SYSBASE)
11171df68dcSPedro Giffunigb_LinkTarget_LDFLAGS := -Wl,--sysroot=$(SYSBASE)
112ead13252SPedro Giffuniendif
113ead13252SPedro Giffunigb_LinkTarget_EXCEPTIONFLAGS := \
114ead13252SPedro Giffuni	-DEXCEPTIONS_ON \
115c25219e0SPedro Giffuni	-fexceptions
116c25219e0SPedro Giffuniifeq ($(COM),GCC)
117c25219e0SPedro Giffunigb_LinkTarget_EXCEPTIONFLAGS +=  -fno-enforce-eh-specs
118c25219e0SPedro Giffuniendif
119ead13252SPedro Giffuni
120ead13252SPedro Giffunigb_LinkTarget_NOEXCEPTIONFLAGS := \
121ead13252SPedro Giffuni	-DEXCEPTIONS_OFF \
122ead13252SPedro Giffuni	-fno-exceptions \
123ead13252SPedro Giffuni
12471df68dcSPedro Giffunigb_LinkTarget_LDFLAGS += \
12571df68dcSPedro Giffuni	-Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
126ead13252SPedro Giffuni	-Wl,-z,combreloc \
127ead13252SPedro Giffuni	-Wl,-z,defs \
128ead13252SPedro Giffuni	$(subst -L../lib , ,$(SOLARLIB)) \
129c25219e0SPedro Giffuni	${FBSD_GCC_RPATH} \
130a8e4828dSPedro Giffuni	 \
131ead13252SPedro Giffuni
132ead13252SPedro Giffuniifeq ($(HAVE_LD_HASH_STYLE),TRUE)
133ead13252SPedro Giffunigb_LinkTarget_LDFLAGS += \
134ead13252SPedro Giffuni	-Wl,--hash-style=both \
135ead13252SPedro Giffuni
136ead13252SPedro Giffuniendif
137ead13252SPedro Giffuni
138ead13252SPedro Giffuniifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),)
139ead13252SPedro Giffunigb_LinkTarget_LDFLAGS += \
140ead13252SPedro Giffuni	-Wl,--dynamic-list-cpp-new \
141ead13252SPedro Giffuni	-Wl,--dynamic-list-cpp-typeinfo \
142ead13252SPedro Giffuni	-Wl,-Bsymbolic-functions \
143ead13252SPedro Giffuni
144ead13252SPedro Giffuniendif
145ead13252SPedro Giffuni
146e3393df0SDon Lewisifneq ($(filter $(CPUNAME),INTEL X86_64),)
147e3393df0SDon Lewisgb_CFLAGS += -fstack-protector
148e3393df0SDon Lewisgb_CXXFLAGS += -fstack-protector
149e3393df0SDon Lewisgb_LinkTarget_LDFLAGS += -fstack-protector
150e3393df0SDon Lewisendif
151e3393df0SDon Lewis
152ead13252SPedro Giffuniifeq ($(gb_DEBUGLEVEL),2)
153ead13252SPedro Giffunigb_COMPILEROPTFLAGS := -O0
1548e6bd3e9SDon Lewisgb_COMPILEROPT1FLAGS := -O0
155ead13252SPedro Giffunielse
156d59d07b5SDon Lewis# Clang versions 3.6.x and 3.7.x generate bad DWARF CFI for stack unwinding
157d59d07b5SDon Lewis# on 32-bit Intel when compiling with -Os optimization.  See
158d59d07b5SDon Lewis# <https://llvm.org/bugs/show_bug.cgi?id=24792>
159d59d07b5SDon Lewis# Work around this by using "-O2 -fno-unroll-loops" instead.
160d59d07b5SDon Lewisifeq ($(COM)$(CPUNAME)$(shell expr $(CCNUMVER) '>=' 000300060000 '&' $(CCNUMVER) '<' 000300080000),CLANGINTEL1)
161d59d07b5SDon Lewisgb_COMPILEROPTFLAGS := -O2 -fno-unroll-loops
162d59d07b5SDon Lewiselse
163ead13252SPedro Giffunigb_COMPILEROPTFLAGS := -Os
164d59d07b5SDon Lewisendif
1658e6bd3e9SDon Lewisgb_COMPILEROPT1FLAGS := -O1
166ead13252SPedro Giffuniendif
167ead13252SPedro Giffuni
168ead13252SPedro Giffunigb_COMPILERNOOPTFLAGS := -O0
169ead13252SPedro Giffuni
170ead13252SPedro Giffuni# Helper class
171ead13252SPedro Giffuni
172ead13252SPedro Giffunigb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
173ead13252SPedro Giffuni
1741ff5b6ebSPedro Giffuni# convert parametters filesystem root to native notation
1751ff5b6ebSPedro Giffuni# does some real work only on windows, make sure not to
1761ff5b6ebSPedro Giffuni# break the dummy implementations on unx*
1771ff5b6ebSPedro Giffunidefine gb_Helper_convert_native
1781ff5b6ebSPedro Giffuni$(1)
1791ff5b6ebSPedro Giffuniendef
180ead13252SPedro Giffuni
181*1bb309c6SDamjan Jovanovic# AsmObject class
182*1bb309c6SDamjan Jovanovic
183*1bb309c6SDamjan Jovanovicgb_AsmObject_EXT := .s
184*1bb309c6SDamjan Jovanovic
185*1bb309c6SDamjan Jovanovicdefine gb_AsmObject__command
186*1bb309c6SDamjan Jovanovic$(call gb_Output_announce,$(2),$(true),ASM,3)
187*1bb309c6SDamjan Jovanovic$(call gb_Helper_abbreviate_dirs,\
188*1bb309c6SDamjan Jovanovic	mkdir -p $(dir $(1)) && \
189*1bb309c6SDamjan Jovanovic	$(gb_CC) \
190*1bb309c6SDamjan Jovanovic		$(DEFS) \
191*1bb309c6SDamjan Jovanovic		$(T_CFLAGS) \
192*1bb309c6SDamjan Jovanovic		$(CFLAGS) \
193*1bb309c6SDamjan Jovanovic		-c $(3) \
194*1bb309c6SDamjan Jovanovic		-o $(1) \
195*1bb309c6SDamjan Jovanovic		-MT $(1) \
196*1bb309c6SDamjan Jovanovic		-I$(dir $(3)) \
197*1bb309c6SDamjan Jovanovic		$(INCLUDE))
198*1bb309c6SDamjan Jovanovicendef
199*1bb309c6SDamjan Jovanovic
200ead13252SPedro Giffuni# CObject class
201ead13252SPedro Giffuni
202b63233d8Sdamjan# $(call gb_CObject__command,object,relative-source,source,dep-file)
203ead13252SPedro Giffunidefine gb_CObject__command
204ead13252SPedro Giffuni$(call gb_Output_announce,$(2),$(true),C  ,3)
205ead13252SPedro Giffuni$(call gb_Helper_abbreviate_dirs,\
206b63233d8Sdamjan	mkdir -p $(dir $(1)) $(dir $(4)) && \
207ead13252SPedro Giffuni	$(gb_CC) \
208b63233d8Sdamjan		$(DEFS) \
209b63233d8Sdamjan		$(T_CFLAGS) \
2108e6bd3e9SDon Lewis		$(CFLAGS) \
211ead13252SPedro Giffuni		-c $(3) \
212ead13252SPedro Giffuni		-o $(1) \
213b63233d8Sdamjan		-MMD -MT $(1) \
214b63233d8Sdamjan		-MF $(4) \
215ead13252SPedro Giffuni		-I$(dir $(3)) \
216ead13252SPedro Giffuni		$(INCLUDE))
217ead13252SPedro Giffuniendef
218ead13252SPedro Giffuni
219a8e4828dSPedro Giffuni# convert parametters filesystem root to native notation
220a8e4828dSPedro Giffuni# does some real work only on windows, make sure not to
221a8e4828dSPedro Giffuni# break the dummy implementations on unx*
222a8e4828dSPedro Giffunidefine gb_Helper_convert_native
223a8e4828dSPedro Giffuni$(1)
224a8e4828dSPedro Giffuniendef
225ead13252SPedro Giffuni
226ead13252SPedro Giffuni# CxxObject class
227ead13252SPedro Giffuni
228b63233d8Sdamjan# $(call gb_CxxObject__command,object,relative-source,source,dep-file)
229ead13252SPedro Giffunidefine gb_CxxObject__command
230ead13252SPedro Giffuni$(call gb_Output_announce,$(2),$(true),CXX,3)
231ead13252SPedro Giffuni$(call gb_Helper_abbreviate_dirs,\
232b63233d8Sdamjan	mkdir -p $(dir $(1)) $(dir $(4)) && \
233ead13252SPedro Giffuni	$(gb_CXX) \
234b63233d8Sdamjan		$(DEFS) \
235b63233d8Sdamjan		$(T_CXXFLAGS) \
2368e6bd3e9SDon Lewis		$(CXXFLAGS) \
237ead13252SPedro Giffuni		-c $(3) \
238ead13252SPedro Giffuni		-o $(1) \
239b63233d8Sdamjan		-MMD -MT $(1) \
240b63233d8Sdamjan		-MF $(4) \
241ead13252SPedro Giffuni		-I$(dir $(3)) \
242ead13252SPedro Giffuni		$(INCLUDE_STL) $(INCLUDE))
243ead13252SPedro Giffuniendef
244ead13252SPedro Giffuni
245ead13252SPedro Giffuni
246ead13252SPedro Giffuni# LinkTarget class
247ead13252SPedro Giffuni
248ead13252SPedro Giffunidefine gb_LinkTarget__get_rpath_for_layer
249ead13252SPedro Giffuni$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
250ead13252SPedro Giffuniendef
251ead13252SPedro Giffuni
252ead13252SPedro Giffunigb_LinkTarget__RPATHS := \
253ead13252SPedro Giffuni	URELIB:\dORIGIN \
254ead13252SPedro Giffuni	UREBIN:\dORIGIN/../lib:\dORIGIN \
255ead13252SPedro Giffuni	OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
256ead13252SPedro Giffuni	BRAND:\dORIGIN:\dORIGIN/../basis-link/program:\dORIGIN/../basis-link/ure-link/lib \
257ead13252SPedro Giffuni	SDKBIN:\dORIGIN/../../ure-link/lib \
258ead13252SPedro Giffuni	NONEBIN:\dORIGIN/../lib:\dORIGIN \
259ead13252SPedro Giffuni
260b63233d8Sdamjangb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
261ead13252SPedro Giffunigb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
262ead13252SPedro Giffuni
263a8e4828dSPedro Giffuniifeq ($(gb_DEBUGLEVEL),0)
264a8e4828dSPedro Giffunigb_LinkTarget_LDFLAGS += -Wl,-O1
265a8e4828dSPedro Giffuniendif
266a8e4828dSPedro Giffuni
26758303369SDamjan Jovanovicifeq ($(COM),CLANG)
2689e1b801eSDamjan Jovanovicifeq ($(ENABLE_SYMBOLS),SMALL)
2699e1b801eSDamjan Jovanovicgb_DEBUG_CFLAGS := -ggdb1 -fno-inline
2709e1b801eSDamjan Jovanovicelse
271b63233d8Sdamjangb_DEBUG_CFLAGS := -ggdb3 -fno-inline
2729e1b801eSDamjan Jovanovicendif
2739e1b801eSDamjan Jovanovicelse
2749e1b801eSDamjan Jovanovicifeq ($(ENABLE_SYMBOLS),SMALL)
2759e1b801eSDamjan Jovanovicgb_DEBUG_CFLAGS := -ggdb1 -finline-limit=0 -fno-inline -fno-default-inline
27658303369SDamjan Jovanovicelse
277b63233d8Sdamjangb_DEBUG_CFLAGS := -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
27858303369SDamjan Jovanovicendif
279ead13252SPedro Giffuniendif
280ead13252SPedro Giffuni
281ead13252SPedro Giffunigb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC)))
282ead13252SPedro Giffunigb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
283ead13252SPedro Giffuni
284ead13252SPedro Giffunidefine gb_LinkTarget__command_dynamiclink
285ead13252SPedro Giffuni$(call gb_Helper_abbreviate_dirs,\
286ead13252SPedro Giffuni	mkdir -p $(dir $(1)) && \
287ead13252SPedro Giffuni	$(gb_CXX) \
288dfce871fSDamjan Jovanovic		$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
2893b02a9c8SDamjan Jovanovic		$(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \
290f006f9b4SDamjan Jovanovic		$(if $(call gb_Library_is_udk_versioned,$(1)),-Wl$(COMMA)-h$(notdir $(1)).$(gb_UDK_MAJOR)) \
291b63233d8Sdamjan		$(subst \d,$$,$(RPATH)) \
292b63233d8Sdamjan		$(T_LDFLAGS) \
293ead13252SPedro Giffuni		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
294ead13252SPedro Giffuni		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
295ead13252SPedro Giffuni		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
2969168f84aSdamjan		-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
2979168f84aSdamjan		$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
2989168f84aSdamjan		$(patsubst %,-l%,$(EXTERNAL_LIBS)) \
299b63233d8Sdamjan		$(LIBS) \
300f006f9b4SDamjan Jovanovic		-o $(if $(call gb_Library_is_udk_versioned,$(1)),$(1).$(gb_UDK_MAJOR),$(1)))
301f006f9b4SDamjan Jovanovicendef
302f006f9b4SDamjan Jovanovic
303f006f9b4SDamjan Jovanovicdefine gb_LinkTarget__command_symlink_udk_versioned_library
304f006f9b4SDamjan Jovanovic	$(if $(call gb_Library_is_udk_versioned,$(1)),
305f006f9b4SDamjan Jovanovic		$(call gb_Helper_abbreviate_dirs,\
306f006f9b4SDamjan Jovanovic			rm -f $(1) && ln -s $(notdir $(1)).$(gb_UDK_MAJOR) $(1)))
307ead13252SPedro Giffuniendef
308ead13252SPedro Giffuni
309ead13252SPedro Giffunidefine gb_LinkTarget__command_staticlink
310ead13252SPedro Giffuni$(call gb_Helper_abbreviate_dirs,\
311ead13252SPedro Giffuni	mkdir -p $(dir $(1)) && \
312ead13252SPedro Giffuni	$(gb_AR) -rsu $(1) \
313ead13252SPedro Giffuni		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
314ead13252SPedro Giffuni		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
315ead13252SPedro Giffuni		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
316ead13252SPedro Giffuni		2> /dev/null)
317ead13252SPedro Giffuniendef
318ead13252SPedro Giffuni
319ead13252SPedro Giffunidefine gb_LinkTarget__command
320ead13252SPedro Giffuni$(call gb_Output_announce,$(2),$(true),LNK,4)
321dfce871fSDamjan Jovanovic$(if $(filter Library GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1)))
322f006f9b4SDamjan Jovanovic$(if $(filter Library,$(TARGETTYPE)),$(call gb_LinkTarget__command_symlink_udk_versioned_library,$(1)))
323ead13252SPedro Giffuni$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
324ead13252SPedro Giffuniendef
325ead13252SPedro Giffuni
326ead13252SPedro Giffuni
327ead13252SPedro Giffuni# Library class
328ead13252SPedro Giffuni
329ead13252SPedro Giffunigb_Library_DEFS :=
330ead13252SPedro Giffunigb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack
331ead13252SPedro Giffunigb_Library_SYSPRE := lib
332ead13252SPedro Giffunigb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
333ead13252SPedro Giffunigb_Library_PLAINEXT := .so
334ead13252SPedro Giffunigb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
335ead13252SPedro Giffuniifeq ($(gb_PRODUCT),$(true))
336ead13252SPedro Giffunigb_Library_STLEXT := port_gcc$(gb_Library_PLAINEXT)
337ead13252SPedro Giffunielse
338ead13252SPedro Giffunigb_Library_STLEXT := port_gcc_stldebug$(gb_Library_PLAINEXT)
339ead13252SPedro Giffuniendif
3403b02a9c8SDamjan Jovanovicgb_Library_VERSIONMAPFLAG := -Wl,--version-script
341ead13252SPedro Giffuni
342ead13252SPedro Giffuniifeq ($(CPUNAME),X86_64)
3438969592bSPedro Giffunigb_Library_OOOEXT := $(gb_Library_PLAINEXT)
344ead13252SPedro Giffunigb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
345ead13252SPedro Giffunielse
3468969592bSPedro Giffunigb_Library_OOOEXT := $(gb_Library_PLAINEXT)
347ead13252SPedro Giffunigb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
348ead13252SPedro Giffuniendif
349ead13252SPedro Giffuni
350ead13252SPedro Giffunigb_Library_PLAINLIBS_NONE += \
351b63233d8Sdamjan	fontconfig \
352b63233d8Sdamjan	Xrender \
353ead13252SPedro Giffuni	dl \
3541ff5b6ebSPedro Giffuni	freetype \
355ead13252SPedro Giffuni	m \
356ead13252SPedro Giffuni	pthread \
357ead13252SPedro Giffuni	X11 \
358828da808SPedro Giffuni	Xext \
359828da808SPedro Giffuni	SM \
360b63233d8Sdamjan	ICE
361ead13252SPedro Giffuni
362ead13252SPedro Giffunigb_Library_FILENAMES := \
363ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
364ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
365ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
366ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
367ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
368ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
369ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
370ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
371ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
372ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
373ead13252SPedro Giffuni
374ead13252SPedro Giffuni
375ead13252SPedro Giffunigb_Library_LAYER := \
376ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
377ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
378ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
379ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
380ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
381ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
382ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
383ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
384ead13252SPedro Giffuni	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
385ead13252SPedro Giffuni
386ead13252SPedro Giffunidefine gb_Library_get_rpath
387a8e4828dSPedro Giffuni-Wl,-z,origin '-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \
38871df68dcSPedro Giffuni'-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)'
389ead13252SPedro Giffuniendef
390ead13252SPedro Giffuni
391ead13252SPedro Giffunidefine gb_Library_Library_platform
392ead13252SPedro Giffuni$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1))
393ead13252SPedro Giffuni
394f006f9b4SDamjan Jovanovicifneq (,$(call gb_Library_is_udk_versioned,$(call gb_Library_get_target,$(1))))
395f006f9b4SDamjan Jovanovic$(call gb_Library_get_target,$(1)) \
396f006f9b4SDamjan Jovanovic$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS +=  \
397f006f9b4SDamjan Jovanovic	$(call gb_Library_get_target,$(1)).$(gb_UDK_MAJOR)
398f006f9b4SDamjan Jovanovic
399f006f9b4SDamjan Jovanovicendif
400ead13252SPedro Giffuniendef
401ead13252SPedro Giffuni
402ead13252SPedro Giffuni
403ead13252SPedro Giffuni# StaticLibrary class
404ead13252SPedro Giffuni
405ead13252SPedro Giffunigb_StaticLibrary_DEFS :=
406ead13252SPedro Giffunigb_StaticLibrary_SYSPRE := lib
407ead13252SPedro Giffunigb_StaticLibrary_PLAINEXT := .a
408ead13252SPedro Giffunigb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
409ead13252SPedro Giffuni
410ead13252SPedro Giffunigb_StaticLibrary_FILENAMES := \
411ead13252SPedro Giffuni	$(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
412ead13252SPedro Giffuni	$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
413ead13252SPedro Giffuni
414ead13252SPedro Giffunigb_StaticLibrary_StaticLibrary_platform =
415ead13252SPedro Giffuni
416ead13252SPedro Giffuni
417ead13252SPedro Giffuni# Executable class
418ead13252SPedro Giffuni
419ead13252SPedro Giffunigb_Executable_EXT :=
420ead13252SPedro Giffuni
421ead13252SPedro Giffunigb_Executable_LAYER := \
422ead13252SPedro Giffuni	$(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
423ead13252SPedro Giffuni	$(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
424ead13252SPedro Giffuni	$(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
425ead13252SPedro Giffuni	$(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
426ead13252SPedro Giffuni	$(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
427ead13252SPedro Giffuni
428ead13252SPedro Giffuni
429ead13252SPedro Giffunidefine gb_Executable_get_rpath
430ead13252SPedro Giffuni'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))' \
431ead13252SPedro Giffuni-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)
432ead13252SPedro Giffuniendef
433ead13252SPedro Giffuni
434ead13252SPedro Giffunidefine gb_Executable_Executable_platform
435ead13252SPedro Giffuni$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1))
436ead13252SPedro Giffuni
437ead13252SPedro Giffuniendef
438ead13252SPedro Giffuni
439ead13252SPedro Giffuni
440e75d772dSDamjan Jovanovic# GoogleTest class
441e75d772dSDamjan Jovanovic
442e75d772dSDamjan Jovanovicgb_GoogleTest_GTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
443e75d772dSDamjan Jovanovicgb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT)
444e75d772dSDamjan Jovanovic
445e75d772dSDamjan Jovanovicdefine gb_GoogleTest_GoogleTest_platform
446e75d772dSDamjan Jovanovic$(call gb_LinkTarget_get_target,$(2)) : RPATH := -Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)
447e75d772dSDamjan Jovanovicendef
448e75d772dSDamjan Jovanovic
449ead13252SPedro Giffuni# JunitTest class
450ead13252SPedro Giffuni
451ead13252SPedro Giffunidefine gb_JunitTest_JunitTest_platform
452ead13252SPedro Giffuni$(call gb_JunitTest_get_target,$(1)) : DEFS := \
45364c5c8b7SDamjan Jovanovic	-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(SRCDIR)/instsetoo_native/$(INPATH)/Apache_OpenOffice/installed/install/en-US/openoffice4/program/soffice}" \
454ead13252SPedro Giffuni    -Dorg.openoffice.test.arg.env=LD_LIBRARY_PATH \
455ead13252SPedro Giffuni    -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \
456ead13252SPedro Giffuni
457ead13252SPedro Giffuniendef
458ead13252SPedro Giffuni
459ead13252SPedro Giffuni# SdiTarget class
460ead13252SPedro Giffuni
461ead13252SPedro Giffunigb_SdiTarget_SVIDLPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
462ead13252SPedro Giffuni
463ead13252SPedro Giffuni# SrsPartMergeTarget
464ead13252SPedro Giffuni
465ead13252SPedro Giffunigb_SrsPartMergeTarget_TRANSEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
466ead13252SPedro Giffuni
467ead13252SPedro Giffuni# SrsPartTarget class
468ead13252SPedro Giffuni
469ead13252SPedro Giffunigb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc
470ead13252SPedro Giffunigb_SrsPartTarget_RSCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
471ead13252SPedro Giffuni
472ead13252SPedro Giffunidefine gb_SrsPartTarget__command_dep
473ead13252SPedro Giffuni$(call gb_Helper_abbreviate_dirs,\
474ead13252SPedro Giffuni	$(gb_GCCP) \
475ead13252SPedro Giffuni		-MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
476ead13252SPedro Giffuni		$(INCLUDE) \
477ead13252SPedro Giffuni		$(DEFS) \
478ead13252SPedro Giffuni		-c -x c++-header $(2) \
479ead13252SPedro Giffuni		-o $(call gb_SrsPartTarget_get_dep_target,$(1)))
480ead13252SPedro Giffuniendef
481ead13252SPedro Giffuni
482ead13252SPedro Giffuni
483ead13252SPedro Giffuni# ComponentTarget
484ead13252SPedro Giffuni
485ead13252SPedro Giffunigb_XSLTPROCPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
486ead13252SPedro Giffunigb_Library_COMPONENTPREFIXES := \
487ead13252SPedro Giffuni    OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \
488ead13252SPedro Giffuni    URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
489a8e4828dSPedro Giffuni    NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
490a8e4828dSPedro Giffuni
491a8e4828dSPedro Giffuni# UnoApiTarget
492a8e4828dSPedro Giffuni
493a8e4828dSPedro Giffunigb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc
494a8e4828dSPedro Giffunigb_UnoApiTarget_IDLCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET)
495a8e4828dSPedro Giffunigb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge
496a8e4828dSPedro Giffunigb_UnoApiTarget_REGMERGECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET)
497a8e4828dSPedro Giffunigb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare
498a8e4828dSPedro Giffunigb_UnoApiTarget_REGCOMPARECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET)
499a8e4828dSPedro Giffunigb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker
500a8e4828dSPedro Giffunigb_UnoApiTarget_CPPUMAKERCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET)
501a8e4828dSPedro Giffunigb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview
502a8e4828dSPedro Giffunigb_UnoApiTarget_REGVIEWCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET)
503ead13252SPedro Giffuni
504ead13252SPedro Giffuni# vim: set noet sw=4 ts=4:
505