xref: /aoo42x/main/solenv/inc/unxfbsd.mk (revision 7fcdd55b)
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*=c++
69# name of C Compiler
70CC*=cc
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)" == "TCMALLOC"
188STDLIBGUIMT+=-ltcmalloc
189STDLIBCUIMT+=-ltcmalloc
190STDSHLGUIMT+=-ltcmalloc
191STDSHLCUIMT+=-ltcmalloc
192.ENDIF
193
194.IF "$(HAVE_LD_HASH_STYLE)"  == "TRUE"
195LINKFLAGS += -Wl,--hash-style=both
196.ELSE
197LINKFLAGS += -Wl,-zdynsort
198.ENDIF
199
200# libraries for linking applications
201STDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
202STDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
203# libraries for linking shared libraries
204STDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
205STDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
206
207X11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed
208
209LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
210
211.IF "$(USE_STLP_DEBUG)" != ""
212.IF "$(STLPORT_VER)" >= "500"
213LIBSTLPORT=$(DYNAMIC) -lstlportstlg
214LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
215.ELSE
216LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
217LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
218.ENDIF
219.ELSE # "$(USE_STLP_DEBUG)" != ""
220.IF "$(STLPORT_VER)" >= "500"
221LIBSTLPORT=$(DYNAMIC) -lstlport
222LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
223.ELSE
224LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
225LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
226.ENDIF
227.ENDIF # "$(USE_STLP_DEBUG)" != ""
228
229#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
230
231# name of library manager
232LIBMGR=ar
233LIBFLAGS=-r
234
235# tool for generating import libraries
236IMPLIB=
237IMPLIBFLAGS=
238
239MAPSYM=
240MAPSYMFLAGS=
241
242RC=irc
243RCFLAGS=-fo$@ $(RCFILES)
244RCLINK=
245RCLINKFLAGS=
246RCSETVERSION=
247
248# platform specific identifier for shared libs
249DLLPRE=lib
250DLLPOST=.so
251PCHPOST=.gch
252