Skip to content

Commit

Permalink
Merge pull request #233 from MrAnno/ci-smtp
Browse files Browse the repository at this point in the history
CI fixes
  • Loading branch information
OverOrion authored Aug 2, 2024
2 parents b664ad8 + 7d83542 commit 9b00d52
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/devshell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
--prefix=${SYSLOG_NG_INSTALL_DIR}
--enable-debug
--enable-all-modules
--disable-smtp
--disable-java
--disable-java-modules
--enable-ebpf
Expand Down Expand Up @@ -169,6 +170,7 @@ jobs:
--enable-linux-caps
--enable-manpages
--enable-all-modules
--disable-smtp
--disable-java
--disable-java-modules
--with-python=3
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ find_package(RabbitMQ)
if (RabbitMQ_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${RabbitMQ_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${RabbitMQ_LIBRARY})
check_include_file("rabbitmq-c/tcp_socket.h" SYSLOG_NG_HAVE_RABBITMQ_C_TCP_SOCKET_H)
check_symbol_exists(amqp_ssl_socket_set_verify_peer "amqp.h;amqp_ssl_socket.h" SYSLOG_NG_HAVE_AMQP_SSL_SOCKET_SET_VERIFY_PEER)
endif()

Expand Down
1 change: 1 addition & 0 deletions cmake/syslog-ng-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
#cmakedefine SYSLOG_NG_HAVE_GMTIME_R
#cmakedefine SYSLOG_NG_HAVE_LOCALTIME_R
#cmakedefine SYSLOG_NG_HAVE_AMQP_SSL_SOCKET_SET_VERIFY_PEER
#cmakedefine SYSLOG_NG_HAVE_RABBITMQ_C_TCP_SOCKET_H
#cmakedefine01 SYSLOG_NG_HAVE_INET_NTOA
#cmakedefine SYSLOG_NG_HAVE_MEMRCHR
#cmakedefine SYSLOG_NG_HAVE_O_LARGEFILE
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1677,10 +1677,16 @@ if test "$enable_amqp" = "yes" && test "$with_librabbitmq_client" = "no"; then
AC_MSG_ERROR([Could not find librabbitmq-c, and AMQP support was explicitly enabled.])
fi

CFLAGS_SAVE="$CFLAGS"
CFLAGS="$CFLAGS $LIBRABBITMQ_CFLAGS"
old_LIBS=$LIBS
LIBS=$LIBRABBITMQ_LIBS

AC_CHECK_FUNCS(amqp_ssl_socket_set_verify_peer)
AC_CHECK_HEADERS(rabbitmq-c/tcp_socket.h)

LIBS=$old_LIBS
CFLAGS="$CFLAGS_SAVE"

dnl ***************************************************************************
dnl rdkafka headers/libraries
Expand Down
8 changes: 8 additions & 0 deletions modules/afamqp/afamqp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

#include "afamqp.h"
#include "syslog-ng.h"
#include "messages.h"
#include "stats/stats-registry.h"
#include "logmsg/nvtable.h"
Expand All @@ -32,10 +33,17 @@
#include "timeutils/misc.h"
#include "compat/amqp-compat.h"

#ifdef SYSLOG_NG_HAVE_RABBITMQ_C_TCP_SOCKET_H
#include <rabbitmq-c/amqp.h>
#include <rabbitmq-c/framing.h>
#include <rabbitmq-c/tcp_socket.h>
#include <rabbitmq-c/ssl_socket.h>
#else
#include <amqp.h>
#include <amqp_framing.h>
#include <amqp_tcp_socket.h>
#include <amqp_ssl_socket.h>
#endif

typedef struct
{
Expand Down
4 changes: 4 additions & 0 deletions modules/afamqp/compat/amqp-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include "syslog-ng.h"
#include "compat/amqp-compat.h"

#ifdef SYSLOG_NG_HAVE_RABBITMQ_C_TCP_SOCKET_H
#include <rabbitmq-c/ssl_socket.h>
#else
#include <amqp_ssl_socket.h>
#endif

void
amqp_compat_set_verify(amqp_socket_t *self, gboolean verify)
Expand Down
7 changes: 7 additions & 0 deletions modules/afamqp/compat/amqp-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
#ifndef AFAMQP_COMPAT_H_INCLUDED
#define AFAMQP_COMPAT_H_INCLUDED

#include "syslog-ng.h"

#ifdef SYSLOG_NG_HAVE_RABBITMQ_C_TCP_SOCKET_H
#include <rabbitmq-c/amqp.h>
#else
#include <amqp.h>
#endif

void amqp_compat_set_verify(amqp_socket_t *self, gboolean verify);

#endif

0 comments on commit 9b00d52

Please sign in to comment.