Skip to content

Commit

Permalink
add ssl dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
john30 committed Feb 8, 2022
1 parent 5ec5c3d commit 6fee17d
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v2
-
name: packages
run: sudo apt-get update && sudo apt-get install -y libmosquitto1 libmosquitto-dev
run: sudo apt-get update && sudo apt-get install -y libmosquitto1 libmosquitto-dev libssl1.1 libssl-dev
-
name: build
run: cmake -Dcoverage=1 -DBUILD_TESTING=1 . && make
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Building ebusd from the source requires the following packages and/or features:
* kernel with pselect or ppoll support
* glibc with argp support or argp-standalone
* libmosquitto-dev for MQTT support
* libssl-dev for SSL support

To start the build process, run these commands:
> ./autogen.sh
Expand Down
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ if test "x$with_mqtt" != "xno"; then
fi
AM_CONDITIONAL([MQTT], [test "x$with_mqtt" != "xno"])

AC_ARG_WITH(ssl, AS_HELP_STRING([--without-ssl], [disable support for SSL]), [], [with_ssl=yes])
if test "x$with_ssl" != "xno"; then
AC_CHECK_LIB([ssl], [OPENSSL_init_ssl],
[AC_CHECK_LIB([crypto], [CRYPTO_new_ex_data],
[AC_DEFINE_UNQUOTED(HAVE_SSL, [1], [Defined if SSL is enabled.])],
[AC_MSG_RESULT([Could not find CRYPTO_new_ex_data in libcrypto.])
with_ssl="no"])],
[AC_MSG_RESULT([Could not find SSL_library_init in libssl.])
with_ssl="no"])
fi
AM_CONDITIONAL([SSL], [test "x$with_ssl" != "xno"])

AC_MSG_CHECKING([for direct float format conversion])
AC_TRY_RUN(
[
Expand Down
4 changes: 2 additions & 2 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG BASE_IMAGE
FROM $BASE_IMAGE as build

RUN apt-get update && apt-get install -y \
libmosquitto-dev libstdc++6 libc6 libgcc1 \
libmosquitto-dev libssl-dev libstdc++6 libc6 libgcc1 \
curl \
autoconf automake g++ make git \
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -26,7 +26,7 @@ RUN ./make_debian.sh
FROM $BASE_IMAGE-slim as image

RUN apt-get update && apt-get install -y \
libmosquitto1 libstdc++6 libc6 libgcc1 \
libmosquitto1 libssl1.1 libstdc++6 libc6 libgcc1 \
&& rm -rf /var/lib/apt/lists/*

LABEL maintainer="[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions contrib/docker/Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG BASE_IMAGE
FROM $BASE_IMAGE as build

RUN apt-get update && apt-get install -y \
libmosquitto-dev libstdc++6 libc6 libgcc1 \
libmosquitto-dev libssl-dev libstdc++6 libc6 libgcc1 \
curl \
autoconf automake g++ make git \
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -26,7 +26,7 @@ RUN ./make_debian.sh
FROM $BASE_IMAGE-slim as image

RUN apt-get update && apt-get install -y \
libmosquitto1 libstdc++6 libc6 libgcc1 \
libmosquitto1 libssl1.1 libstdc++6 libc6 libgcc1 \
&& rm -rf /var/lib/apt/lists/*

LABEL maintainer="[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions contrib/docker/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG BASE_IMAGE
FROM $BASE_IMAGE as build

RUN apt-get update && apt-get install -y \
libmosquitto-dev libstdc++6 libc6 libgcc1 \
libmosquitto-dev libssl-dev libstdc++6 libc6 libgcc1 \
curl \
autoconf automake g++ make git \
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -26,7 +26,7 @@ RUN %EBUSD_MAKE%
FROM $BASE_IMAGE-slim as image

RUN apt-get update && apt-get install -y \
libmosquitto1 libstdc++6 libc6 libgcc1 \
libmosquitto1 libssl1.1 libstdc++6 libc6 libgcc1 \
&& rm -rf /var/lib/apt/lists/*

LABEL maintainer="[email protected]"
Expand Down
4 changes: 4 additions & 0 deletions make_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ else
mqtt=1
fi
fi
ldd $RELEASE/usr/bin/ebusd | egrep -q libssl.so.1.1
if [ $? -eq 0 ]; then
extralibs="$extralibs, libssl1.1 (>= 1.1.1)"
fi

if [ -n "$RUNTEST" ]; then
echo
Expand Down
4 changes: 4 additions & 0 deletions src/ebusd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ ebusd_LDADD = ../lib/utils/libutils.a \
-lpthread \
@EXTRA_LIBS@

if SSL
ebusd_LDADD += -lssl -lcrypto
endif

if CONTRIB
ebusd_LDADD += ../lib/ebus/contrib/libebuscontrib.a
endif
Expand Down

0 comments on commit 6fee17d

Please sign in to comment.