xref: /aoo42x/main/solenv/inc/unxfbsd.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28# Makefile for FreeBSD.
29
30ASM=
31AFLAGS=
32
33SOLAR_JAVA*=
34JAVAFLAGSDEBUG=-g
35
36# Include arch specific makefile.
37.IF "$(CPUNAME)" == "INTEL"
38.INCLUDE : unxfbsdi.mk
39.ENDIF
40.IF "$(CPUNAME)" == "X86_64"
41.INCLUDE : unxfbsdx.mk
42.ENDIF
43
44# filter for supressing verbose messages from linker
45#not needed at the moment
46#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
47
48# _PTHREADS is needed for the stl
49CDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450
50
51# enable visibility define in "sal/types.h"
52.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
53CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
54.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
55
56# this is a platform with JAVA support
57.IF "$(SOLAR_JAVA)"!=""
58JAVADEF=-DSOLAR_JAVA
59.IF "$(debug)"==""
60JAVA_RUNTIME=-ljava
61.ELSE
62JAVA_RUNTIME=-ljava_g
63.ENDIF
64.ENDIF
65
66# name of C++ Compiler
67CXX*=g++
68# name of C Compiler
69CC*=gcc
70.IF "$(SYSBASE)"!=""
71CFLAGS_SYSBASE:=-isystem $(SYSBASE)/usr/include
72CXX+:=$(CFLAGS_SYSBASE)
73CC+:=$(CFLAGS_SYSBASE)
74.ENDIF          # "$(SYSBASE)"!=""
75CFLAGS+=-fmessage-length=0 -c
76
77# flags to enable build with symbols; required for crashdump feature
78.IF "$(ENABLE_SYMBOLS)"=="SMALL"
79CFLAGSENABLESYMBOLS=-g1
80.ELSE
81CFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
82
83.ENDIF
84
85# flags for the C++ Compiler
86CFLAGSCC= -pipe $(ARCH_FLAGS)
87# Flags for enabling exception handling
88CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
89# Flags for disabling exception handling
90CFLAGS_NO_EXCEPTIONS=-fno-exceptions
91
92# -fpermissive should be removed as soon as possible
93CFLAGSCXX= -pipe $(ARCH_FLAGS)
94PICSWITCH:=-fpic
95.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
96CFLAGSCXX += -fvisibility-inlines-hidden
97.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
98
99# Compiler flags for compiling static object in multi threaded environment with graphical user interface
100CFLAGSOBJGUIMT=
101# Compiler flags for compiling static object in multi threaded environment with character user interface
102CFLAGSOBJCUIMT=
103# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
104CFLAGSSLOGUIMT=$(PICSWITCH)
105# Compiler flags for compiling shared object in multi threaded environment with character user interface
106CFLAGSSLOCUIMT=$(PICSWITCH)
107# Compiler flags for profiling
108CFLAGSPROF=
109# Compiler flags for debugging
110CFLAGSDEBUG=-g
111CFLAGSDBGUTIL=
112# Compiler flags for disabling optimizations
113CFLAGSNOOPT=-O0
114# Compiler flags for describing the output path
115CFLAGSOUTOBJ=-o
116
117# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
118CFLAGSWARNCC=-Wall -Wextra -Wendif-labels
119CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
120    -Wno-non-virtual-dtor
121CFLAGSWALLCC=$(CFLAGSWARNCC)
122CFLAGSWALLCXX=$(CFLAGSWARNCXX)
123CFLAGSWERRCC=-Werror
124
125# Once all modules on this platform compile without warnings, set
126# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
127# settings.mk): Currently this is not tested on FreeBSD
128#MODULES_WITH_WARNINGS :=
129
130# switches for dynamic and static linking
131STATIC		= -Wl,-Bstatic
132DYNAMIC		= -Wl,-Bdynamic
133
134# name of linker
135LINK*=$(CXX)
136LINKC*=$(CC)
137
138# default linker flags
139LINKFLAGSDEFS*=#-Wl,-z,defs
140LINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
141LINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
142    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
143LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
144LINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
145LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
146LINKFLAGSRUNPATH_OXT=
147LINKFLAGSRUNPATH_NONE=
148LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
149
150# linker flags for linking applications
151LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
152LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
153
154# linker flags for linking shared libraries
155LINKFLAGSSHLGUI= -shared
156LINKFLAGSSHLCUI= -shared
157
158LINKFLAGSTACK=
159LINKFLAGSPROF=
160LINKFLAGSDEBUG=-g
161LINKFLAGSOPT=
162
163# linker flags for optimization (symbol hashtable)
164# for now, applied to symbol scoped libraries, only
165LINKFLAGSOPTIMIZE*=-Wl,-O1
166LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
167
168SONAME_SWITCH=-Wl,-h
169
170# Sequence of libs does matter !
171
172STDLIBCPP=-lstdc++
173
174# default objectfilenames to link
175STDOBJVCL=$(L)/salmain.o
176STDOBJGUI=
177STDSLOGUI=
178STDOBJCUI=
179STDSLOCUI=
180
181# libraries for linking applications
182STDLIBGUIMT=-lX11 $(PTHREAD_LIBS) -lm
183STDLIBCUIMT=$(PTHREAD_LIBS) -lm
184# libraries for linking shared libraries
185STDSHLGUIMT=-lX11 -lXext $(PTHREAD_LIBS) -lm
186STDSHLCUIMT=$(PTHREAD_LIBS) -lm
187
188LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
189
190.IF "$(USE_STLP_DEBUG)" != ""
191.IF "$(STLPORT_VER)" >= "500"
192LIBSTLPORT=$(DYNAMIC) -lstlportstlg
193LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
194.ELSE
195LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
196LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
197.ENDIF
198.ELSE # "$(USE_STLP_DEBUG)" != ""
199.IF "$(STLPORT_VER)" >= "500"
200LIBSTLPORT=$(DYNAMIC) -lstlport
201LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
202.ELSE
203LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
204LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
205.ENDIF
206.ENDIF # "$(USE_STLP_DEBUG)" != ""
207
208#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
209
210# name of library manager
211LIBMGR=ar
212LIBFLAGS=-r
213
214# tool for generating import libraries
215IMPLIB=
216IMPLIBFLAGS=
217
218MAPSYM=
219MAPSYMFLAGS=
220
221RC=irc
222RCFLAGS=-fo$@ $(RCFILES)
223RCLINK=
224RCLINKFLAGS=
225RCSETVERSION=
226
227# platform specific identifier for shared libs
228DLLPRE=lib
229DLLPOST=.so
230