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