diff --git a/client/Makefile b/client/Makefile index 5c0c8402..9f71c3fe 100644 --- a/client/Makefile +++ b/client/Makefile @@ -29,6 +29,10 @@ ifeq ($(WITH_TLS),yes) STATIC_LDADD+= -lssl -lcrypto endif +ifeq ($(UNAME),AIX) + LOCAL_LDFLAGS+=-Wl,-bnoipath +endif + ifeq ($(WITH_SHARED_LIBRARIES),yes) ALL_DEPS:= mosquitto_pub mosquitto_sub mosquitto_rr else diff --git a/config.h b/config.h index c4330061..df67a056 100644 --- a/config.h +++ b/config.h @@ -12,6 +12,8 @@ # define _XOPEN_SOURCE 600 # define __BSD_VISIBLE 1 # define HAVE_NETINET_IN_H +#elif defined(_AIX) +# define HAVE_NETINET_IN_H #else # define _XOPEN_SOURCE 700 # define _DEFAULT_SOURCE 1 diff --git a/lib/cpp/Makefile b/lib/cpp/Makefile index 02ad35dd..a31c2809 100644 --- a/lib/cpp/Makefile +++ b/lib/cpp/Makefile @@ -1,8 +1,8 @@ R=../.. include ${R}/config.mk -ifneq ($(UNAME),SunOS) - LOCAL_LDFLAGS+=-Wl,-soname,libmosquittopp.so.${SOVERSION} +ifeq ($(or $(findstring $(UNAME),SunOS), $(findstring $(UNAME),AIX)),) +LOCAL_LDFLAGS+=-Wl,-soname,libmosquittopp.so.${SOVERSION} endif LOCAL_CPPFLAGS+= LOCAL_CXXFLAGS+=-fPIC @@ -24,7 +24,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}${libdir}/pkgconfig/" $(INSTALL) -m644 ${R}/libmosquittopp.pc.in "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc" diff --git a/lib/socks_mosq.c b/lib/socks_mosq.c index 2cfe142c..727c8a4c 100644 --- a/lib/socks_mosq.c +++ b/lib/socks_mosq.c @@ -30,7 +30,7 @@ Contributors: #else # include #endif -#if defined(__FreeBSD__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(_AIX) # include # include #endif diff --git a/man/mosquitto.conf.5.xml b/man/mosquitto.conf.5.xml index 1eb7a8c8..027cb912 100644 --- a/man/mosquitto.conf.5.xml +++ b/man/mosquitto.conf.5.xml @@ -1292,7 +1292,7 @@ accept_protocol_versions 3, 4 address/host part of the , then will take priority. - This option is not available on Windows. + This option is not available on Windows and AIX. Not reloaded on reload signal. diff --git a/plugins/plugin.mk b/plugins/plugin.mk index a5b26771..9ba54f24 100644 --- a/plugins/plugin.mk +++ b/plugins/plugin.mk @@ -6,6 +6,10 @@ LOCAL_CPPFLAGS+= LOCAL_LIBADD+= LOCAL_LDFLAGS+=-fPIC -shared +ifeq ($(UNAME),AIX) + LOCAL_LDFLAGS+=-Wl,-G +endif + binary : ${PLUGIN_NAME}.so ${PLUGIN_NAME}.a ${PLUGIN_NAME}.a : ${OBJS} ${OBJS_EXTERNAL} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f4a09d6e..cf801ee2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -260,6 +260,7 @@ if(UNIX) set_target_properties(mosquitto PROPERTIES LINK_FLAGS "-Wl,-exported_symbols_list -Wl,${mosquitto_SOURCE_DIR}/src/linker-macosx.syms" ) + elseif (${CMAKE_SYSTEM_NAME} MATCHES "AIX") else() set_target_properties(mosquitto PROPERTIES LINK_FLAGS "-Wl,-dynamic-list=${mosquitto_SOURCE_DIR}/src/linker.syms" diff --git a/src/Makefile b/src/Makefile index 65cefa70..defb269f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -11,12 +11,16 @@ LOCAL_LDADD+=-lcjson -lm ${LIBMOSQ_COMMON} # ------------------------------------------ # Platform specific # ------------------------------------------ -ifneq ($(or $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD), $(findstring $(UNAME),NetBSD)),) +ifneq ($(or $(findstring $(UNAME),AIX), $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD), $(findstring $(UNAME),NetBSD)),) LOCAL_LDFLAGS+=-Wl,--dynamic-list=linker.syms else LOCAL_LDADD+=-ldl endif +ifeq ($(UNAME),AIX) + LOCAL_LDFLAGS+=-Wl,-bE:linker-aix.syms +endif + ifeq ($(UNAME),Linux) LOCAL_LDADD+=-lrt LOCAL_LDFLAGS+=-Wl,--dynamic-list=linker.syms diff --git a/src/context.c b/src/context.c index f2b2d7c9..2e0b1a52 100644 --- a/src/context.c +++ b/src/context.c @@ -19,7 +19,7 @@ Contributors: #include "config.h" #include -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(_AIX) #include #endif diff --git a/src/linker-aix.syms b/src/linker-aix.syms new file mode 100644 index 00000000..7e8b6cd5 --- /dev/null +++ b/src/linker-aix.syms @@ -0,0 +1,81 @@ +mosquitto_apply_on_all_clients +mosquitto_broker_node_id_set +mosquitto_broker_publish +mosquitto_broker_publish_copy +mosquitto_callback_register +mosquitto_callback_unregister +mosquitto_calloc +mosquitto_client +mosquitto_client_address +mosquitto_client_certificate +mosquitto_client_clean_session +mosquitto_client_id +mosquitto_client_id_hashv +mosquitto_client_keepalive +mosquitto_client_port +mosquitto_client_protocol +mosquitto_client_protocol_version +mosquitto_client_sub_count +mosquitto_client_username +mosquitto_complete_basic_auth +mosquitto_control_command_reply +mosquitto_control_generic_callback +mosquitto_control_send_response +mosquitto_free +mosquitto_kick_client_by_clientid +mosquitto_kick_client_by_username +mosquitto_log_printf +mosquitto_log_vprintf +mosquitto_malloc +mosquitto_persist_base_msg_add +mosquitto_persist_base_msg_delete +mosquitto_persist_client_add +mosquitto_persist_client_delete +mosquitto_persist_client_msg_add +mosquitto_persist_client_msg_clear +mosquitto_persist_client_msg_delete +mosquitto_persist_client_msg_update +mosquitto_persist_client_update +mosquitto_persist_retain_msg_delete +mosquitto_persist_retain_msg_set +mosquitto_persistence_location +mosquitto_plugin_set_info +mosquitto_property_add_binary +mosquitto_property_add_byte +mosquitto_property_add_int16 +mosquitto_property_add_int32 +mosquitto_property_add_string +mosquitto_property_add_string_pair +mosquitto_property_add_varint +mosquitto_property_check_all +mosquitto_property_check_command +mosquitto_property_copy_all +mosquitto_property_free_all +mosquitto_property_identifier +mosquitto_property_identifier_to_string +mosquitto_property_next +mosquitto_property_read_binary +mosquitto_property_read_byte +mosquitto_property_read_int16 +mosquitto_property_read_int32 +mosquitto_property_read_string +mosquitto_property_read_string_pair +mosquitto_property_read_varint +mosquitto_pub_topic_check2 +mosquitto_pub_topic_check +mosquitto_realloc +mosquitto_set_clientid +mosquitto_set_username +mosquitto_strdup +mosquitto_string_to_property_info +mosquitto_strndup +mosquitto_sub_matches_acl +mosquitto_sub_matches_acl_with_pattern +mosquitto_sub_topic_check2 +mosquitto_sub_topic_check +mosquitto_subscription_add +mosquitto_subscription_delete +mosquitto_topic_matches_sub2 +mosquitto_topic_matches_sub +mosquitto_topic_matches_sub_with_pattern +mosquitto_validate_utf8 diff --git a/src/net.c b/src/net.c index 633f220b..60ed5eb2 100644 --- a/src/net.c +++ b/src/net.c @@ -20,7 +20,9 @@ Contributors: #ifndef WIN32 # include -# include +# ifndef _AIX +# include +# endif # include # include # include @@ -656,7 +658,7 @@ int net__tls_load_verify(struct mosquitto__listener *listener) } -#ifndef WIN32 +#if !defined(WIN32) && !defined(_AIX) static int net__bind_interface(struct mosquitto__listener *listener, struct addrinfo *rp) { /* @@ -805,7 +807,7 @@ static int net__socket_listen_tcp(struct mosquitto__listener *listener) return 1; } -#ifndef WIN32 +#if !defined(WIN32) && !defined(_AIX) if(listener->bind_interface){ /* It might be possible that an interface does not support all relevant sa_families. * We should successfully find at least one. */