xref: /aoo42x/main/solenv/inc/unxsols4.mk (revision 7871dc3e)
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/../lib:$$ORIGIN'\'
137    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
138LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
139LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN/../../ure-link/lib'\'
140LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
141LINKFLAGSRUNPATH_OXT=
142LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
143LINKFLAGSRUNPATH_NONE=
144LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
145LINKCFLAGS=-w -mt -z combreloc -norunpath
146
147# -z text force fatal error if non PIC code is linked into shared library. Such code
148#    would be expensive on startup
149CHECKFORPIC =-z text
150LINKFLAGSSHLGUI=$(CHECKFORPIC) -G
151LINKFLAGSSHLCUI=$(CHECKFORPIC) -G
152
153# switches for dynamic and static linking
154LINKFLAGSDEFS*= -z defs
155STATIC		= -Bstatic
156DIRECT		= -Bdirect $(LINKFLAGSDEFS)
157DYNAMIC		= -Bdynamic
158
159LINKFLAGSAPPGUI+=$(DIRECT)
160LINKFLAGSAPPCUI+=$(DIRECT)
161LINKFLAGSSHLGUI+=$(DIRECT)
162LINKFLAGSSHLCUI+=$(DIRECT)
163
164LINKFLAGSTACK=
165LINKFLAGSPROF=-L$(COMPATH)/WS6U1/lib/libp -xpg -z allextract
166LINKFLAGSDEBUG=
167LINKFLAGSOPT=
168LINKVERSIONMAPFLAG=-M
169
170# mapfile for non-executable stack
171LINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
172LINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
173LINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
174
175APPLINKSTATIC=$(STATIC)
176APPLINKSHARED=$(DIRECT)
177APP_LINKTYPE=
178
179STDLIBCPP=-lCrun
180
181# reihenfolge der libs NICHT egal!
182STDOBJGUI=
183.IF "DBG_UTIL" != ""
184STDSLOGUI=#-lpthread
185.ELSE
186STDSLOGUI=
187.ENDIF
188STDOBJCUI=
189STDSLOCUI=
190
191# CPPRUNTIME - define where to place C++ runtime if required
192STDLIBGUIMT=$(DYNAMIC) -lpthread -lm
193STDLIBCUIMT=$(DYNAMIC) -lpthread -lm
194STDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
195STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
196
197# libdl.so - no really an GUI library but required in this context
198STDLIBGUIMT+=-ldl
199STDSHLGUIMT+=-ldl
200X11LINK_DYNAMIC = -lXext -lX11
201
202# @@@ interposer needed for -Bdirect @@@
203# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
204LIBSALCPPRT=
205
206.IF "$(USE_STLP_DEBUG)" != ""
207LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
208LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
209.ELSE
210LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
211LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
212.ENDIF # "$(USE_STLP_DEBUG)" != ""
213
214LIBMGR=CC
215LIBFLAGS=-xar -o
216
217IMPLIB=
218IMPLIBFLAGS=
219
220MAPSYM=
221MAPSYMFLAGS=
222IGNORE_SYMBOLS=S-LP64
223
224RC=irc
225RCFLAGS=-fo$@ $(RCFILES)
226RCLINK=
227RCLINKFLAGS=
228RCSETVERSION=
229
230DLLPOSTFIX=
231
232DLLPRE=lib
233DLLPOST=.so
234
235LDUMP=cppfilt /b /n /o /p
236
237CFLAGSCXXSLO +=
238CFLAGSCXXOBJ +=
239
240LINKFLAGSAPPGUI+=
241LINKFLAGSSHLGUI+=
242LINKFLAGSAPPCUI+=
243LINKFLAGSSHLCUI+=
244