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