Skip to content

Commit

Permalink
Add WITH_STRIP build option.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Jun 13, 2016
1 parent 6c87f7a commit d90cd58
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Client:
- Connections now default to using MQTT v3.1.1.
- Default to using port 8883 when using TLS.

Build:
- Add WITH_STRIP option (defaulting to "no") that when set to "yes" will strip
executables and shared libraries when installing.

1.4.7 - 20151221
================
Expand Down
4 changes: 2 additions & 2 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ client_shared.o : client_shared.c client_shared.h

install : all
$(INSTALL) -d ${DESTDIR}$(prefix)/bin
$(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} mosquitto_pub ${DESTDIR}${prefix}/bin/mosquitto_pub
$(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} mosquitto_sub ${DESTDIR}${prefix}/bin/mosquitto_sub
$(INSTALL) ${STRIP_OPTS} mosquitto_pub ${DESTDIR}${prefix}/bin/mosquitto_pub
$(INSTALL) ${STRIP_OPTS} mosquitto_sub ${DESTDIR}${prefix}/bin/mosquitto_sub

uninstall :
-rm -f ${DESTDIR}${prefix}/bin/mosquitto_pub
Expand Down
9 changes: 8 additions & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ WITH_DOCS:=yes
# Build with client support for SOCK5 proxy.
WITH_SOCKS:=yes

# Strip executables and shared libraries on install.
WITH_STRIP:=no

# =============================================================================
# End of user configuration
# =============================================================================
Expand All @@ -88,7 +91,6 @@ WITH_SOCKS:=yes
# Also bump lib/mosquitto.h, CMakeLists.txt,
# installer/mosquitto.nsi, installer/mosquitto64.nsi
VERSION=1.4.90
TIMESTAMP:=$(shell date "+%F %T%z")

# Client library SO version. Bump if incompatible API/ABI changes are made.
SOVERSION=1
Expand All @@ -97,6 +99,7 @@ SOVERSION=1
XSLTPROC=xsltproc
# For html generation
DB_HTML_XSL=man/html.xsl
TIMESTAMP:=$(shell date "+%F %T%z")

#MANCOUNTRIES=en_GB

Expand Down Expand Up @@ -254,3 +257,7 @@ prefix=/usr/local
mandir=${prefix}/share/man
localedir=${prefix}/share/locale
STRIP?=strip

ifeq ($(WITH_STRIP),yes)
STRIP_OPTS:=-s --strip-program=${CROSS_COMPILE}${STRIP}
endif
2 changes: 1 addition & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ all : libmosquitto.so.${SOVERSION} libmosquitto.a

install : all
$(INSTALL) -d ${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/
$(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} libmosquitto.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so.${SOVERSION}
$(INSTALL) ${STRIP_OPTS} libmosquitto.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so.${SOVERSION}
ln -sf libmosquitto.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so
$(INSTALL) -d ${DESTDIR}${prefix}/include/
$(INSTALL) mosquitto.h ${DESTDIR}${prefix}/include/mosquitto.h
Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ all : libmosquittopp.so.${SOVERSION}

install : all
$(INSTALL) -d ${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/
$(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} libmosquittopp.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}
$(INSTALL) ${STRIP_OPTS} libmosquittopp.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}
ln -sf libmosquittopp.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so
$(INSTALL) -d ${DESTDIR}${prefix}/include/
$(INSTALL) mosquittopp.h ${DESTDIR}${prefix}/include/mosquittopp.h
Expand Down
6 changes: 4 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,12 @@ mosquitto_passwd.o : mosquitto_passwd.c

install : all
$(INSTALL) -d ${DESTDIR}$(prefix)/sbin
$(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} mosquitto ${DESTDIR}${prefix}/sbin/mosquitto
$(INSTALL) ${STRIP_OPTS} mosquitto ${DESTDIR}${prefix}/sbin/mosquitto
$(INSTALL) -d ${DESTDIR}$(prefix)/include
$(INSTALL) mosquitto_plugin.h ${DESTDIR}${prefix}/include/mosquitto_plugin.h
ifeq ($(WITH_TLS),yes)
$(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} mosquitto_passwd ${DESTDIR}${prefix}/bin/mosquitto_passwd
$(INSTALL) -d ${DESTDIR}$(prefix)/bin
$(INSTALL) ${STRIP_OPTS} mosquitto_passwd ${DESTDIR}${prefix}/bin/mosquitto_passwd
endif

uninstall :
Expand Down

0 comments on commit d90cd58

Please sign in to comment.