xref: /aoo41x/main/solenv/inc/unxsols4.mk (revision 910823ae)
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
25ASM=/usr/ccs/bin/as
26# needs -D__sparcv8plus because it's not defined by the assembler with -xarch=v8plus
27AFLAGS=-P -xarch=v8plus -D__sparcv8plus
28
29CDEFS+=-D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=$(STLPORT_VER)
30
31SOLAR_JAVA*=TRUE
32.IF "$(SOLAR_JAVA)"!=""
33JAVADEF=-DSOLAR_JAVA
34JAVAFLAGSDEBUG=-g
35.IF "$(debug)"==""
36JAVA_RUNTIME=-ljava
37.ELSE
38JAVA_RUNTIME=-ljava_g
39.ENDIF
40.ENDIF
41
42# architecture dependent flags for the C and C++ compiler that can be changed by
43# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
44ARCH_FLAGS*=
45
46CXX*=CC
47CC*=cc
48
49CFLAGS=$(PREENVCFLAGS) -c -temp=/tmp
50# CC defines __sparcv8plus with -xarch=v8plus, cc does not (sigh)
51CFLAGSCC=-xCC -D__sparcv8plus $(ARCH_FLAGS)
52CFLAGSCXX=-features=no%altspell -library=no%Cstd $(ARCH_FLAGS)
53
54# flags to enable build with symbols; required for crashdump feature
55CFLAGSENABLESYMBOLS=-g0 -xs # was temporarily commented out, reenabled before Beta
56CFLAGSENABLESYMBOLS_CC_ONLY=-g -xs # was temporarily commented out, reenabled before Beta
57
58CFLAGSEXCEPTIONS=
59CFLAGS_NO_EXCEPTIONS=-noex
60
61CFLAGSOBJGUIMT=-KPIC -mt
62CFLAGSOBJCUIMT=-KPIC -mt
63CFLAGSSLOGUIMT=-KPIC -mt
64CFLAGSSLOCUIMT=-KPIC -mt
65CFLAGSPROF=-xpg
66CFLAGSDEBUG=-g
67CFLAGSDBGUTIL=
68#  -m32 -xarch=sparc        restrict target to 32 bit sparc
69#  -xO3                     optimization level 3
70#  -xspace                  don't do optimizations which do increase binary size
71#  -xprefetch=yes           do prefetching (helps on UltraSparc III)
72CFLAGSOPT=-m32 -xarch=sparc -xO3 -xspace -xprefetch=yes
73CFLAGSNOOPT=
74CFLAGSOUTOBJ=-o
75
76# Warnings switched off for CXX:
77# - doubunder: we have many identifiers containing double underscores, some of
78#   them in the stable UDK API we cannot change
79# - identexpected: Identifier expected instead of "}"
80#   if an enum ends with a comma before the '}'
81#   this warning does not seem to heed #pragma disable_warn, and is not helpful
82# - inllargeuse: "function is too large and will not be expanded inline" is
83#   merely a hint
84# - inllargeint: "function is too large to generate inline, consider writing
85#   it yourself" is merely a hint
86# - notemsource: "could not find source for function" appears to be spurious
87# - reftotemp: warns about calling non-const functions on temporary objects,
88#   something legally done by boost::scoped_array<T>::reset, for example
89#   (this_type(p).swap(*this))
90# - truncwarn: "conversion of 64 bit type value to smaller type causes
91#   truncation" at least with CC 5.8 is reported only at the end of a
92#   compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
93#   sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
94#   disabled globally
95# - wnoretvalue: warning about the last statement of a function not
96#   returning a value. Unfortunately triggers on perfectly acceptable
97#   code, for example if the last statement in is a throw statement
98# - anonnotype: Warns if a type is declared in an anonymous union. Temporary
99#   disabled until issue i97325 is fixed. Note: The compiler is actually
100#   right about this warning, the C++ standard is explicit about this.
101CFLAGSWARNCC=
102CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype
103CFLAGSWALLCC=$(CFLAGSWARNCC)
104CFLAGSWALLCXX=$(CFLAGSWARNCXX)
105CFLAGSWERRCC=-errwarn=%all
106CFLAGSWERRCXX=-xwe
107
108# Once all modules on this platform compile without warnings, set
109# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
110# settings.mk):
111MODULES_WITH_WARNINGS := \
112    soldep
113
114STDOBJVCL=$(L)/salmain.o
115
116THREADLIB=
117.IF "$(PURIFY)"!=""
118LINK=/usr/local/purify-4.2-solaris2/purify CC
119.ELSE
120LINK=$(CXX)
121.ENDIF
122LINKC=$(CC)
123
124# link against set of baseline libraries
125.IF "$(SYSBASE)"!=""
126C_RESTRICTIONFLAGS*=-xc99=none
127#LD_OPTIONS+:=-L$(SYSBASE)/usr/lib
128CDEFS+=-DSYSBASE="$(SYSBASE)"
129CFLAGSCC+=$(C_RESTRICTIONFLAGS)
130#.EXPORT : LD_OPTIONS
131.ENDIF          # "$(SYSBASE)"!=""
132
133# -z combreloc combines multiple relocation sections. Reduces overhead on startup
134# -norunpath prevents the compiler from recording his own libs in the runpath
135LINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
136LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN'\'
137#LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
138    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
139LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN'\'
140LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN'\'
141LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN'\'
142#LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
143#LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN/../../ure-link/lib'\'
144#LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
145LINKFLAGSRUNPATH_OXT=
146LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN'\'
147#LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
148LINKFLAGSRUNPATH_NONE=
149LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
150LINKCFLAGS=-w -mt -z combreloc -norunpath
151
152# -z text force fatal error if non PIC code is linked into shared library. Such code
153#    would be expensive on startup
154CHECKFORPIC =-z text
155LINKFLAGSSHLGUI=$(CHECKFORPIC) -G
156LINKFLAGSSHLCUI=$(CHECKFORPIC) -G
157
158# switches for dynamic and static linking
159LINKFLAGSDEFS*= -z defs
160STATIC		= -Bstatic
161DIRECT		= -Bdirect $(LINKFLAGSDEFS)
162DYNAMIC		= -Bdynamic
163
164LINKFLAGSAPPGUI+=$(DIRECT)
165LINKFLAGSAPPCUI+=$(DIRECT)
166LINKFLAGSSHLGUI+=$(DIRECT)
167LINKFLAGSSHLCUI+=$(DIRECT)
168
169LINKFLAGSTACK=
170LINKFLAGSPROF=-L$(COMPATH)/WS6U1/lib/libp -xpg -z allextract
171LINKFLAGSDEBUG=
172LINKFLAGSOPT=
173LINKVERSIONMAPFLAG=-M
174
175# mapfile for non-executable stack
176LINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
177LINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
178LINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
179
180APPLINKSTATIC=$(STATIC)
181APPLINKSHARED=$(DIRECT)
182APP_LINKTYPE=
183
184STDLIBCPP=-lCrun
185
186# reihenfolge der libs NICHT egal!
187STDOBJGUI=
188.IF "DBG_UTIL" != ""
189STDSLOGUI=#-lpthread
190.ELSE
191STDSLOGUI=
192.ENDIF
193STDOBJCUI=
194STDSLOCUI=
195
196# CPPRUNTIME - define where to place C++ runtime if required
197STDLIBGUIMT=$(DYNAMIC) -lpthread -lm
198STDLIBCUIMT=$(DYNAMIC) -lpthread -lm
199STDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
200STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
201
202# libdl.so - no really an GUI library but required in this context
203STDLIBGUIMT+=-ldl
204STDSHLGUIMT+=-ldl
205X11LINK_DYNAMIC = -lXext -lX11
206
207# @@@ interposer needed for -Bdirect @@@
208# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
209LIBSALCPPRT=
210
211.IF "$(USE_STLP_DEBUG)" != ""
212LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
213LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
214.ELSE
215LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
216LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
217.ENDIF # "$(USE_STLP_DEBUG)" != ""
218
219LIBMGR=CC
220LIBFLAGS=-xar -o
221
222IMPLIB=
223IMPLIBFLAGS=
224
225MAPSYM=
226MAPSYMFLAGS=
227IGNORE_SYMBOLS=S-LP64
228
229RC=irc
230RCFLAGS=-fo$@ $(RCFILES)
231RCLINK=
232RCLINKFLAGS=
233RCSETVERSION=
234
235DLLPOSTFIX=
236
237DLLPRE=lib
238DLLPOST=.so
239
240LDUMP=cppfilt /b /n /o /p
241
242CFLAGSCXXSLO +=
243CFLAGSCXXOBJ +=
244
245LINKFLAGSAPPGUI+=
246LINKFLAGSSHLGUI+=
247LINKFLAGSAPPCUI+=
248LINKFLAGSSHLCUI+=
249