xref: /aoo42x/main/solenv/inc/unxfbsd.mk (revision 908225ed)
17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir# Makefile for FreeBSD.
25cdf0e10cSrcweir
26cdf0e10cSrcweirASM=
27cdf0e10cSrcweirAFLAGS=
28cdf0e10cSrcweir
29cdf0e10cSrcweirSOLAR_JAVA*=
30*908225edSPedro GiffuniPICSWITCH*:=-fPIC
31cdf0e10cSrcweirJAVAFLAGSDEBUG=-g
32cdf0e10cSrcweir
33cdf0e10cSrcweir# Include arch specific makefile.
34cdf0e10cSrcweir.IF "$(CPUNAME)" == "INTEL"
35cdf0e10cSrcweir.INCLUDE : unxfbsdi.mk
36cdf0e10cSrcweir.ENDIF
37cdf0e10cSrcweir.IF "$(CPUNAME)" == "X86_64"
38cdf0e10cSrcweir.INCLUDE : unxfbsdx.mk
39cdf0e10cSrcweir.ENDIF
4076cf6069SPedro Giffuni.IF "$(CPUNAME)" == "POWERPC"
4176cf6069SPedro Giffuni.INCLUDE : unxfbsdppc.mk
4276cf6069SPedro Giffuni.ENDIF
4376cf6069SPedro Giffuni.IF "$(CPUNAME)" == "POWERPC64"
4476cf6069SPedro Giffuni.INCLUDE : unxfbsdppc64.mk
4576cf6069SPedro Giffuni.ENDIF
46cdf0e10cSrcweir
4786e1cf34SPedro Giffuni# filter for suppressing verbose messages from linker
48cdf0e10cSrcweir#not needed at the moment
49cdf0e10cSrcweir#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
50cdf0e10cSrcweir
51cdf0e10cSrcweir# _PTHREADS is needed for the stl
52*908225edSPedro GiffuniCDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450 -DHAVE_STL_INCLUDE_PATH
53cdf0e10cSrcweir
54cdf0e10cSrcweir# enable visibility define in "sal/types.h"
55cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
56cdf0e10cSrcweirCDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
57cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
58cdf0e10cSrcweir
59cdf0e10cSrcweir# this is a platform with JAVA support
60cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"!=""
61cdf0e10cSrcweirJAVADEF=-DSOLAR_JAVA
62cdf0e10cSrcweir.IF "$(debug)"==""
63cdf0e10cSrcweirJAVA_RUNTIME=-ljava
64cdf0e10cSrcweir.ELSE
65cdf0e10cSrcweirJAVA_RUNTIME=-ljava_g
66cdf0e10cSrcweir.ENDIF
67cdf0e10cSrcweir.ENDIF
68cdf0e10cSrcweir
69cdf0e10cSrcweir# name of C++ Compiler
707fcdd55bSPedro GiffuniCXX*=c++
71cdf0e10cSrcweir# name of C Compiler
727fcdd55bSPedro GiffuniCC*=cc
73cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
7425da6cb0SPedro GiffuniCFLAGS_SYSBASE:=--sysroot=$(SYSBASE)
75cdf0e10cSrcweirCXX+:=$(CFLAGS_SYSBASE)
76cdf0e10cSrcweirCC+:=$(CFLAGS_SYSBASE)
77cdf0e10cSrcweir.ENDIF          # "$(SYSBASE)"!=""
78cdf0e10cSrcweirCFLAGS+=-fmessage-length=0 -c
79cdf0e10cSrcweir
80cdf0e10cSrcweir# flags to enable build with symbols; required for crashdump feature
81cdf0e10cSrcweir.IF "$(ENABLE_SYMBOLS)"=="SMALL"
82cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g1
83cdf0e10cSrcweir.ELSE
84cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
85cdf0e10cSrcweir
86cdf0e10cSrcweir.ENDIF
87cdf0e10cSrcweir
88cdf0e10cSrcweir# flags for the C++ Compiler
89a8e4828dSPedro GiffuniCFLAGSCC= -pipe $(ARCH_FLAGS)
90cdf0e10cSrcweir# Flags for enabling exception handling
91*908225edSPedro GiffuniCFLAGSEXCEPTIONS=-fexceptions
92cdf0e10cSrcweir# Flags for disabling exception handling
93cdf0e10cSrcweirCFLAGS_NO_EXCEPTIONS=-fno-exceptions
94cdf0e10cSrcweir
95cdf0e10cSrcweir# -fpermissive should be removed as soon as possible
96a8e4828dSPedro GiffuniCFLAGSCXX= -pipe $(ARCH_FLAGS)
97cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
98cdf0e10cSrcweirCFLAGSCXX += -fvisibility-inlines-hidden
99cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
100cdf0e10cSrcweir
101cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with graphical user interface
102cdf0e10cSrcweirCFLAGSOBJGUIMT=
103cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with character user interface
104cdf0e10cSrcweirCFLAGSOBJCUIMT=
105cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
106cdf0e10cSrcweirCFLAGSSLOGUIMT=$(PICSWITCH)
107cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with character user interface
108cdf0e10cSrcweirCFLAGSSLOCUIMT=$(PICSWITCH)
109cdf0e10cSrcweir# Compiler flags for profiling
110cdf0e10cSrcweirCFLAGSPROF=
111cdf0e10cSrcweir# Compiler flags for debugging
112cdf0e10cSrcweirCFLAGSDEBUG=-g
113cdf0e10cSrcweirCFLAGSDBGUTIL=
114cdf0e10cSrcweir# Compiler flags for disabling optimizations
115cdf0e10cSrcweirCFLAGSNOOPT=-O0
116cdf0e10cSrcweir# Compiler flags for describing the output path
117cdf0e10cSrcweirCFLAGSOUTOBJ=-o
118cdf0e10cSrcweir
119cdf0e10cSrcweir# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
120cdf0e10cSrcweirCFLAGSWARNCC=-Wall -Wextra -Wendif-labels
121cdf0e10cSrcweirCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
122cdf0e10cSrcweir    -Wno-non-virtual-dtor
123cdf0e10cSrcweirCFLAGSWALLCC=$(CFLAGSWARNCC)
124cdf0e10cSrcweirCFLAGSWALLCXX=$(CFLAGSWARNCXX)
125cdf0e10cSrcweirCFLAGSWERRCC=-Werror
126cdf0e10cSrcweir
127cdf0e10cSrcweir# Once all modules on this platform compile without warnings, set
128cdf0e10cSrcweir# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
129cdf0e10cSrcweir# settings.mk): Currently this is not tested on FreeBSD
130cdf0e10cSrcweir#MODULES_WITH_WARNINGS :=
131cdf0e10cSrcweir
132cdf0e10cSrcweir# switches for dynamic and static linking
133cdf0e10cSrcweirSTATIC		= -Wl,-Bstatic
134cdf0e10cSrcweirDYNAMIC		= -Wl,-Bdynamic
135cdf0e10cSrcweir
136cdf0e10cSrcweir# name of linker
137cdf0e10cSrcweirLINK*=$(CXX)
138cdf0e10cSrcweirLINKC*=$(CC)
139cdf0e10cSrcweir
140cdf0e10cSrcweir# default linker flags
14125da6cb0SPedro Giffuni.IF "$(SYSBASE)"!=""
14225da6cb0SPedro GiffuniLINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE)
14325da6cb0SPedro Giffuni.ENDIF          # "$(SYSBASE)"!=""
14425da6cb0SPedro GiffuniLINKFLAGSDEFS*=-Wl,-z,defs
145a8e4828dSPedro GiffuniLINKFLAGSRUNPATH_URELIB=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
146910823aeSJürgen SchmidtLINKFLAGSRUNPATH_UREBIN=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
147910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_UREBIN=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
148cdf0e10cSrcweir    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
149910823aeSJürgen SchmidtLINKFLAGSRUNPATH_OOO=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
150910823aeSJürgen SchmidtLINKFLAGSRUNPATH_SDK=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
151910823aeSJürgen SchmidtLINKFLAGSRUNPATH_BRAND=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
152910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_OOO=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
153910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_SDK=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
154910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_BRAND=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
155cdf0e10cSrcweirLINKFLAGSRUNPATH_OXT=
156910823aeSJürgen SchmidtLINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\'
157910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\'
158cdf0e10cSrcweirLINKFLAGSRUNPATH_NONE=
159*908225edSPedro GiffuniLINKFLAGS=-Wl,-z,combreloc $(LDFLAGS) $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE)
160cdf0e10cSrcweir
161cdf0e10cSrcweir# linker flags for linking applications
16225da6cb0SPedro GiffuniLINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
16325da6cb0SPedro Giffuni      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
16425da6cb0SPedro GiffuniLINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
16525da6cb0SPedro Giffuni      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
166cdf0e10cSrcweir
167cdf0e10cSrcweir# linker flags for linking shared libraries
168cdf0e10cSrcweirLINKFLAGSSHLGUI= -shared
169cdf0e10cSrcweirLINKFLAGSSHLCUI= -shared
170cdf0e10cSrcweir
171cdf0e10cSrcweirLINKFLAGSTACK=
172cdf0e10cSrcweirLINKFLAGSPROF=
173cdf0e10cSrcweirLINKFLAGSDEBUG=-g
174cdf0e10cSrcweirLINKFLAGSOPT=
175cdf0e10cSrcweir
176cdf0e10cSrcweir# linker flags for optimization (symbol hashtable)
177cdf0e10cSrcweir# for now, applied to symbol scoped libraries, only
178cdf0e10cSrcweirLINKFLAGSOPTIMIZE*=-Wl,-O1
179cdf0e10cSrcweirLINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
180cdf0e10cSrcweir
181cdf0e10cSrcweirSONAME_SWITCH=-Wl,-h
182cdf0e10cSrcweir
183cdf0e10cSrcweir# Sequence of libs does matter !
184cdf0e10cSrcweir
185cdf0e10cSrcweirSTDLIBCPP=-lstdc++
186cdf0e10cSrcweir
187cdf0e10cSrcweir# default objectfilenames to link
18825da6cb0SPedro GiffuniSTDOBJVCL=$(L)$/salmain.o
189cdf0e10cSrcweirSTDOBJGUI=
190cdf0e10cSrcweirSTDSLOGUI=
191cdf0e10cSrcweirSTDOBJCUI=
192cdf0e10cSrcweirSTDSLOCUI=
193cdf0e10cSrcweir
19486686c1aSPedro Giffuni.IF "$(ALLOC)" == "TCMALLOC"
19525da6cb0SPedro GiffuniSTDLIBGUIMT+=-ltcmalloc
19625da6cb0SPedro GiffuniSTDLIBCUIMT+=-ltcmalloc
19725da6cb0SPedro GiffuniSTDSHLGUIMT+=-ltcmalloc
19825da6cb0SPedro GiffuniSTDSHLCUIMT+=-ltcmalloc
19925da6cb0SPedro Giffuni.ENDIF
20025da6cb0SPedro Giffuni
201cdf0e10cSrcweir# libraries for linking applications
202*908225edSPedro GiffuniSTDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_LDFLAGS}
203*908225edSPedro GiffuniSTDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_LDFLAGS}
204cdf0e10cSrcweir# libraries for linking shared libraries
205*908225edSPedro GiffuniSTDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_LDFLAGS}
206*908225edSPedro GiffuniSTDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_LDFLAGS}
20725da6cb0SPedro Giffuni
20825da6cb0SPedro GiffuniX11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed
209cdf0e10cSrcweir
210cdf0e10cSrcweirLIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
211cdf0e10cSrcweir
212cdf0e10cSrcweir.IF "$(USE_STLP_DEBUG)" != ""
213cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
214cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlportstlg
215cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
216cdf0e10cSrcweir.ELSE
217cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
218cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
219cdf0e10cSrcweir.ENDIF
220cdf0e10cSrcweir.ELSE # "$(USE_STLP_DEBUG)" != ""
221cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
222cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport
223cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
224cdf0e10cSrcweir.ELSE
225cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc
226cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
227cdf0e10cSrcweir.ENDIF
228cdf0e10cSrcweir.ENDIF # "$(USE_STLP_DEBUG)" != ""
229cdf0e10cSrcweir
230cdf0e10cSrcweir#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
231cdf0e10cSrcweir
232cdf0e10cSrcweir# name of library manager
233cdf0e10cSrcweirLIBMGR=ar
234cdf0e10cSrcweirLIBFLAGS=-r
235cdf0e10cSrcweir
236cdf0e10cSrcweir# tool for generating import libraries
237cdf0e10cSrcweirIMPLIB=
238cdf0e10cSrcweirIMPLIBFLAGS=
239cdf0e10cSrcweir
240cdf0e10cSrcweirMAPSYM=
241cdf0e10cSrcweirMAPSYMFLAGS=
242cdf0e10cSrcweir
243cdf0e10cSrcweirRC=irc
244cdf0e10cSrcweirRCFLAGS=-fo$@ $(RCFILES)
245cdf0e10cSrcweirRCLINK=
246cdf0e10cSrcweirRCLINKFLAGS=
247cdf0e10cSrcweirRCSETVERSION=
248cdf0e10cSrcweir
249cdf0e10cSrcweir# platform specific identifier for shared libs
250cdf0e10cSrcweirDLLPRE=lib
251cdf0e10cSrcweirDLLPOST=.so
25286686c1aSPedro GiffuniPCHPOST=.gch
253