xref: /aoo42x/main/odk/settings/settings.mk (revision ed9d7cbe)
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
60cdf0e10cSrcweirOS=WIN
61cdf0e10cSrcweirPS=\\
62cdf0e10cSrcweirICL=$$
63cdf0e10cSrcweirCC=cl
64cdf0e10cSrcweirLINK=link
65cdf0e10cSrcweirBUILDLIB=lib
66cdf0e10cSrcweirECHO=@echo
67cdf0e10cSrcweirMKDIR=mkdir
68cdf0e10cSrcweirMV=move
69cdf0e10cSrcweirCAT=type
70cdf0e10cSrcweirOBJ_EXT=obj
71cdf0e10cSrcweirEXE_EXT=.exe
72cdf0e10cSrcweirCOPY=copy
73cdf0e10cSrcweirSHAREDLIB_EXT=dll
74cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_BIN)
75cdf0e10cSrcweirPACKAGE_LIB_DIR=windows.plt
76cdf0e10cSrcweirUNOPKG_PLATFORM=Windows
77cdf0e10cSrcweir
78cdf0e10cSrcweirOSEP=^<
79cdf0e10cSrcweirCSEP=^>
80cdf0e10cSrcweirQUOTE=
81cdf0e10cSrcweirQM=
82cdf0e10cSrcweirSQM=
83cdf0e10cSrcweirECHOLINE=@echo.
84cdf0e10cSrcweirP2BG=
85cdf0e10cSrcweir
86cdf0e10cSrcweirDEL=del
87cdf0e10cSrcweirDELRECURSIVE=rd /S /Q
88cdf0e10cSrcweirURLPREFIX=file:///
89cdf0e10cSrcweir
90cdf0e10cSrcweirSALLIB=isal.lib
91cdf0e10cSrcweirCPPULIB=icppu.lib
92cdf0e10cSrcweirCPPUHELPERLIB=icppuhelper.lib
93cdf0e10cSrcweirSALHELPERLIB=isalhelper.lib
94cdf0e10cSrcweirREGLIB=ireg.lib
95cdf0e10cSrcweirSTORELIB=istore.lib
96cdf0e10cSrcweir
97cdf0e10cSrcweirBLANK=
98cdf0e10cSrcweirEMPTYSTRING=
99cdf0e10cSrcweirPATH_SEPARATOR=;
100cdf0e10cSrcweir
101cdf0e10cSrcweir# use this for release version
102cdf0e10cSrcweirCC_FLAGS_JNI=-c -MT -Zm500 -Zc:forScope,wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -Zc:forScope -GR -EHa
103cdf0e10cSrcweirCC_FLAGS=-c -MT -Zm500 -Zc:forScope,wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -Zc:forScope -GR -EHa
104cdf0e10cSrcweirifeq "$(CPP_MANIFEST)" "true"
105cdf0e10cSrcweir#CC_FLAGS+=-EHa -Zc:wchar_t-
106cdf0e10cSrcweirLINK_MANIFEST=mt -manifest $@.manifest "-outputresource:$@;2"
107cdf0e10cSrcweirelse
108cdf0e10cSrcweir#CC_FLAGS+=
109cdf0e10cSrcweirLINK_MANIFEST=
110cdf0e10cSrcweirendif
111cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
112cdf0e10cSrcweirCC_FLAGS_JNI+=-Zi
113cdf0e10cSrcweirCC_FLAGS+=-Zi
114cdf0e10cSrcweirendif
115cdf0e10cSrcweir
116cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
117cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
118cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/win32"
119cdf0e10cSrcweir
120cdf0e10cSrcweir# define for used compiler necessary for UNO
121cdf0e10cSrcweir# -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
122cdf0e10cSrcweir
123cdf0e10cSrcweirCC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
124cdf0e10cSrcweirCC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
125cdf0e10cSrcweirCC_OUTPUT_SWITCH=-Fo
126cdf0e10cSrcweir
127cdf0e10cSrcweirLIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL /DEBUGTYPE:cv
128cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) /DEF:$(PRJ)/settings/component.uno.def
12975b2d2d7SJürgen SchmidtEXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1b000000 /DEBUGTYPE:cv /NODEFAULTLIB  msvcrt.lib msvcprt.lib kernel32.lib
130cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
131cdf0e10cSrcweirLIBRARY_LINK_FLAGS+=/DEBUG
132cdf0e10cSrcweirEXE_LINK_FLAGS+=/DEBUG
133cdf0e10cSrcweirendif
134cdf0e10cSrcweir
135cdf0e10cSrcweirLINK_JAVA_LIBS=/LIBPATH:"$(OO_SDK_JAVA_HOME)/lib"
136cdf0e10cSrcweir
137cdf0e10cSrcweir# use this for release version
138cdf0e10cSrcweir#EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
139cdf0e10cSrcweir#LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL
140cdf0e10cSrcweirendif
141cdf0e10cSrcweir
142cdf0e10cSrcweir
143cdf0e10cSrcweir
144cdf0e10cSrcweir###########################################################################
145cdf0e10cSrcweir#
146cdf0e10cSrcweir# Solaris specific settings
147cdf0e10cSrcweir#
148cdf0e10cSrcweir###########################################################################
149cdf0e10cSrcweirifneq (,$(findstring solaris,$(PLATFORM)))
150cdf0e10cSrcweir# Settings for Solaris using Sun Workshop compiler
151cdf0e10cSrcweir
152b3ba5bc7SJü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)
153cdf0e10cSrcweir
154cdf0e10cSrcweirifeq "$(PROCTYPE)" "sparc"
155cdf0e10cSrcweirPLATFORM=solsparc
156cdf0e10cSrcweirPACKAGE_LIB_DIR=solaris_sparc.plt
157cdf0e10cSrcweirUNOPKG_PLATFORM=Solaris_SPARC
158cdf0e10cSrcweirJAVA_PROC_TYPE=sparc
159cdf0e10cSrcweirelse
160cdf0e10cSrcweirifeq "$(PROCTYPE)" "sparc64"
161cdf0e10cSrcweirPLATFORM=solsparc
162cdf0e10cSrcweirPACKAGE_LIB_DIR=solaris_sparc64.plt
163cdf0e10cSrcweirUNOPKG_PLATFORM=Solaris_SPARC64
164cdf0e10cSrcweirJAVA_PROC_TYPE=sparcv9
165cdf0e10cSrcweirelse
166cdf0e10cSrcweirPLATFORM=solintel
167cdf0e10cSrcweirPACKAGE_LIB_DIR=solaris_x86.plt
168cdf0e10cSrcweirUNOPKG_PLATFORM=Solaris_x86
169cdf0e10cSrcweirJAVA_PROC_TYPE=i386
170cdf0e10cSrcweirendif
171cdf0e10cSrcweirendif
172cdf0e10cSrcweir
173cdf0e10cSrcweirOS=SOLARIS
174cdf0e10cSrcweirPS=/
175cdf0e10cSrcweirICL=\$$
176cdf0e10cSrcweirCC=CC
177cdf0e10cSrcweirLINK=CC
178cdf0e10cSrcweirLIB=CC
179cdf0e10cSrcweirECHO=@echo
180cdf0e10cSrcweirMKDIR=mkdir -p
181cdf0e10cSrcweirCAT=cat
182cdf0e10cSrcweirOBJ_EXT=o
183cdf0e10cSrcweirSHAREDLIB_EXT=so
184cdf0e10cSrcweirSHAREDLIB_PRE=lib
185cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
186cdf0e10cSrcweir
187cdf0e10cSrcweirOSEP=\<
188cdf0e10cSrcweirCSEP=\>
189cdf0e10cSrcweirQUOTE=$(subst S,\,S)
190cdf0e10cSrcweirQM=\"
191cdf0e10cSrcweirSQM='
192cdf0e10cSrcweirECHOLINE=@echo
193cdf0e10cSrcweirP2BG=&
194cdf0e10cSrcweir
195cdf0e10cSrcweirDEL=rm -f
196cdf0e10cSrcweirDELRECURSIVE=rm -rf
197cdf0e10cSrcweirCOPY=cp
198cdf0e10cSrcweirURLPREFIX=file://
199cdf0e10cSrcweir
200cdf0e10cSrcweir# Include UDK version numbers
201cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
202cdf0e10cSrcweir
203cdf0e10cSrcweirSALLIB=-luno_sal
204cdf0e10cSrcweirCPPULIB=-luno_cppu
205cdf0e10cSrcweirCPPUHELPERLIB=-luno_cppuhelperC52
206cdf0e10cSrcweirSALHELPERLIB=-luno_salhelperC52
207cdf0e10cSrcweirREGLIB=-lreg
208cdf0e10cSrcweirSTORELIB=-lstore
209cdf0e10cSrcweir
210cdf0e10cSrcweirEMPTYSTRING=
211cdf0e10cSrcweirPATH_SEPARATOR=:
212cdf0e10cSrcweir
213cdf0e10cSrcweirCC_FLAGS_JNI=-c -KPIC
214cdf0e10cSrcweirCC_FLAGS=-c -KPIC -xldscope=hidden
215cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
216cdf0e10cSrcweirCC_FLAGS_JNI+=-g
217cdf0e10cSrcweirCC_FLAGS+=-g
218cdf0e10cSrcweirendif
219cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
220cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
221cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
222cdf0e10cSrcweir
223cdf0e10cSrcweir# define for used compiler necessary for UNO
224cdf0e10cSrcweir# -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel
225cdf0e10cSrcweir
226cdf0e10cSrcweirCC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=sunpro5
227cdf0e10cSrcweirCC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5  -DHAVE_GCC_VISIBILITY_FEATURE
228cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
229cdf0e10cSrcweir
230cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
231cdf0e10cSrcweir# means if used CC is lower then version 5.5 use option -instance=static
232cdf0e10cSrcweirifeq ($(OO_SDK_CC_55_OR_HIGHER),)
233cdf0e10cSrcweirLIBRARY_LINK_FLAGS+=-instances=static
234cdf0e10cSrcweirendif
235cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map
236cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
237cdf0e10cSrcweir
238cdf0e10cSrcweirEXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
239*ed9d7cbeSJürgen SchmidtLINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)"
240cdf0e10cSrcweirLINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
241cdf0e10cSrcweir
242cdf0e10cSrcweirifeq "$(PROCTYPE)" "sparc64"
243cdf0e10cSrcweirCC_FLAGS+=-m64
244cdf0e10cSrcweirLIBRARY_LINK_FLAGS+=-m64
245cdf0e10cSrcweirEXE_LINK_FLAGS+=-m64
246cdf0e10cSrcweirendif
247cdf0e10cSrcweir
248cdf0e10cSrcweirendif
249cdf0e10cSrcweir
250cdf0e10cSrcweir
251cdf0e10cSrcweir
252cdf0e10cSrcweir###########################################################################
253cdf0e10cSrcweir#
254cdf0e10cSrcweir# Linux specific settings
255cdf0e10cSrcweir#
256cdf0e10cSrcweir###########################################################################
257cdf0e10cSrcweirifneq (,$(findstring linux,$(PLATFORM)))
258cdf0e10cSrcweir# Settings for Linux using gcc compiler
259cdf0e10cSrcweir
260cdf0e10cSrcweirPROCTYPE := $(shell $(PRJ)/config.guess | cut -d "-" -f1 | sed -e 's/^i.86$$/i386/')
261cdf0e10cSrcweirPLATFORM=linux
262cdf0e10cSrcweir
263cdf0e10cSrcweirPACKAGE_LIB_DIR=linux_$(PROCTYPE).plt
264cdf0e10cSrcweirUNOPKG_PLATFORM=Linux_$(PROCTYPE)
265cdf0e10cSrcweirJAVA_PROC_TYPE=$(PROCTYPE)
266cdf0e10cSrcweir
267cdf0e10cSrcweirifeq "$(PROCTYPE)" "i386"
268cdf0e10cSrcweirPACKAGE_LIB_DIR=linux_x86.plt
269cdf0e10cSrcweirUNOPKG_PLATFORM=Linux_x86
270cdf0e10cSrcweirJAVA_PROC_TYPE=i386
271cdf0e10cSrcweirendif
272cdf0e10cSrcweir
273cdf0e10cSrcweirifeq "$(PROCTYPE)" "powerpc"
274cdf0e10cSrcweirPACKAGE_LIB_DIR=linux_powerpc.plt
275cdf0e10cSrcweirUNOPKG_PLATFORM=Linux_PowerPC
276cdf0e10cSrcweirJAVA_PROC_TYPE=ppc
277cdf0e10cSrcweirendif
278cdf0e10cSrcweir
279cdf0e10cSrcweirifeq "$(PROCTYPE)" "sparc"
280cdf0e10cSrcweirPACKAGE_LIB_DIR=linux_sparc.plt
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"
356cdf0e10cSrcweirCC_DEFINES_JNI=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
357cdf0e10cSrcweirCC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -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
375*ed9d7cbeSJü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)))
386cdf0e10cSrcweir# Settings for MacOSX using gcc 4.0.1 compiler
387cdf0e10cSrcweir
388cdf0e10cSrcweirPROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
389cdf0e10cSrcweir
390cdf0e10cSrcweir# Default is MacOSX on a Intel machine
391cdf0e10cSrcweirPLATFORM=macosx
392cdf0e10cSrcweir
393cdf0e10cSrcweirifeq "$(PROCTYPE)" "i386"
394cdf0e10cSrcweirPACKAGE_LIB_DIR=macosx_x86.plt
395cdf0e10cSrcweirUNOPKG_PLATFORM=MacOSX_x86
396cdf0e10cSrcweirJAVA_PROC_TYPE=x86
397cdf0e10cSrcweirelse
398cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
399cdf0e10cSrcweirPACKAGE_LIB_DIR=macosx_x86.plt
400cdf0e10cSrcweirUNOPKG_PLATFORM=MacOSX_x86
401cdf0e10cSrcweirJAVA_PROC_TYPE=x86
402cdf0e10cSrcweirelse
403cdf0e10cSrcweirPACKAGE_LIB_DIR=macosx_ppc.plt
404cdf0e10cSrcweirUNOPKG_PLATFORM=MacOSX_PowerPC
405cdf0e10cSrcweirJAVA_PROC_TYPE=ppc
406cdf0e10cSrcweirendif
407cdf0e10cSrcweirendif
408cdf0e10cSrcweirJAVABIN=Commands
409cdf0e10cSrcweir
410cdf0e10cSrcweirGCC_VERSION =$(shell gcc -dumpversion| cut -d"." -f1,2)
411cdf0e10cSrcweirifeq "$(GCC_VERSION)" "4.2"
412cdf0e10cSrcweirGCC_ARCH_OPTION=-arch i386
413cdf0e10cSrcweirendif
414cdf0e10cSrcweir
415cdf0e10cSrcweirOS=MACOSX
416cdf0e10cSrcweirPS=/
417cdf0e10cSrcweirICL=\$$
418cdf0e10cSrcweirCC=gcc-$(GCC_VERSION)
419cdf0e10cSrcweirLINK=g++-$(GCC_VERSION)
420cdf0e10cSrcweirLIB=g++-$(GCC_VERSION)
421cdf0e10cSrcweirECHO=@echo
422cdf0e10cSrcweirMKDIR=mkdir -p
423cdf0e10cSrcweirCAT=cat
424cdf0e10cSrcweirOBJ_EXT=o
425cdf0e10cSrcweirSHAREDLIB_EXT=dylib
426cdf0e10cSrcweirSHAREDLIB_PRE=lib
427cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
428cdf0e10cSrcweir
429cdf0e10cSrcweirCOMID=gcc3
430cdf0e10cSrcweirCPPU_ENV=gcc3
431cdf0e10cSrcweir
432cdf0e10cSrcweirOSEP=\<
433cdf0e10cSrcweirCSEP=\>
434cdf0e10cSrcweirQUOTE=$(subst S,\,S)
435cdf0e10cSrcweirQM=\"
436cdf0e10cSrcweirSQM='
437cdf0e10cSrcweirECHOLINE=@echo
438cdf0e10cSrcweirP2BG=&
439cdf0e10cSrcweir
440cdf0e10cSrcweirDEL=rm -f
441cdf0e10cSrcweirDELRECURSIVE=rm -rf
442cdf0e10cSrcweirCOPY=cp
443cdf0e10cSrcweirURLPREFIX=file://
444cdf0e10cSrcweir
445cdf0e10cSrcweir# Include UDK version numbers
446cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
447cdf0e10cSrcweir
448cdf0e10cSrcweirSALLIB=-luno_sal
449cdf0e10cSrcweirCPPULIB=-luno_cppu
450cdf0e10cSrcweirCPPUHELPERLIB=-luno_cppuhelper$(COMID)
451cdf0e10cSrcweirSALHELPERLIB=-luno_salhelper$(COMID)
452cdf0e10cSrcweirREGLIB=-lreg
453cdf0e10cSrcweirSTORELIB=-lstore
454cdf0e10cSrcweir
455*ed9d7cbeSJürgen SchmidtSALDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_sal.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_sal.dylib'
456*ed9d7cbeSJürgen SchmidtCPPUDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppu.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_cppu.dylib'
457*ed9d7cbeSJürgen SchmidtCPPUHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppuhelper'$(COMID).dylib.3:$(OO_SDK_OFFICE_LIB_DIR)/libuno_cppuhelper$(COMID).dylib'
458*ed9d7cbeSJürgen SchmidtSALHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_salhelper$(COMID).dylib'
459*ed9d7cbeSJürgen SchmidtREGDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libreg.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libreg.dylib'
460*ed9d7cbeSJürgen SchmidtSTOREDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libstore.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libstore.dylib'
461cdf0e10cSrcweir
462b3ba5bc7SJürgen SchmidtINSTALL_NAME_URELIBS=install_name_tool -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
463cdf0e10cSrcweir
464cdf0e10cSrcweirINSTALL_NAME_URELIBS_BIN=install_name_tool -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
465cdf0e10cSrcweir
466cdf0e10cSrcweirEMPTYSTRING=
467cdf0e10cSrcweirPATH_SEPARATOR=:
468cdf0e10cSrcweir
469cdf0e10cSrcweirCC_FLAGS_JNI=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION)
470cdf0e10cSrcweirCC_FLAGS=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden
471cdf0e10cSrcweir# -O is necessary for inlining (see gcc documentation)
472cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
473cdf0e10cSrcweirCC_FLAGS_JNI+=-g
474cdf0e10cSrcweirCC_FLAGS+=-g
475cdf0e10cSrcweirelse
476cdf0e10cSrcweirCC_FLAGS_JNI+=-O
477cdf0e10cSrcweirCC_FLAGS+=-O
478cdf0e10cSrcweirendif
479cdf0e10cSrcweir
480cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
481cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
482cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
483cdf0e10cSrcweirCC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
484cdf0e10cSrcweirCC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE
485cdf0e10cSrcweir
486cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
487cdf0e10cSrcweir
488cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
489cdf0e10cSrcweir#-fPIC -fno-common
490cdf0e10cSrcweir
491cdf0e10cSrcweir# install_name '@executable_path$/(@:f)'
492cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)  -Wl,-exported_symbols_list $(COMP_MAPFILE)
493cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
494cdf0e10cSrcweir
495cdf0e10cSrcweirEXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
496*ed9d7cbeSJürgen SchmidtLINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_OFFICE_LIB_DIR)"
497cdf0e10cSrcweirLINK_JAVA_LIBS=-framework JavaVM
498cdf0e10cSrcweir#LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/Libraries"
499cdf0e10cSrcweir
500cdf0e10cSrcweirendif
501cdf0e10cSrcweir
502cdf0e10cSrcweir###########################################################################
503cdf0e10cSrcweir#
504cdf0e10cSrcweir# FreeBSD specific settings
505cdf0e10cSrcweir#
506cdf0e10cSrcweir###########################################################################
507cdf0e10cSrcweirifneq (,$(findstring freebsd,$(PLATFORM)))
508cdf0e10cSrcweir# Settings for FreeBSD using gcc compiler
509cdf0e10cSrcweir
510cdf0e10cSrcweirPROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
511cdf0e10cSrcweir
512cdf0e10cSrcweirifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
513cdf0e10cSrcweirPLATFORM=kfreebsd
514cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
515cdf0e10cSrcweirPACKAGE_LIB_DIR=kfreebsd_x86_64.plt
516cdf0e10cSrcweirUNOPKG_PLATFORM=kFreeBSD_x86_64
517cdf0e10cSrcweirelse
518cdf0e10cSrcweirPACKAGE_LIB_DIR=kfreebsd_x86.plt
519cdf0e10cSrcweirUNOPKG_PLATFORM=kFreeBSD_x86
520cdf0e10cSrcweirendif
521cdf0e10cSrcweirelse
522cdf0e10cSrcweirPLATFORM=freebsd
523cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
524cdf0e10cSrcweirPACKAGE_LIB_DIR=freebsd_x86_64.plt
525cdf0e10cSrcweirUNOPKG_PLATFORM=FreeBSD_x86_64
526cdf0e10cSrcweirelse
527cdf0e10cSrcweirPACKAGE_LIB_DIR=freebsd_x86.plt
528cdf0e10cSrcweirUNOPKG_PLATFORM=FreeBSD_x86
529cdf0e10cSrcweirendif
530cdf0e10cSrcweirendif
531cdf0e10cSrcweir
532cdf0e10cSrcweirifeq "$(PROCTYPE)" "x86_64"
533cdf0e10cSrcweirJAVA_PROC_TYPE=amd64
534cdf0e10cSrcweirelse
535cdf0e10cSrcweirJAVA_PROC_TYPE=i386
536cdf0e10cSrcweirendif
537cdf0e10cSrcweir
538cdf0e10cSrcweirifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
539cdf0e10cSrcweirOS=LINUX
540cdf0e10cSrcweirelse
541cdf0e10cSrcweirOS=FREEBSD
542cdf0e10cSrcweirendif
543cdf0e10cSrcweirPS=/
544cdf0e10cSrcweirICL=\$$
545cdf0e10cSrcweirCC=gcc
546cdf0e10cSrcweirLINK=g++
547cdf0e10cSrcweirLIB=g++
548cdf0e10cSrcweirECHO=@echo
549cdf0e10cSrcweirMKDIR=mkdir -p
550cdf0e10cSrcweirCAT=cat
551cdf0e10cSrcweirOBJ_EXT=o
552cdf0e10cSrcweirSHAREDLIB_EXT=so
553cdf0e10cSrcweirSHAREDLIB_PRE=lib
554cdf0e10cSrcweirSHAREDLIB_OUT=$(OUT_LIB)
555cdf0e10cSrcweir
556cdf0e10cSrcweirGCC_VERSION=$(shell $(CC) -dumpversion)
557cdf0e10cSrcweir
558cdf0e10cSrcweirCOMID=gcc3
559cdf0e10cSrcweirCPPU_ENV=gcc3
560cdf0e10cSrcweir
561cdf0e10cSrcweirOSEP=\<
562cdf0e10cSrcweirCSEP=\>
563cdf0e10cSrcweirQUOTE=$(subst S,\,S)
564cdf0e10cSrcweirQM=\"
565cdf0e10cSrcweirSQM='
566cdf0e10cSrcweirECHOLINE=@echo
567cdf0e10cSrcweirP2BG=&
568cdf0e10cSrcweir
569cdf0e10cSrcweirDEL=rm -f
570cdf0e10cSrcweirDELRECURSIVE=rm -rf
571cdf0e10cSrcweirCOPY=cp
572cdf0e10cSrcweirURLPREFIX=file://
573cdf0e10cSrcweir
574cdf0e10cSrcweir# Include UDK version numbers
575cdf0e10cSrcweirinclude $(PRJ)/include/udkversion.mk
576cdf0e10cSrcweir
577cdf0e10cSrcweirSALLIB=-luno_sal
578cdf0e10cSrcweirCPPULIB=-luno_cppu
579cdf0e10cSrcweirCPPUHELPERLIB=-luno_cppuhelper$(COMID)
580cdf0e10cSrcweirSALHELPERLIB=-luno_salhelper$(COMID)
581cdf0e10cSrcweirREGLIB=-lreg
582cdf0e10cSrcweirSTORELIB=-lstore
583cdf0e10cSrcweir
584cdf0e10cSrcweirEMPTYSTRING=
585cdf0e10cSrcweirPATH_SEPARATOR=:
586cdf0e10cSrcweir
587cdf0e10cSrcweirCC_FLAGS_JNI=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS)
588cdf0e10cSrcweirCC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden
589cdf0e10cSrcweir# -O is necessary for inlining (see gcc documentation)
590cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
591cdf0e10cSrcweirCC_FLAGS_JNI+=-g
592cdf0e10cSrcweirCC_FLAGS+=-g
593cdf0e10cSrcweirelse
594cdf0e10cSrcweirCC_FLAGS_JNI+=-O
595cdf0e10cSrcweirCC_FLAGS+=-O
596cdf0e10cSrcweirendif
597cdf0e10cSrcweir
598cdf0e10cSrcweirSDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd"
599cdf0e10cSrcweirCC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
600cdf0e10cSrcweirSTL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
601cdf0e10cSrcweirCC_DEFINES_JNI=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
602cdf0e10cSrcweirCC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE
603cdf0e10cSrcweir
604cdf0e10cSrcweirCC_OUTPUT_SWITCH=-o
605cdf0e10cSrcweir
606cdf0e10cSrcweirLIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN'
607cdf0e10cSrcweir#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
608cdf0e10cSrcweirCOMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
609cdf0e10cSrcweir
610cdf0e10cSrcweirEXE_LINK_FLAGS=-Wl,--allow-shlib-undefined
611cdf0e10cSrcweir#EXE_LINK_FLAGS+=-Wl,-export-dynamic -Wl,-z,defs
612*ed9d7cbeSJürgen SchmidtLINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)" $(PTHREAD_LIBS)
613cdf0e10cSrcweirLINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
614cdf0e10cSrcweir
615cdf0e10cSrcweirendif
6162752044bSAriel Constenla-Haile
617*ed9d7cbeSJürgen Schmidt# add additional boost specific settings
618*ed9d7cbeSJürgen Schmidtifneq "$(OO_SDK_BOOST_HOME)" ""
619*ed9d7cbeSJürgen SchmidtSTL_INCLUDES+= -I"$(OO_SDK_BOOST_HOME)"
620*ed9d7cbeSJürgen Schmidtendif
6212752044bSAriel Constenla-Haile
6222752044bSAriel Constenla-Haile# Add OSL_DEBUG_LEVEL to compiler the flags (for OSL_TRACE et. al.)
6232752044bSAriel Constenla-Haileifeq "$(DEBUG)" "yes"
6242752044bSAriel Constenla-HaileCC_FLAGS += -DOSL_DEBUG_LEVEL=2
6252752044bSAriel Constenla-Haileendif
626