update dev300-m58
[ooovba.git] / solenv / inc / unxlngs.mk
blob5c787bba2cfe3be2ee473728f88d8e29ee47c097
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: unxlngs.mk,v $
11 # $Revision: 1.27 $
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 unxlngs
33 ASM=$(CC)
34 AFLAGS=-Wa,-K,PIC -c $(CDEFS)
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 -D_PTHREADS -D_REENTRANT -DSPARC -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
70 CFLAGS+=-fmessage-length=0 -c
72 # flags to enable build with symbols; required for crashdump feature
73 .IF "$(ENABLE_SYMBOLS)"=="SMALL"
74 CFLAGSENABLESYMBOLS=-g1
75 .ELSE
76 CFLAGSENABLESYMBOLS=-g
77 .ENDIF
78 .IF "$(HAVE_LD_HASH_STYLE)" == "TRUE"
79 LINKFLAGS += -Wl,--hash-style=$(WITH_LINKER_HASH_STYLE)
80 .ELSE
81 LINKFLAGS += -Wl,-zdynsort
82 .ENDIF
84 # flags for the C++ Compiler
85 CFLAGSCC= -pipe $(ARCH_FLAGS)
86 # Flags for enabling exception handling
87 CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
88 # Flags for disabling exception handling
89 CFLAGS_NO_EXCEPTIONS=-fno-exceptions
91 CFLAGSCXX= -pipe $(ARCH_FLAGS)
93 PICSWITCH:=-fPIC
95 # Compiler flags for compiling static object in multi threaded environment with graphical user interface
96 CFLAGSOBJGUIMT=
97 # Compiler flags for compiling static object in multi threaded environment with character user interface
98 CFLAGSOBJCUIMT=
99 # Compiler flags for compiling shared object in multi threaded environment with graphical user interface
100 CFLAGSSLOGUIMT=$(PICSWITCH)
101 # Compiler flags for compiling shared object in multi threaded environment with character user interface
102 CFLAGSSLOCUIMT=$(PICSWITCH)
103 # Compiler flags for profiling
104 CFLAGSPROF=
105 # Compiler flags for debugging
106 CFLAGSDEBUG=-g
107 CFLAGSDBGUTIL=
108 # Compiler flags for enabling optimizations
109 .IF "$(PRODUCT)"!=""
110 CFLAGSOPT=-Os -fno-strict-aliasing # optimizing for products
111 .ELSE # "$(PRODUCT)"!=""
112 CFLAGSOPT= # no optimizing for non products
113 .ENDIF # "$(PRODUCT)"!=""
114 # Compiler flags for disabling optimizations
115 CFLAGSNOOPT=-O0
116 # Compiler flags for describing the output path
117 CFLAGSOUTOBJ=-o
119 CFLAGSWARNCC=-Wreturn-type
120 .IF "$(PRODUCT)"!=""
121 CFLAGWARNCC+=-Wuninitialized # not supported without optimization
122 .ENDIF
123 CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy
124 # -Wshadow does not work for C with nested uses of pthread_cleanup_push:
125 CFLAGSWALLCC=-Wall -Wextra -Wendif-labels
126 CFLAGSWALLCXX=$(CFLAGSWALLCC) -Wshadow -Wno-ctor-dtor-privacy
127 CFLAGSWERRCC=-Werror
129 # switches for dynamic and static linking
130 STATIC = -Wl,-Bstatic
131 DYNAMIC = -Wl,-Bdynamic
133 # name of linker
134 LINK*=$(CXX)
136 # default linker flags
137 LINKFLAGSDEFS*=-Wl,-z,defs
138 LINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
139 LINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
140 #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
141 LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
142 LINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
143 LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
144 LINKFLAGSRUNPATH_OXT=
145 LINKFLAGSRUNPATH_NONE=
146 LINKFLAGS=-z combreloc $(LINKFLAGSDEFS)
147 .IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
148 LINKFLAGS += -Wl,--as-needed
149 .ENDIF
151 # linker flags for linking applications
152 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
153 LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
155 # linker flags for linking shared libraries
156 LINKFLAGSSHLGUI= -shared
157 LINKFLAGSSHLCUI= -shared
159 LINKFLAGSTACK=
160 LINKFLAGSPROF=
161 LINKFLAGSDEBUG=-g
162 LINKFLAGSOPT=
164 # linker flags for optimization (symbol hashtable)
165 # for now, applied to symbol scoped libraries, only
166 LINKFLAGSOPTIMIZE*=-Wl,-O1
167 LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
169 SONAME_SWITCH=-Wl,-h
171 # Sequence of libs does matter !
173 STDLIBCPP=-lstdc++
175 # default objectfilenames to link
176 STDOBJVCL=$(L)/salmain.o
177 STDOBJGUI=
178 STDSLOGUI=
179 STDOBJCUI=
180 STDSLOCUI=
182 # libraries for linking applications
183 STDLIBGUIMT=-lX11 -ldl -lpthread -lm
184 STDLIBCUIMT=-ldl -lpthread -lm
185 # libraries for linking shared libraries
186 STDSHLGUIMT=-lX11 -lXext -ldl -lpthread -lm
187 STDSHLCUIMT=-ldl -lpthread -lm
189 LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
191 .IF "$(STLPORT_VER)" >= "500"
192 LIBSTLPORT=$(DYNAMIC) -lstlport $(STDLIBCPP)
193 LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
194 .ELSE
195 LIBSTLPORT=$(DYNAMIC) -lstlport_gcc $(STDLIBCPP)
196 LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
197 .ENDIF
199 #FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
201 # name of library manager
202 LIBMGR=ar
203 LIBFLAGS=-r
205 # tool for generating import libraries
206 IMPLIB=
207 IMPLIBFLAGS=
209 MAPSYM=
210 MAPSYMFLAGS=
212 RC=irc
213 RCFLAGS=-fo$@ $(RCFILES)
214 RCLINK=
215 RCLINKFLAGS=
216 RCSETVERSION=
218 # platform specific identifier for shared libs
219 DLLPOSTFIX=ls
220 DLLPRE=lib
221 DLLPOST=.so