From: W.C.A. Wijngaards Date: Thu, 24 Aug 2023 10:51:16 +0000 (+0200) Subject: - dnsoverquic, fix to detect ngtcp2_crypto_quictls for openssl crypto, after X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1d3cea43d155f401dfe1cfcdeb9c371c645ae42;p=thirdparty%2Funbound.git - dnsoverquic, fix to detect ngtcp2_crypto_quictls for openssl crypto, after change in libngtcp2. --- diff --git a/configure b/configure index 3edb1e460..053bedd69 100755 --- a/configure +++ b/configure @@ -20090,7 +20090,7 @@ $as_echo "found in $dir" >&6; } $as_echo "#define HAVE_NGTCP2 1" >>confdefs.h - LIBS="$LIBS -lngtcp2 -lngtcp2_crypto_openssl" + LIBS="$LIBS -lngtcp2" break; fi done @@ -20138,6 +20138,86 @@ cat >>confdefs.h <<_ACEOF #define HAVE_DECL_NGTCP2_CRYPTO_ENCRYPT_CB $ac_have_decl _ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngtcp2_crypto_encrypt_cb in -lngtcp2_crypto_openssl" >&5 +$as_echo_n "checking for ngtcp2_crypto_encrypt_cb in -lngtcp2_crypto_openssl... " >&6; } +if ${ac_cv_lib_ngtcp2_crypto_openssl_ngtcp2_crypto_encrypt_cb+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lngtcp2_crypto_openssl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ngtcp2_crypto_encrypt_cb (); +int +main () +{ +return ngtcp2_crypto_encrypt_cb (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ngtcp2_crypto_openssl_ngtcp2_crypto_encrypt_cb=yes +else + ac_cv_lib_ngtcp2_crypto_openssl_ngtcp2_crypto_encrypt_cb=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ngtcp2_crypto_openssl_ngtcp2_crypto_encrypt_cb" >&5 +$as_echo "$ac_cv_lib_ngtcp2_crypto_openssl_ngtcp2_crypto_encrypt_cb" >&6; } +if test "x$ac_cv_lib_ngtcp2_crypto_openssl_ngtcp2_crypto_encrypt_cb" = xyes; then : + LIBS="$LIBS -lngtcp2_crypto_openssl" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngtcp2_crypto_encrypt_cb in -lngtcp2_crypto_quictls" >&5 +$as_echo_n "checking for ngtcp2_crypto_encrypt_cb in -lngtcp2_crypto_quictls... " >&6; } +if ${ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_encrypt_cb+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lngtcp2_crypto_quictls $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ngtcp2_crypto_encrypt_cb (); +int +main () +{ +return ngtcp2_crypto_encrypt_cb (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_encrypt_cb=yes +else + ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_encrypt_cb=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_encrypt_cb" >&5 +$as_echo "$ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_encrypt_cb" >&6; } +if test "x$ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_encrypt_cb" = xyes; then : + LIBS="$LIBS -lngtcp2_crypto_quictls" +fi + for ac_func in ngtcp2_crypto_encrypt_cb do : ac_fn_c_check_func "$LINENO" "ngtcp2_crypto_encrypt_cb" "ac_cv_func_ngtcp2_crypto_encrypt_cb" diff --git a/configure.ac b/configure.ac index 41ab566ef..9f09ad3b0 100644 --- a/configure.ac +++ b/configure.ac @@ -1518,7 +1518,7 @@ if test x_$withval = x_yes -o x_$withval != x_no; then fi AC_MSG_RESULT(found in $dir) AC_DEFINE([HAVE_NGTCP2], [1], [Define this to use ngtcp2.]) - LIBS="$LIBS -lngtcp2 -lngtcp2_crypto_openssl" + LIBS="$LIBS -lngtcp2" break; fi done @@ -1532,6 +1532,8 @@ if test x_$withval = x_yes -o x_$withval != x_no; then AC_CHECK_DECLS([ngtcp2_crypto_encrypt_cb], [], [], [AC_INCLUDES_DEFAULT #include ]) + AC_CHECK_LIB([ngtcp2_crypto_openssl], [ngtcp2_crypto_encrypt_cb], [ LIBS="$LIBS -lngtcp2_crypto_openssl" ]) + AC_CHECK_LIB([ngtcp2_crypto_quictls], [ngtcp2_crypto_encrypt_cb], [ LIBS="$LIBS -lngtcp2_crypto_quictls" ]) AC_CHECK_FUNCS([ngtcp2_crypto_encrypt_cb]) AC_CHECK_FUNCS([SSL_is_quic], [], [AC_MSG_ERROR([No QUIC support detected in OpenSSL. Need OpenSSL version with QUIC support to enable DNS over QUIC with libngtcp2.])]) fi