xref: /aoo41x/main/solenv/inc/os2gcci.mk (revision 534c536d)
17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew 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
178*534c536dSYuri DarioCFLAGS+=$(LIBXML_CFLAGS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/os2
179*534c536dSYuri DarioCFLAGSCXX+=$(LIBXML_CFLAGS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/os2
180*534c536dSYuri Dario
181cdf0e10cSrcweir# name of linker
182cdf0e10cSrcweirLINK*=gcc
183cdf0e10cSrcweir# default linker flags
184cdf0e10cSrcweirLINKFLAGS= -Zbin-files -Zmap
185cdf0e10cSrcweir#27/01/06 bin-files confuses transex/rsc work, removed.
186cdf0e10cSrcweirLINKFLAGS= -Zno-fork -Zhigh-mem -Zmap
187cdf0e10cSrcweir.IF "$(OS2_ARGS_WILD)" != ""
188cdf0e10cSrcweirLINKFLAGS+=-Zargs-wild -Zargs-resp
189cdf0e10cSrcweir.ENDIF
190cdf0e10cSrcweir
191cdf0e10cSrcweir.IF "$(aout)"==""
192cdf0e10cSrcweir#LINKFLAGS+= -Zlinker /NOI -Zlinker /PACKD:65536 -Zlinker /EXEPACK:2
193cdf0e10cSrcweir#LINKFLAGS+= -Zlinker /NOExtdictionary
194cdf0e10cSrcweirLINKFLAGS+= -Zomf
195*534c536dSYuri DarioLINKFLAGS+= -Zlinker "DISABLE 1121"
196cdf0e10cSrcweir.ENDIF
197cdf0e10cSrcweir
198cdf0e10cSrcweir
199cdf0e10cSrcweir# linker flags for linking applications
200cdf0e10cSrcweir.IF "$(aout)"==""
201cdf0e10cSrcweir#LINKFLAGSAPPGUI= -Zlinker /PM:PM -Zstack 0x2000
202cdf0e10cSrcweir#LINKFLAGSAPPCUI= -Zlinker /PM:VIO
203cdf0e10cSrcweir.ELSE
204cdf0e10cSrcweirLINKFLAGSAPPGUI=
205cdf0e10cSrcweirLINKFLAGSAPPCUI=
206cdf0e10cSrcweir.ENDIF
207cdf0e10cSrcweir
208cdf0e10cSrcweir# linker flags for linking shared libraries
209cdf0e10cSrcweirLINKFLAGSSHLGUI= -Zdll #-Zsym
210cdf0e10cSrcweirLINKFLAGSSHLCUI= -Zdll #-Zsym
211cdf0e10cSrcweir
212cdf0e10cSrcweir.IF "$(aout)"==""
213cdf0e10cSrcweirLINKFLAGSTACK=-Zlinker /STACK:
214cdf0e10cSrcweirLINKFLAGSPROF=
215cdf0e10cSrcweir#LINKFLAGSDEBUG=-Zlinker /DEBUG
216cdf0e10cSrcweirLINKFLAGSDEBUG=-g
217cdf0e10cSrcweirLINKFLAGSOPT=-g
218cdf0e10cSrcweir.ELSE
219cdf0e10cSrcweirLINKFLAGSTACK=-Zstack
220cdf0e10cSrcweirLINKFLAGSPROF=
221cdf0e10cSrcweirLINKFLAGSDEBUG=-g
222cdf0e10cSrcweirLINKFLAGSOPT=-s
223cdf0e10cSrcweir.ENDIF
224cdf0e10cSrcweir
225cdf0e10cSrcweir.IF "$(NO_BSYMBOLIC)"==""
226cdf0e10cSrcweir.IF "$(PRJNAME)" != "envtest"
227cdf0e10cSrcweirLINKFLAGSSHLGUI+=
228cdf0e10cSrcweirLINKFLAGSSHLCUI+=
229cdf0e10cSrcweir.ENDIF
230cdf0e10cSrcweir.ENDIF				# "$(NO_BSYMBOLIC)"==""
231cdf0e10cSrcweir
232cdf0e10cSrcweirLINKVERSIONMAPFLAG=-Wl,--version-script
233cdf0e10cSrcweir
234cdf0e10cSrcweirSONAME_SWITCH=-Wl,-h
235cdf0e10cSrcweir
236cdf0e10cSrcweir# Sequence of libs does matter !
237cdf0e10cSrcweir
238cdf0e10cSrcweir#STDLIBCPP=stdc++ supc++ gcc_eh
239cdf0e10cSrcweir#STDLIBCPP=stdc++ gcc432
240*534c536dSYuri DarioSTDLIBCPP=-lstdc++ -lgcc_so_d
241cdf0e10cSrcweir
242cdf0e10cSrcweir# default objectfilenames to link
243*534c536dSYuri DarioSTDOBJVCL=$(L)/salmain.o
244cdf0e10cSrcweirSTDOBJGUI=
245cdf0e10cSrcweirSTDSLOGUI=
246cdf0e10cSrcweirSTDOBJCUI=
247cdf0e10cSrcweirSTDSLOCUI=
248cdf0e10cSrcweir
249cdf0e10cSrcweir# libraries for linking applications
250cdf0e10cSrcweirSTDLIBCUIST=$(STDLIBCPP)
251cdf0e10cSrcweirSTDLIBGUIMT=$(STDLIBCPP)
252cdf0e10cSrcweirSTDLIBCUIMT=$(STDLIBCPP)
253cdf0e10cSrcweirSTDLIBGUIST=$(STDLIBCPP)
254cdf0e10cSrcweir# libraries for linking shared libraries
255cdf0e10cSrcweirSTDSHLGUIMT=$(STDLIBCPP)
256cdf0e10cSrcweirSTDSHLCUIMT=$(STDLIBCPP)
257cdf0e10cSrcweir
258*534c536dSYuri DarioLIBSTLPORT=stlp45.lib $(DYNAMIC)
259*534c536dSYuri DarioLIBSTLPORTST=stlp45.lib $(STATIC) $(DYNAMIC)
260cdf0e10cSrcweir
261cdf0e10cSrcweir
262cdf0e10cSrcweir# name of library manager
263cdf0e10cSrcweirLIBMGR=ar
264*534c536dSYuri DarioLIBFLAGS=-crv
265cdf0e10cSrcweir
266cdf0e10cSrcweir.IF "$(aout)"==""
267cdf0e10cSrcweirLIBMGR=emxomfar -p2048
268cdf0e10cSrcweir.ENDIF
269cdf0e10cSrcweir
270cdf0e10cSrcweir# tool for generating import libraries
271cdf0e10cSrcweirIMPLIB=emximp
272cdf0e10cSrcweirIMPLIBFLAGS=-o
273cdf0e10cSrcweir
274cdf0e10cSrcweirMAPSYM=mapsym
275cdf0e10cSrcweirMAPSYMFLAGS=
276cdf0e10cSrcweir
277cdf0e10cSrcweirRC=wrc -bt=os2 -i$(PATH_EMXPGCC)\include
278cdf0e10cSrcweirRCFLAGS=-r $(RCFILES) -fo=$@
279cdf0e10cSrcweirRCLINK=wrc -bt=os2
280cdf0e10cSrcweirRCLINKFLAGS=
281cdf0e10cSrcweirRCSETVERSION=
282cdf0e10cSrcweir
283cdf0e10cSrcweir# platform specific identifier for shared libs
284a4f23604SHerbert DürrDLLPOSTFIX=
285cdf0e10cSrcweirDLLPRE=lib
286cdf0e10cSrcweirDLLPOST=.dll
287cdf0e10cSrcweir
288