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