1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/openssl] Fix OpenSSL::Engine build on Debian

On Debian 9 (“stretch”) the `OPENSSL_NO_STATIC_ENGINE` macro is not
defined, which causes all the `#if HAVE_ENGINE_LOAD_…` directives to
fail with `error: 'HAVE_ENGINE_LOAD_…' is not defined, evaluates to 0
[-Werror,-Wundef]` while building TruffleRuby.

We can accomplish the same thing with `#ifdef`, which (of course) works
fine when the `HAVE_ENGINE_LOAD…` macros are also undefined.

Upstreamed from , which fixed
.

https://github.com/ruby/openssl/commit/65e2adf1ac
This commit is contained in:
Tom Stuart 2021-03-24 09:32:15 +00:00 committed by Kazuki Yamaguchi
parent e2bf3659e1
commit 5ab2625243

View file

@ -101,48 +101,48 @@ ossl_engine_s_load(int argc, VALUE *argv, VALUE klass)
return Qtrue; return Qtrue;
} }
StringValueCStr(name); StringValueCStr(name);
#if HAVE_ENGINE_LOAD_DYNAMIC #ifdef HAVE_ENGINE_LOAD_DYNAMIC
OSSL_ENGINE_LOAD_IF_MATCH(dynamic, DYNAMIC); OSSL_ENGINE_LOAD_IF_MATCH(dynamic, DYNAMIC);
#endif #endif
#ifndef OPENSSL_NO_STATIC_ENGINE #ifndef OPENSSL_NO_STATIC_ENGINE
#if HAVE_ENGINE_LOAD_4758CCA #ifdef HAVE_ENGINE_LOAD_4758CCA
OSSL_ENGINE_LOAD_IF_MATCH(4758cca, 4758CCA); OSSL_ENGINE_LOAD_IF_MATCH(4758cca, 4758CCA);
#endif #endif
#if HAVE_ENGINE_LOAD_AEP #ifdef HAVE_ENGINE_LOAD_AEP
OSSL_ENGINE_LOAD_IF_MATCH(aep, AEP); OSSL_ENGINE_LOAD_IF_MATCH(aep, AEP);
#endif #endif
#if HAVE_ENGINE_LOAD_ATALLA #ifdef HAVE_ENGINE_LOAD_ATALLA
OSSL_ENGINE_LOAD_IF_MATCH(atalla, ATALLA); OSSL_ENGINE_LOAD_IF_MATCH(atalla, ATALLA);
#endif #endif
#if HAVE_ENGINE_LOAD_CHIL #ifdef HAVE_ENGINE_LOAD_CHIL
OSSL_ENGINE_LOAD_IF_MATCH(chil, CHIL); OSSL_ENGINE_LOAD_IF_MATCH(chil, CHIL);
#endif #endif
#if HAVE_ENGINE_LOAD_CSWIFT #ifdef HAVE_ENGINE_LOAD_CSWIFT
OSSL_ENGINE_LOAD_IF_MATCH(cswift, CSWIFT); OSSL_ENGINE_LOAD_IF_MATCH(cswift, CSWIFT);
#endif #endif
#if HAVE_ENGINE_LOAD_NURON #ifdef HAVE_ENGINE_LOAD_NURON
OSSL_ENGINE_LOAD_IF_MATCH(nuron, NURON); OSSL_ENGINE_LOAD_IF_MATCH(nuron, NURON);
#endif #endif
#if HAVE_ENGINE_LOAD_SUREWARE #ifdef HAVE_ENGINE_LOAD_SUREWARE
OSSL_ENGINE_LOAD_IF_MATCH(sureware, SUREWARE); OSSL_ENGINE_LOAD_IF_MATCH(sureware, SUREWARE);
#endif #endif
#if HAVE_ENGINE_LOAD_UBSEC #ifdef HAVE_ENGINE_LOAD_UBSEC
OSSL_ENGINE_LOAD_IF_MATCH(ubsec, UBSEC); OSSL_ENGINE_LOAD_IF_MATCH(ubsec, UBSEC);
#endif #endif
#if HAVE_ENGINE_LOAD_PADLOCK #ifdef HAVE_ENGINE_LOAD_PADLOCK
OSSL_ENGINE_LOAD_IF_MATCH(padlock, PADLOCK); OSSL_ENGINE_LOAD_IF_MATCH(padlock, PADLOCK);
#endif #endif
#if HAVE_ENGINE_LOAD_CAPI #ifdef HAVE_ENGINE_LOAD_CAPI
OSSL_ENGINE_LOAD_IF_MATCH(capi, CAPI); OSSL_ENGINE_LOAD_IF_MATCH(capi, CAPI);
#endif #endif
#if HAVE_ENGINE_LOAD_GMP #ifdef HAVE_ENGINE_LOAD_GMP
OSSL_ENGINE_LOAD_IF_MATCH(gmp, GMP); OSSL_ENGINE_LOAD_IF_MATCH(gmp, GMP);
#endif #endif
#if HAVE_ENGINE_LOAD_GOST #ifdef HAVE_ENGINE_LOAD_GOST
OSSL_ENGINE_LOAD_IF_MATCH(gost, GOST); OSSL_ENGINE_LOAD_IF_MATCH(gost, GOST);
#endif #endif
#endif #endif
#if HAVE_ENGINE_LOAD_CRYPTODEV #ifdef HAVE_ENGINE_LOAD_CRYPTODEV
OSSL_ENGINE_LOAD_IF_MATCH(cryptodev, CRYPTODEV); OSSL_ENGINE_LOAD_IF_MATCH(cryptodev, CRYPTODEV);
#endif #endif
OSSL_ENGINE_LOAD_IF_MATCH(openssl, OPENSSL); OSSL_ENGINE_LOAD_IF_MATCH(openssl, OPENSSL);