xref: /aoo41x/main/solenv/inc/os2gcci.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28# --- OS2-Environment ----------------------------------------------
29
30#change output dir name using the object binary format.
31#.IF "$(aout)"==""
32#OUTFMT=omf
33#.ELSE
34#OUTFMT=aout
35#.ENDIF
36#OUTPATH+=OUTFMT
37#INPATH+=OUTFMT
38#GVERDIR+=OUTFMT
39
40# mk file for os2gcci
41ASM=as
42AFLAGS=
43
44#//YD SOLAR_JAVA=TRUE
45JAVAFLAGSDEBUG=-g
46
47# filter for supressing verbose messages from linker
48#not needed at the moment
49#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
50
51.IF "$(ttt)"!=""
52CDEFS+=-E
53.ENDIF
54
55# _PTHREADS is needed for the stl
56CDEFS+=-DX86 -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=400
57
58# this is a platform with JAVA support
59.IF "$(SOLAR_JAVA)"!=""
60JAVADEF=-DSOLAR_JAVA
61.IF "$(debug)"==""
62JAVA_RUNTIME=javai.lib
63.ELSE
64JAVA_RUNTIME=javai_g.lib
65.ENDIF
66.ENDIF
67
68# architecture dependent flags for the C and C++ compiler that can be changed by
69# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
70ARCH_FLAGS*=
71
72# name of C++ Compiler
73CXX*=g++
74# name of C Compiler
75CC*=gcc
76# flags for C and C++ Compiler
77CFLAGS+=-c
78# flags for the C++ Compiler
79CFLAGSCC= $(ARCH_FLAGS)
80
81.IF "$(aout)"==""
82CFLAGS+=-Zomf
83.ENDIF
84
85# Flags for enabling exception handling
86CFLAGSEXCEPTIONS=-fexceptions
87# Flags for disabling exception handling
88CFLAGS_NO_EXCEPTIONS=-fno-exceptions
89
90CFLAGSCXX= -frtti $(ARCH_FLAGS)
91CFLAGSCXX+= -Wno-ctor-dtor-privacy  -fmessage-length=0
92PICSWITCH:=
93
94# Compiler flags for compiling static object in single threaded environment with graphical user interface
95CFLAGSOBJGUIST=-Zcrtdll
96# Compiler flags for compiling static object in single threaded environment with character user interface
97CFLAGSOBJCUIST=-Zcrtdll
98# Compiler flags for compiling static object in multi threaded environment with graphical user interface
99CFLAGSOBJGUIMT=-Zcrtdll
100# Compiler flags for compiling static object in multi threaded environment with character user interface
101CFLAGSOBJCUIMT=-Zcrtdll
102# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
103CFLAGSSLOGUIMT=$(PICSWITCH) -Zdll -Zcrtdll
104# Compiler flags for compiling shared object in multi threaded environment with character user interface
105CFLAGSSLOCUIMT=$(PICSWITCH) -Zdll -Zcrtdll
106# Compiler flags for profiling
107CFLAGSPROF=
108# Compiler flags for debugging
109CFLAGSDEBUG=-g
110CFLAGSDBGUTIL=
111# Compiler flags for enabling optimazations
112CFLAGSOPT=-s -O1 -march=pentium -mtune=pentium4
113# Compiler flags for disabling optimazations
114CFLAGSNOOPT=-O0
115# Compiler flags for discibing the output path
116CFLAGSOUTOBJ=-o
117
118# Warnings switched off for CXX:
119# - doubunder: we have many identifiers containing double underscores, some of
120#   them in the stable UDK API we cannot change
121# - inllargeuse: "function is too large and will not be expanded inline" is
122#   merely a hint
123# - inllargeint: "function is too large to generate inline, consider writing
124#   it yourself" is merely a hint
125# - notemsource: "could not find source for function" appears to be spurious
126# - reftotemp: warns about calling non-const functions on temporary objects,
127#   something legally done by boost::scoped_array<T>::reset, for example
128#   (this_type(p).swap(*this))
129# - truncwarn: "conversion of 64 bit type value to smaller type causes
130#   truncation" at least with CC 5.8 is reported only at the end of a
131#   compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
132#   sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
133#   disabled globally
134CFLAGSWARNCC=
135CFLAGSWARNCXX=+w2 -erroff=doubunder,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn
136CFLAGSWARNCXX=
137CFLAGSWALLCC=$(CFLAGSWARNCC)
138CFLAGSWALLCXX=$(CFLAGSWARNCXX)
139CFLAGSWERRCC=-errwarn=%all
140CFLAGSWERRCXX=-xwe
141
142# Once all modules on this platform compile without warnings, set
143# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
144# settings.mk):
145MODULES_WITH_WARNINGS := \
146    b_server \
147    basctl \
148    basebmp \
149    canvas \
150    chart2 \
151    cppcanvas \
152    desktop \
153    devtools \
154    dxcanvas \
155    extensions \
156    filter \
157    glcanvas \
158    lingu \
159    r_tools \
160    sc \
161    sd \
162    slideshow \
163    starmath \
164    svx \
165    sw \
166    writerperfect \
167    xmlsecurity
168
169
170# switches for dynamic and static linking
171STATIC		=
172DYNAMIC		=
173
174# this is needed to allow stl headers to include os2.h instead of svpm.h
175# in earlier stages of project build. Once svpm.h is in place, we can
176# compile without this flag.
177.IF "$(STL_OS2_BUILDING)" != ""
178CFLAGS+=-DSTL_OS2_BUILDING
179CFLAGSCXX+=-DSTL_OS2_BUILDING
180.ENDIF
181
182# name of linker
183LINK*=gcc
184# default linker flags
185LINKFLAGS= -Zbin-files -Zmap
186#27/01/06 bin-files confuses transex/rsc work, removed.
187LINKFLAGS= -Zno-fork -Zhigh-mem -Zmap
188.IF "$(OS2_ARGS_WILD)" != ""
189LINKFLAGS+=-Zargs-wild -Zargs-resp
190.ENDIF
191
192.IF "$(aout)"==""
193#LINKFLAGS+= -Zlinker /NOI -Zlinker /PACKD:65536 -Zlinker /EXEPACK:2
194#LINKFLAGS+= -Zlinker /NOExtdictionary
195LINKFLAGS+= -Zomf
196#LINKFLAGS+= -Zlinker "DISABLE 1121"
197.ENDIF
198
199
200# linker flags for linking applications
201.IF "$(aout)"==""
202#LINKFLAGSAPPGUI= -Zlinker /PM:PM -Zstack 0x2000
203#LINKFLAGSAPPCUI= -Zlinker /PM:VIO
204.ELSE
205LINKFLAGSAPPGUI=
206LINKFLAGSAPPCUI=
207.ENDIF
208
209# linker flags for linking shared libraries
210LINKFLAGSSHLGUI= -Zdll #-Zsym
211LINKFLAGSSHLCUI= -Zdll #-Zsym
212
213.IF "$(aout)"==""
214LINKFLAGSTACK=-Zlinker /STACK:
215LINKFLAGSPROF=
216#LINKFLAGSDEBUG=-Zlinker /DEBUG
217LINKFLAGSDEBUG=-g
218LINKFLAGSOPT=-g
219.ELSE
220LINKFLAGSTACK=-Zstack
221LINKFLAGSPROF=
222LINKFLAGSDEBUG=-g
223LINKFLAGSOPT=-s
224.ENDIF
225
226.IF "$(NO_BSYMBOLIC)"==""
227.IF "$(PRJNAME)" != "envtest"
228LINKFLAGSSHLGUI+=
229LINKFLAGSSHLCUI+=
230.ENDIF
231.ENDIF				# "$(NO_BSYMBOLIC)"==""
232
233LINKVERSIONMAPFLAG=-Wl,--version-script
234
235SONAME_SWITCH=-Wl,-h
236
237# Sequence of libs does matter !
238
239#STDLIBCPP=stdc++ supc++ gcc_eh
240#STDLIBCPP=stdc++ gcc432
241STDLIBCPP=stdc432 gcc432
242
243# default objectfilenames to link
244STDOBJVCL=$(L)/salmain.obj
245STDOBJGUI=
246STDSLOGUI=
247STDOBJCUI=
248STDSLOCUI=
249
250# libraries for linking applications
251STDLIBCUIST=$(STDLIBCPP)
252STDLIBGUIMT=$(STDLIBCPP)
253STDLIBCUIMT=$(STDLIBCPP)
254STDLIBGUIST=$(STDLIBCPP)
255# libraries for linking shared libraries
256STDSHLGUIMT=$(STDLIBCPP)
257STDSHLCUIMT=$(STDLIBCPP)
258
259LIBSTLPORT=$(DYNAMIC) stlp45.lib
260LIBSTLPORTST=$(STATIC) stlp45.lib $(DYNAMIC)
261
262
263# name of library manager
264LIBMGR=ar
265LIBFLAGS=crv
266
267.IF "$(aout)"==""
268LIBMGR=emxomfar -p2048
269.ENDIF
270
271# tool for generating import libraries
272IMPLIB=emximp
273IMPLIBFLAGS=-o
274
275MAPSYM=mapsym
276MAPSYMFLAGS=
277
278RC=wrc -bt=os2 -i$(PATH_EMXPGCC)\include
279RCFLAGS=-r $(RCFILES) -fo=$@
280RCLINK=wrc -bt=os2
281RCLINKFLAGS=
282RCSETVERSION=
283
284# platform specific identifier for shared libs
285DLLPOSTFIX=go
286DLLPRE=lib
287DLLPOST=.dll
288
289