summaryrefslogtreecommitdiff
path: root/sal/Library_sal.mk
blob: d7e65ad17dbf28c9e26f38dadf9e15c9979a1a29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2011 Matúš Kukan <matus.kukan@gmail.com> (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.

$(eval $(call gb_Library_Library,sal))

$(eval $(call gb_Library_set_soversion_script,sal,3,$(SRCDIR)/sal/util/sal.map))

$(eval $(call gb_Library_add_package_headers,sal,sal_generated))
$(eval $(call gb_Library_add_package_headers,sal,sal_inc))

$(eval $(call gb_Library_set_include,sal,\
	$$(INCLUDE) \
	-I$(realpath $(SRCDIR)/sal/inc) \
))

$(eval $(call gb_Library_add_defs,sal,\
	$(if $(VALGRIND_CFLAGS), \
		$(VALGRIND_CFLAGS) \
		-DHAVE_MEMCHECK_H=1 \
	) \
	$(if $(filter $(ALLOC),SYS_ALLOC TCMALLOC JEMALLOC), \
		-DFORCE_SYSALLOC \
	) \
	$(if $(filter $(OS),IOS), \
		-DNO_DL_FUNCTIONS \
		-DNO_CHILD_PROCESSES \
	) \
	$(LFS_CFLAGS) \
	-DSAL_DLLIMPLEMENTATION \
))

$(eval $(call gb_Library_add_linked_libs,sal,\
	$(if $(filter $(GUI),UNX), \
		$(if $(filter $(OS),ANDROID),, \
			pthread \
		) \
	) \
	$(if $(filter $(OS),LINUX), \
		dl \
	) \
	$(if $(filter $(OS),SOLARIS), \
		nsl \
		socket \
	) \
	$(if $(filter $(OS),WNT), \
		advapi32 \
		comdlg32 \
		mpr \
		ole32 \
		shell32 \
		user32 \
		ws2_32 \
	) \
	$(if $(filter $(OS),ANDROID), \
		lo-bootstrap \
	) \
	$(gb_STDLIBS) \
))

ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_use_externals,sal,\
	carbon \
	corefoundation \
))
endif

$(eval $(call gb_Library_add_exception_objects,sal,\
	sal/osl/all/debugbase \
	sal/osl/all/loadmodulerelative \
	sal/osl/all/log  \
	sal/osl/all/trace  \
	sal/osl/all/utility \
	sal/rtl/source/alloc_arena \
	sal/rtl/source/alloc_cache \
	sal/rtl/source/alloc_fini \
	sal/rtl/source/alloc_global \
	sal/rtl/source/bootstrap \
	sal/rtl/source/byteseq \
	sal/rtl/source/cipher \
	sal/rtl/source/cmdargs \
	sal/rtl/source/crc \
	sal/rtl/source/digest \
	sal/rtl/source/hash \
	sal/rtl/source/locale \
	sal/rtl/source/logfile \
	sal/rtl/source/math \
	sal/rtl/source/memory \
	sal/rtl/source/random \
	sal/rtl/source/rtl_process \
	sal/rtl/source/strbuf \
	sal/rtl/source/strimp \
	sal/rtl/source/string \
	sal/rtl/source/unload \
	sal/rtl/source/uri \
	sal/rtl/source/ustrbuf \
	sal/rtl/source/ustring \
	sal/rtl/source/uuid \
	sal/textenc/converter \
	sal/textenc/tcvtbyte \
	sal/textenc/tcvtutf8 \
	sal/textenc/tenchelp \
	sal/textenc/tencinfo \
	sal/textenc/textcvt \
	sal/textenc/textenc \
	sal/textenc/unichars \
))
$(eval $(call gb_Library_add_cobjects,sal,\
	sal/osl/all/filepath \
))

ifeq ($(GUI),UNX)
$(eval $(call gb_Library_add_exception_objects,sal,\
	sal/osl/unx/conditn \
	sal/osl/unx/file \
	sal/osl/unx/file_error_transl \
	sal/osl/unx/file_misc \
	sal/osl/unx/file_path_helper \
	sal/osl/unx/file_stat \
	sal/osl/unx/file_url \
	sal/osl/unx/file_volume \
	sal/osl/unx/process \
	sal/osl/unx/process_impl \
	sal/osl/unx/salinit \
	sal/osl/unx/uunxapi \
))
$(eval $(call gb_Library_add_cobjects,sal,\
	sal/osl/unx/diagnose \
	sal/osl/unx/module \
	sal/osl/unx/mutex \
	sal/osl/unx/nlsupport \
	sal/osl/unx/pipe \
	sal/osl/unx/profile \
	sal/osl/unx/readwrite_helper \
	sal/osl/unx/security \
	sal/osl/unx/semaphor \
	sal/osl/unx/socket \
	sal/osl/unx/system \
	sal/osl/unx/tempfile \
	sal/osl/unx/thread \
	sal/osl/unx/time \
	sal/osl/unx/util \
))
$(eval $(call gb_Library_add_cobject,sal,sal/osl/unx/signal, \
	$(if $(filter $(ENABLE_CRASHDUMP),YES)$(if $(PRODUCT),,TRUE), \
		-DSAL_ENABLE_CRASH_REPORT) \
))

ifneq ($(filter $(OS),MACOSX IOS),)
$(eval $(call gb_Library_add_exception_objects,sal,\
	sal/osl/unx/osxlocale \
))
endif
ifneq ($(filter $(OS),SOLARIS FREEBSD NETBSD MACOSX AIX OPENBSD DRAGONFLY)$(filter $(OS)$(CPU),LINUXS),)
$(eval $(call gb_Library_add_cobjects,sal,\
	sal/osl/unx/backtrace \
))
endif
ifneq ($(filter $(OS)$(CPU),SOLARISU SOLARISS NETBSDS LINUXS),)
$(eval $(call gb_Library_add_asmobjects,sal,\
	sal/osl/unx/asm/interlck_sparc \
))
else ifeq ($(OS)$(CPU),SOLARISI)
$(eval $(call gb_Library_add_asmobjects,sal,\
	sal/osl/unx/asm/interlck_x86 \
))
else
$(eval $(call gb_Library_add_cobjects,sal,\
	sal/osl/unx/interlck \
))
endif

else # $(GUI) != UNX

# FIXME ?
# .IF "$(CCNUMVER)" >= "001400000000"
# $(eval $(call gb_Library_add_defs,sal,\
	-D_CRT_NON_CONFORMING_SWPRINTFS \
))
# .ENDIF

$(eval $(call gb_Library_add_exception_objects,sal,\
	sal/osl/w32/file \
	sal/osl/w32/file_dirvol \
	sal/osl/w32/file_url \
	sal/osl/w32/module \
	sal/osl/w32/path_helper \
	sal/osl/w32/process \
	sal/osl/w32/procimpl \
	sal/osl/w32/profile \
	sal/osl/w32/salinit \
	sal/osl/w32/signal \
	sal/osl/w32/socket \
	sal/osl/w32/tempfile \
))
$(eval $(call gb_Library_add_cobjects,sal,\
	sal/osl/w32/conditn \
	sal/osl/w32/diagnose \
	sal/osl/w32/dllentry \
	sal/osl/w32/file_error \
	sal/osl/w32/interlck \
	sal/osl/w32/mutex \
	sal/osl/w32/nlsupport \
	sal/osl/w32/pipe \
	sal/osl/w32/security \
	sal/osl/w32/semaphor \
	sal/osl/w32/thread \
	sal/osl/w32/time \
	sal/osl/w32/util \
))

endif # ifeq ($(GUI),UNX)

# vim: set noet sw=4 ts=4: