xref: /aoo42x/main/solenv/inc/unxfbsd.mk (revision 25da6cb0)
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# Makefile for FreeBSD.
29
30ASM=
31AFLAGS=
32
33SOLAR_JAVA*=
34PICSWITCH*:=-fpic
35JAVAFLAGSDEBUG=-g
36
37# Include arch specific makefile.
38.IF "$(CPUNAME)" == "INTEL"
39.INCLUDE : unxfbsdi.mk
40.ENDIF
41.IF "$(CPUNAME)" == "X86_64"
42.INCLUDE : unxfbsdx.mk
43.ENDIF
44
45# filter for supressing verbose messages from linker
46#not needed at the moment
47#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
48
49# _PTHREADS is needed for the stl
50CDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450
51
52# enable visibility define in "sal/types.h"
53.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
54CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
55.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
56
57# this is a platform with JAVA support
58.IF "$(SOLAR_JAVA)"!=""
59JAVADEF=-DSOLAR_JAVA
60.IF "$(debug)"==""
61JAVA_RUNTIME=-ljava
62.ELSE
63JAVA_RUNTIME=-ljava_g
64.ENDIF
65.ENDIF
66
67# name of C++ Compiler
68CXX*=g++
69# name of C Compiler
70CC*=gcc
71.IF "$(SYSBASE)"!=""
72CFLAGS_SYSBASE:=--sysroot=$(SYSBASE)
73CXX+:=$(CFLAGS_SYSBASE)
74CC+:=$(CFLAGS_SYSBASE)
75.ENDIF          # "$(SYSBASE)"!=""
76CFLAGS+=-fmessage-length=0 -c
77
78# flags to enable build with symbols; required for crashdump feature
79.IF "$(ENABLE_SYMBOLS)"=="SMALL"
80CFLAGSENABLESYMBOLS=-g1
81.ELSE
82CFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
83
84.ENDIF
85
86# flags for the C++ Compiler
87CFLAGSCC= -pipe $(ARCH_FLAGS)
88# Flags for enabling exception handling
89CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
90# Flags for disabling exception handling
91CFLAGS_NO_EXCEPTIONS=-fno-exceptions
92
93# -fpermissive should be removed as soon as possible
94CFLAGSCXX= -pipe $(ARCH_FLAGS)
95.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
96CFLAGSCXX += -fvisibility-inlines-hidden
97.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
98
99# Compiler flags for compiling static object in multi threaded environment with graphical user interface
100CFLAGSOBJGUIMT=
101# Compiler flags for compiling static object in multi threaded environment with character user interface
102CFLAGSOBJCUIMT=
103# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
104CFLAGSSLOGUIMT=$(PICSWITCH)
105# Compiler flags for compiling shared object in multi threaded environment with character user interface
106CFLAGSSLOCUIMT=$(PICSWITCH)
107# Compiler flags for profiling
108CFLAGSPROF=
109# Compiler flags for debugging
110CFLAGSDEBUG=-g
111CFLAGSDBGUTIL=
112# Compiler flags for disabling optimizations
113CFLAGSNOOPT=-O0
114# Compiler flags for describing the output path
115CFLAGSOUTOBJ=-o
116
117# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
118CFLAGSWARNCC=-Wall -Wextra -Wendif-labels
119CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
120    -Wno-non-virtual-dtor
121CFLAGSWALLCC=$(CFLAGSWARNCC)
122CFLAGSWALLCXX=$(CFLAGSWARNCXX)
123CFLAGSWERRCC=-Werror
124
125# Once all modules on this platform compile without warnings, set
126# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
127# settings.mk): Currently this is not tested on FreeBSD
128#MODULES_WITH_WARNINGS :=
129
130# switches for dynamic and static linking
131STATIC		= -Wl,-Bstatic
132DYNAMIC		= -Wl,-Bdynamic
133
134# name of linker
135LINK*=$(CXX)
136LINKC*=$(CC)
137
138# default linker flags
139.IF "$(SYSBASE)"!=""
140LINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE)
141.ENDIF          # "$(SYSBASE)"!=""
142LINKFLAGSDEFS*=-Wl,-z,defs
143LINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
144LINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
145    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
146LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
147LINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
148LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
149LINKFLAGSRUNPATH_OXT=
150LINKFLAGSRUNPATH_BOXT=-Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\'
151LINKFLAGSRUNPATH_NONE=
152LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE)
153
154# linker flags for linking applications
155LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
156      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
157LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
158      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
159
160# linker flags for linking shared libraries
161LINKFLAGSSHLGUI= -shared
162LINKFLAGSSHLCUI= -shared
163
164LINKFLAGSTACK=
165LINKFLAGSPROF=
166LINKFLAGSDEBUG=-g
167LINKFLAGSOPT=
168
169# linker flags for optimization (symbol hashtable)
170# for now, applied to symbol scoped libraries, only
171LINKFLAGSOPTIMIZE*=-Wl,-O1
172LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
173
174SONAME_SWITCH=-Wl,-h
175
176# Sequence of libs does matter !
177
178STDLIBCPP=-lstdc++
179
180# default objectfilenames to link
181STDOBJVCL=$(L)$/salmain.o
182STDOBJGUI=
183STDSLOGUI=
184STDOBJCUI=
185STDSLOCUI=
186
187.IF "$(ALLOC)" == "PTMALLOC"
188STDLIBGUIMT+=-lptmalloc
189STDLIBCUIMT+=-lptmalloc
190STDSHLGUIMT+=-lptmalloc
191STDSHLCUIMT+=-lptmalloc
192.ELIF "$(ALLOC)" == "TCMALLOC"
193STDLIBGUIMT+=-ltcmalloc
194STDLIBCUIMT+=-ltcmalloc
195STDSHLGUIMT+=-ltcmalloc
196STDSHLCUIMT+=-ltcmalloc
197.ENDIF
198
199.IF "$(HAVE_LD_HASH_STYLE)"  == "TRUE"
200LINKFLAGS += -Wl,--hash-style=both
201.ELSE
202LINKFLAGS += -Wl,-zdynsort
203.ENDIF
204
205# libraries for linking applications
206STDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
207STDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
208# libraries for linking shared libraries
209STDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
210STDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
211
212X11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed
213
214LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
215
216.IF "$(USE_STLP_DEBUG)" != ""
217.IF "$(STLPORT_VER)" >= "500"
218LIBSTLPORT=$(DYNAMIC) -lstlportstlg
219LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
220.ELSE
221LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
222LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
223.ENDIF
224.ELSE # "$(USE_STLP_DEBUG)" != ""
225.IF "$(STLPORT_VER)" >= "500"
226LIBSTLPORT=$(DYNAMIC) -lstlport
227LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
228.ELSE
229LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
230LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
231.ENDIF
232.ENDIF # "$(USE_STLP_DEBUG)" != ""
233
234#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
235
236# name of library manager
237LIBMGR=ar
238LIBFLAGS=-r
239
240# tool for generating import libraries
241IMPLIB=
242IMPLIBFLAGS=
243
244MAPSYM=
245MAPSYMFLAGS=
246
247RC=irc
248RCFLAGS=-fo$@ $(RCFILES)
249RCLINK=
250RCLINKFLAGS=
251RCSETVERSION=
252
253# platform specific identifier for shared libs
254DLLPRE=lib
255DLLPOST=.so
256PCHPOST=.gch