Enable building on AIX

The AIX operating system by IBM does not provide the getifaddrs function
and requires a custom linker script syntax. This commit allows for a
basic GCC build on AIX 7.2.

The build was tested using the command lines

make CC=gcc WITH_CJSON=no WITH_DOCS=no WITH_STATIC_LIBRARIES=yes
and
CC=gcc cmake <srcpath> -DDOCUMENTATION=no

At this point, the persistence test suite seems to fail. The library, as
well as the mosquitto_sub and mosquitto_pub executables were tested and
appear to be functional.

Signed-off-by: Andreas Kempf <aakempf@gmail.com>
This commit is contained in:
Andreas Kempf
2022-05-18 17:20:41 +02:00
committed by Andreas Kempf
parent 26b007f3fc
commit 28e3495012
9 changed files with 58 additions and 7 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
R=../..
include ${R}/config.mk
ifneq ($(UNAME),SunOS)
ifneq ($(and $(findstring $(UNAME),SunOS), $(findstring $(UNAME),AIX)),)
LIB_LDFLAGS:=$(LDFLAGS) -Wl,-soname,libmosquittopp.so.${SOVERSION}
endif
@@ -21,7 +21,9 @@ install : all
ln -sf libmosquittopp.so.${SOVERSION} "${DESTDIR}${libdir}/libmosquittopp.so"
ifeq ($(WITH_STATIC_LIBRARIES),yes)
$(INSTALL) libmosquittopp.a "${DESTDIR}${libdir}/libmosquittopp.a"
ifneq ($(UNAME),AIX)
${CROSS_COMPILE}${STRIP} -g --strip-unneeded "${DESTDIR}${libdir}/libmosquittopp.a"
endif
endif
$(INSTALL) -d "${DESTDIR}${incdir}/"
$(INSTALL) ${R}/include/mosquittopp.h "${DESTDIR}${incdir}/mosquittopp.h"