Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ set( pkgconfigdir "${libdir}/pkgconfig" CACHE PATH "Path to pkgconfig directory.
#------------------------------------------------------------------------------
set( with-tests "yes" CACHE BOOL "Compile with unit tests." )

# Implement -Dwith-ssl and define WOLFSSL_USER_SETTINGS and output ${ssl}.
# Implement -Dwith-ssl and define WITH_SSL and output ${ssl}.
#------------------------------------------------------------------------------
set( with-ssl "yes" CACHE BOOL "Compile with internal ssl." )

if (with-ssl)
add_definitions( -DWOLFSSL_USER_SETTINGS )
add_definitions( -DWITH_SSL )
endif()

if (with-ssl)
set( ssl "-DWOLFSSL_USER_SETTINGS" )
set( ssl "-DWITH_SSL" )
endif()

# Implement -Denable-ndebug and define NDEBUG.
Expand All @@ -144,6 +144,7 @@ if (BUILD_SHARED_LIBS)
add_definitions( -DBOOST_ALL_DYN_LINK )
endif()

add_definitions( -DWOLFSSL_USER_SETTINGS )
if (BUILD_SHARED_LIBS)
set( Boost_USE_STATIC_LIBS "off" )
else()
Expand Down Expand Up @@ -553,6 +554,12 @@ if (with-tests)
"../../test/ssl/vectors/certs/server-ecc384-cert.pem"
"../../test/ssl/vectors/certs/server-ecc384-key.pem"
"../../test/ssl/vectors/certs/server-key.pem"
"../../test/ssl/vectors/certs/custom/client-ecc384.pfx"
"../../test/ssl/vectors/certs/custom/localhost-ecc256-cert.pem"
"../../test/ssl/vectors/certs/custom/localhost-ecc256-key.pem"
"../../test/ssl/vectors/certs/custom/localhost-ecc384-cert.pem"
"../../test/ssl/vectors/certs/custom/localhost-ecc384-key.pem"
"../../test/ssl/vectors/certs/custom/readme.txt"
"../../test/ssl/vectors/certs/custom/server-ecc384-key-enc.pem"
"../../test/ssl/vectors/certs/test/server-cert-ecc-badsig.pem"
"../../test/ssl/vectors/certs/test/server-cert-rsa-badsig.pem"
Expand Down
29 changes: 19 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ AC_ARG_WITH([tests],
AC_MSG_RESULT([$with_tests])
AM_CONDITIONAL([WITH_TESTS], [test x$with_tests != xno])

# Implement --with-ssl and define WOLFSSL_USER_SETTINGS and output ${ssl}.
# Implement --with-ssl and define WITH_SSL and output ${ssl}.
#------------------------------------------------------------------------------
AC_MSG_CHECKING([--with-ssl option])
AC_ARG_WITH([ssl],
Expand All @@ -107,8 +107,9 @@ AC_ARG_WITH([ssl],
[with_ssl=$withval],
[with_ssl=yes])
AC_MSG_RESULT([$with_ssl])
AS_CASE([${with_ssl}], [yes], AC_DEFINE([WOLFSSL_USER_SETTINGS]))
AS_CASE([${with_ssl}], [yes], AC_SUBST([ssl], [-DWOLFSSL_USER_SETTINGS]))
AS_CASE([${with_ssl}], [yes], AC_DEFINE([WITH_SSL]))
AS_CASE([${with_ssl}], [yes], AC_SUBST([ssl], [-DWITH_SSL]))
AS_CASE([${with_ssl}], [yes], AC_SUBST([ssl_include], [-I${includedir}/bitcoin/network/ssl]))

# Implement --enable-ndebug and define NDEBUG.
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -136,6 +137,16 @@ AC_ARG_ENABLE([isystem],
AC_MSG_RESULT([$enable_isystem])


# Set preprocessor defines.
#==============================================================================
# Conditionally define the preprocessor symbol WOLFSSL_USER_SETTINGS.
#------------------------------------------------------------------------------

AS_IF([test x${with_ssl} != "xno"], [
AC_DEFINE([WOLFSSL_USER_SETTINGS])
AC_SUBST([wolfssl], -DWOLFSSL_USER_SETTINGS])
])

# Set flags.
#==============================================================================
# Require c++20 for all c++ products.
Expand Down Expand Up @@ -251,15 +262,13 @@ AS_CASE([${with_tests}], [yes],

# Require bitcoin-system of at least version 4.0.0 and output ${bitcoin_system_CPPFLAGS/LIBS/PKG}.
#------------------------------------------------------------------------------
PKG_CHECK_MODULES([bitcoin_system], [libbitcoin-system >= 4.0.0],
[bitcoin_system_INCLUDEDIR="`$PKG_CONFIG --variable=includedir "libbitcoin-system >= 4.0.0" 2>/dev/null`"
bitcoin_system_OTHER_CFLAGS="`$PKG_CONFIG --cflags-only-other "libbitcoin-system >= 4.0.0" 2>/dev/null`"],
[AC_MSG_ERROR([libbitcoin-system >= 4.0.0 is required but was not found.])])
PKG_CHECK_MODULES([bitcoin_system], [libbitcoin-system >= 4.0.0], [],
[
AC_MSG_ERROR([libbitcoin-system >= 4.0.0 is required but was not found.])
])
AC_SUBST([bitcoin_system_PKG], ['libbitcoin-system >= 4.0.0'])
AC_SUBST([bitcoin_system_CPPFLAGS], [${bitcoin_system_CFLAGS}])
AS_IF([test x${bitcoin_system_INCLUDEDIR} != "x"],
[AC_SUBST([bitcoin_system_ISYS_CPPFLAGS], ["-isystem${bitcoin_system_INCLUDEDIR} ${bitcoin_system_OTHER_CFLAGS}"])],
[AC_SUBST([bitcoin_system_ISYS_CPPFLAGS], [${bitcoin_system_OTHER_CFLAGS}])])
AC_SUBST([bitcoin_system_ISYS_CPPFLAGS], [`echo ${bitcoin_system_CPPFLAGS} | $SED s/^-I/-isystem/g | $SED s/' -I'/' -isystem'/g`]])
AC_MSG_NOTICE([bitcoin_system_CPPFLAGS : ${bitcoin_system_CPPFLAGS}])
AC_MSG_NOTICE([bitcoin_system_ISYS_CPPFLAGS : ${bitcoin_system_ISYS_CPPFLAGS}])
AC_MSG_NOTICE([bitcoin_system_OTHER_CFLAGS : ${bitcoin_system_OTHER_CFLAGS}])
Expand Down
3 changes: 1 addition & 2 deletions libbitcoin-network.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@


# Metadata
#==============================================================================
Name: libbitcoin-network
Expand All @@ -29,7 +28,7 @@ Requires: libbitcoin-system >= 4.0.0

# Include directory and any other required compiler flags.
#------------------------------------------------------------------------------
Cflags: -I${includedir} @ssl@
Cflags: -I${includedir} @ssl_include@ @ssl@ @wolfssl@

# Lib directory, lib and any required that do not publish pkg-config.
#------------------------------------------------------------------------------
Expand Down
Loading