forked from eclipse-mosquitto/mosquitto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mk
326 lines (260 loc) · 8.72 KB
/
config.mk
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# =============================================================================
# User configuration section.
#
# These options control compilation on all systems apart from Windows and Mac
# OS X. Use CMake to compile on Windows and Mac.
#
# Largely, these are options that are designed to make mosquitto run more
# easily in restrictive environments by removing features.
#
# Modify the variable below to enable/disable features.
#
# Can also be overriden at the command line, e.g.:
#
# make WITH_TLS=no
# =============================================================================
# Uncomment to compile the broker with tcpd/libwrap support.
#WITH_WRAP:=yes
# Comment out to disable SSL/TLS support in the broker and client.
# Disabling this will also mean that passwords must be stored in plain text. It
# is strongly recommended that you only disable WITH_TLS if you are not using
# password authentication at all.
WITH_TLS:=yes
# Comment out to disable TLS/PSK support in the broker and client. Requires
# WITH_TLS=yes.
# This must be disabled if using openssl < 1.0.
WITH_TLS_PSK:=yes
# Comment out to disable client threading support.
WITH_THREADING:=yes
# Comment out to remove bridge support from the broker. This allow the broker
# to connect to other brokers and subscribe/publish to topics. You probably
# want to leave this included unless you want to save a very small amount of
# memory size and CPU time.
WITH_BRIDGE:=yes
# Comment out to remove persistent database support from the broker. This
# allows the broker to store retained messages and durable subscriptions to a
# file periodically and on shutdown. This is usually desirable (and is
# suggested by the MQTT spec), but it can be disabled if required.
WITH_PERSISTENCE:=yes
# Comment out to remove memory tracking support from the broker. If disabled,
# mosquitto won't track heap memory usage nor export '$SYS/broker/heap/current
# size', but will use slightly less memory and CPU time.
WITH_MEMORY_TRACKING:=yes
# Compile with database upgrading support? If disabled, mosquitto won't
# automatically upgrade old database versions.
# Not currently supported.
#WITH_DB_UPGRADE:=yes
# Comment out to remove publishing of the $SYS topic hierarchy containing
# information about the broker state.
WITH_SYS_TREE:=yes
# Build with systemd support. If enabled, mosquitto will notify systemd after
# initialization. See README in service/systemd/ for more information.
WITH_SYSTEMD:=no
# Build with SRV lookup support.
WITH_SRV:=no
# Build with websockets support on the broker.
WITH_WEBSOCKETS:=no
# Use elliptic keys in broker
WITH_EC:=yes
# Build man page documentation by default.
WITH_DOCS:=yes
# Build with client support for SOCK5 proxy.
WITH_SOCKS:=yes
# Strip executables and shared libraries on install.
WITH_STRIP:=no
# Build static libraries
WITH_STATIC_LIBRARIES:=no
# Use this variable to add extra library dependencies when building the clients
# with the static libmosquitto library. This may be required on some systems
# where e.g. -lz or -latomic are needed for openssl.
CLIENT_STATIC_LDADD:=
# Build shared libraries
WITH_SHARED_LIBRARIES:=yes
# Build with async dns lookup support for bridges (temporary). Requires glibc.
#WITH_ADNS:=yes
# Build with epoll support.
WITH_EPOLL:=yes
# Build with bundled uthash.h
WITH_BUNDLED_DEPS:=yes
# Build with coverage options
WITH_COVERAGE:=no
# =============================================================================
# End of user configuration
# =============================================================================
# Also bump lib/mosquitto.h, CMakeLists.txt,
# installer/mosquitto.nsi, installer/mosquitto64.nsi
VERSION=1.6.9
# Client library SO version. Bump if incompatible API/ABI changes are made.
SOVERSION=1
# Man page generation requires xsltproc and docbook-xsl
XSLTPROC=xsltproc --nonet
# For html generation
DB_HTML_XSL=man/html.xsl
#MANCOUNTRIES=en_GB
UNAME:=$(shell uname -s)
ifeq ($(UNAME),SunOS)
ifeq ($(CC),cc)
CFLAGS?=-O
else
CFLAGS?=-Wall -ggdb -O2
endif
else
CFLAGS?=-Wall -ggdb -O2
endif
STATIC_LIB_DEPS:=
LIB_CPPFLAGS=$(CPPFLAGS) -I. -I.. -I../lib
ifeq ($(WITH_BUNDLED_DEPS),yes)
LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -I../src/deps
endif
LIB_CFLAGS:=$(CFLAGS)
LIB_CXXFLAGS:=$(CXXFLAGS)
LIB_LDFLAGS:=$(LDFLAGS)
LIB_LIBADD:=$(LIBADD)
BROKER_CPPFLAGS:=$(LIB_CPPFLAGS)
BROKER_CFLAGS:=${CFLAGS} -DVERSION="\"${VERSION}\"" -DWITH_BROKER
BROKER_LDFLAGS:=${LDFLAGS}
BROKER_LDADD:=
CLIENT_CPPFLAGS:=$(CPPFLAGS) -I.. -I../lib
CLIENT_CFLAGS:=${CFLAGS} -DVERSION="\"${VERSION}\""
CLIENT_LDFLAGS:=$(LDFLAGS) -L../lib
CLIENT_LDADD:=
PASSWD_LDADD:=
ifneq ($(or $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD), $(findstring $(UNAME),NetBSD)),)
BROKER_LDADD:=$(BROKER_LDADD) -lm
else
BROKER_LDADD:=$(BROKER_LDADD) -ldl -lm
endif
ifeq ($(UNAME),Linux)
BROKER_LDADD:=$(BROKER_LDADD) -lrt
BROKER_LDFLAGS:=$(BROKER_LDFLAGS) -Wl,--dynamic-list=linker.syms
LIB_LIBADD:=$(LIB_LIBADD) -lrt
endif
ifeq ($(WITH_SHARED_LIBRARIES),yes)
CLIENT_LDADD:=${CLIENT_LDADD} ../lib/libmosquitto.so.${SOVERSION}
endif
ifeq ($(UNAME),SunOS)
ifeq ($(CC),cc)
LIB_CFLAGS:=$(LIB_CFLAGS) -xc99 -KPIC
else
LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC
endif
ifeq ($(CXX),CC)
LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -KPIC
else
LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC
endif
else
LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC
LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC
endif
ifneq ($(UNAME),SunOS)
LIB_LDFLAGS:=$(LIB_LDFLAGS) -Wl,--version-script=linker.version -Wl,-soname,libmosquitto.so.$(SOVERSION)
endif
ifeq ($(UNAME),QNX)
BROKER_LDADD:=$(BROKER_LDADD) -lsocket
LIB_LIBADD:=$(LIB_LIBADD) -lsocket
endif
ifeq ($(WITH_WRAP),yes)
BROKER_LDADD:=$(BROKER_LDADD) -lwrap
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WRAP
endif
ifeq ($(WITH_TLS),yes)
BROKER_LDADD:=$(BROKER_LDADD) -lssl -lcrypto
LIB_LIBADD:=$(LIB_LIBADD) -lssl -lcrypto
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_TLS
LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_TLS
PASSWD_LDADD:=$(PASSWD_LDADD) -lcrypto
CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_TLS
STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lssl -lcrypto
ifeq ($(WITH_TLS_PSK),yes)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_TLS_PSK
LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_TLS_PSK
CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_TLS_PSK
endif
endif
ifeq ($(WITH_THREADING),yes)
LIB_LIBADD:=$(LIB_LIBADD) -lpthread
LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_THREADING
CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_THREADING
STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lpthread
endif
ifeq ($(WITH_SOCKS),yes)
LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_SOCKS
CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_SOCKS
endif
ifeq ($(WITH_BRIDGE),yes)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_BRIDGE
endif
ifeq ($(WITH_PERSISTENCE),yes)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_PERSISTENCE
endif
ifeq ($(WITH_MEMORY_TRACKING),yes)
ifneq ($(UNAME),SunOS)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_MEMORY_TRACKING
endif
endif
ifeq ($(WITH_SYS_TREE),yes)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_SYS_TREE
endif
ifeq ($(WITH_SYSTEMD),yes)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_SYSTEMD
BROKER_LDADD:=$(BROKER_LDADD) -lsystemd
endif
ifeq ($(WITH_SRV),yes)
LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_SRV
LIB_LIBADD:=$(LIB_LIBADD) -lcares
CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_SRV
STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lcares
endif
ifeq ($(UNAME),SunOS)
BROKER_LDADD:=$(BROKER_LDADD) -lsocket -lnsl
LIB_LIBADD:=$(LIB_LIBADD) -lsocket -lnsl
endif
ifeq ($(WITH_EC),yes)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_EC
endif
ifeq ($(WITH_ADNS),yes)
BROKER_LDADD:=$(BROKER_LDADD) -lanl
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_ADNS
endif
MAKE_ALL:=mosquitto
ifeq ($(WITH_DOCS),yes)
MAKE_ALL:=$(MAKE_ALL) docs
endif
ifeq ($(WITH_WEBSOCKETS),yes)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WEBSOCKETS
BROKER_LDADD:=$(BROKER_LDADD) -lwebsockets
endif
ifeq ($(WITH_WEBSOCKETS),static)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WEBSOCKETS
BROKER_LDADD:=$(BROKER_LDADD) -static -lwebsockets
endif
INSTALL?=install
prefix?=/usr/local
incdir?=${prefix}/include
libdir?=${prefix}/lib${LIB_SUFFIX}
localedir?=${prefix}/share/locale
mandir?=${prefix}/share/man
STRIP?=strip
ifeq ($(WITH_STRIP),yes)
STRIP_OPTS?=-s --strip-program=${CROSS_COMPILE}${STRIP}
endif
ifeq ($(WITH_EPOLL),yes)
ifeq ($(UNAME),Linux)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_EPOLL
endif
endif
ifeq ($(WITH_BUNDLED_DEPS),yes)
BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -Ideps
endif
ifeq ($(WITH_COVERAGE),yes)
BROKER_CFLAGS:=$(BROKER_CFLAGS) -coverage
BROKER_LDFLAGS:=$(BROKER_LDFLAGS) -coverage
LIB_CFLAGS:=$(LIB_CFLAGS) -coverage
LIB_LDFLAGS:=$(LIB_LDFLAGS) -coverage
CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -coverage
CLIENT_LDFLAGS:=$(CLIENT_LDFLAGS) -coverage
endif
BROKER_LDADD:=${BROKER_LDADD} ${LDADD}
CLIENT_LDADD:=${CLIENT_LDADD} ${LDADD}
PASSWD_LDADD:=${PASSWD_LDADD} ${LDADD}