Skip to content

Commit 5f1bfae

Browse files
author
Ian Craggs
committed
Merge branch 'develop'
2 parents 08e3029 + d2c4751 commit 5f1bfae

File tree

4 files changed

+38
-24
lines changed

4 files changed

+38
-24
lines changed

Makefile

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@
2323
SHELL = /bin/sh
2424
.PHONY: clean, mkdir, install, uninstall, html
2525

26+
ifndef release.version
27+
release.version = 1.0.3
28+
endif
29+
30+
# determine current platform
31+
BUILD_TYPE ?= debug
32+
ifeq ($(OS),Windows_NT)
33+
OSTYPE ?= $(OS)
34+
MACHINETYPE ?= $(PROCESSOR_ARCHITECTURE)
35+
else
36+
OSTYPE ?= $(shell uname -s)
37+
MACHINETYPE ?= $(shell uname -m)
38+
build.level = $(shell date)
39+
endif # OS
40+
ifeq ($(OSTYPE),linux)
41+
OSTYPE = Linux
42+
endif
43+
2644
# assume this is normally run in the main Paho directory
2745
ifndef srcdir
2846
srcdir = src
@@ -78,19 +96,6 @@ MQTTLIB_CS = paho-mqtt3cs
7896
MQTTLIB_A = paho-mqtt3a
7997
MQTTLIB_AS = paho-mqtt3as
8098

81-
# determine current platform
82-
BUILD_TYPE ?= debug
83-
ifeq ($(OS),Windows_NT)
84-
OSTYPE ?= $(OS)
85-
MACHINETYPE ?= $(PROCESSOR_ARCHITECTURE)
86-
else
87-
OSTYPE ?= $(shell uname -s)
88-
MACHINETYPE ?= $(shell uname -m)
89-
endif # OS
90-
ifeq ($(OSTYPE),linux)
91-
OSTYPE = Linux
92-
endif
93-
9499
CC ?= gcc
95100

96101
ifndef INSTALL
@@ -121,6 +126,8 @@ LDFLAGS_AS = $(LDFLAGS) -shared $(START_GROUP) -lpthread $(EXTRA_LIB) -lssl -lcr
121126

122127
ifeq ($(OSTYPE),Linux)
123128

129+
SED_COMMAND = sed -i "s/\#\#MQTTCLIENT_VERSION_TAG\#\#/${release.version}/g; s/\#\#MQTTCLIENT_BUILD_TAG\#\#/${build.level}/g"
130+
124131
MQTTCLIENT_INIT = MQTTClient_init
125132
MQTTASYNC_INIT = MQTTAsync_init
126133
START_GROUP = -Wl,--start-group
@@ -135,6 +142,8 @@ LDFLAGS_AS += -Wl,-soname,lib${MQTTLIB_AS}.so.${MAJOR_VERSION} -Wl,-no-whole-arc
135142

136143
else ifeq ($(OSTYPE),Darwin)
137144

145+
SED_COMMAND = sed -i "" -e "s/\#\#MQTTCLIENT_VERSION_TAG\#\#/${release.version}/g" -e "s/\#\#MQTTCLIENT_BUILD_TAG\#\#/${build.level}/g"
146+
138147
MQTTCLIENT_INIT = _MQTTClient_init
139148
MQTTASYNC_INIT = _MQTTAsync_init
140149
START_GROUP =
@@ -181,21 +190,25 @@ ${ASYNC_SAMPLES}: ${blddir}/samples/%: ${srcdir}/samples/%.c $(MQTTLIB_A_TARGET)
181190
${CC} -o $@ $< -l${MQTTLIB_A} ${FLAGS_EXE}
182191

183192
${MQTTLIB_C_TARGET}: ${SOURCE_FILES_C} ${HEADERS_C}
193+
$(SED_COMMAND) $(srcdir)/MQTTClient.c
184194
${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_C} ${LDFLAGS_C}
185195
-ln -s lib$(MQTTLIB_C).so.${VERSION} ${blddir}/lib$(MQTTLIB_C).so.${MAJOR_VERSION}
186196
-ln -s lib$(MQTTLIB_C).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_C).so
187197

188198
${MQTTLIB_CS_TARGET}: ${SOURCE_FILES_CS} ${HEADERS_C}
199+
$(SED_COMMAND) $(srcdir)/MQTTClient.c
189200
${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_CS} -DOPENSSL ${LDFLAGS_CS}
190201
-ln -s lib$(MQTTLIB_CS).so.${VERSION} ${blddir}/lib$(MQTTLIB_CS).so.${MAJOR_VERSION}
191202
-ln -s lib$(MQTTLIB_CS).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_CS).so
192203

193204
${MQTTLIB_A_TARGET}: ${SOURCE_FILES_A} ${HEADERS_A}
205+
$(SED_COMMAND) $(srcdir)/MQTTAsync.c
194206
${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_A} ${LDFLAGS_A}
195207
-ln -s lib$(MQTTLIB_A).so.${VERSION} ${blddir}/lib$(MQTTLIB_A).so.${MAJOR_VERSION}
196208
-ln -s lib$(MQTTLIB_A).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_A).so
197209

198210
${MQTTLIB_AS_TARGET}: ${SOURCE_FILES_AS} ${HEADERS_A}
211+
$(SED_COMMAND) $(srcdir)/MQTTAsync.c
199212
${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_AS} -DOPENSSL ${LDFLAGS_AS}
200213
-ln -s lib$(MQTTLIB_AS).so.${VERSION} ${blddir}/lib$(MQTTLIB_AS).so.${MAJOR_VERSION}
201214
-ln -s lib$(MQTTLIB_AS).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_AS).so

src/MQTTAsync.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2014 IBM Corp.
2+
* Copyright (c) 2009, 2015 IBM Corp.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -23,7 +23,7 @@
2323
* @cond MQTTAsync_main
2424
* @mainpage Asynchronous MQTT client library for C
2525
*
26-
* &copy; Copyright IBM Corp. 2009, 2014
26+
* &copy; Copyright IBM Corp. 2009, 2015
2727
*
2828
* @brief An Asynchronous MQTT client library for C.
2929
*
@@ -447,7 +447,7 @@ DLLExport int MQTTAsync_setCallbacks(MQTTAsync handle, void* context, MQTTAsync_
447447
* @param serverURI A null-terminated string specifying the server to
448448
* which the client will connect. It takes the form <i>protocol://host:port</i>.
449449
* <i>protocol</i> must be <i>tcp</i> or <i>ssl</i>. For <i>host</i>, you can
450-
* specify either an IP address or a domain name. For instance, to connect to
450+
* specify either an IP address or a host name. For instance, to connect to
451451
* a server running on the local machines with the default MQTT port, specify
452452
* <i>tcp://localhost:1883</i>.
453453
* @param clientId The client identifier passed to the server when the

src/MQTTClient.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2014 IBM Corp.
2+
* Copyright (c) 2009, 2015 IBM Corp.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -38,7 +38,7 @@
3838
* @endcond
3939
* @cond MQTTClient_main
4040
* @mainpage MQTT Client library for C
41-
* &copy; Copyright IBM Corp. 2009, 2014
41+
* &copy; Copyright IBM Corp. 2009, 2015
4242
*
4343
* @brief An MQTT client library in C.
4444
*
@@ -370,8 +370,9 @@ DLLExport int MQTTClient_setCallbacks(MQTTClient handle, void* context, MQTTClie
370370
* this function.
371371
* @param serverURI A null-terminated string specifying the server to
372372
* which the client will connect. It takes the form <i>protocol://host:port</i>.
373-
* Currently, <i>protocol</i> must be <i>tcp</i>. For <i>host</i>, you can
374-
* specify either an IP address or a domain name. For instance, to connect to
373+
* Currently, <i>protocol</i> must be <i>tcp</i> or <i>ssl</i>.
374+
* For <i>host</i>, you can
375+
* specify either an IP address or a host name. For instance, to connect to
375376
* a server running on the local machines with the default MQTT port, specify
376377
* <i>tcp://localhost:1883</i>.
377378
* @param clientId The client identifier passed to the server when the
@@ -567,13 +568,13 @@ typedef struct
567568
*/
568569
MQTTClient_willOptions* will;
569570
/**
570-
* MQTT servers that support the MQTT v3.1 protocol provide authentication
571+
* MQTT servers that support the MQTT v3.1.1 protocol provide authentication
571572
* and authorisation by user name and password. This is the user name
572573
* parameter.
573574
*/
574575
const char* username;
575576
/**
576-
* MQTT servers that support the MQTT v3.1 protocol provide authentication
577+
* MQTT servers that support the MQTT v3.1.1 protocol provide authentication
577578
* and authorisation by user name and password. This is the password
578579
* parameter.
579580
*/

src/MQTTVersion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2012, 2014 IBM Corp.
2+
* Copyright (c) 2012, 2015 IBM Corp.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -178,7 +178,7 @@ void printEyecatchers(char* filename)
178178
int main(int argc, char** argv)
179179
{
180180
printf("MQTTVersion: print the version strings of an MQTT client library\n");
181-
printf("Copyright (c) 2013 IBM Corp.\n");
181+
printf("Copyright (c) 2012, 2015 IBM Corp.\n");
182182

183183
if (argc == 1)
184184
{

0 commit comments

Comments
 (0)