xref: /trunk/main/solenv/inc/unxsols4.mk (revision 31bbceb0f9d64c0c2c3b22a794a1666c1f33396e)
17871dc3eSAndrew Rist#**************************************************************
2cdf0e10cSrcweir#
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
10cdf0e10cSrcweir#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir#
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.
19cdf0e10cSrcweir#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir
25cdf0e10cSrcweirASM=/usr/ccs/bin/as
26cdf0e10cSrcweir# needs -D__sparcv8plus because it's not defined by the assembler with -xarch=v8plus
27cdf0e10cSrcweirAFLAGS=-P -xarch=v8plus -D__sparcv8plus
28cdf0e10cSrcweir
29cdf0e10cSrcweirCDEFS+=-D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=$(STLPORT_VER)
30cdf0e10cSrcweir
31cdf0e10cSrcweirSOLAR_JAVA*=TRUE
32cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"!=""
33cdf0e10cSrcweirJAVADEF=-DSOLAR_JAVA
34cdf0e10cSrcweirJAVAFLAGSDEBUG=-g
35cdf0e10cSrcweir.IF "$(debug)"==""
36cdf0e10cSrcweirJAVA_RUNTIME=-ljava
37cdf0e10cSrcweir.ELSE
38cdf0e10cSrcweirJAVA_RUNTIME=-ljava_g
39cdf0e10cSrcweir.ENDIF
40cdf0e10cSrcweir.ENDIF
41cdf0e10cSrcweir
42cdf0e10cSrcweir# architecture dependent flags for the C and C++ compiler that can be changed by
43cdf0e10cSrcweir# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
44cdf0e10cSrcweirARCH_FLAGS*=
45cdf0e10cSrcweir
46cdf0e10cSrcweirCXX*=CC
47cdf0e10cSrcweirCC*=cc
48cdf0e10cSrcweir
49cdf0e10cSrcweirCFLAGS=$(PREENVCFLAGS) -c -temp=/tmp
50cdf0e10cSrcweir# CC defines __sparcv8plus with -xarch=v8plus, cc does not (sigh)
51cdf0e10cSrcweirCFLAGSCC=-xCC -D__sparcv8plus $(ARCH_FLAGS)
52cdf0e10cSrcweirCFLAGSCXX=-features=no%altspell -library=no%Cstd $(ARCH_FLAGS)
53cdf0e10cSrcweir
54cdf0e10cSrcweir# flags to enable build with symbols; required for crashdump feature
55cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g0 -xs # was temporarily commented out, reenabled before Beta
56cdf0e10cSrcweirCFLAGSENABLESYMBOLS_CC_ONLY=-g -xs # was temporarily commented out, reenabled before Beta
57cdf0e10cSrcweir
58cdf0e10cSrcweirCFLAGSEXCEPTIONS=
59cdf0e10cSrcweirCFLAGS_NO_EXCEPTIONS=-noex
60cdf0e10cSrcweir
61cdf0e10cSrcweirCFLAGSOBJGUIMT=-KPIC -mt
62cdf0e10cSrcweirCFLAGSOBJCUIMT=-KPIC -mt
63cdf0e10cSrcweirCFLAGSSLOGUIMT=-KPIC -mt
64cdf0e10cSrcweirCFLAGSSLOCUIMT=-KPIC -mt
65cdf0e10cSrcweirCFLAGSPROF=-xpg
66cdf0e10cSrcweirCFLAGSDEBUG=-g
67cdf0e10cSrcweirCFLAGSDBGUTIL=
68cdf0e10cSrcweir#  -m32 -xarch=sparc        restrict target to 32 bit sparc
69cdf0e10cSrcweir#  -xO3                     optimization level 3
70cdf0e10cSrcweir#  -xspace                  don't do optimizations which do increase binary size
71cdf0e10cSrcweir#  -xprefetch=yes           do prefetching (helps on UltraSparc III)
72cdf0e10cSrcweirCFLAGSOPT=-m32 -xarch=sparc -xO3 -xspace -xprefetch=yes
73cdf0e10cSrcweirCFLAGSNOOPT=
74cdf0e10cSrcweirCFLAGSOUTOBJ=-o
75cdf0e10cSrcweir
76cdf0e10cSrcweir# Warnings switched off for CXX:
77cdf0e10cSrcweir# - doubunder: we have many identifiers containing double underscores, some of
78cdf0e10cSrcweir#   them in the stable UDK API we cannot change
79cdf0e10cSrcweir# - identexpected: Identifier expected instead of "}"
80cdf0e10cSrcweir#   if an enum ends with a comma before the '}'
81cdf0e10cSrcweir#   this warning does not seem to heed #pragma disable_warn, and is not helpful
82cdf0e10cSrcweir# - inllargeuse: "function is too large and will not be expanded inline" is
83cdf0e10cSrcweir#   merely a hint
84cdf0e10cSrcweir# - inllargeint: "function is too large to generate inline, consider writing
85cdf0e10cSrcweir#   it yourself" is merely a hint
86cdf0e10cSrcweir# - notemsource: "could not find source for function" appears to be spurious
87cdf0e10cSrcweir# - reftotemp: warns about calling non-const functions on temporary objects,
88cdf0e10cSrcweir#   something legally done by boost::scoped_array<T>::reset, for example
89cdf0e10cSrcweir#   (this_type(p).swap(*this))
90cdf0e10cSrcweir# - truncwarn: "conversion of 64 bit type value to smaller type causes
91cdf0e10cSrcweir#   truncation" at least with CC 5.8 is reported only at the end of a
92cdf0e10cSrcweir#   compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
93cdf0e10cSrcweir#   sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
94cdf0e10cSrcweir#   disabled globally
95cdf0e10cSrcweir# - wnoretvalue: warning about the last statement of a function not
96cdf0e10cSrcweir#   returning a value. Unfortunately triggers on perfectly acceptable
97cdf0e10cSrcweir#   code, for example if the last statement in is a throw statement
98cdf0e10cSrcweir# - anonnotype: Warns if a type is declared in an anonymous union. Temporary
99cdf0e10cSrcweir#   disabled until issue i97325 is fixed. Note: The compiler is actually
100cdf0e10cSrcweir#   right about this warning, the C++ standard is explicit about this.
101cdf0e10cSrcweirCFLAGSWARNCC=
102cdf0e10cSrcweirCFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype
103cdf0e10cSrcweirCFLAGSWALLCC=$(CFLAGSWARNCC)
104cdf0e10cSrcweirCFLAGSWALLCXX=$(CFLAGSWARNCXX)
105cdf0e10cSrcweirCFLAGSWERRCC=-errwarn=%all
106cdf0e10cSrcweirCFLAGSWERRCXX=-xwe
107cdf0e10cSrcweir
108cdf0e10cSrcweir# Once all modules on this platform compile without warnings, set
109cdf0e10cSrcweir# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
110cdf0e10cSrcweir# settings.mk):
111*f3ecff4eSAndre FischerMODULES_WITH_WARNINGS :=
112cdf0e10cSrcweir
113cdf0e10cSrcweirSTDOBJVCL=$(L)/salmain.o
114cdf0e10cSrcweir
115cdf0e10cSrcweirTHREADLIB=
116cdf0e10cSrcweir.IF "$(PURIFY)"!=""
117cdf0e10cSrcweirLINK=/usr/local/purify-4.2-solaris2/purify CC
118cdf0e10cSrcweir.ELSE
119cdf0e10cSrcweirLINK=$(CXX)
120cdf0e10cSrcweir.ENDIF
121cdf0e10cSrcweirLINKC=$(CC)
122cdf0e10cSrcweir
123cdf0e10cSrcweir# link against set of baseline libraries
124cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
125cdf0e10cSrcweirC_RESTRICTIONFLAGS*=-xc99=none
126cdf0e10cSrcweir#LD_OPTIONS+:=-L$(SYSBASE)/usr/lib
127cdf0e10cSrcweirCDEFS+=-DSYSBASE="$(SYSBASE)"
128cdf0e10cSrcweirCFLAGSCC+=$(C_RESTRICTIONFLAGS)
129cdf0e10cSrcweir#.EXPORT : LD_OPTIONS
130cdf0e10cSrcweir.ENDIF          # "$(SYSBASE)"!=""
131cdf0e10cSrcweir
132cdf0e10cSrcweir# -z combreloc combines multiple relocation sections. Reduces overhead on startup
133cdf0e10cSrcweir# -norunpath prevents the compiler from recording his own libs in the runpath
134cdf0e10cSrcweirLINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
135910823aeSJürgen SchmidtLINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN'\'
136910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
137cdf0e10cSrcweir    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
138910823aeSJürgen SchmidtLINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN'\'
139910823aeSJürgen SchmidtLINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN'\'
140910823aeSJürgen SchmidtLINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN'\'
141910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
142910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN/../../ure-link/lib'\'
143910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
144cdf0e10cSrcweirLINKFLAGSRUNPATH_OXT=
145910823aeSJürgen SchmidtLINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN'\'
146910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
147cdf0e10cSrcweirLINKFLAGSRUNPATH_NONE=
148cdf0e10cSrcweirLINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
149cdf0e10cSrcweirLINKCFLAGS=-w -mt -z combreloc -norunpath
150cdf0e10cSrcweir
151cdf0e10cSrcweir# -z text force fatal error if non PIC code is linked into shared library. Such code
152cdf0e10cSrcweir#    would be expensive on startup
153cdf0e10cSrcweirCHECKFORPIC =-z text
154cdf0e10cSrcweirLINKFLAGSSHLGUI=$(CHECKFORPIC) -G
155cdf0e10cSrcweirLINKFLAGSSHLCUI=$(CHECKFORPIC) -G
156cdf0e10cSrcweir
157cdf0e10cSrcweir# switches for dynamic and static linking
158cdf0e10cSrcweirLINKFLAGSDEFS*= -z defs
159cdf0e10cSrcweirSTATIC      = -Bstatic
160cdf0e10cSrcweirDIRECT      = -Bdirect $(LINKFLAGSDEFS)
161cdf0e10cSrcweirDYNAMIC     = -Bdynamic
162cdf0e10cSrcweir
163cdf0e10cSrcweirLINKFLAGSAPPGUI+=$(DIRECT)
164cdf0e10cSrcweirLINKFLAGSAPPCUI+=$(DIRECT)
165cdf0e10cSrcweirLINKFLAGSSHLGUI+=$(DIRECT)
166cdf0e10cSrcweirLINKFLAGSSHLCUI+=$(DIRECT)
167cdf0e10cSrcweir
168cdf0e10cSrcweirLINKFLAGSTACK=
169cdf0e10cSrcweirLINKFLAGSPROF=-L$(COMPATH)/WS6U1/lib/libp -xpg -z allextract
170cdf0e10cSrcweirLINKFLAGSDEBUG=
171cdf0e10cSrcweirLINKFLAGSOPT=
172cdf0e10cSrcweirLINKVERSIONMAPFLAG=-M
173cdf0e10cSrcweir
174cdf0e10cSrcweir# mapfile for non-executable stack
175cdf0e10cSrcweirLINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
176cdf0e10cSrcweirLINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
177cdf0e10cSrcweirLINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
178cdf0e10cSrcweir
179cdf0e10cSrcweirAPPLINKSTATIC=$(STATIC)
180cdf0e10cSrcweirAPPLINKSHARED=$(DIRECT)
181cdf0e10cSrcweirAPP_LINKTYPE=
182cdf0e10cSrcweir
183cdf0e10cSrcweirSTDLIBCPP=-lCrun
184cdf0e10cSrcweir
185cdf0e10cSrcweir# reihenfolge der libs NICHT egal!
186cdf0e10cSrcweirSTDOBJGUI=
187cdf0e10cSrcweir.IF "DBG_UTIL" != ""
188cdf0e10cSrcweirSTDSLOGUI=#-lpthread
189cdf0e10cSrcweir.ELSE
190cdf0e10cSrcweirSTDSLOGUI=
191cdf0e10cSrcweir.ENDIF
192cdf0e10cSrcweirSTDOBJCUI=
193cdf0e10cSrcweirSTDSLOCUI=
194cdf0e10cSrcweir
195cdf0e10cSrcweir# CPPRUNTIME - define where to place C++ runtime if required
196cdf0e10cSrcweirSTDLIBGUIMT=$(DYNAMIC) -lpthread -lm
197cdf0e10cSrcweirSTDLIBCUIMT=$(DYNAMIC) -lpthread -lm
198cdf0e10cSrcweirSTDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
199cdf0e10cSrcweirSTDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
200cdf0e10cSrcweir
201cdf0e10cSrcweir# libdl.so - no really an GUI library but required in this context
202cdf0e10cSrcweirSTDLIBGUIMT+=-ldl
203cdf0e10cSrcweirSTDSHLGUIMT+=-ldl
204cdf0e10cSrcweirX11LINK_DYNAMIC = -lXext -lX11
205cdf0e10cSrcweir
206cdf0e10cSrcweir# @@@ interposer needed for -Bdirect @@@
207cdf0e10cSrcweir# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
208cdf0e10cSrcweirLIBSALCPPRT=
209cdf0e10cSrcweir
210cdf0e10cSrcweir.IF "$(USE_STLP_DEBUG)" != ""
211cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
212cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
213cdf0e10cSrcweir.ELSE
214cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
215cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
216cdf0e10cSrcweir.ENDIF # "$(USE_STLP_DEBUG)" != ""
217cdf0e10cSrcweir
218cdf0e10cSrcweirLIBMGR=CC
219cdf0e10cSrcweirLIBFLAGS=-xar -o
220cdf0e10cSrcweir
221cdf0e10cSrcweirIMPLIB=
222cdf0e10cSrcweirIMPLIBFLAGS=
223cdf0e10cSrcweir
224cdf0e10cSrcweirMAPSYM=
225cdf0e10cSrcweirMAPSYMFLAGS=
226cdf0e10cSrcweirIGNORE_SYMBOLS=S-LP64
227cdf0e10cSrcweir
228cdf0e10cSrcweirRC=irc
229cdf0e10cSrcweirRCFLAGS=-fo$@ $(RCFILES)
230cdf0e10cSrcweirRCLINK=
231cdf0e10cSrcweirRCLINKFLAGS=
232cdf0e10cSrcweirRCSETVERSION=
233cdf0e10cSrcweir
234a4f23604SHerbert DürrDLLPOSTFIX=
235cdf0e10cSrcweir
236cdf0e10cSrcweirDLLPRE=lib
237cdf0e10cSrcweirDLLPOST=.so
238cdf0e10cSrcweir
239cdf0e10cSrcweirLDUMP=cppfilt /b /n /o /p
240cdf0e10cSrcweir
241cdf0e10cSrcweirCFLAGSCXXSLO +=
242cdf0e10cSrcweirCFLAGSCXXOBJ +=
243cdf0e10cSrcweir
244cdf0e10cSrcweirLINKFLAGSAPPGUI+=
245cdf0e10cSrcweirLINKFLAGSSHLGUI+=
246cdf0e10cSrcweirLINKFLAGSAPPCUI+=
247cdf0e10cSrcweirLINKFLAGSSHLCUI+=
248