iotivity 0.9.0
[platform/upstream/iotivity.git] / service / protocol-plugin / plugins / mqtt-fan / lib / config.mk
1 # =============================================================================
2 # User configuration section.
3 #
4 # Largely, these are options that are designed to make mosquitto run more
5 # easily in restrictive environments by removing features.
6 #
7 # Modify the variable below to enable/disable features.
8 #
9 # Can also be overriden at the command line, e.g.:
10 #
11 # make WITH_TLS=no
12 # =============================================================================
13
14 # Uncomment to compile the broker with tcpd/libwrap support.
15 #WITH_WRAP:=yes
16
17 # Comment out to disable SSL/TLS support in the broker and client.
18 # Disabling this will also mean that passwords must be stored in plain text. It
19 # is strongly recommended that you only disable WITH_TLS if you are not using
20 # password authentication at all.
21 WITH_TLS:=yes
22
23 # Comment out to disable TLS/PSK support in the broker and client. Requires
24 # WITH_TLS=yes.
25 # This must be disabled if using openssl < 1.0.
26 WITH_TLS_PSK:=yes
27
28 # Comment out to disable client client threading support.
29 WITH_THREADING:=yes
30
31 # Uncomment to compile the broker with strict protocol support. This means that
32 # both the client library and the broker will be very strict about protocol
33 # compliance on incoming data. Neither of them will return an error on
34 # incorrect "remaining length" values if this is commented out. The old
35 # behaviour (prior to 0.12) is equivalent to compiling with
36 # WITH_STRICT_PROTOCOL defined and means that clients will be immediately
37 # disconnected from the broker on non-compliance.
38 #WITH_STRICT_PROTOCOL:=yes
39
40 # Comment out to remove bridge support from the broker. This allow the broker
41 # to connect to other brokers and subscribe/publish to topics. You probably
42 # want to leave this included unless you want to save a very small amount of
43 # memory size and CPU time.
44 WITH_BRIDGE:=yes
45
46 # Comment out to remove persistent database support from the broker. This
47 # allows the broker to store retained messages and durable subscriptions to a
48 # file periodically and on shutdown. This is usually desirable (and is
49 # suggested by the MQTT spec), but it can be disabled if required.
50 WITH_PERSISTENCE:=yes
51
52 # Comment out to remove memory tracking support from the broker. If disabled,
53 # mosquitto won't track heap memory usage nor export '$SYS/broker/heap/current
54 # size', but will use slightly less memory and CPU time.
55 WITH_MEMORY_TRACKING:=yes
56
57 # Compile with database upgrading support? If disabled, mosquitto won't
58 # automatically upgrade old database versions.
59 # Not currently supported.
60 #WITH_DB_UPGRADE:=yes
61
62 # Comment out to remove publishing of the $SYS topic hierarchy containing
63 # information about the broker state.
64 WITH_SYS_TREE:=yes
65
66 # Build with Python module. Comment out if Python is not installed, or required
67 # Python modules are not available.
68 WITH_PYTHON:=yes
69
70 # Build with SRV lookup support.
71 WITH_SRV:=no
72
73 # =============================================================================
74 # End of user configuration
75 # =============================================================================
76
77
78 # Also bump lib/mosquitto.h, lib/python/setup.py, CMakeLists.txt,
79 # installer/mosquitto.nsi, installer/mosquitto-cygwin.nsi
80 VERSION=1.3.1
81 TIMESTAMP:=$(shell date "+%F %T%z")
82
83 # Client library SO version. Bump if incompatible API/ABI changes are made.
84 SOVERSION=1
85
86 # Man page generation requires xsltproc and docbook-xsl
87 XSLTPROC=xsltproc
88 # For html generation
89 DB_HTML_XSL=man/html.xsl
90
91 #MANCOUNTRIES=en_GB
92
93 UNAME:=$(shell uname -s)
94 ifeq ($(UNAME),SunOS)
95         ifeq ($(CC),cc)
96                 CFLAGS?=-O
97         else
98                 CFLAGS?=-Wall -ggdb -O2
99         endif
100 else
101         CFLAGS?=-Wall -ggdb -O2
102 endif
103
104 LIB_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I. -I.. -I./lib
105 LIB_CXXFLAGS:=$(LIB_CFLAGS) ${CPPFLAGS}
106 LIB_LDFLAGS:=${LDFLAGS}
107
108 BROKER_CFLAGS:=${LIB_CFLAGS} ${CPPFLAGS} -DVERSION="\"${VERSION}\"" -DTIMESTAMP="\"${TIMESTAMP}\"" -DWITH_BROKER
109 CLIENT_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I./lib -DVERSION="\"${VERSION}\""
110
111 ifeq ($(UNAME),FreeBSD)
112         BROKER_LIBS:=-lm
113 else
114         BROKER_LIBS:=-ldl -lm
115 endif
116 LIB_LIBS:=
117 PASSWD_LIBS:=
118
119 ifeq ($(UNAME),Linux)
120         BROKER_LIBS:=$(BROKER_LIBS) -lrt
121         LIB_LIBS:=$(LIB_LIBS) -lrt
122 endif
123
124 CLIENT_LDFLAGS:=$(LDFLAGS) -L./lib ./lib/libmosquitto.so.${SOVERSION}
125
126 ifeq ($(UNAME),SunOS)
127         ifeq ($(CC),cc)
128                 LIB_CFLAGS:=$(LIB_CFLAGS) -xc99 -KPIC
129         else
130                 LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC
131         endif
132
133         ifeq ($(CXX),CC)
134                 LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -KPIC
135         else
136                 LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC
137         endif
138 else
139         LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC
140         LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC
141 endif
142
143 ifneq ($(UNAME),SunOS)
144         LIB_LDFLAGS:=$(LIB_LDFLAGS) -Wl,-soname,libmosquitto.so.$(SOVERSION)
145 endif
146
147 ifeq ($(UNAME),QNX)
148         BROKER_LIBS:=$(BROKER_LIBS) -lsocket
149         LIB_LIBS:=$(LIB_LIBS) -lsocket
150 endif
151
152 ifeq ($(WITH_WRAP),yes)
153         BROKER_LIBS:=$(BROKER_LIBS) -lwrap
154         BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_WRAP
155 endif
156
157 ifeq ($(WITH_TLS),yes)
158         BROKER_LIBS:=$(BROKER_LIBS) -lssl -lcrypto
159         LIB_LIBS:=$(LIB_LIBS) -lssl -lcrypto
160         BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_TLS
161         LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_TLS
162         PASSWD_LIBS:=-lcrypto
163         CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_TLS
164
165         ifeq ($(WITH_TLS_PSK),yes)
166                 BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_TLS_PSK
167                 LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_TLS_PSK
168                 CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_TLS_PSK
169         endif
170 endif
171
172 ifeq ($(WITH_THREADING),yes)
173         LIB_LIBS:=$(LIB_LIBS) -lpthread
174         LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_THREADING
175 endif
176
177 ifeq ($(WITH_STRICT_PROTOCOL),yes)
178         LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_STRICT_PROTOCOL
179         BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_STRICT_PROTOCOL
180 endif
181
182 ifeq ($(WITH_BRIDGE),yes)
183         BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_BRIDGE
184 endif
185
186 ifeq ($(WITH_PERSISTENCE),yes)
187         BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_PERSISTENCE
188 endif
189
190 ifeq ($(WITH_MEMORY_TRACKING),yes)
191         ifneq ($(UNAME),SunOS)
192                 BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_MEMORY_TRACKING
193         endif
194 endif
195
196 #ifeq ($(WITH_DB_UPGRADE),yes)
197 #       BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_DB_UPGRADE
198 #endif
199
200 ifeq ($(WITH_SYS_TREE),yes)
201         BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_SYS_TREE
202 endif
203
204 ifeq ($(WITH_SRV),yes)
205         LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_SRV
206         LIB_LIBS:=$(LIB_LIBS) -lcares
207 endif
208
209 ifeq ($(UNAME),SunOS)
210         BROKER_LIBS:=$(BROKER_LIBS) -lsocket -lnsl
211         LIB_LIBS:=$(LIB_LIBS) -lsocket -lnsl
212 endif
213
214
215 INSTALL?=install
216 prefix=/usr/local
217 mandir=${prefix}/share/man
218 localedir=${prefix}/share/locale