xref: /aoo41x/main/solenv/inc/unxfbsd.mk (revision af84ad07)
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 supressing 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) -std=gnu++98
106.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
107CFLAGSCXX += -fvisibility-inlines-hidden
108.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
109
110.IF "$(CPUNAME)" == "INTEL" || "$(CPUNAME)" == "X86_64"
111CFLAGSCC += -fstack-protector
112CFLAGSCXX += -fstack-protector
113.ENDIF
114
115# Compiler flags for compiling static object in multi threaded environment with graphical user interface
116CFLAGSOBJGUIMT=
117# Compiler flags for compiling static object in multi threaded environment with character user interface
118CFLAGSOBJCUIMT=
119# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
120CFLAGSSLOGUIMT=$(PICSWITCH)
121# Compiler flags for compiling shared object in multi threaded environment with character user interface
122CFLAGSSLOCUIMT=$(PICSWITCH)
123# Compiler flags for profiling
124CFLAGSPROF=
125# Compiler flags for debugging
126CFLAGSDEBUG=-g
127CFLAGSDBGUTIL=
128# Compiler flags for disabling optimizations
129CFLAGSNOOPT=-O0
130# Compiler flags for describing the output path
131CFLAGSOUTOBJ=-o
132
133# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
134CFLAGSWARNCC=-Wall -Wextra -Wendif-labels
135CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
136    -Wno-non-virtual-dtor
137CFLAGSWALLCC=$(CFLAGSWARNCC)
138CFLAGSWALLCXX=$(CFLAGSWARNCXX)
139CFLAGSWERRCC=-Werror
140
141# Once all modules on this platform compile without warnings, set
142# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
143# settings.mk): Currently this is not tested on FreeBSD
144#MODULES_WITH_WARNINGS :=
145
146# switches for dynamic and static linking
147STATIC		= -Wl,-Bstatic
148DYNAMIC		= -Wl,-Bdynamic
149
150# name of linker
151LINK*=$(CXX)
152LINKC*=$(CC)
153
154# default linker flags
155.IF "$(SYSBASE)"!=""
156LINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE)
157.ENDIF          # "$(SYSBASE)"!=""
158LINKFLAGSDEFS*=-Wl,-z,defs
159LINKFLAGSRUNPATH_URELIB=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
160LINKFLAGSRUNPATH_UREBIN=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
161#LINKFLAGSRUNPATH_UREBIN=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
162    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
163LINKFLAGSRUNPATH_OOO=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
164LINKFLAGSRUNPATH_SDK=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
165LINKFLAGSRUNPATH_BRAND=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
166#LINKFLAGSRUNPATH_OOO=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
167#LINKFLAGSRUNPATH_SDK=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
168#LINKFLAGSRUNPATH_BRAND=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
169LINKFLAGSRUNPATH_OXT=
170LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
171#LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\'
172LINKFLAGSRUNPATH_NONE=
173LINKFLAGS=-Wl,-z,combreloc $(LDFLAGS) $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE)
174
175# linker flags for linking applications
176LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
177      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
178LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
179      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
180
181# linker flags for linking shared libraries
182LINKFLAGSSHLGUI= -shared
183LINKFLAGSSHLCUI= -shared
184
185LINKFLAGSTACK=
186LINKFLAGSPROF=
187LINKFLAGSDEBUG=-g
188LINKFLAGSOPT=
189
190# linker flags for optimization (symbol hashtable)
191# for now, applied to symbol scoped libraries, only
192LINKFLAGSOPTIMIZE*=-Wl,-O1
193LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
194
195SONAME_SWITCH=-Wl,-h
196
197# Sequence of libs does matter !
198
199STDLIBCPP=-lstdc++
200
201# default objectfilenames to link
202STDOBJVCL=$(L)$/salmain.o
203STDOBJGUI=
204STDSLOGUI=
205STDOBJCUI=
206STDSLOCUI=
207
208.IF "$(ALLOC)" == "TCMALLOC"
209STDLIBGUIMT+=-ltcmalloc
210STDLIBCUIMT+=-ltcmalloc
211STDSHLGUIMT+=-ltcmalloc
212STDSHLCUIMT+=-ltcmalloc
213.ENDIF
214
215# libraries for linking applications
216STDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH}
217STDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH}
218# libraries for linking shared libraries
219STDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH}
220STDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH}
221
222X11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed
223
224LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
225
226.IF "$(USE_STLP_DEBUG)" != ""
227.IF "$(STLPORT_VER)" >= "500"
228LIBSTLPORT=$(DYNAMIC) -lstlportstlg
229LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
230.ELSE
231LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
232LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
233.ENDIF
234.ELSE # "$(USE_STLP_DEBUG)" != ""
235.IF "$(STLPORT_VER)" >= "500"
236LIBSTLPORT=$(DYNAMIC) -lstlport
237LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
238.ELSE
239LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
240LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
241.ENDIF
242.ENDIF # "$(USE_STLP_DEBUG)" != ""
243
244#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
245
246# name of library manager
247LIBMGR=ar
248LIBFLAGS=-r
249
250# tool for generating import libraries
251IMPLIB=
252IMPLIBFLAGS=
253
254MAPSYM=
255MAPSYMFLAGS=
256
257RC=irc
258RCFLAGS=-fo$@ $(RCFILES)
259RCLINK=
260RCLINKFLAGS=
261RCSETVERSION=
262
263# platform specific identifier for shared libs
264DLLPRE=lib
265DLLPOST=.so
266PCHPOST=.gch
267