Various build improvements to help packaging.

pull/975/head
Roger A. Light 7 years ago
parent f7474d3482
commit 59bd07627d

@ -5,6 +5,9 @@ Broker:
- Elevate log level to warning for situation when socket limit is hit. - Elevate log level to warning for situation when socket limit is hit.
- Remove requirement to use `user root` in snap package config files. - Remove requirement to use `user root` in snap package config files.
Build:
- Various fixes to ease building.
1.5.2 - 20180919 1.5.2 - 20180919
================ ================

@ -1,10 +1,19 @@
#ifndef CONFIG_H #ifndef CONFIG_H
/* ============================================================ /* ============================================================
* Control compile time options. * Platform options
* ============================================================ * ============================================================ */
*
* Compile time options have moved to config.mk. #ifdef __APPLE__
*/ # define __DARWIN_C_SOURCE
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__SYMBIAN32__) || defined(__QNX__)
# define _XOPEN_SOURCE 700
# define __BSD_VISIBLE 1
# define HAVE_NETINET_IN_H
#else
# define _XOPEN_SOURCE 700
# define _DEFAULT_SOURCE 1
# define _POSIX_C_SOURCE 200809L
#endif
/* ============================================================ /* ============================================================
@ -27,16 +36,4 @@
#define uthash_malloc(sz) mosquitto__malloc(sz) #define uthash_malloc(sz) mosquitto__malloc(sz)
#define uthash_free(ptr,sz) mosquitto__free(ptr) #define uthash_free(ptr,sz) mosquitto__free(ptr)
#ifdef __APPLE__
# define __DARWIN_C_SOURCE
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__SYMBIAN32__) || defined(__QNX__)
# define _XOPEN_SOURCE 700
# define __BSD_VISIBLE 1
# define HAVE_NETINET_IN_H
#else
# define _XOPEN_SOURCE 700
# define _DEFAULT_SOURCE 1
# define _POSIX_C_SOURCE 200809L
#endif
#endif #endif

@ -275,9 +275,11 @@ ifeq ($(WITH_WEBSOCKETS),static)
endif endif
INSTALL?=install INSTALL?=install
prefix=/usr/local prefix?=/usr/local
mandir=${prefix}/share/man incdir?=${prefix}/include
localedir=${prefix}/share/locale libdir?=${prefix}/lib${LIB_SUFFIX}
localedir?=${prefix}/share/locale
mandir?=${prefix}/share/man
STRIP?=strip STRIP?=strip
ifeq ($(WITH_STRIP),yes) ifeq ($(WITH_STRIP),yes)

@ -48,25 +48,24 @@ all : ${ALL_DEPS}
$(MAKE) -C cpp $(MAKE) -C cpp
install : all install : all
$(INSTALL) -d "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/" $(INSTALL) -d "${DESTDIR}${libdir}/"
$(INSTALL) ${STRIP_OPTS} libmosquitto.so.${SOVERSION} "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so.${SOVERSION}" $(INSTALL) ${STRIP_OPTS} libmosquitto.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquitto.so.${SOVERSION}"
ln -sf libmosquitto.so.${SOVERSION} "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so" ln -sf libmosquitto.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquitto.so"
ifeq ($(WITH_STATIC_LIBRARIES),yes) ifeq ($(WITH_STATIC_LIBRARIES),yes)
$(INSTALL) libmosquitto.a "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.a" $(INSTALL) ${STRIP_OPTS} libmosquitto.a "${DESTDIR}${libdir}/libmosquitto.a"
${CROSS_COMPILE}${STRIP} -g --strip-unneeded "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.a"
endif endif
$(INSTALL) -d "${DESTDIR}${prefix}/include/" $(INSTALL) -d "${DESTDIR}${incdir}/"
$(INSTALL) mosquitto.h "${DESTDIR}${prefix}/include/mosquitto.h" $(INSTALL) mosquitto.h "${DESTDIR}${incdir}/mosquitto.h"
$(INSTALL) -d "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig" $(INSTALL) -d "${DESTDIR}${libdir}/pkgconfig"
$(INSTALL) -m644 ../libmosquitto.pc.in "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig/libmosquitto.pc" $(INSTALL) -m644 ../libmosquitto.pc.in "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc"
sed -i -e "s#@CMAKE_INSTALL_PREFIX@#$(prefix)#" -e "s#@VERSION@#$(VERSION)#" "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig/libmosquitto.pc" sed -i -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc"
$(MAKE) -C cpp install $(MAKE) -C cpp install
uninstall : uninstall :
-rm -f "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so.${SOVERSION}" -rm -f "${DESTDIR}${libdir}/libmosquitto.so.${SOVERSION}"
-rm -f "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so" -rm -f "${DESTDIR}${libdir}/libmosquitto.so"
-rm -f "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.a" -rm -f "${DESTDIR}${libdir}/libmosquitto.a"
-rm -f "${DESTDIR}${prefix}/include/mosquitto.h" -rm -f "${DESTDIR}${incdir}/mosquitto.h"
reallyclean : clean reallyclean : clean

@ -15,24 +15,24 @@ endif
all : ${ALL_DEPS} all : ${ALL_DEPS}
install : all install : all
$(INSTALL) -d "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/" $(INSTALL) -d "${DESTDIR}${libdir}/"
$(INSTALL) ${STRIP_OPTS} libmosquittopp.so.${SOVERSION} "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}" $(INSTALL) ${STRIP_OPTS} libmosquittopp.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquittopp.so.${SOVERSION}"
ln -sf libmosquittopp.so.${SOVERSION} "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so" ln -sf libmosquittopp.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquittopp.so"
ifeq ($(WITH_STATIC_LIBRARIES),yes) ifeq ($(WITH_STATIC_LIBRARIES),yes)
$(INSTALL) libmosquittopp.a "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.a" $(INSTALL) libmosquittopp.a "${DESTDIR}${libdir}/libmosquittopp.a"
${CROSS_COMPILE}${STRIP} -g --strip-unneeded "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.a" ${CROSS_COMPILE}${STRIP} -g --strip-unneeded "${DESTDIR}${libdir}/libmosquittopp.a"
endif endif
$(INSTALL) -d "${DESTDIR}${prefix}/include/" $(INSTALL) -d "${DESTDIR}${incdir}/"
$(INSTALL) mosquittopp.h "${DESTDIR}${prefix}/include/mosquittopp.h" $(INSTALL) mosquittopp.h "${DESTDIR}${incdir}/mosquittopp.h"
$(INSTALL) -d "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig" $(INSTALL) -d "${DESTDIR}${libdir}/pkgconfig/"
$(INSTALL) -m644 ../../libmosquittopp.pc.in "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig/libmosquittopp.pc" $(INSTALL) -m644 ../../libmosquittopp.pc.in "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc"
sed -i -e "s#@CMAKE_INSTALL_PREFIX@#$(prefix)#" -e "s#@VERSION@#$(VERSION)#" "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig/libmosquittopp.pc" sed -i -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc"
uninstall : uninstall :
-rm -f "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}" -rm -f "${DESTDIR}${libdir}/libmosquittopp.so.${SOVERSION}"
-rm -f "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so" -rm -f "${DESTDIR}${libdir}/libmosquittopp.so"
-rm -f "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.a" -rm -f "${DESTDIR}${libdir}/libmosquittopp.a"
-rm -f "${DESTDIR}${prefix}/include/mosquittopp.h" -rm -f "${DESTDIR}${incdir}/mosquittopp.h"
clean : clean :
-rm -f *.o libmosquittopp.so.${SOVERSION} libmosquittopp.a -rm -f *.o libmosquittopp.so.${SOVERSION} libmosquittopp.a

Loading…
Cancel
Save