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