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