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: unxfbsd.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 #*************************************************************************
32 # Makefile for FreeBSD.
40 # Include arch specific makefile.
41 .IF
"$(CPUNAME)" == "INTEL"
42 .INCLUDE
: unxfbsdi.mk
44 .IF
"$(CPUNAME)" == "X86_64"
45 .INCLUDE
: unxfbsdx.mk
48 # filter for supressing verbose messages from linker
49 #not needed at the moment
50 #LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
52 # _PTHREADS is needed for the stl
53 CDEFS
+=$(PTHREAD_CFLAGS
) -D_PTHREADS
-D_REENTRANT
-DNEW_SOLAR
-D_USE_NAMESPACE
=1 -DSTLPORT_VERSION
=450
55 # enable visibility define in "sal/types.h"
56 .IF
"$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
57 CDEFS
+= -DHAVE_GCC_VISIBILITY_FEATURE
58 .ENDIF
# "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
60 # this is a platform with JAVA support
61 .IF
"$(SOLAR_JAVA)"!=""
70 # name of C++ Compiler
75 CFLAGS_SYSBASE
:=-isystem
$(SYSBASE
)/usr
/include
76 CXX
+:=$(CFLAGS_SYSBASE
)
77 CC
+:=$(CFLAGS_SYSBASE
)
78 .ENDIF
# "$(SYSBASE)"!=""
79 CFLAGS
+=-fmessage-length
=0 -c
81 # flags to enable build with symbols; required for crashdump feature
82 .IF
"$(ENABLE_SYMBOLS)"=="SMALL"
83 CFLAGSENABLESYMBOLS
=-g1
85 CFLAGSENABLESYMBOLS
=-g
# was temporarily commented out, reenabled before Beta
89 # flags for the C++ Compiler
90 CFLAGSCC
= -pipe
$(ARCH_FLAGS
)
91 # Flags for enabling exception handling
92 CFLAGSEXCEPTIONS
=-fexceptions
-fno-enforce-eh-specs
93 # Flags for disabling exception handling
94 CFLAGS_NO_EXCEPTIONS
=-fno-exceptions
96 # -fpermissive should be removed as soon as possible
97 CFLAGSCXX
= -pipe
$(ARCH_FLAGS
)
99 .IF
"$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
100 CFLAGSCXX
+= -fvisibility-inlines-hidden
101 .ENDIF
# "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
103 # Compiler flags for compiling static object in multi threaded environment with graphical user interface
105 # Compiler flags for compiling static object in multi threaded environment with character user interface
107 # Compiler flags for compiling shared object in multi threaded environment with graphical user interface
108 CFLAGSSLOGUIMT
=$(PICSWITCH
)
109 # Compiler flags for compiling shared object in multi threaded environment with character user interface
110 CFLAGSSLOCUIMT
=$(PICSWITCH
)
111 # Compiler flags for profiling
113 # Compiler flags for debugging
116 # Compiler flags for disabling optimizations
118 # Compiler flags for describing the output path
121 # -Wshadow does not work for C with nested uses of pthread_cleanup_push:
122 CFLAGSWARNCC
=-Wall
-Wextra
-Wendif-labels
123 CFLAGSWARNCXX
=$(CFLAGSWARNCC
) -Wshadow
-Wno-ctor-dtor-privacy \
124 -Wno-non-virtual-dtor
125 CFLAGSWALLCC
=$(CFLAGSWARNCC
)
126 CFLAGSWALLCXX
=$(CFLAGSWARNCXX
)
129 # Once all modules on this platform compile without warnings, set
130 # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
131 # settings.mk): Currently this is not tested on FreeBSD
132 #MODULES_WITH_WARNINGS :=
134 # switches for dynamic and static linking
135 STATIC
= -Wl
,-Bstatic
136 DYNAMIC
= -Wl
,-Bdynamic
142 # default linker flags
143 LINKFLAGSDEFS
*=#-Wl,-z,defs
144 LINKFLAGSRUNPATH_URELIB
=-Wl
,-rpath
,\''$$ORIGIN'\'
145 LINKFLAGSRUNPATH_UREBIN
=-Wl
,-rpath
,\''$$ORIGIN/../lib:$$ORIGIN'\'
146 #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
147 LINKFLAGSRUNPATH_OOO
=-Wl
,-rpath
,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
148 LINKFLAGSRUNPATH_SDK
=-Wl
,-rpath
,\''$$ORIGIN/../../ure-link/lib'\'
149 LINKFLAGSRUNPATH_BRAND
=-Wl
,-rpath
,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
150 LINKFLAGSRUNPATH_OXT
=
151 LINKFLAGSRUNPATH_NONE
=
152 LINKFLAGS
=-Wl
,-z
,combreloc
$(LINKFLAGSDEFS
)
153 .IF
"$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
154 LINKFLAGS
+= -Wl
,--as-needed
157 # linker flags for linking applications
158 LINKFLAGSAPPGUI
= -Wl
,-export-dynamic
-Wl
,--noinhibit-exec
159 LINKFLAGSAPPCUI
= -Wl
,-export-dynamic
-Wl
,--noinhibit-exec
161 # linker flags for linking shared libraries
162 LINKFLAGSSHLGUI
= -shared
163 LINKFLAGSSHLCUI
= -shared
170 # linker flags for optimization (symbol hashtable)
171 # for now, applied to symbol scoped libraries, only
172 LINKFLAGSOPTIMIZE
*=-Wl
,-O1
173 LINKVERSIONMAPFLAG
=$(LINKFLAGSOPTIMIZE
) -Wl
,--version-script
177 # Sequence of libs does matter !
181 # default objectfilenames to link
182 STDOBJVCL
=$(L
)/salmain.o
188 # libraries for linking applications
189 STDLIBGUIMT
=-lX11
$(PTHREAD_LIBS
) -lm
190 STDLIBCUIMT
=$(PTHREAD_LIBS
) -lm
191 # libraries for linking shared libraries
192 STDSHLGUIMT
=-lX11
-lXext
$(PTHREAD_LIBS
) -lm
193 STDSHLCUIMT
=$(PTHREAD_LIBS
) -lm
195 LIBSALCPPRT
*=-Wl
,--whole-archive
-lsalcpprt
-Wl
,--no-whole-archive
197 .IF
"$(USE_STLP_DEBUG)" != ""
198 .IF
"$(STLPORT_VER)" >= "500"
199 LIBSTLPORT
=$(DYNAMIC
) -lstlportstlg
200 LIBSTLPORTST
=$(STATIC
) -lstlportstlg
$(DYNAMIC
)
202 LIBSTLPORT
=$(DYNAMIC
) -lstlport_gcc_stldebug
203 LIBSTLPORTST
=$(STATIC
) -lstlport_gcc_stldebug
$(DYNAMIC
)
205 .ELSE
# "$(USE_STLP_DEBUG)" != ""
206 .IF
"$(STLPORT_VER)" >= "500"
207 LIBSTLPORT
=$(DYNAMIC
) -lstlport
208 LIBSTLPORTST
=$(STATIC
) -lstlport
$(DYNAMIC
)
210 LIBSTLPORT
=$(DYNAMIC
) -lstlport_gcc
211 LIBSTLPORTST
=$(STATIC
) -lstlport_gcc
$(DYNAMIC
)
213 .ENDIF
# "$(USE_STLP_DEBUG)" != ""
215 #FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
217 # name of library manager
221 # tool for generating import libraries
229 RCFLAGS
=-fo
$@
$(RCFILES
)
234 # platform specific identifier for shared libs