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