xref: /aoo42x/main/solenv/inc/unxfbsd.mk (revision 7871dc3e)
1*7871dc3eSAndrew Rist#**************************************************************
2*7871dc3eSAndrew Rist#
3*7871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7871dc3eSAndrew Rist#  distributed with this work for additional information
6*7871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
9*7871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*7871dc3eSAndrew Rist#
11*7871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*7871dc3eSAndrew Rist#
13*7871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7871dc3eSAndrew Rist#  software distributed under the License is distributed on an
15*7871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*7871dc3eSAndrew Rist#  specific language governing permissions and limitations
18*7871dc3eSAndrew Rist#  under the License.
19*7871dc3eSAndrew Rist#
20*7871dc3eSAndrew Rist#**************************************************************
21*7871dc3eSAndrew Rist
22*7871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir# Makefile for FreeBSD.
25cdf0e10cSrcweir
26cdf0e10cSrcweirASM=
27cdf0e10cSrcweirAFLAGS=
28cdf0e10cSrcweir
29cdf0e10cSrcweirSOLAR_JAVA*=
3025da6cb0SPedro 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
40cdf0e10cSrcweir
41cdf0e10cSrcweir# filter for supressing verbose messages from linker
42cdf0e10cSrcweir#not needed at the moment
43cdf0e10cSrcweir#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
44cdf0e10cSrcweir
45cdf0e10cSrcweir# _PTHREADS is needed for the stl
46cdf0e10cSrcweirCDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450
47cdf0e10cSrcweir
48cdf0e10cSrcweir# enable visibility define in "sal/types.h"
49cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
50cdf0e10cSrcweirCDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
51cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
52cdf0e10cSrcweir
53cdf0e10cSrcweir# this is a platform with JAVA support
54cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"!=""
55cdf0e10cSrcweirJAVADEF=-DSOLAR_JAVA
56cdf0e10cSrcweir.IF "$(debug)"==""
57cdf0e10cSrcweirJAVA_RUNTIME=-ljava
58cdf0e10cSrcweir.ELSE
59cdf0e10cSrcweirJAVA_RUNTIME=-ljava_g
60cdf0e10cSrcweir.ENDIF
61cdf0e10cSrcweir.ENDIF
62cdf0e10cSrcweir
63cdf0e10cSrcweir# name of C++ Compiler
647fcdd55bSPedro GiffuniCXX*=c++
65cdf0e10cSrcweir# name of C Compiler
667fcdd55bSPedro GiffuniCC*=cc
67cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
6825da6cb0SPedro GiffuniCFLAGS_SYSBASE:=--sysroot=$(SYSBASE)
69cdf0e10cSrcweirCXX+:=$(CFLAGS_SYSBASE)
70cdf0e10cSrcweirCC+:=$(CFLAGS_SYSBASE)
71cdf0e10cSrcweir.ENDIF          # "$(SYSBASE)"!=""
72cdf0e10cSrcweirCFLAGS+=-fmessage-length=0 -c
73cdf0e10cSrcweir
74cdf0e10cSrcweir# flags to enable build with symbols; required for crashdump feature
75cdf0e10cSrcweir.IF "$(ENABLE_SYMBOLS)"=="SMALL"
76cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g1
77cdf0e10cSrcweir.ELSE
78cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
79cdf0e10cSrcweir
80cdf0e10cSrcweir.ENDIF
81cdf0e10cSrcweir
82cdf0e10cSrcweir# flags for the C++ Compiler
83cdf0e10cSrcweirCFLAGSCC= -pipe $(ARCH_FLAGS)
84cdf0e10cSrcweir# Flags for enabling exception handling
85cdf0e10cSrcweirCFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
86cdf0e10cSrcweir# Flags for disabling exception handling
87cdf0e10cSrcweirCFLAGS_NO_EXCEPTIONS=-fno-exceptions
88cdf0e10cSrcweir
89cdf0e10cSrcweir# -fpermissive should be removed as soon as possible
90cdf0e10cSrcweirCFLAGSCXX= -pipe $(ARCH_FLAGS)
91cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
92cdf0e10cSrcweirCFLAGSCXX += -fvisibility-inlines-hidden
93cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
94cdf0e10cSrcweir
95cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with graphical user interface
96cdf0e10cSrcweirCFLAGSOBJGUIMT=
97cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with character user interface
98cdf0e10cSrcweirCFLAGSOBJCUIMT=
99cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
100cdf0e10cSrcweirCFLAGSSLOGUIMT=$(PICSWITCH)
101cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with character user interface
102cdf0e10cSrcweirCFLAGSSLOCUIMT=$(PICSWITCH)
103cdf0e10cSrcweir# Compiler flags for profiling
104cdf0e10cSrcweirCFLAGSPROF=
105cdf0e10cSrcweir# Compiler flags for debugging
106cdf0e10cSrcweirCFLAGSDEBUG=-g
107cdf0e10cSrcweirCFLAGSDBGUTIL=
108cdf0e10cSrcweir# Compiler flags for disabling optimizations
109cdf0e10cSrcweirCFLAGSNOOPT=-O0
110cdf0e10cSrcweir# Compiler flags for describing the output path
111cdf0e10cSrcweirCFLAGSOUTOBJ=-o
112cdf0e10cSrcweir
113cdf0e10cSrcweir# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
114cdf0e10cSrcweirCFLAGSWARNCC=-Wall -Wextra -Wendif-labels
115cdf0e10cSrcweirCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
116cdf0e10cSrcweir    -Wno-non-virtual-dtor
117cdf0e10cSrcweirCFLAGSWALLCC=$(CFLAGSWARNCC)
118cdf0e10cSrcweirCFLAGSWALLCXX=$(CFLAGSWARNCXX)
119cdf0e10cSrcweirCFLAGSWERRCC=-Werror
120cdf0e10cSrcweir
121cdf0e10cSrcweir# Once all modules on this platform compile without warnings, set
122cdf0e10cSrcweir# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
123cdf0e10cSrcweir# settings.mk): Currently this is not tested on FreeBSD
124cdf0e10cSrcweir#MODULES_WITH_WARNINGS :=
125cdf0e10cSrcweir
126cdf0e10cSrcweir# switches for dynamic and static linking
127cdf0e10cSrcweirSTATIC		= -Wl,-Bstatic
128cdf0e10cSrcweirDYNAMIC		= -Wl,-Bdynamic
129cdf0e10cSrcweir
130cdf0e10cSrcweir# name of linker
131cdf0e10cSrcweirLINK*=$(CXX)
132cdf0e10cSrcweirLINKC*=$(CC)
133cdf0e10cSrcweir
134cdf0e10cSrcweir# default linker flags
13525da6cb0SPedro Giffuni.IF "$(SYSBASE)"!=""
13625da6cb0SPedro GiffuniLINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE)
13725da6cb0SPedro Giffuni.ENDIF          # "$(SYSBASE)"!=""
13825da6cb0SPedro GiffuniLINKFLAGSDEFS*=-Wl,-z,defs
13925da6cb0SPedro GiffuniLINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
14025da6cb0SPedro GiffuniLINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
141cdf0e10cSrcweir    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
14225da6cb0SPedro GiffuniLINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
14325da6cb0SPedro GiffuniLINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
14425da6cb0SPedro GiffuniLINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
145cdf0e10cSrcweirLINKFLAGSRUNPATH_OXT=
14625da6cb0SPedro GiffuniLINKFLAGSRUNPATH_BOXT=-Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\'
147cdf0e10cSrcweirLINKFLAGSRUNPATH_NONE=
14825da6cb0SPedro GiffuniLINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE)
149cdf0e10cSrcweir
150cdf0e10cSrcweir# linker flags for linking applications
15125da6cb0SPedro GiffuniLINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
15225da6cb0SPedro Giffuni      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
15325da6cb0SPedro GiffuniLINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
15425da6cb0SPedro Giffuni      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
155cdf0e10cSrcweir
156cdf0e10cSrcweir# linker flags for linking shared libraries
157cdf0e10cSrcweirLINKFLAGSSHLGUI= -shared
158cdf0e10cSrcweirLINKFLAGSSHLCUI= -shared
159cdf0e10cSrcweir
160cdf0e10cSrcweirLINKFLAGSTACK=
161cdf0e10cSrcweirLINKFLAGSPROF=
162cdf0e10cSrcweirLINKFLAGSDEBUG=-g
163cdf0e10cSrcweirLINKFLAGSOPT=
164cdf0e10cSrcweir
165cdf0e10cSrcweir# linker flags for optimization (symbol hashtable)
166cdf0e10cSrcweir# for now, applied to symbol scoped libraries, only
167cdf0e10cSrcweirLINKFLAGSOPTIMIZE*=-Wl,-O1
168cdf0e10cSrcweirLINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
169cdf0e10cSrcweir
170cdf0e10cSrcweirSONAME_SWITCH=-Wl,-h
171cdf0e10cSrcweir
172cdf0e10cSrcweir# Sequence of libs does matter !
173cdf0e10cSrcweir
174cdf0e10cSrcweirSTDLIBCPP=-lstdc++
175cdf0e10cSrcweir
176cdf0e10cSrcweir# default objectfilenames to link
17725da6cb0SPedro GiffuniSTDOBJVCL=$(L)$/salmain.o
178cdf0e10cSrcweirSTDOBJGUI=
179cdf0e10cSrcweirSTDSLOGUI=
180cdf0e10cSrcweirSTDOBJCUI=
181cdf0e10cSrcweirSTDSLOCUI=
182cdf0e10cSrcweir
18386686c1aSPedro Giffuni.IF "$(ALLOC)" == "TCMALLOC"
18425da6cb0SPedro GiffuniSTDLIBGUIMT+=-ltcmalloc
18525da6cb0SPedro GiffuniSTDLIBCUIMT+=-ltcmalloc
18625da6cb0SPedro GiffuniSTDSHLGUIMT+=-ltcmalloc
18725da6cb0SPedro GiffuniSTDSHLCUIMT+=-ltcmalloc
18825da6cb0SPedro Giffuni.ENDIF
18925da6cb0SPedro Giffuni
19025da6cb0SPedro Giffuni.IF "$(HAVE_LD_HASH_STYLE)"  == "TRUE"
19125da6cb0SPedro GiffuniLINKFLAGS += -Wl,--hash-style=both
19225da6cb0SPedro Giffuni.ELSE
19325da6cb0SPedro GiffuniLINKFLAGS += -Wl,-zdynsort
19425da6cb0SPedro Giffuni.ENDIF
19525da6cb0SPedro Giffuni
196cdf0e10cSrcweir# libraries for linking applications
19725da6cb0SPedro GiffuniSTDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
19825da6cb0SPedro GiffuniSTDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
199cdf0e10cSrcweir# libraries for linking shared libraries
20025da6cb0SPedro GiffuniSTDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
20125da6cb0SPedro GiffuniSTDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
20225da6cb0SPedro Giffuni
20325da6cb0SPedro GiffuniX11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed
204cdf0e10cSrcweir
205cdf0e10cSrcweirLIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
206cdf0e10cSrcweir
207cdf0e10cSrcweir.IF "$(USE_STLP_DEBUG)" != ""
208cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
209cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlportstlg
210cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
211cdf0e10cSrcweir.ELSE
212cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
213cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
214cdf0e10cSrcweir.ENDIF
215cdf0e10cSrcweir.ELSE # "$(USE_STLP_DEBUG)" != ""
216cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
217cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport
218cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
219cdf0e10cSrcweir.ELSE
220cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc
221cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
222cdf0e10cSrcweir.ENDIF
223cdf0e10cSrcweir.ENDIF # "$(USE_STLP_DEBUG)" != ""
224cdf0e10cSrcweir
225cdf0e10cSrcweir#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
226cdf0e10cSrcweir
227cdf0e10cSrcweir# name of library manager
228cdf0e10cSrcweirLIBMGR=ar
229cdf0e10cSrcweirLIBFLAGS=-r
230cdf0e10cSrcweir
231cdf0e10cSrcweir# tool for generating import libraries
232cdf0e10cSrcweirIMPLIB=
233cdf0e10cSrcweirIMPLIBFLAGS=
234cdf0e10cSrcweir
235cdf0e10cSrcweirMAPSYM=
236cdf0e10cSrcweirMAPSYMFLAGS=
237cdf0e10cSrcweir
238cdf0e10cSrcweirRC=irc
239cdf0e10cSrcweirRCFLAGS=-fo$@ $(RCFILES)
240cdf0e10cSrcweirRCLINK=
241cdf0e10cSrcweirRCLINKFLAGS=
242cdf0e10cSrcweirRCSETVERSION=
243cdf0e10cSrcweir
244cdf0e10cSrcweir# platform specific identifier for shared libs
245cdf0e10cSrcweirDLLPRE=lib
246cdf0e10cSrcweirDLLPOST=.so
24786686c1aSPedro GiffuniPCHPOST=.gch
248