xref: /aoo42x/main/solenv/inc/unxfbsd.mk (revision 86686c1a)
1cdf0e10cSrcweir#*************************************************************************
2cdf0e10cSrcweir#
3cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4cdf0e10cSrcweir#
5cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
6cdf0e10cSrcweir#
7cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
8cdf0e10cSrcweir#
9cdf0e10cSrcweir# This file is part of OpenOffice.org.
10cdf0e10cSrcweir#
11cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
12cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
13cdf0e10cSrcweir# only, as published by the Free Software Foundation.
14cdf0e10cSrcweir#
15cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
16cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
17cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
19cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
20cdf0e10cSrcweir#
21cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
22cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
23cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
24cdf0e10cSrcweir# for a copy of the LGPLv3 License.
25cdf0e10cSrcweir#
26cdf0e10cSrcweir#*************************************************************************
27cdf0e10cSrcweir
28cdf0e10cSrcweir# Makefile for FreeBSD.
29cdf0e10cSrcweir
30cdf0e10cSrcweirASM=
31cdf0e10cSrcweirAFLAGS=
32cdf0e10cSrcweir
33cdf0e10cSrcweirSOLAR_JAVA*=
3425da6cb0SPedro GiffuniPICSWITCH*:=-fpic
35cdf0e10cSrcweirJAVAFLAGSDEBUG=-g
36cdf0e10cSrcweir
37cdf0e10cSrcweir# Include arch specific makefile.
38cdf0e10cSrcweir.IF "$(CPUNAME)" == "INTEL"
39cdf0e10cSrcweir.INCLUDE : unxfbsdi.mk
40cdf0e10cSrcweir.ENDIF
41cdf0e10cSrcweir.IF "$(CPUNAME)" == "X86_64"
42cdf0e10cSrcweir.INCLUDE : unxfbsdx.mk
43cdf0e10cSrcweir.ENDIF
44cdf0e10cSrcweir
45cdf0e10cSrcweir# filter for supressing verbose messages from linker
46cdf0e10cSrcweir#not needed at the moment
47cdf0e10cSrcweir#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
48cdf0e10cSrcweir
49cdf0e10cSrcweir# _PTHREADS is needed for the stl
50cdf0e10cSrcweirCDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450
51cdf0e10cSrcweir
52cdf0e10cSrcweir# enable visibility define in "sal/types.h"
53cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
54cdf0e10cSrcweirCDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
55cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
56cdf0e10cSrcweir
57cdf0e10cSrcweir# this is a platform with JAVA support
58cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"!=""
59cdf0e10cSrcweirJAVADEF=-DSOLAR_JAVA
60cdf0e10cSrcweir.IF "$(debug)"==""
61cdf0e10cSrcweirJAVA_RUNTIME=-ljava
62cdf0e10cSrcweir.ELSE
63cdf0e10cSrcweirJAVA_RUNTIME=-ljava_g
64cdf0e10cSrcweir.ENDIF
65cdf0e10cSrcweir.ENDIF
66cdf0e10cSrcweir
67cdf0e10cSrcweir# name of C++ Compiler
68cdf0e10cSrcweirCXX*=g++
69cdf0e10cSrcweir# name of C Compiler
70cdf0e10cSrcweirCC*=gcc
71cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
7225da6cb0SPedro GiffuniCFLAGS_SYSBASE:=--sysroot=$(SYSBASE)
73cdf0e10cSrcweirCXX+:=$(CFLAGS_SYSBASE)
74cdf0e10cSrcweirCC+:=$(CFLAGS_SYSBASE)
75cdf0e10cSrcweir.ENDIF          # "$(SYSBASE)"!=""
76cdf0e10cSrcweirCFLAGS+=-fmessage-length=0 -c
77cdf0e10cSrcweir
78cdf0e10cSrcweir# flags to enable build with symbols; required for crashdump feature
79cdf0e10cSrcweir.IF "$(ENABLE_SYMBOLS)"=="SMALL"
80cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g1
81cdf0e10cSrcweir.ELSE
82cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
83cdf0e10cSrcweir
84cdf0e10cSrcweir.ENDIF
85cdf0e10cSrcweir
86cdf0e10cSrcweir# flags for the C++ Compiler
87cdf0e10cSrcweirCFLAGSCC= -pipe $(ARCH_FLAGS)
88cdf0e10cSrcweir# Flags for enabling exception handling
89cdf0e10cSrcweirCFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
90cdf0e10cSrcweir# Flags for disabling exception handling
91cdf0e10cSrcweirCFLAGS_NO_EXCEPTIONS=-fno-exceptions
92cdf0e10cSrcweir
93cdf0e10cSrcweir# -fpermissive should be removed as soon as possible
94cdf0e10cSrcweirCFLAGSCXX= -pipe $(ARCH_FLAGS)
95cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
96cdf0e10cSrcweirCFLAGSCXX += -fvisibility-inlines-hidden
97cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
98cdf0e10cSrcweir
99cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with graphical user interface
100cdf0e10cSrcweirCFLAGSOBJGUIMT=
101cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with character user interface
102cdf0e10cSrcweirCFLAGSOBJCUIMT=
103cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
104cdf0e10cSrcweirCFLAGSSLOGUIMT=$(PICSWITCH)
105cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with character user interface
106cdf0e10cSrcweirCFLAGSSLOCUIMT=$(PICSWITCH)
107cdf0e10cSrcweir# Compiler flags for profiling
108cdf0e10cSrcweirCFLAGSPROF=
109cdf0e10cSrcweir# Compiler flags for debugging
110cdf0e10cSrcweirCFLAGSDEBUG=-g
111cdf0e10cSrcweirCFLAGSDBGUTIL=
112cdf0e10cSrcweir# Compiler flags for disabling optimizations
113cdf0e10cSrcweirCFLAGSNOOPT=-O0
114cdf0e10cSrcweir# Compiler flags for describing the output path
115cdf0e10cSrcweirCFLAGSOUTOBJ=-o
116cdf0e10cSrcweir
117cdf0e10cSrcweir# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
118cdf0e10cSrcweirCFLAGSWARNCC=-Wall -Wextra -Wendif-labels
119cdf0e10cSrcweirCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
120cdf0e10cSrcweir    -Wno-non-virtual-dtor
121cdf0e10cSrcweirCFLAGSWALLCC=$(CFLAGSWARNCC)
122cdf0e10cSrcweirCFLAGSWALLCXX=$(CFLAGSWARNCXX)
123cdf0e10cSrcweirCFLAGSWERRCC=-Werror
124cdf0e10cSrcweir
125cdf0e10cSrcweir# Once all modules on this platform compile without warnings, set
126cdf0e10cSrcweir# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
127cdf0e10cSrcweir# settings.mk): Currently this is not tested on FreeBSD
128cdf0e10cSrcweir#MODULES_WITH_WARNINGS :=
129cdf0e10cSrcweir
130cdf0e10cSrcweir# switches for dynamic and static linking
131cdf0e10cSrcweirSTATIC		= -Wl,-Bstatic
132cdf0e10cSrcweirDYNAMIC		= -Wl,-Bdynamic
133cdf0e10cSrcweir
134cdf0e10cSrcweir# name of linker
135cdf0e10cSrcweirLINK*=$(CXX)
136cdf0e10cSrcweirLINKC*=$(CC)
137cdf0e10cSrcweir
138cdf0e10cSrcweir# default linker flags
13925da6cb0SPedro Giffuni.IF "$(SYSBASE)"!=""
14025da6cb0SPedro GiffuniLINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE)
14125da6cb0SPedro Giffuni.ENDIF          # "$(SYSBASE)"!=""
14225da6cb0SPedro GiffuniLINKFLAGSDEFS*=-Wl,-z,defs
14325da6cb0SPedro GiffuniLINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
14425da6cb0SPedro GiffuniLINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
145cdf0e10cSrcweir    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
14625da6cb0SPedro GiffuniLINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
14725da6cb0SPedro GiffuniLINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
14825da6cb0SPedro GiffuniLINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
149cdf0e10cSrcweirLINKFLAGSRUNPATH_OXT=
15025da6cb0SPedro GiffuniLINKFLAGSRUNPATH_BOXT=-Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\'
151cdf0e10cSrcweirLINKFLAGSRUNPATH_NONE=
15225da6cb0SPedro GiffuniLINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE)
153cdf0e10cSrcweir
154cdf0e10cSrcweir# linker flags for linking applications
15525da6cb0SPedro GiffuniLINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
15625da6cb0SPedro Giffuni      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
15725da6cb0SPedro GiffuniLINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
15825da6cb0SPedro Giffuni      -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
159cdf0e10cSrcweir
160cdf0e10cSrcweir# linker flags for linking shared libraries
161cdf0e10cSrcweirLINKFLAGSSHLGUI= -shared
162cdf0e10cSrcweirLINKFLAGSSHLCUI= -shared
163cdf0e10cSrcweir
164cdf0e10cSrcweirLINKFLAGSTACK=
165cdf0e10cSrcweirLINKFLAGSPROF=
166cdf0e10cSrcweirLINKFLAGSDEBUG=-g
167cdf0e10cSrcweirLINKFLAGSOPT=
168cdf0e10cSrcweir
169cdf0e10cSrcweir# linker flags for optimization (symbol hashtable)
170cdf0e10cSrcweir# for now, applied to symbol scoped libraries, only
171cdf0e10cSrcweirLINKFLAGSOPTIMIZE*=-Wl,-O1
172cdf0e10cSrcweirLINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
173cdf0e10cSrcweir
174cdf0e10cSrcweirSONAME_SWITCH=-Wl,-h
175cdf0e10cSrcweir
176cdf0e10cSrcweir# Sequence of libs does matter !
177cdf0e10cSrcweir
178cdf0e10cSrcweirSTDLIBCPP=-lstdc++
179cdf0e10cSrcweir
180cdf0e10cSrcweir# default objectfilenames to link
18125da6cb0SPedro GiffuniSTDOBJVCL=$(L)$/salmain.o
182cdf0e10cSrcweirSTDOBJGUI=
183cdf0e10cSrcweirSTDSLOGUI=
184cdf0e10cSrcweirSTDOBJCUI=
185cdf0e10cSrcweirSTDSLOCUI=
186cdf0e10cSrcweir
187*86686c1aSPedro Giffuni.IF "$(ALLOC)" == "TCMALLOC"
18825da6cb0SPedro GiffuniSTDLIBGUIMT+=-ltcmalloc
18925da6cb0SPedro GiffuniSTDLIBCUIMT+=-ltcmalloc
19025da6cb0SPedro GiffuniSTDSHLGUIMT+=-ltcmalloc
19125da6cb0SPedro GiffuniSTDSHLCUIMT+=-ltcmalloc
19225da6cb0SPedro Giffuni.ENDIF
19325da6cb0SPedro Giffuni
19425da6cb0SPedro Giffuni.IF "$(HAVE_LD_HASH_STYLE)"  == "TRUE"
19525da6cb0SPedro GiffuniLINKFLAGS += -Wl,--hash-style=both
19625da6cb0SPedro Giffuni.ELSE
19725da6cb0SPedro GiffuniLINKFLAGS += -Wl,-zdynsort
19825da6cb0SPedro Giffuni.ENDIF
19925da6cb0SPedro Giffuni
200cdf0e10cSrcweir# libraries for linking applications
20125da6cb0SPedro GiffuniSTDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
20225da6cb0SPedro GiffuniSTDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
203cdf0e10cSrcweir# libraries for linking shared libraries
20425da6cb0SPedro GiffuniSTDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
20525da6cb0SPedro GiffuniSTDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed
20625da6cb0SPedro Giffuni
20725da6cb0SPedro GiffuniX11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed
208cdf0e10cSrcweir
209cdf0e10cSrcweirLIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
210cdf0e10cSrcweir
211cdf0e10cSrcweir.IF "$(USE_STLP_DEBUG)" != ""
212cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
213cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlportstlg
214cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
215cdf0e10cSrcweir.ELSE
216cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
217cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
218cdf0e10cSrcweir.ENDIF
219cdf0e10cSrcweir.ELSE # "$(USE_STLP_DEBUG)" != ""
220cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
221cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport
222cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
223cdf0e10cSrcweir.ELSE
224cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc
225cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
226cdf0e10cSrcweir.ENDIF
227cdf0e10cSrcweir.ENDIF # "$(USE_STLP_DEBUG)" != ""
228cdf0e10cSrcweir
229cdf0e10cSrcweir#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
230cdf0e10cSrcweir
231cdf0e10cSrcweir# name of library manager
232cdf0e10cSrcweirLIBMGR=ar
233cdf0e10cSrcweirLIBFLAGS=-r
234cdf0e10cSrcweir
235cdf0e10cSrcweir# tool for generating import libraries
236cdf0e10cSrcweirIMPLIB=
237cdf0e10cSrcweirIMPLIBFLAGS=
238cdf0e10cSrcweir
239cdf0e10cSrcweirMAPSYM=
240cdf0e10cSrcweirMAPSYMFLAGS=
241cdf0e10cSrcweir
242cdf0e10cSrcweirRC=irc
243cdf0e10cSrcweirRCFLAGS=-fo$@ $(RCFILES)
244cdf0e10cSrcweirRCLINK=
245cdf0e10cSrcweirRCLINKFLAGS=
246cdf0e10cSrcweirRCSETVERSION=
247cdf0e10cSrcweir
248cdf0e10cSrcweir# platform specific identifier for shared libs
249cdf0e10cSrcweirDLLPRE=lib
250cdf0e10cSrcweirDLLPOST=.so
251*86686c1aSPedro GiffuniPCHPOST=.gch
252