Skip to content
Permalink
Browse files

configure: set openssl & fmt flags with pkg_check_modules

  • Loading branch information...
binarytrails authored and aberaud committed Aug 27, 2019
1 parent 7ae3b3a commit 9b8358cdf1e0c39c6654074601a78756c9dea96f
Showing with 11 additions and 8 deletions.
  1. +8 −5 configure.ac
  2. +3 −3 src/Makefile.am
@@ -146,9 +146,6 @@ AS_IF([test "x$with_openssl" != "xno"],
[PKG_CHECK_MODULES([OpenSSL], [openssl >= 1.1], [have_openssl=yes], [have_openssl=no])],
[have_openssl=no])
AS_IF([test "x$have_openssl" = "xyes"], [
AC_SUBST(OpenSSL_CFLAGS, "")
AC_SUBST(OpenSSL_LIBS, "")
AC_SUBST(OpenSSL_LDFLAGS, "-lssl")
AC_MSG_NOTICE([Using OpenSSL])
], [
AC_MSG_NOTICE([Not using OpenSSL])
@@ -163,8 +160,14 @@ AS_IF([test "x$with_http_parser_fork" = "xyes"],[
])

AM_COND_IF([PROXY_CLIENT_OR_SERVER], [
AC_CHECK_HEADERS([asio.hpp], exit,, AC_MSG_ERROR([Missing Asio header files]))
PKG_CHECK_MODULES([Fmt], [fmt >= 5.3.0])
AC_CHECK_HEADERS([asio.hpp], exit,, AC_MSG_ERROR([Missing Asio headers files]))
CXXFLAGS="${CXXFLAGS} -DASIO_STANDALONE"
PKG_CHECK_MODULES([Fmt], [fmt >= 5.3.0], [have_fmt=yes], [have_fmt=no])
AS_IF([test "x$have_fmt" = "xyes"], [
AC_MSG_NOTICE([Using libfmt])
], [
AC_MSG_NOTICE([Missing libfmt files])
])
# http_parser has no pkgconfig, instead we check with:
AC_CHECK_LIB(http_parser, exit,, AC_MSG_ERROR([Missing HttpParser library files]))
AC_CHECK_HEADERS([http_parser.h], [http_parser_headers=yes; break;])
@@ -1,8 +1,8 @@
lib_LTLIBRARIES = libopendht.la

libopendht_la_CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/include/opendht @Argon2_CFLAGS@ @JsonCpp_CFLAGS@ @MsgPack_CFLAGS@ @OpenSSL_CFLAGS@
libopendht_la_LIBADD = @Argon2_LIBS@ @JsonCpp_LIBS@ @GnuTLS_LIBS@ @Nettle_LIBS@ @OpenSSL_LIBS@
libopendht_la_LDFLAGS = @LDFLAGS@ @Argon2_LDFLAGS@ @OpenSSL_LDFLAGS@ -version-number @OPENDHT_MAJOR_VERSION@:@OPENDHT_MINOR_VERSION@:@OPENDHT_PATCH_VERSION@
libopendht_la_CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/include/opendht @Argon2_CFLAGS@ @JsonCpp_CFLAGS@ @MsgPack_CFLAGS@ @OpenSSL_CFLAGS@ @Fmt_CFLAGS@
libopendht_la_LIBADD = @Argon2_LIBS@ @JsonCpp_LIBS@ @GnuTLS_LIBS@ @Nettle_LIBS@ @OpenSSL_LIBS@ @Fmt_LIBS@
libopendht_la_LDFLAGS = @LDFLAGS@ @Argon2_LDFLAGS@ @OpenSSL_LDFLAGS@ @Fmt_LDFLAGS@ -version-number @OPENDHT_MAJOR_VERSION@:@OPENDHT_MINOR_VERSION@:@OPENDHT_PATCH_VERSION@
libopendht_la_SOURCES = \
dht.cpp \
storage.h \

0 comments on commit 9b8358c

Please sign in to comment.
You can’t perform that action at this time.