xref: /aoo42x/main/odk/settings/settings.mk (revision 3187fb04)
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
400*3187fb04SJim JagielskiCLANG_CXX_VERSIONING=-std=c++11 -stdlib=libc++
401cdf0e10cSrcweir
402cdf0e10cSrcweirOS=MACOSX
403cdf0e10cSrcweirPS=/
404cdf0e10cSrcweirICL=\$$
405*3187fb04SJim JagielskiCC=`xcrun -f clang` $(GCC_ARCH_OPTION)
406*3187fb04SJim JagielskiCXX=`xcrun -f clang++` $(GCC_ARCH_OPTION) $(CLANG_CXX_VERSIONING)
407*3187fb04SJim JagielskiLINK=`xcrun -f clang++` $(GCC_ARCH_OPTION) $(CLANG_CXX_VERSIONING)
408*3187fb04SJim JagielskiLIB=`xcrun -f clang++` $(GCC_ARCH_OPTION) $(CLANG_CXX_VERSIONING)
409789d489dSHerbert DürrINSTALLTOOL=`xcrun -f install_name_tool`
410789d489dSHerbert Dürr
411cdf0e10cSrcweirECHO=@echo
412cdf0e10cSrcweirMKDIR=mkdir -p
413cdf0e10cSrcweirCAT=cat
414cdf0e10cSrcweirOBJ_EXT=o
415cdf0e10cSrcweirSHAREDLIB_EXT=dylib
416cdf0e10cSrcweirSHAREDLIB_PRE=lib
417cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
418cdf0e10cSrcweir
419809f4227SJim JagielskiCOMID=s5abi
420809f4227SJim JagielskiCPPU_ENV=s5abi
421cdf0e10cSrcweir
422cdf0e10cSrcweirOSEP=\<
423cdf0e10cSrcweirCSEP=\>
424cdf0e10cSrcweirQUOTE=$(subst S,\,S)
425cdf0e10cSrcweirQM=\"
426cdf0e10cSrcweirSQM='
427cdf0e10cSrcweirECHOLINE=@echo
428cdf0e10cSrcweirP2BG=&
429cdf0e10cSrcweir
430cdf0e10cSrcweirDEL=rm -f
431cdf0e10cSrcweirDELRECURSIVE=rm -rf
432cdf0e10cSrcweirCOPY=cp
433cdf0e10cSrcweirURLPREFIX=file://
434cdf0e10cSrcweir
435cdf0e10cSrcweir# Include UDK version numbers
436cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
437cdf0e10cSrcweir
4381cfb2a70SJim JagielskiSALLIB=-luno_sal
4391cfb2a70SJim JagielskiCPPULIB=-luno_cppu
4401cfb2a70SJim JagielskiCPPUHELPERLIB=-luno_cppuhelper$(COMID)
4411cfb2a70SJim JagielskiSALHELPERLIB=-luno_salhelper$(COMID)
4421cfb2a70SJim JagielskiREGLIB=-lreg
4431cfb2a70SJim JagielskiSTORELIB=-lstore
4441cfb2a70SJim Jagielski
445a4523a2bSJim JagielskiSALDYLIB=-Wl,-dylib_file,@_______URELIB/libuno_sal.dylib:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_sal.dylib'
446a4523a2bSJim JagielskiCPPUDYLIB=-Wl,-dylib_file,@_______URELIB/libuno_cppu.dylib:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_cppu.dylib'
447a4523a2bSJim JagielskiCPPUHELPERDYLIB=-Wl,-dylib_file,@_______URELIB/libuno_cppuhelper'$(COMID).dylib:$(OO_SDK_OFFICE_LIB_DIR)/libuno_cppuhelper$(COMID).dylib'
448a4523a2bSJim JagielskiSALHELPERDYLIB=-Wl,-dylib_file,@_______URELIB/libuno_salhelper$(COMID).dylib:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_salhelper$(COMID).dylib'
449a4523a2bSJim JagielskiREGDYLIB=-Wl,-dylib_file,@_______URELIB/libreg.dylib:'$(OO_SDK_OFFICE_LIB_DIR)/libreg.dylib'
450a4523a2bSJim JagielskiSTOREDYLIB=-Wl,-dylib_file,@_______URELIB/libstore.dylib:'$(OO_SDK_OFFICE_LIB_DIR)/libstore.dylib'
4511cfb2a70SJim Jagielski
452a4523a2bSJim JagielskiINSTALL_NAME_URELIBS=$(INSTALLTOOL) -change @_______URELIB/libuno_sal.dylib @executable_path/libuno_sal.dylib -change  @_______URELIB/libuno_cppu.dylib @executable_path/libuno_cppu.dylib -change @_______URELIB/libuno_cppuhelper$(COMID).dylib @executable_path/libuno_cppuhelper$(COMID).dylib -change @_______URELIB/libuno_salhelper$(COMID).dylib @executable_path/libuno_salhelper$(COMID).dylib -change @_______URELIB/libreg.dylib @executable_path/libreg.dylib -change @_______URELIB/libstore.dylib @executable_path/libstore.dylib
4531cfb2a70SJim Jagielski
454a4523a2bSJim JagielskiINSTALL_NAME_URELIBS_BIN=$(INSTALLTOOL) -change @_______URELIB/libuno_sal.dylib libuno_sal.dylib -change  @_______URELIB/libuno_cppu.dylib libuno_cppu.dylib -change @_______URELIB/libuno_cppuhelper$(COMID).dylib libuno_cppuhelper$(COMID).dylib -change @_______URELIB/libuno_salhelper$(COMID).dylib libuno_salhelper$(COMID).dylib -change @_______URELIB/libreg.dylib libreg.dylib -change @_______URELIB/libstore.dylib libstore.dylib
455cdf0e10cSrcweir
456cdf0e10cSrcweirEMPTYSTRING=
457cdf0e10cSrcweirPATH_SEPARATOR=:
458cdf0e10cSrcweir
459789d489dSHerbert DürrCC_FLAGS_JNI=-c -fPIC -fno-common $(GCC_ARCH_OPTION)
460789d489dSHerbert DürrCC_FLAGS=-c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden
461789d489dSHerbert Dürr
462cdf0e10cSrcweir# -O is necessary for inlining (see gcc documentation)
463cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
464cdf0e10cSrcweirCC_FLAGS_JNI+=-g
465cdf0e10cSrcweirCC_FLAGS+=-g
466cdf0e10cSrcweirelse
467cdf0e10cSrcweirCC_FLAGS_JNI+=-O
468cdf0e10cSrcweirCC_FLAGS+=-O
469cdf0e10cSrcweirendif
470cdf0e10cSrcweir
471cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
472cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
473cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
47478ecfec3SDon LewisCC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
47578ecfec3SDon LewisCC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE
476cdf0e10cSrcweir
477cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
478cdf0e10cSrcweir
479cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
480cdf0e10cSrcweir#-fPIC -fno-common
481cdf0e10cSrcweir
482cdf0e10cSrcweir# install_name '@executable_path$/(@:f)'
483cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)  -Wl,-exported_symbols_list $(COMP_MAPFILE)
484cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
485cdf0e10cSrcweir
486cdf0e10cSrcweirEXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
487ed9d7cbeSJürgen SchmidtLINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_OFFICE_LIB_DIR)"
488cdf0e10cSrcweirLINK_JAVA_LIBS=-framework JavaVM
489cdf0e10cSrcweir#LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/Libraries"
490cdf0e10cSrcweir
491cdf0e10cSrcweirendif
492cdf0e10cSrcweir
493cdf0e10cSrcweir###########################################################################
494cdf0e10cSrcweir#
495cdf0e10cSrcweir# FreeBSD specific settings
496cdf0e10cSrcweir#
497cdf0e10cSrcweir###########################################################################
498cdf0e10cSrcweirifneq (,$(findstring freebsd,$(PLATFORM)))
499cdf0e10cSrcweir# Settings for FreeBSD using gcc compiler
500cdf0e10cSrcweir
501cdf0e10cSrcweirPROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
502cdf0e10cSrcweir
503cdf0e10cSrcweirifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
504cdf0e10cSrcweirPLATFORM=kfreebsd
505cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
506cdf0e10cSrcweirUNOPKG_PLATFORM=kFreeBSD_x86_64
507cdf0e10cSrcweirelse
508cdf0e10cSrcweirUNOPKG_PLATFORM=kFreeBSD_x86
509cdf0e10cSrcweirendif
510cdf0e10cSrcweirelse
511cdf0e10cSrcweirPLATFORM=freebsd
512cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
513cdf0e10cSrcweirUNOPKG_PLATFORM=FreeBSD_x86_64
514cdf0e10cSrcweirelse
515cdf0e10cSrcweirUNOPKG_PLATFORM=FreeBSD_x86
516cdf0e10cSrcweirendif
517e15a4534Spfgifeq "$(PROCTYPE)" "powerpc"
518e15a4534SpfgUNOPKG_PLATFORM=FreeBSD_ppc
519e15a4534Spfgendif
520cdf0e10cSrcweirendif
521cdf0e10cSrcweir
522cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
523cdf0e10cSrcweirJAVA_PROC_TYPE=amd64
524cdf0e10cSrcweirelse
525cdf0e10cSrcweirJAVA_PROC_TYPE=i386
526cdf0e10cSrcweirendif
527cdf0e10cSrcweir
528e15a4534Spfgifeq "$(PROCTYPE)" "powerpc64"
529e15a4534SpfgJAVA_PROC_TYPE=ppc64
530e15a4534Spfgendif
531e15a4534Spfg
532cdf0e10cSrcweirifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
533cdf0e10cSrcweirOS=LINUX
534cdf0e10cSrcweirelse
535cdf0e10cSrcweirOS=FREEBSD
536cdf0e10cSrcweirendif
537cdf0e10cSrcweirPS=/
538cdf0e10cSrcweirICL=\$$
539cdf0e10cSrcweirCC=gcc
540cdf0e10cSrcweirLINK=g++
541cdf0e10cSrcweirLIB=g++
542cdf0e10cSrcweirECHO=@echo
543cdf0e10cSrcweirMKDIR=mkdir -p
544cdf0e10cSrcweirCAT=cat
545cdf0e10cSrcweirOBJ_EXT=o
546cdf0e10cSrcweirSHAREDLIB_EXT=so
547cdf0e10cSrcweirSHAREDLIB_PRE=lib
548cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
549cdf0e10cSrcweir
550cdf0e10cSrcweirGCC_VERSION=$(shell $(CC) -dumpversion)
551cdf0e10cSrcweir
552cdf0e10cSrcweirCOMID=gcc3
553cdf0e10cSrcweirCPPU_ENV=gcc3
554cdf0e10cSrcweir
555cdf0e10cSrcweirOSEP=\<
556cdf0e10cSrcweirCSEP=\>
557cdf0e10cSrcweirQUOTE=$(subst S,\,S)
558cdf0e10cSrcweirQM=\"
559cdf0e10cSrcweirSQM='
560cdf0e10cSrcweirECHOLINE=@echo
561cdf0e10cSrcweirP2BG=&
562cdf0e10cSrcweir
563cdf0e10cSrcweirDEL=rm -f
564cdf0e10cSrcweirDELRECURSIVE=rm -rf
565cdf0e10cSrcweirCOPY=cp
566cdf0e10cSrcweirURLPREFIX=file://
567cdf0e10cSrcweir
568cdf0e10cSrcweir# Include UDK version numbers
569cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
570cdf0e10cSrcweir
571cdf0e10cSrcweirSALLIB=-luno_sal
572cdf0e10cSrcweirCPPULIB=-luno_cppu
573cdf0e10cSrcweirCPPUHELPERLIB=-luno_cppuhelper$(COMID)
574cdf0e10cSrcweirSALHELPERLIB=-luno_salhelper$(COMID)
575cdf0e10cSrcweirREGLIB=-lreg
576cdf0e10cSrcweirSTORELIB=-lstore
577cdf0e10cSrcweir
578cdf0e10cSrcweirEMPTYSTRING=
579cdf0e10cSrcweirPATH_SEPARATOR=:
580cdf0e10cSrcweir
581cdf0e10cSrcweirCC_FLAGS_JNI=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS)
582cdf0e10cSrcweirCC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden
583cdf0e10cSrcweir# -O is necessary for inlining (see gcc documentation)
584cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
585cdf0e10cSrcweirCC_FLAGS_JNI+=-g
586cdf0e10cSrcweirCC_FLAGS+=-g
587cdf0e10cSrcweirelse
588cdf0e10cSrcweirCC_FLAGS_JNI+=-O
589cdf0e10cSrcweirCC_FLAGS+=-O
590cdf0e10cSrcweirendif
591cdf0e10cSrcweir
592cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd"
593cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
594cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
59578ecfec3SDon LewisCC_DEFINES_JNI=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV)
59678ecfec3SDon LewisCC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE
597cdf0e10cSrcweir
598cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
599cdf0e10cSrcweir
600cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN'
601cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
602cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
603cdf0e10cSrcweir
604cdf0e10cSrcweirEXE_LINK_FLAGS=-Wl,--allow-shlib-undefined
605cdf0e10cSrcweir#EXE_LINK_FLAGS+=-Wl,-export-dynamic -Wl,-z,defs
606ed9d7cbeSJürgen SchmidtLINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)" $(PTHREAD_LIBS)
607cdf0e10cSrcweirLINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
608cdf0e10cSrcweir
609cdf0e10cSrcweirendif
6102752044bSAriel Constenla-Haile
611ed9d7cbeSJürgen Schmidt# add additional boost specific settings
612ed9d7cbeSJürgen Schmidtifneq "$(OO_SDK_BOOST_HOME)" ""
613ed9d7cbeSJürgen SchmidtSTL_INCLUDES+= -I"$(OO_SDK_BOOST_HOME)"
614ed9d7cbeSJürgen Schmidtendif
6152752044bSAriel Constenla-Haile
6162752044bSAriel Constenla-Haile# Add OSL_DEBUG_LEVEL to compiler the flags (for OSL_TRACE et. al.)
6172752044bSAriel Constenla-Haileifeq "$(DEBUG)" "yes"
6182752044bSAriel Constenla-HaileCC_FLAGS += -DOSL_DEBUG_LEVEL=2
6192752044bSAriel Constenla-Haileendif
620