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