1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: unxlngi4.mk,v $
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 #*************************************************************************
31 # mk file for unxlngi4
38 # filter for supressing verbose messages from linker
39 #not needed at the moment
40 #LINKOUTPUT_FILTER=" |& $(SOLARENV)$/bin$/msg_filter"
42 # _PTHREADS is needed for the stl
43 CDEFS
+=$(PTHREAD_CFLAGS
) -DGLIBC
=2 -DX86
-D_PTHREADS
-D_REENTRANT
-DNEW_SOLAR
-D_USE_NAMESPACE
=1 -DSTLPORT_VERSION
=$(STLPORT_VER
)
45 # enable visibility define in "sal/types.h"
46 .IF
"$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
47 CDEFS
+= -DHAVE_GCC_VISIBILITY_FEATURE
48 .ENDIF
# "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
50 # this is a platform with JAVA support
51 .IF
"$(SOLAR_JAVA)"!=""
60 # architecture dependent flags for the C and C++ compiler that can be changed by
61 # exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
62 ARCH_FLAGS
*=-mcpu
=pentiumpro
64 # name of C++ Compiler
68 # flags for C and C++ Compiler
69 CFLAGS
+=-fmessage-length
=0 -c
71 # flags to enable build with symbols; required for crashdump feature
72 .IF
"$(ENABLE_SYMBOLS)"=="SMALL"
73 CFLAGSENABLESYMBOLS
=-g1
75 CFLAGSENABLESYMBOLS
=-g
78 # flags for the C++ Compiler
79 CFLAGSCC
= -pipe
$(ARCH_FLAGS
)
80 # Flags for enabling exception handling
81 CFLAGSEXCEPTIONS
=-fexceptions
-fno-enforce-eh-specs
82 # Flags for disabling exception handling
83 CFLAGS_NO_EXCEPTIONS
=-fno-exceptions
85 CFLAGSCXX
= -pipe
$(ARCH_FLAGS
)
87 # HACK: enable Hamburg developers to build on glibc-2.2 machines but compile vs. glibc-2.1 headers
88 .IF
"$(BUILD_SPECIAL)"==""
89 CFLAGSCXX
+=-include preinclude.h
93 # Compiler flags for compiling static object in multi threaded environment with graphical user interface
95 # Compiler flags for compiling static object in multi threaded environment with character user interface
97 # Compiler flags for compiling shared object in multi threaded environment with graphical user interface
98 CFLAGSSLOGUIMT
=$(PICSWITCH
)
99 # Compiler flags for compiling shared object in multi threaded environment with character user interface
100 CFLAGSSLOCUIMT
=$(PICSWITCH
)
101 # Compiler flags for profiling
103 # Compiler flags for debugging
106 # Compiler flags for enabling optimizations
108 # reduce to -O1 to avoid optimization problems
110 # Compiler flags for disabling optimizations
112 # Compiler flags for describing the output path
117 CFLAGSWARNCC
+=-Wuninitialized
# not supported without optimization
119 CFLAGSWARNCXX
=$(CFLAGSWARNCC
) -Wno-ctor-dtor-privacy
120 # -Wshadow does not work for C with nested uses of pthread_cleanup_push:
121 CFLAGSWALLCC
=-Wall
-Wextra
-Wendif-labels
122 CFLAGSWALLCXX
=$(CFLAGSWALLCC
) -Wshadow
-Wno-ctor-dtor-privacy
125 # switches for dynamic and static linking
126 STATIC
= -Wl
,-Bstatic
127 DYNAMIC
= -Wl
,-Bdynamic
133 # default linker flags
134 LINKFLAGSDEFS
*=-Wl
,-z
,defs
135 LINKFLAGSRUNPATH_URELIB
=-Wl
,-rpath
,\''$$ORIGIN'\'
136 LINKFLAGSRUNPATH_UREBIN
=-Wl
,-rpath
,\''$$ORIGIN/../lib:$$ORIGIN'\'
137 #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
138 LINKFLAGSRUNPATH_OOO
=-Wl
,-rpath
,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
139 LINKFLAGSRUNPATH_SDK
=-Wl
,-rpath
,\''$$ORIGIN/../../ure-link/lib'\'
140 LINKFLAGSRUNPATH_BRAND
=-Wl
,-rpath
,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
141 LINKFLAGSRUNPATH_OXT
=
142 LINKFLAGSRUNPATH_NONE
=
143 LINKFLAGS
=-Wl
,-z
,combreloc
$(LINKFLAGSDEFS
)
144 .IF
"$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
145 LINKFLAGS
+= -Wl
,--as-needed
148 # linker flags for linking applications
149 LINKFLAGSAPPGUI
= -Wl
,-export-dynamic
-Wl
,--noinhibit-exec
150 LINKFLAGSAPPCUI
= -Wl
,-export-dynamic
-Wl
,--noinhibit-exec
152 # linker flags for linking shared libraries
153 LINKFLAGSSHLGUI
= -shared
154 LINKFLAGSSHLCUI
= -shared
161 # linker flags for optimization (symbol hashtable)
162 # for now, applied to symbol scoped libraries, only
163 LINKFLAGSOPTIMIZE
*=-Wl
,-O1
164 LINKVERSIONMAPFLAG
=$(LINKFLAGSOPTIMIZE
) -Wl
,--version-script
168 # Sequence of libs does matter !
172 # default objectfilenames to link
173 STDOBJVCL
=$(L
)$/salmain.o
179 .IF
"$(ALLOC)" == "TCMALLOC"
180 STDLIBGUIMT
+=-ltcmalloc
181 STDLIBCUIMT
+=-ltcmalloc
182 STDSHLGUIMT
+=-ltcmalloc
183 STDSHLCUIMT
+=-ltcmalloc
186 # libraries for linking applications
187 STDLIBGUIMT
+=-lX11
-ldl
-lpthread
-lm
188 STDLIBCUIMT
+=-ldl
-lpthread
-lm
189 # libraries for linking shared libraries
190 STDSHLGUIMT
+=-lX11
-lXext
-ldl
-lpthread
-lm
191 STDSHLCUIMT
+=-ldl
-lpthread
-lm
193 LIBSALCPPRT
*=-Wl
,--whole-archive
-lsalcpprt
-Wl
,--no-whole-archive
195 .IF
"$(STLPORT_VER)" >= "500"
196 LIBSTLPORT
=$(DYNAMIC
) -lstlport
-lstdc
++
197 LIBSTLPORTST
=$(STATIC
) -lstlport
$(DYNAMIC
)
199 LIBSTLPORT
=$(DYNAMIC
) -lstlport_gcc
-lstdc
++
200 LIBSTLPORTST
=$(STATIC
) -lstlport_gcc
$(DYNAMIC
)
203 #FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
205 # name of library manager
209 # tool for generating import libraries
217 RCFLAGS
=-fo
$@
$(RCFILES
)
222 # platform specific identifier for shared libs