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