xref: /aoo42x/main/odk/settings/settings.mk (revision 1cfb2a70)
1122c3632SJürgen Schmidt#**************************************************************
22752044bSAriel Constenla-Haile#
3122c3632SJürgen Schmidt#  Licensed to the Apache Software Foundation (ASF) under one
4122c3632SJürgen Schmidt#  or more contributor license agreements.  See the NOTICE file
5122c3632SJürgen Schmidt#  distributed with this work for additional information
6122c3632SJürgen Schmidt#  regarding copyright ownership.  The ASF licenses this file
7122c3632SJürgen Schmidt#  to you under the Apache License, Version 2.0 (the
8122c3632SJürgen Schmidt#  "License"); you may not use this file except in compliance
9122c3632SJürgen Schmidt#  with the License.  You may obtain a copy of the License at
102752044bSAriel Constenla-Haile#
11122c3632SJürgen Schmidt#    http://www.apache.org/licenses/LICENSE-2.0
122752044bSAriel Constenla-Haile#
13122c3632SJürgen Schmidt#  Unless required by applicable law or agreed to in writing,
14122c3632SJürgen Schmidt#  software distributed under the License is distributed on an
15122c3632SJürgen Schmidt#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16122c3632SJürgen Schmidt#  KIND, either express or implied.  See the License for the
17122c3632SJürgen Schmidt#  specific language governing permissions and limitations
18122c3632SJürgen Schmidt#  under the License.
192752044bSAriel Constenla-Haile#
20122c3632SJürgen Schmidt#**************************************************************
21122c3632SJürgen Schmidt
22cdf0e10cSrcweir# Global settings file for the minimal build environment of the SDK
23cdf0e10cSrcweir# This file have to updated/extended for other platforms.
24cdf0e10cSrcweir
25cdf0e10cSrcweir# test for the platform
26cdf0e10cSrcweirPLATFORM := $(shell $(PRJ)/config.guess | cut -d"-" -f3,4)
27cdf0e10cSrcweir
28cdf0e10cSrcweir# config.guess is missing for windows. We rely on getting "" in this case.
29cdf0e10cSrcweirifeq "$(PLATFORM)" ""
30cdf0e10cSrcweirPLATFORM = windows
31cdf0e10cSrcweirendif
32cdf0e10cSrcweir
33cdf0e10cSrcweir# debug option, default is no debug
34cdf0e10cSrcweirDEBUG=no
35cdf0e10cSrcweirifeq "$(MAKECMDGOALS)" "debug"
36cdf0e10cSrcweirDEBUG=yes
37cdf0e10cSrcweirendif
38cdf0e10cSrcweir
39cdf0e10cSrcweir###########################################################################
40cdf0e10cSrcweir#
41cdf0e10cSrcweir# Java settings
42cdf0e10cSrcweir#
43cdf0e10cSrcweir###########################################################################
44cdf0e10cSrcweirJAVAC_FLAGS=
45cdf0e10cSrcweir
46cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
47cdf0e10cSrcweirJAVAC_FLAGS+=-g
48cdf0e10cSrcweirendif
49cdf0e10cSrcweir
50cdf0e10cSrcweirJAVABIN=bin
51cdf0e10cSrcweir
52cdf0e10cSrcweir###########################################################################
53cdf0e10cSrcweir#
54cdf0e10cSrcweir# Windows specific settings
55cdf0e10cSrcweir#
56cdf0e10cSrcweir###########################################################################
57cdf0e10cSrcweirifeq "$(PLATFORM)" "windows"
58cdf0e10cSrcweir# Settings for Windows using Microsoft compiler/linker
59cdf0e10cSrcweir
60edd74ba5SDamjan JovanovicPROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1 | sed -e 's/^i.86$$/i386/')
61edd74ba5SDamjan Jovanovic
62cdf0e10cSrcweirOS=WIN
63cdf0e10cSrcweirPS=\\
64cdf0e10cSrcweirICL=$$
65cdf0e10cSrcweirCC=cl
66cdf0e10cSrcweirLINK=link
67cdf0e10cSrcweirBUILDLIB=lib
68cdf0e10cSrcweirECHO=@echo
69cdf0e10cSrcweirMKDIR=mkdir
70cdf0e10cSrcweirMV=move
71cdf0e10cSrcweirCAT=type
72cdf0e10cSrcweirOBJ_EXT=obj
73cdf0e10cSrcweirEXE_EXT=.exe
74cdf0e10cSrcweirCOPY=copy
75cdf0e10cSrcweirSHAREDLIB_EXT=dll
76cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_BIN)
77cdf0e10cSrcweirUNOPKG_PLATFORM=Windows
78cdf0e10cSrcweir
79cdf0e10cSrcweirOSEP=^<
80cdf0e10cSrcweirCSEP=^>
81cdf0e10cSrcweirQUOTE=
82cdf0e10cSrcweirQM=
83cdf0e10cSrcweirSQM=
84cdf0e10cSrcweirECHOLINE=@echo.
85cdf0e10cSrcweirP2BG=
86cdf0e10cSrcweir
87cdf0e10cSrcweirDEL=del
88cdf0e10cSrcweirDELRECURSIVE=rd /S /Q
89cdf0e10cSrcweirURLPREFIX=file:///
90cdf0e10cSrcweir
91cdf0e10cSrcweirSALLIB=isal.lib
92cdf0e10cSrcweirCPPULIB=icppu.lib
93cdf0e10cSrcweirCPPUHELPERLIB=icppuhelper.lib
94cdf0e10cSrcweirSALHELPERLIB=isalhelper.lib
95cdf0e10cSrcweirREGLIB=ireg.lib
96cdf0e10cSrcweirSTORELIB=istore.lib
97cdf0e10cSrcweir
98cdf0e10cSrcweirBLANK=
99cdf0e10cSrcweirEMPTYSTRING=
100cdf0e10cSrcweirPATH_SEPARATOR=;
101cdf0e10cSrcweir
102cdf0e10cSrcweir# use this for release version
103e5a7b9b2SHerbert DürrCC_FLAGS_JNI=-c -MT -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa
104e5a7b9b2SHerbert DürrCC_FLAGS=-c -MT -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa
105cdf0e10cSrcweirifeq "$(CPP_MANIFEST)" "true"
106cdf0e10cSrcweir#CC_FLAGS+=-EHa -Zc:wchar_t-
107cdf0e10cSrcweirLINK_MANIFEST=mt -manifest $@.manifest "-outputresource:$@;2"
108cdf0e10cSrcweirelse
109cdf0e10cSrcweir#CC_FLAGS+=
110cdf0e10cSrcweirLINK_MANIFEST=
111cdf0e10cSrcweirendif
112cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
113cdf0e10cSrcweirCC_FLAGS_JNI+=-Zi
114cdf0e10cSrcweirCC_FLAGS+=-Zi
115cdf0e10cSrcweirendif
116cdf0e10cSrcweir
117cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
118cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
119cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/win32"
120cdf0e10cSrcweir
121cdf0e10cSrcweir# define for used compiler necessary for UNO
122cdf0e10cSrcweir# -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
123cdf0e10cSrcweir
124edd74ba5SDamjan Jovanovicifeq "$(PROCTYPE)" "i386"
125cdf0e10cSrcweirCC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
126cdf0e10cSrcweirCC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
127edd74ba5SDamjan Jovanovicendif
128edd74ba5SDamjan Jovanovicifeq "$(PROCTYPE)" "x86_64"
129edd74ba5SDamjan JovanovicCC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=mscx
130edd74ba5SDamjan JovanovicCC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=mscx
131edd74ba5SDamjan Jovanovicendif
132cdf0e10cSrcweirCC_OUTPUT_SWITCH=-Fo
133cdf0e10cSrcweir
134cdf0e10cSrcweirLIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL /DEBUGTYPE:cv
135cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) /DEF:$(PRJ)/settings/component.uno.def
13675b2d2d7SJürgen SchmidtEXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1b000000 /DEBUGTYPE:cv /NODEFAULTLIB  msvcrt.lib msvcprt.lib kernel32.lib
137cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
138cdf0e10cSrcweirLIBRARY_LINK_FLAGS+=/DEBUG
139cdf0e10cSrcweirEXE_LINK_FLAGS+=/DEBUG
140cdf0e10cSrcweirendif
141cdf0e10cSrcweir
142cdf0e10cSrcweirLINK_JAVA_LIBS=/LIBPATH:"$(OO_SDK_JAVA_HOME)/lib"
143cdf0e10cSrcweir
144cdf0e10cSrcweir# use this for release version
145cdf0e10cSrcweir#EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
146cdf0e10cSrcweir#LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL
147cdf0e10cSrcweirendif
148cdf0e10cSrcweir
149cdf0e10cSrcweir
150cdf0e10cSrcweir
151cdf0e10cSrcweir###########################################################################
152cdf0e10cSrcweir#
153cdf0e10cSrcweir# Solaris specific settings
154cdf0e10cSrcweir#
155cdf0e10cSrcweir###########################################################################
156cdf0e10cSrcweirifneq (,$(findstring solaris,$(PLATFORM)))
157cdf0e10cSrcweir# Settings for Solaris using Sun Workshop compiler
158cdf0e10cSrcweir
159b3ba5bc7SJürgen SchmidtPROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)$(shell /usr/ccs/bin/elfdump -e "$(OFFICE_PROGRAM_PATH)/libuno_sal.so.3" | /usr/xpg4/bin/grep -q -w ELFCLASS64 && echo 64)
160cdf0e10cSrcweir
161cdf0e10cSrcweirifeq "$(PROCTYPE)" "sparc"
162cdf0e10cSrcweirPLATFORM=solsparc
163cdf0e10cSrcweirUNOPKG_PLATFORM=Solaris_SPARC
164cdf0e10cSrcweirJAVA_PROC_TYPE=sparc
165cdf0e10cSrcweirelse
166cdf0e10cSrcweirifeq "$(PROCTYPE)" "sparc64"
167cdf0e10cSrcweirPLATFORM=solsparc
168cdf0e10cSrcweirUNOPKG_PLATFORM=Solaris_SPARC64
169cdf0e10cSrcweirJAVA_PROC_TYPE=sparcv9
170cdf0e10cSrcweirelse
171cdf0e10cSrcweirPLATFORM=solintel
172cdf0e10cSrcweirUNOPKG_PLATFORM=Solaris_x86
173cdf0e10cSrcweirJAVA_PROC_TYPE=i386
174cdf0e10cSrcweirendif
175cdf0e10cSrcweirendif
176cdf0e10cSrcweir
177cdf0e10cSrcweirOS=SOLARIS
178cdf0e10cSrcweirPS=/
179cdf0e10cSrcweirICL=\$$
180cdf0e10cSrcweirCC=CC
181cdf0e10cSrcweirLINK=CC
182cdf0e10cSrcweirLIB=CC
183cdf0e10cSrcweirECHO=@echo
184cdf0e10cSrcweirMKDIR=mkdir -p
185cdf0e10cSrcweirCAT=cat
186cdf0e10cSrcweirOBJ_EXT=o
187cdf0e10cSrcweirSHAREDLIB_EXT=so
188cdf0e10cSrcweirSHAREDLIB_PRE=lib
189cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
190cdf0e10cSrcweir
191cdf0e10cSrcweirOSEP=\<
192cdf0e10cSrcweirCSEP=\>
193cdf0e10cSrcweirQUOTE=$(subst S,\,S)
194cdf0e10cSrcweirQM=\"
195cdf0e10cSrcweirSQM='
196cdf0e10cSrcweirECHOLINE=@echo
197cdf0e10cSrcweirP2BG=&
198cdf0e10cSrcweir
199cdf0e10cSrcweirDEL=rm -f
200cdf0e10cSrcweirDELRECURSIVE=rm -rf
201cdf0e10cSrcweirCOPY=cp
202cdf0e10cSrcweirURLPREFIX=file://
203cdf0e10cSrcweir
204cdf0e10cSrcweir# Include UDK version numbers
205cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
206cdf0e10cSrcweir
207cdf0e10cSrcweirSALLIB=-luno_sal
208cdf0e10cSrcweirCPPULIB=-luno_cppu
209cdf0e10cSrcweirCPPUHELPERLIB=-luno_cppuhelperC52
210cdf0e10cSrcweirSALHELPERLIB=-luno_salhelperC52
211cdf0e10cSrcweirREGLIB=-lreg
212cdf0e10cSrcweirSTORELIB=-lstore
213cdf0e10cSrcweir
214cdf0e10cSrcweirEMPTYSTRING=
215cdf0e10cSrcweirPATH_SEPARATOR=:
216cdf0e10cSrcweir
217cdf0e10cSrcweirCC_FLAGS_JNI=-c -KPIC
218cdf0e10cSrcweirCC_FLAGS=-c -KPIC -xldscope=hidden
219cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
220cdf0e10cSrcweirCC_FLAGS_JNI+=-g
221cdf0e10cSrcweirCC_FLAGS+=-g
222cdf0e10cSrcweirendif
223cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
224cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
225cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
226cdf0e10cSrcweir
227cdf0e10cSrcweir# define for used compiler necessary for UNO
228cdf0e10cSrcweir# -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel
229cdf0e10cSrcweir
230cdf0e10cSrcweirCC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=sunpro5
231cdf0e10cSrcweirCC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5  -DHAVE_GCC_VISIBILITY_FEATURE
232cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
233cdf0e10cSrcweir
234cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
235cdf0e10cSrcweir# means if used CC is lower then version 5.5 use option -instance=static
236cdf0e10cSrcweirifeq ($(OO_SDK_CC_55_OR_HIGHER),)
237cdf0e10cSrcweirLIBRARY_LINK_FLAGS+=-instances=static
238cdf0e10cSrcweirendif
239cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map
240cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
241cdf0e10cSrcweir
242cdf0e10cSrcweirEXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
243ed9d7cbeSJürgen SchmidtLINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)"
244cdf0e10cSrcweirLINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
245cdf0e10cSrcweir
246cdf0e10cSrcweirifeq "$(PROCTYPE)" "sparc64"
247cdf0e10cSrcweirCC_FLAGS+=-m64
248cdf0e10cSrcweirLIBRARY_LINK_FLAGS+=-m64
249cdf0e10cSrcweirEXE_LINK_FLAGS+=-m64
250cdf0e10cSrcweirendif
251cdf0e10cSrcweir
252cdf0e10cSrcweirendif
253cdf0e10cSrcweir
254cdf0e10cSrcweir
255cdf0e10cSrcweir
256cdf0e10cSrcweir###########################################################################
257cdf0e10cSrcweir#
258cdf0e10cSrcweir# Linux specific settings
259cdf0e10cSrcweir#
260cdf0e10cSrcweir###########################################################################
261cdf0e10cSrcweirifneq (,$(findstring linux,$(PLATFORM)))
262cdf0e10cSrcweir# Settings for Linux using gcc compiler
263cdf0e10cSrcweir
264cdf0e10cSrcweirPROCTYPE := $(shell $(PRJ)/config.guess | cut -d "-" -f1 | sed -e 's/^i.86$$/i386/')
265cdf0e10cSrcweirPLATFORM=linux
266cdf0e10cSrcweir
267cdf0e10cSrcweirUNOPKG_PLATFORM=Linux_$(PROCTYPE)
268cdf0e10cSrcweirJAVA_PROC_TYPE=$(PROCTYPE)
269cdf0e10cSrcweir
270cdf0e10cSrcweirifeq "$(PROCTYPE)" "i386"
271cdf0e10cSrcweirUNOPKG_PLATFORM=Linux_x86
272cdf0e10cSrcweirJAVA_PROC_TYPE=i386
273cdf0e10cSrcweirendif
274cdf0e10cSrcweir
275cdf0e10cSrcweirifeq "$(PROCTYPE)" "powerpc"
276cdf0e10cSrcweirUNOPKG_PLATFORM=Linux_PowerPC
277cdf0e10cSrcweirJAVA_PROC_TYPE=ppc
278cdf0e10cSrcweirendif
279cdf0e10cSrcweir
280cdf0e10cSrcweirifeq "$(PROCTYPE)" "sparc"
281cdf0e10cSrcweirUNOPKG_PLATFORM=Linux_SPARC
282cdf0e10cSrcweirJAVA_PROC_TYPE=sparc
283cdf0e10cSrcweirendif
284cdf0e10cSrcweir
285cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
286cdf0e10cSrcweirJAVA_PROC_TYPE=amd64
287cdf0e10cSrcweirendif
288cdf0e10cSrcweir
289cdf0e10cSrcweirifeq "$(PROCTYPE)" "powerpc64"
290cdf0e10cSrcweirJAVA_PROC_TYPE=ppc64
291cdf0e10cSrcweirendif
292cdf0e10cSrcweir
293cdf0e10cSrcweirOS=LINUX
294cdf0e10cSrcweirPS=/
295cdf0e10cSrcweirICL=\$$
296cdf0e10cSrcweirCC=gcc
297cdf0e10cSrcweirLINK=g++
298cdf0e10cSrcweirLIB=g++
299cdf0e10cSrcweirECHO=@echo
300cdf0e10cSrcweirMKDIR=mkdir -p
301cdf0e10cSrcweirCAT=cat
302cdf0e10cSrcweirOBJ_EXT=o
303cdf0e10cSrcweirSHAREDLIB_EXT=so
304cdf0e10cSrcweirSHAREDLIB_PRE=lib
305cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
306cdf0e10cSrcweir
307cdf0e10cSrcweirGCC_VERSION=$(shell $(CC) -dumpversion)
308cdf0e10cSrcweir
309cdf0e10cSrcweirCOMID=gcc3
310cdf0e10cSrcweirCPPU_ENV=gcc3
311cdf0e10cSrcweir
312cdf0e10cSrcweirOSEP=\<
313cdf0e10cSrcweirCSEP=\>
314cdf0e10cSrcweirQUOTE=$(subst S,\,S)
315cdf0e10cSrcweirQM=\"
316cdf0e10cSrcweirSQM='
317cdf0e10cSrcweirECHOLINE=@echo
318cdf0e10cSrcweirP2BG=&
319cdf0e10cSrcweir
320cdf0e10cSrcweirDEL=rm -f
321cdf0e10cSrcweirDELRECURSIVE=rm -rf
322cdf0e10cSrcweirCOPY=cp
323cdf0e10cSrcweirURLPREFIX=file://
324cdf0e10cSrcweir
325cdf0e10cSrcweir# Include UDK version numbers
326cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
327cdf0e10cSrcweir
328cdf0e10cSrcweirSALLIB=-luno_sal
329cdf0e10cSrcweirCPPULIB=-luno_cppu
330cdf0e10cSrcweirCPPUHELPERLIB=-luno_cppuhelper$(COMID)
331cdf0e10cSrcweirSALHELPERLIB=-luno_salhelper$(COMID)
332cdf0e10cSrcweirREGLIB=-lreg
333cdf0e10cSrcweirSTORELIB=-lstore
334cdf0e10cSrcweir
335cdf0e10cSrcweirEMPTYSTRING=
336cdf0e10cSrcweirPATH_SEPARATOR=:
337cdf0e10cSrcweir
338cdf0e10cSrcweirCC_FLAGS_JNI=-c -fpic
339cdf0e10cSrcweirCC_FLAGS=-c -fpic -fvisibility=hidden
340cdf0e10cSrcweir# -O is necessary for inlining (see gcc documentation)
341cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
342cdf0e10cSrcweirCC_FLAGS_JNI+=-g
343cdf0e10cSrcweirCC_FLAGS+=-g
344cdf0e10cSrcweirelse
345cdf0e10cSrcweirCC_FLAGS_JNI+=-O
346cdf0e10cSrcweirCC_FLAGS+=-O
347cdf0e10cSrcweirendif
348cdf0e10cSrcweir
349cdf0e10cSrcweirifeq "$(PROCTYPE)" "ppc"
350cdf0e10cSrcweirCC_FLAGS+=-fPIC
351cdf0e10cSrcweirendif
352cdf0e10cSrcweir
353cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/linux"
354cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
355cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
35678ecfec3SDon LewisCC_DEFINES_JNI=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV)
35778ecfec3SDon LewisCC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE
358cdf0e10cSrcweir
359cdf0e10cSrcweir# define for used compiler necessary for UNO
360cdf0e10cSrcweir#-DCPPU_ENV=gcc2 -- gcc 2.91/2.95
361cdf0e10cSrcweir#-DCPPU_ENV=gcc3 -- gcc3 3.0
362cdf0e10cSrcweir
363cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
364cdf0e10cSrcweir
365cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN'
366cdf0e10cSrcweir
367cdf0e10cSrcweirifeq "$(PROCTYPE)" "ppc"
368cdf0e10cSrcweirLIBRARY_LINK_FLAGS+=-fPIC
369cdf0e10cSrcweirendif
370cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
371cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
372cdf0e10cSrcweir
373cdf0e10cSrcweir#EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
374cdf0e10cSrcweirEXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--no-whole-archive
375ed9d7cbeSJürgen SchmidtLINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)"
376cdf0e10cSrcweirLINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
377cdf0e10cSrcweir
378cdf0e10cSrcweirendif
379cdf0e10cSrcweir
380cdf0e10cSrcweir###########################################################################
381cdf0e10cSrcweir#
382cdf0e10cSrcweir# MacOSX/Darwin specific settings
383cdf0e10cSrcweir#
384cdf0e10cSrcweir###########################################################################
385cdf0e10cSrcweirifneq (,$(findstring darwin,$(PLATFORM)))
386789d489dSHerbert Dürr# Settings for MacOSX using LLVM version 4.2 (clang-425.0.28)
387cdf0e10cSrcweir
388cdf0e10cSrcweirPROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
389cdf0e10cSrcweir
390cdf0e10cSrcweir# Default is MacOSX on a Intel machine
391cdf0e10cSrcweirPLATFORM=macosx
392cdf0e10cSrcweir
393cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
394789d489dSHerbert DürrUNOPKG_PLATFORM=MacOSX_x86_64
395cdf0e10cSrcweirendif
396789d489dSHerbert Dürr
397cdf0e10cSrcweirJAVABIN=Commands
398cdf0e10cSrcweir
399789d489dSHerbert DürrGCC_ARCH_OPTION=-arch x86_64
400cdf0e10cSrcweir
401cdf0e10cSrcweirOS=MACOSX
402cdf0e10cSrcweirPS=/
403cdf0e10cSrcweirICL=\$$
404789d489dSHerbert DürrCC=`xcrun -f clang` -arch x86_64
405789d489dSHerbert DürrCXX=`xcrun -f clang++` -arch x86_64 -std=c++11
406789d489dSHerbert DürrLINK=`xcrun -f clang++` -arch x86_64 -std=c++11
407789d489dSHerbert DürrLIB=`xcrun -f clang++` -arch x86_64 -std=c++11
408789d489dSHerbert DürrINSTALLTOOL=`xcrun -f install_name_tool`
409789d489dSHerbert Dürr
410cdf0e10cSrcweirECHO=@echo
411cdf0e10cSrcweirMKDIR=mkdir -p
412cdf0e10cSrcweirCAT=cat
413cdf0e10cSrcweirOBJ_EXT=o
414cdf0e10cSrcweirSHAREDLIB_EXT=dylib
415cdf0e10cSrcweirSHAREDLIB_PRE=lib
416cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
417cdf0e10cSrcweir
418cdf0e10cSrcweirCOMID=gcc3
419cdf0e10cSrcweirCPPU_ENV=gcc3
420789d489dSHerbert DürrCOMID=s5abi
421789d489dSHerbert DürrCPPU_ENV=s5abi
422cdf0e10cSrcweir
423cdf0e10cSrcweirOSEP=\<
424cdf0e10cSrcweirCSEP=\>
425cdf0e10cSrcweirQUOTE=$(subst S,\,S)
426cdf0e10cSrcweirQM=\"
427cdf0e10cSrcweirSQM='
428cdf0e10cSrcweirECHOLINE=@echo
429cdf0e10cSrcweirP2BG=&
430cdf0e10cSrcweir
431cdf0e10cSrcweirDEL=rm -f
432cdf0e10cSrcweirDELRECURSIVE=rm -rf
433cdf0e10cSrcweirCOPY=cp
434cdf0e10cSrcweirURLPREFIX=file://
435cdf0e10cSrcweir
436cdf0e10cSrcweir# Include UDK version numbers
437cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
438cdf0e10cSrcweir
439*1cfb2a70SJim JagielskiSALLIB=-luno_sal
440*1cfb2a70SJim JagielskiCPPULIB=-luno_cppu
441*1cfb2a70SJim JagielskiCPPUHELPERLIB=-luno_cppuhelper$(COMID)
442*1cfb2a70SJim JagielskiSALHELPERLIB=-luno_salhelper$(COMID)
443*1cfb2a70SJim JagielskiREGLIB=-lreg
444*1cfb2a70SJim JagielskiSTORELIB=-lstore
445*1cfb2a70SJim Jagielski
446*1cfb2a70SJim JagielskiSALDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_sal.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_sal.dylib'
447*1cfb2a70SJim JagielskiCPPUDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppu.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_cppu.dylib'
448*1cfb2a70SJim JagielskiCPPUHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppuhelper'$(COMID).dylib.3:$(OO_SDK_OFFICE_LIB_DIR)/libuno_cppuhelper$(COMID).dylib'
449*1cfb2a70SJim JagielskiSALHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_salhelper$(COMID).dylib'
450*1cfb2a70SJim JagielskiREGDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libreg.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libreg.dylib'
451*1cfb2a70SJim JagielskiSTOREDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libstore.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libstore.dylib'
452*1cfb2a70SJim Jagielski
453*1cfb2a70SJim JagielskiINSTALL_NAME_URELIBS=$(INSTALLTOOL) -change @__________________________________________________URELIB/libuno_sal.dylib.3 @executable_path/libuno_sal.dylib.3 -change  @__________________________________________________URELIB/libuno_cppu.dylib.3 @executable_path/libuno_cppu.dylib.3 -change @__________________________________________________URELIB/libuno_cppuhelper$(COMID).dylib.3 @executable_path/libuno_cppuhelper$(COMID).dylib.3 -change @__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3 @executable_path/libuno_salhelper$(COMID).dylib.3 -change @__________________________________________________URELIB/libreg.dylib.3 @executable_path/libreg.dylib.3 -change @__________________________________________________URELIB/libstore.dylib.3 @executable_path/libstore.dylib.3
454*1cfb2a70SJim Jagielski
455*1cfb2a70SJim JagielskiINSTALL_NAME_URELIBS_BIN=$(INSTALLTOOL) -change @__________________________________________________URELIB/libuno_sal.dylib.3 libuno_sal.dylib.3 -change  @__________________________________________________URELIB/libuno_cppu.dylib.3 libuno_cppu.dylib.3 -change @__________________________________________________URELIB/libuno_cppuhelper$(COMID).dylib.3 libuno_cppuhelper$(COMID).dylib.3 -change @__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3 libuno_salhelper$(COMID).dylib.3 -change @__________________________________________________URELIB/libreg.dylib.3 libreg.dylib.3 -change @__________________________________________________URELIB/libstore.dylib.3 libstore.dylib.3
456cdf0e10cSrcweir
457cdf0e10cSrcweirEMPTYSTRING=
458cdf0e10cSrcweirPATH_SEPARATOR=:
459cdf0e10cSrcweir
460789d489dSHerbert DürrCC_FLAGS_JNI=-c -fPIC -fno-common $(GCC_ARCH_OPTION)
461789d489dSHerbert DürrCC_FLAGS=-c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden
462789d489dSHerbert Dürr
463cdf0e10cSrcweir# -O is necessary for inlining (see gcc documentation)
464cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
465cdf0e10cSrcweirCC_FLAGS_JNI+=-g
466cdf0e10cSrcweirCC_FLAGS+=-g
467cdf0e10cSrcweirelse
468cdf0e10cSrcweirCC_FLAGS_JNI+=-O
469cdf0e10cSrcweirCC_FLAGS+=-O
470cdf0e10cSrcweirendif
471cdf0e10cSrcweir
472cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
473cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
474cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
47578ecfec3SDon LewisCC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
47678ecfec3SDon LewisCC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE
477cdf0e10cSrcweir
478cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
479cdf0e10cSrcweir
480cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
481cdf0e10cSrcweir#-fPIC -fno-common
482cdf0e10cSrcweir
483cdf0e10cSrcweir# install_name '@executable_path$/(@:f)'
484cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)  -Wl,-exported_symbols_list $(COMP_MAPFILE)
485cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
486cdf0e10cSrcweir
487cdf0e10cSrcweirEXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
488ed9d7cbeSJürgen SchmidtLINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_OFFICE_LIB_DIR)"
489cdf0e10cSrcweirLINK_JAVA_LIBS=-framework JavaVM
490cdf0e10cSrcweir#LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/Libraries"
491cdf0e10cSrcweir
492cdf0e10cSrcweirendif
493cdf0e10cSrcweir
494cdf0e10cSrcweir###########################################################################
495cdf0e10cSrcweir#
496cdf0e10cSrcweir# FreeBSD specific settings
497cdf0e10cSrcweir#
498cdf0e10cSrcweir###########################################################################
499cdf0e10cSrcweirifneq (,$(findstring freebsd,$(PLATFORM)))
500cdf0e10cSrcweir# Settings for FreeBSD using gcc compiler
501cdf0e10cSrcweir
502cdf0e10cSrcweirPROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
503cdf0e10cSrcweir
504cdf0e10cSrcweirifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
505cdf0e10cSrcweirPLATFORM=kfreebsd
506cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
507cdf0e10cSrcweirUNOPKG_PLATFORM=kFreeBSD_x86_64
508cdf0e10cSrcweirelse
509cdf0e10cSrcweirUNOPKG_PLATFORM=kFreeBSD_x86
510cdf0e10cSrcweirendif
511cdf0e10cSrcweirelse
512cdf0e10cSrcweirPLATFORM=freebsd
513cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
514cdf0e10cSrcweirUNOPKG_PLATFORM=FreeBSD_x86_64
515cdf0e10cSrcweirelse
516cdf0e10cSrcweirUNOPKG_PLATFORM=FreeBSD_x86
517cdf0e10cSrcweirendif
518e15a4534Spfgifeq "$(PROCTYPE)" "powerpc"
519e15a4534SpfgUNOPKG_PLATFORM=FreeBSD_ppc
520e15a4534Spfgendif
521cdf0e10cSrcweirendif
522cdf0e10cSrcweir
523cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
524cdf0e10cSrcweirJAVA_PROC_TYPE=amd64
525cdf0e10cSrcweirelse
526cdf0e10cSrcweirJAVA_PROC_TYPE=i386
527cdf0e10cSrcweirendif
528cdf0e10cSrcweir
529e15a4534Spfgifeq "$(PROCTYPE)" "powerpc64"
530e15a4534SpfgJAVA_PROC_TYPE=ppc64
531e15a4534Spfgendif
532e15a4534Spfg
533cdf0e10cSrcweirifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
534cdf0e10cSrcweirOS=LINUX
535cdf0e10cSrcweirelse
536cdf0e10cSrcweirOS=FREEBSD
537cdf0e10cSrcweirendif
538cdf0e10cSrcweirPS=/
539cdf0e10cSrcweirICL=\$$
540cdf0e10cSrcweirCC=gcc
541cdf0e10cSrcweirLINK=g++
542cdf0e10cSrcweirLIB=g++
543cdf0e10cSrcweirECHO=@echo
544cdf0e10cSrcweirMKDIR=mkdir -p
545cdf0e10cSrcweirCAT=cat
546cdf0e10cSrcweirOBJ_EXT=o
547cdf0e10cSrcweirSHAREDLIB_EXT=so
548cdf0e10cSrcweirSHAREDLIB_PRE=lib
549cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
550cdf0e10cSrcweir
551cdf0e10cSrcweirGCC_VERSION=$(shell $(CC) -dumpversion)
552cdf0e10cSrcweir
553cdf0e10cSrcweirCOMID=gcc3
554cdf0e10cSrcweirCPPU_ENV=gcc3
555cdf0e10cSrcweir
556cdf0e10cSrcweirOSEP=\<
557cdf0e10cSrcweirCSEP=\>
558cdf0e10cSrcweirQUOTE=$(subst S,\,S)
559cdf0e10cSrcweirQM=\"
560cdf0e10cSrcweirSQM='
561cdf0e10cSrcweirECHOLINE=@echo
562cdf0e10cSrcweirP2BG=&
563cdf0e10cSrcweir
564cdf0e10cSrcweirDEL=rm -f
565cdf0e10cSrcweirDELRECURSIVE=rm -rf
566cdf0e10cSrcweirCOPY=cp
567cdf0e10cSrcweirURLPREFIX=file://
568cdf0e10cSrcweir
569cdf0e10cSrcweir# Include UDK version numbers
570cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
571cdf0e10cSrcweir
572cdf0e10cSrcweirSALLIB=-luno_sal
573cdf0e10cSrcweirCPPULIB=-luno_cppu
574cdf0e10cSrcweirCPPUHELPERLIB=-luno_cppuhelper$(COMID)
575cdf0e10cSrcweirSALHELPERLIB=-luno_salhelper$(COMID)
576cdf0e10cSrcweirREGLIB=-lreg
577cdf0e10cSrcweirSTORELIB=-lstore
578cdf0e10cSrcweir
579cdf0e10cSrcweirEMPTYSTRING=
580cdf0e10cSrcweirPATH_SEPARATOR=:
581cdf0e10cSrcweir
582cdf0e10cSrcweirCC_FLAGS_JNI=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS)
583cdf0e10cSrcweirCC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden
584cdf0e10cSrcweir# -O is necessary for inlining (see gcc documentation)
585cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
586cdf0e10cSrcweirCC_FLAGS_JNI+=-g
587cdf0e10cSrcweirCC_FLAGS+=-g
588cdf0e10cSrcweirelse
589cdf0e10cSrcweirCC_FLAGS_JNI+=-O
590cdf0e10cSrcweirCC_FLAGS+=-O
591cdf0e10cSrcweirendif
592cdf0e10cSrcweir
593cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd"
594cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
595cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
59678ecfec3SDon LewisCC_DEFINES_JNI=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV)
59778ecfec3SDon LewisCC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE
598cdf0e10cSrcweir
599cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
600cdf0e10cSrcweir
601cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN'
602cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
603cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
604cdf0e10cSrcweir
605cdf0e10cSrcweirEXE_LINK_FLAGS=-Wl,--allow-shlib-undefined
606cdf0e10cSrcweir#EXE_LINK_FLAGS+=-Wl,-export-dynamic -Wl,-z,defs
607ed9d7cbeSJürgen SchmidtLINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)" $(PTHREAD_LIBS)
608cdf0e10cSrcweirLINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
609cdf0e10cSrcweir
610cdf0e10cSrcweirendif
6112752044bSAriel Constenla-Haile
612ed9d7cbeSJürgen Schmidt# add additional boost specific settings
613ed9d7cbeSJürgen Schmidtifneq "$(OO_SDK_BOOST_HOME)" ""
614ed9d7cbeSJürgen SchmidtSTL_INCLUDES+= -I"$(OO_SDK_BOOST_HOME)"
615ed9d7cbeSJürgen Schmidtendif
6162752044bSAriel Constenla-Haile
6172752044bSAriel Constenla-Haile# Add OSL_DEBUG_LEVEL to compiler the flags (for OSL_TRACE et. al.)
6182752044bSAriel Constenla-Haileifeq "$(DEBUG)" "yes"
6192752044bSAriel Constenla-HaileCC_FLAGS += -DOSL_DEBUG_LEVEL=2
6202752044bSAriel Constenla-Haileendif
621