xref: /aoo41x/main/solenv/inc/unxbsds.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# mk file for unxbsds
29ASM=gcc
30AFLAGS=-Wa,-Av8plusa,-K,PIC -x assembler-with-cpp -c $(CDEFS)
31
32SOLAR_JAVA=TRUE
33JAVAFLAGSDEBUG=-g
34
35# filter for supressing verbose messages from linker
36#not needed at the moment
37#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
38
39# _PTHREADS is needed for the stl
40CDEFS+=-D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER) -DOSL_USE_SYS_V_SEMAPHORE
41
42# this is a platform with JAVA support
43.IF "$(SOLAR_JAVA)"!=""
44JAVADEF=-DSOLAR_JAVA
45.IF "$(debug)"==""
46JAVA_RUNTIME=-ljava
47.ELSE
48JAVA_RUNTIME=-ljava_g
49.ENDIF
50.ENDIF
51
52# architecture dependent flags for the C and C++ compiler that can be changed by
53# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
54ARCH_FLAGS*=
55
56# name of C++ Compiler
57CXX=g++
58# name of C Compiler
59CC=gcc
60# flags for C and C++ Compiler
61CFLAGS=-c
62# flags for the C++ Compiler
63CFLAGSCC= -pipe $(ARCH_FLAGS)
64
65# Flags for enabling exception handling
66CFLAGSEXCEPTIONS=-fexceptions
67# Flags for disabling exception handling
68CFLAGS_NO_EXCEPTIONS=-fno-exceptions
69
70CFLAGSCXX= -pipe $(ARCH_FLAGS)
71PICSWITCH:=-fPIC
72
73# Compiler flags for compiling static object in multi threaded environment with graphical user interface
74CFLAGSOBJGUIMT=$(PICSWITCH)
75# Compiler flags for compiling static object in multi threaded environment with character user interface
76CFLAGSOBJCUIMT=$(PICSWITCH)
77# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
78CFLAGSSLOGUIMT=$(PICSWITCH)
79# Compiler flags for compiling shared object in multi threaded environment with character user interface
80CFLAGSSLOCUIMT=$(PICSWITCH)
81# Compiler flags for profiling
82CFLAGSPROF=
83# Compiler flags for debugging
84CFLAGSDEBUG=-g
85CFLAGSDBGUTIL=
86# Compiler flags for enabling optimizations
87CFLAGSOPT=-O2
88# Compiler flags for disabling optimizations
89CFLAGSNOOPT=-O
90# Compiler flags for describing the output path
91CFLAGSOUTOBJ=-o
92
93CFLAGSWARNCC=
94CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy
95# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
96CFLAGSWALLCC=-Wall -Wextra -Wendif-labels
97CFLAGSWALLCXX=$(CFLAGSWALLCC) -Wshadow -Wno-ctor-dtor-privacy
98CFLAGSWERRCC=-Werror
99
100# switches for dynamic and static linking
101STATIC		= -Wl,-Bstatic
102DYNAMIC		= -Wl,-Bdynamic
103
104# name of linker
105LINK=gcc
106# default linker flags
107LINKFLAGS=
108
109# linker flags for linking applications
110LINKFLAGSAPPGUI= -Wl,-export-dynamic
111LINKFLAGSAPPCUI= -Wl,-export-dynamic
112# linker flags for linking shared libraries
113LINKFLAGSSHLGUI= -shared
114LINKFLAGSSHLCUI= -shared
115
116LINKFLAGSTACK=
117LINKFLAGSPROF=
118LINKFLAGSDEBUG=-g
119LINKFLAGSOPT=
120
121.IF "$(NO_BSYMBOLIC)"==""
122.IF "$(PRJNAME)" != "envtest"
123LINKFLAGSSHLGUI+=-Wl,-Bsymbolic
124LINKFLAGSSHLCUI+=-Wl,-Bsymbolic
125.ENDIF
126.ENDIF				# "$(NO_BSYMBOLIC)"==""
127
128LINKVERSIONMAPFLAG=-Wl,--version-script
129
130# Sequence of libs does matter !
131
132STDLIBCPP=-lstdc++
133
134# default objectfilenames to link
135STDOBJGUI=
136STDSLOGUI=
137STDOBJCUI=
138STDSLOCUI=
139
140# libraries for linking applications
141STDLIBGUIMT=-lX11 -lpthread -lm
142STDLIBCUIMT=-lpthread -lm
143# libraries for linking shared libraries
144STDSHLGUIMT=-lX11 -lXext -lpthread -lm
145STDSHLCUIMT=-lpthread -lm
146
147# STLport always needs pthread. This may yield some redundant -lpthread
148# but that doesn't matter.
149.IF "$(STLPORT_VER)" >= "500"
150LIBSTLPORT=$(DYNAMIC) -lstlport -lpthread
151LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC) -lpthread
152.ELSE
153LIBSTLPORT=$(DYNAMIC) -lstlport_gcc -lpthread
154LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC) -lpthread
155.ENDIF
156
157
158# name of library manager
159LIBMGR=ar
160LIBFLAGS=-r
161
162# tool for generating import libraries
163IMPLIB=
164IMPLIBFLAGS=
165
166MAPSYM=
167MAPSYMFLAGS=
168
169RC=irc
170RCFLAGS=-fo$@ $(RCFILES)
171RCLINK=
172RCLINKFLAGS=
173RCSETVERSION=
174
175# platform specific identifier for shared libs
176DLLPOSTFIX=bs
177DLLPRE=lib
178DLLPOST=.so
179
180