update ooo310-m15
[ooovba.git] / solenv / inc / unxlngx6.mk
blobbe22c1fad5259730b29fe9b7565a2eb686d141da
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: unxlngx6.mk,v $
11 # $Revision: 1.19.12.1 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 # mk file for unxlngx6
33 ASM=
34 AFLAGS=
36 SOLAR_JAVA*=
37 JAVAFLAGSDEBUG=-g
39 # filter for supressing verbose messages from linker
40 #not needed at the moment
41 #LINKOUTPUT_FILTER=" |& $(SOLARENV)$/bin$/msg_filter"
43 # _PTHREADS is needed for the stl
44 CDEFS+=$(PTHREAD_CFLAGS) -DGLIBC=2 -DX86_64 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER)
46 # enable visibility define in "sal/types.h"
47 .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
48 CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
49 .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
51 # this is a platform with JAVA support
52 .IF "$(SOLAR_JAVA)"!=""
53 JAVADEF=-DSOLAR_JAVA
54 .IF "$(debug)"==""
55 JAVA_RUNTIME=-ljava
56 .ELSE
57 JAVA_RUNTIME=-ljava_g
58 .ENDIF
59 .ENDIF
61 # architecture dependent flags for the C and C++ compiler that can be changed by
62 # exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
63 ARCH_FLAGS*=
65 # name of C++ Compiler
66 CXX*=g++
67 # name of C Compiler
68 CC*=gcc
69 .IF "$(SYSBASE)"!=""
70 CFLAGS_SYSBASE:=-isystem $(SYSBASE)$/usr$/include
71 CXX+:=$(CFLAGS_SYSBASE)
72 CC+:=$(CFLAGS_SYSBASE)
73 .ENDIF # "$(SYSBASE)"!=""
74 CFLAGS+=-Wreturn-type -fmessage-length=0 -c
75 # flags to enable build with symbols; required for crashdump feature
76 .IF "$(ENABLE_SYMBOLS)"=="SMALL"
77 CFLAGSENABLESYMBOLS=-g1
78 .ELSE
79 CFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
81 .ENDIF
82 .IF "$(HAVE_LD_HASH_STYLE)" == "TRUE"
83 LINKFLAGS += -Wl,--hash-style=$(WITH_LINKER_HASH_STYLE)
84 .ELSE
85 LINKFLAGS += -Wl,-zdynsort
86 .ENDIF
88 # flags for the C++ Compiler
89 CFLAGSCC= -pipe $(ARCH_FLAGS)
90 # Flags for enabling exception handling
91 CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
92 # Flags for disabling exception handling
93 CFLAGS_NO_EXCEPTIONS=-fno-exceptions
95 # -fpermissive should be removed as soon as possible
96 CFLAGSCXX= -pipe $(ARCH_FLAGS)
97 CFLAGSCXX+= -Wno-ctor-dtor-privacy
98 CFLAGSCXX+= -fno-use-cxa-atexit
99 PICSWITCH:=-fpic
100 .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" && "$(HAVE_GCC_VISIBILITY_BROKEN)" != "TRUE"
101 CFLAGSCXX += -fvisibility-inlines-hidden
102 .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
104 # Compiler flags for compiling static object in multi threaded environment with graphical user interface
105 CFLAGSOBJGUIMT=
106 # Compiler flags for compiling static object in multi threaded environment with character user interface
107 CFLAGSOBJCUIMT=
108 # Compiler flags for compiling shared object in multi threaded environment with graphical user interface
109 CFLAGSSLOGUIMT=$(PICSWITCH)
110 # Compiler flags for compiling shared object in multi threaded environment with character user interface
111 CFLAGSSLOCUIMT=$(PICSWITCH)
112 # Compiler flags for profiling
113 CFLAGSPROF=
114 # Compiler flags for debugging
115 CFLAGSDEBUG=-g
116 CFLAGSDBGUTIL=
117 # Compiler flags for enabling optimizations
118 .IF "$(PRODUCT)"!=""
119 CFLAGSOPT=-O2 -fno-strict-aliasing # optimizing for products
120 CFLAGSOPT+=-Wuninitialized # not supported without optimization
121 .ELSE # "$(PRODUCT)"!=""
122 CFLAGSOPT= # no optimizing for non products
123 .ENDIF # "$(PRODUCT)"!=""
124 # Compiler flags for disabling optimizations
125 CFLAGSNOOPT=-O0
126 # Compiler flags for describing the output path
127 CFLAGSOUTOBJ=-o
129 # -Wshadow does not work for C with nested uses of pthread_cleanup_push:
130 CFLAGSWARNCC=-Wall -Wextra -Wendif-labels
131 CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
132 -Wno-non-virtual-dtor
133 CFLAGSWALLCC=$(CFLAGSWARNCC)
134 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
135 CFLAGSWERRCC=-Werror
137 # Once all modules on this platform compile without warnings, set
138 # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
139 # settings.mk):
141 MODULES_WITH_WARNINGS := \
142 extensions \
143 soldep \
146 # switches for dynamic and static linking
147 STATIC = -Wl,-Bstatic
148 DYNAMIC = -Wl,-Bdynamic
150 # name of linker
151 LINK*=$(CXX)
152 LINKC*=$(CC)
154 # default linker flags
155 LINKFLAGSDEFS*=-Wl,-z,defs
156 LINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
157 LINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
158 #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
159 LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
160 LINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
161 LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
162 LINKFLAGSRUNPATH_OXT=
163 LINKFLAGSRUNPATH_NONE=
164 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
165 .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
166 LINKFLAGS += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
167 .ENDIF
168 .IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
169 LINKFLAGS += -Wl,--as-needed
170 .ENDIF
172 # linker flags for linking applications
173 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
174 LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
176 # linker flags for linking shared libraries
177 LINKFLAGSSHLGUI= -shared
178 LINKFLAGSSHLCUI= -shared
180 LINKFLAGSTACK=
181 LINKFLAGSPROF=
182 LINKFLAGSDEBUG=-g
183 LINKFLAGSOPT=
185 # linker flags for optimization (symbol hashtable)
186 # for now, applied to symbol scoped libraries, only
187 LINKFLAGSOPTIMIZE*=-Wl,-O1
188 LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
190 SONAME_SWITCH=-Wl,-h
192 # Sequence of libs does matter !
194 STDLIBCPP=-lstdc++
196 # default objectfilenames to link
197 STDOBJVCL=$(L)$/salmain.o
198 STDOBJGUI=
199 STDSLOGUI=
200 STDOBJCUI=
201 STDSLOCUI=
203 # libraries for linking applications
204 STDLIBGUIMT+=-lX11 -ldl -lpthread -lm
205 STDLIBCUIMT+=-ldl -lpthread -lm
206 # libraries for linking shared libraries
207 STDSHLGUIMT+=-lX11 -lXext -ldl -lpthread -lm
208 STDSHLCUIMT+=-ldl -lpthread -lm
210 LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
212 .IF "$(USE_STLP_DEBUG)" != ""
213 .IF "$(STLPORT_VER)" >= "500"
214 LIBSTLPORT=$(DYNAMIC) -lstlportstlg
215 LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
216 .ELSE
217 LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
218 LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
219 .ENDIF
220 .ELSE # "$(USE_STLP_DEBUG)" != ""
221 .IF "$(STLPORT_VER)" >= "500"
222 LIBSTLPORT=$(DYNAMIC) -lstlport
223 LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
224 .ELSE
225 LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
226 LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
227 .ENDIF
228 .ENDIF # "$(USE_STLP_DEBUG)" != ""
230 #FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
232 # name of library manager
233 LIBMGR=ar
234 LIBFLAGS=-r
236 # tool for generating import libraries
237 IMPLIB=
238 IMPLIBFLAGS=
240 MAPSYM=
241 MAPSYMFLAGS=
243 RC=irc
244 RCFLAGS=-fo$@ $(RCFILES)
245 RCLINK=
246 RCLINKFLAGS=
247 RCSETVERSION=
249 # platform specific identifier for shared libs
250 DLLPOSTFIX=lx
251 DLLPRE=lib
252 DLLPOST=.so
253 PCHPOST=.gch