xref: /aoo41x/main/solenv/inc/os2gcci.mk (revision cde270a3)
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# until we get a solution to libc ticket#251, use dmik's -q option.
41EMXOMFOPT = -q
42.EXPORT : EMXOMFOPT
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
182CFLAGS+=$(LIBXML_CFLAGS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/os2
183CFLAGSCXX+=$(LIBXML_CFLAGS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/os2
184
185# name of linker
186LINK*=gcc
187# default linker flags
188LINKFLAGS= -Zbin-files -Zmap
189#27/01/06 bin-files confuses transex/rsc work, removed.
190LINKFLAGS= -Zno-fork -Zhigh-mem -Zmap
191.IF "$(OS2_ARGS_WILD)" != ""
192LINKFLAGS+=-Zargs-wild -Zargs-resp
193.ENDIF
194
195.IF "$(aout)"==""
196#LINKFLAGS+= -Zlinker /NOI -Zlinker /PACKD:65536 -Zlinker /EXEPACK:2
197#LINKFLAGS+= -Zlinker /NOExtdictionary
198LINKFLAGS+= -Zomf
199LINKFLAGS+= -Zlinker "DISABLE 1121"
200.ENDIF
201
202
203# linker flags for linking applications
204.IF "$(aout)"==""
205#LINKFLAGSAPPGUI= -Zlinker /PM:PM -Zstack 0x2000
206#LINKFLAGSAPPCUI= -Zlinker /PM:VIO
207.ELSE
208LINKFLAGSAPPGUI=
209LINKFLAGSAPPCUI=
210.ENDIF
211
212# linker flags for linking shared libraries
213LINKFLAGSSHLGUI= -Zdll #-Zsym
214LINKFLAGSSHLCUI= -Zdll #-Zsym
215
216.IF "$(aout)"==""
217LINKFLAGSTACK=-Zlinker /STACK:
218LINKFLAGSPROF=
219#LINKFLAGSDEBUG=-Zlinker /DEBUG
220LINKFLAGSDEBUG=-g
221LINKFLAGSOPT=-g
222.ELSE
223LINKFLAGSTACK=-Zstack
224LINKFLAGSPROF=
225LINKFLAGSDEBUG=-g
226LINKFLAGSOPT=-s
227.ENDIF
228
229.IF "$(NO_BSYMBOLIC)"==""
230.IF "$(PRJNAME)" != "envtest"
231LINKFLAGSSHLGUI+=
232LINKFLAGSSHLCUI+=
233.ENDIF
234.ENDIF				# "$(NO_BSYMBOLIC)"==""
235
236LINKVERSIONMAPFLAG=-Wl,--version-script
237
238SONAME_SWITCH=-Wl,-h
239
240# Sequence of libs does matter !
241
242#STDLIBCPP=stdc++ supc++ gcc_eh
243#STDLIBCPP=stdc++ gcc432
244STDLIBCPP=-lstdc++ -lgcc_so_d
245
246# default objectfilenames to link
247STDOBJVCL=$(L)/salmain.o
248STDOBJGUI=
249STDSLOGUI=
250STDOBJCUI=
251STDSLOCUI=
252
253# libraries for linking applications
254STDLIBCUIST=$(STDLIBCPP)
255STDLIBGUIMT=$(STDLIBCPP)
256STDLIBCUIMT=$(STDLIBCPP)
257STDLIBGUIST=$(STDLIBCPP)
258# libraries for linking shared libraries
259STDSHLGUIMT=$(STDLIBCPP)
260STDSHLCUIMT=$(STDLIBCPP)
261
262LIBSTLPORT=stlp45.lib $(DYNAMIC)
263LIBSTLPORTST=stlp45.lib $(STATIC) $(DYNAMIC)
264
265
266# name of library manager
267LIBMGR=ar
268LIBFLAGS=-crv
269
270.IF "$(aout)"==""
271LIBMGR=emxomfar -p2048
272.ENDIF
273
274# tool for generating import libraries
275IMPLIB=emximp -p2048
276IMPLIBFLAGS=-o
277
278MAPSYM=mapsym
279MAPSYMFLAGS=
280
281RC=wrc -q -bt=os2 -i$(PATH_EMXPGCC)\include
282RCFLAGS=-r $(RCFILES) -fo=$@
283RCLINK=wrc -bt=os2
284RCLINKFLAGS=
285RCSETVERSION=
286
287# platform specific identifier for shared libs
288DLLPOSTFIX=
289DLLPRE=lib
290DLLPOST=.dll
291
292