Merge pull request #1724 from nghttp2/compile-with-libressl-3.5
Compile with libressl 3.5
This commit is contained in:
commit
8d48686cec
|
@ -150,8 +150,18 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
autoreconf -i
|
autoreconf -i
|
||||||
./configure
|
./configure
|
||||||
- name: Configure cmake
|
- name: Configure cmake (Linux)
|
||||||
if: matrix.buildtool == 'cmake'
|
if: matrix.buildtool == 'cmake' && runner.os == 'Linux'
|
||||||
|
run: |
|
||||||
|
make dist
|
||||||
|
VERSION=$(grep PACKAGE_VERSION config.h | cut -d' ' -f3 | tr -d '"')
|
||||||
|
tar xf nghttp2-$VERSION.tar.gz
|
||||||
|
cd nghttp2-$VERSION
|
||||||
|
echo 'NGHTTP2_CMAKE_DIR='"$PWD" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
cmake -DENABLE_WERROR=1 -DWITH_MRUBY=1 -DWITH_NEVERBLEED=1 -DENABLE_APP=1 $EXTRA_CMAKE_OPTS -DCPPFLAGS="$CPPFLAGS" -DLDFLAGS="$LDFLAGS" .
|
||||||
|
- name: Configure cmake (MacOS)
|
||||||
|
if: matrix.buildtool == 'cmake' && runner.os == 'macOS'
|
||||||
run: |
|
run: |
|
||||||
make dist
|
make dist
|
||||||
VERSION=$(grep PACKAGE_VERSION config.h | cut -d' ' -f3 | tr -d '"')
|
VERSION=$(grep PACKAGE_VERSION config.h | cut -d' ' -f3 | tr -d '"')
|
||||||
|
@ -162,12 +172,17 @@ jobs:
|
||||||
# This fixes infamous 'stdio.h not found' error.
|
# This fixes infamous 'stdio.h not found' error.
|
||||||
echo 'SDKROOT='"$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
|
echo 'SDKROOT='"$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
|
||||||
|
|
||||||
cmake -DENABLE_WERROR=1 -DWITH_MRUBY=1 -DWITH_NEVERBLEED=1 -DENABLE_APP=1 $EXTRA_CMAKE_OPTS -DCPPFLAGS="$CPPFLAGS" -DLDFLAGS="$LDFLAGS" .
|
cmake -DENABLE_WERROR=1 -DWITH_MRUBY=1 -DENABLE_APP=1 $EXTRA_CMAKE_OPTS -DCPPFLAGS="$CPPFLAGS" -DLDFLAGS="$LDFLAGS" .
|
||||||
- name: Build nghttp2 with autotools
|
- name: Build nghttp2 with autotools (Linux)
|
||||||
if: matrix.buildtool == 'autotools'
|
if: matrix.buildtool == 'autotools' && runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" distcheck \
|
make -j"$(nproc)" distcheck \
|
||||||
DISTCHECK_CONFIGURE_FLAGS="--with-mruby --with-neverbleed --with-libev --enable-werror $EXTRA_AUTOTOOLS_OPTS CPPFLAGS=\"$CPPFLAGS\" LDFLAGS=\"$LDFLAGS\""
|
DISTCHECK_CONFIGURE_FLAGS="--with-mruby --with-neverbleed --with-libev --enable-werror $EXTRA_AUTOTOOLS_OPTS CPPFLAGS=\"$CPPFLAGS\" LDFLAGS=\"$LDFLAGS\""
|
||||||
|
- name: Build nghttp2 with autotools (MacOS)
|
||||||
|
if: matrix.buildtool == 'autotools' && runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
make -j"$(sysctl -n hw.ncpu)" distcheck \
|
||||||
|
DISTCHECK_CONFIGURE_FLAGS="--with-mruby --with-libev --enable-werror $EXTRA_AUTOTOOLS_OPTS CPPFLAGS=\"$CPPFLAGS\" LDFLAGS=\"$LDFLAGS\""
|
||||||
- name: Build nghttp2 with cmake
|
- name: Build nghttp2 with cmake
|
||||||
if: matrix.buildtool == 'cmake'
|
if: matrix.buildtool == 'cmake'
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -44,13 +44,13 @@ using namespace nghttp2;
|
||||||
|
|
||||||
namespace shrpx {
|
namespace shrpx {
|
||||||
|
|
||||||
#if !LIBRESSL_2_7_API && !OPENSSL_1_1_API
|
#if !LIBRESSL_3_5_API && !LIBRESSL_2_7_API && !OPENSSL_1_1_API
|
||||||
|
|
||||||
void *BIO_get_data(BIO *bio) { return bio->ptr; }
|
void *BIO_get_data(BIO *bio) { return bio->ptr; }
|
||||||
void BIO_set_data(BIO *bio, void *ptr) { bio->ptr = ptr; }
|
void BIO_set_data(BIO *bio, void *ptr) { bio->ptr = ptr; }
|
||||||
void BIO_set_init(BIO *bio, int init) { bio->init = init; }
|
void BIO_set_init(BIO *bio, int init) { bio->init = init; }
|
||||||
|
|
||||||
#endif // !LIBRESSL_2_7_API && !OPENSSL_1_1_API
|
#endif // !LIBRESSL_3_5_API && !LIBRESSL_2_7_API && !OPENSSL_1_1_API
|
||||||
|
|
||||||
Connection::Connection(struct ev_loop *loop, int fd, SSL *ssl,
|
Connection::Connection(struct ev_loop *loop, int fd, SSL *ssl,
|
||||||
MemchunkPool *mcpool, ev_tstamp write_timeout,
|
MemchunkPool *mcpool, ev_tstamp write_timeout,
|
||||||
|
@ -259,14 +259,14 @@ long shrpx_bio_ctrl(BIO *b, int cmd, long num, void *ptr) {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
int shrpx_bio_create(BIO *b) {
|
int shrpx_bio_create(BIO *b) {
|
||||||
#if OPENSSL_1_1_API
|
#if OPENSSL_1_1_API || LIBRESSL_3_5_API
|
||||||
BIO_set_init(b, 1);
|
BIO_set_init(b, 1);
|
||||||
#else // !OPENSSL_1_1_API
|
#else // !OPENSSL_1_1_API && !LIBRESSL_3_5_API
|
||||||
b->init = 1;
|
b->init = 1;
|
||||||
b->num = 0;
|
b->num = 0;
|
||||||
b->ptr = nullptr;
|
b->ptr = nullptr;
|
||||||
b->flags = 0;
|
b->flags = 0;
|
||||||
#endif // !OPENSSL_1_1_API
|
#endif // !OPENSSL_1_1_API && !LIBRESSL_3_5_API
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -277,17 +277,17 @@ int shrpx_bio_destroy(BIO *b) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !OPENSSL_1_1_API
|
#if !OPENSSL_1_1_API && !LIBRESSL_3_5_API
|
||||||
b->ptr = nullptr;
|
b->ptr = nullptr;
|
||||||
b->init = 0;
|
b->init = 0;
|
||||||
b->flags = 0;
|
b->flags = 0;
|
||||||
#endif // !OPENSSL_1_1_API
|
#endif // !OPENSSL_1_1_API && !LIBRESSL_3_5_API
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#if OPENSSL_1_1_API
|
#if OPENSSL_1_1_API || LIBRESSL_3_5_API
|
||||||
|
|
||||||
BIO_METHOD *create_bio_method() {
|
BIO_METHOD *create_bio_method() {
|
||||||
auto meth = BIO_meth_new(BIO_TYPE_FD, "nghttpx-bio");
|
auto meth = BIO_meth_new(BIO_TYPE_FD, "nghttpx-bio");
|
||||||
|
@ -302,7 +302,7 @@ BIO_METHOD *create_bio_method() {
|
||||||
return meth;
|
return meth;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !OPENSSL_1_1_API
|
#else // !OPENSSL_1_1_API && !LIBRESSL_3_5_API
|
||||||
|
|
||||||
BIO_METHOD *create_bio_method() {
|
BIO_METHOD *create_bio_method() {
|
||||||
static auto meth = new BIO_METHOD{
|
static auto meth = new BIO_METHOD{
|
||||||
|
@ -314,7 +314,7 @@ BIO_METHOD *create_bio_method() {
|
||||||
return meth;
|
return meth;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !OPENSSL_1_1_API
|
#endif // !OPENSSL_1_1_API && !LIBRESSL_3_5_API
|
||||||
|
|
||||||
void Connection::set_ssl(SSL *ssl) {
|
void Connection::set_ssl(SSL *ssl) {
|
||||||
tls.ssl = ssl;
|
tls.ssl = ssl;
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
# define LIBRESSL_IN_USE 1
|
# define LIBRESSL_IN_USE 1
|
||||||
# define LIBRESSL_LEGACY_API (LIBRESSL_VERSION_NUMBER < 0x20700000L)
|
# define LIBRESSL_LEGACY_API (LIBRESSL_VERSION_NUMBER < 0x20700000L)
|
||||||
# define LIBRESSL_2_7_API (LIBRESSL_VERSION_NUMBER >= 0x20700000L)
|
# define LIBRESSL_2_7_API (LIBRESSL_VERSION_NUMBER >= 0x20700000L)
|
||||||
|
# define LIBRESSL_3_5_API (LIBRESSL_VERSION_NUMBER >= 0x30500000L)
|
||||||
# else // !LIBRESSL_VERSION_NUMBER
|
# else // !LIBRESSL_VERSION_NUMBER
|
||||||
# define OPENSSL_1_1_API (OPENSSL_VERSION_NUMBER >= 0x1010000fL)
|
# define OPENSSL_1_1_API (OPENSSL_VERSION_NUMBER >= 0x1010000fL)
|
||||||
# define OPENSSL_1_1_1_API (OPENSSL_VERSION_NUMBER >= 0x10101000L)
|
# define OPENSSL_1_1_1_API (OPENSSL_VERSION_NUMBER >= 0x10101000L)
|
||||||
|
@ -40,6 +41,7 @@
|
||||||
# define LIBRESSL_IN_USE 0
|
# define LIBRESSL_IN_USE 0
|
||||||
# define LIBRESSL_LEGACY_API 0
|
# define LIBRESSL_LEGACY_API 0
|
||||||
# define LIBRESSL_2_7_API 0
|
# define LIBRESSL_2_7_API 0
|
||||||
|
# define LIBRESSL_3_5_API 0
|
||||||
# endif // !LIBRESSL_VERSION_NUMBER
|
# endif // !LIBRESSL_VERSION_NUMBER
|
||||||
|
|
||||||
#endif // OPENSSL_COMPAT_H
|
#endif // OPENSSL_COMPAT_H
|
||||||
|
|
Loading…
Reference in New Issue