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