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