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