]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- dnsoverquic, fix to detect ngtcp2_crypto_quictls for openssl crypto, after
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 24 Aug 2023 10:51:16 +0000 (12:51 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 24 Aug 2023 10:51:16 +0000 (12:51 +0200)
  change in libngtcp2.

configure
configure.ac

index 3edb1e46026558b1c1d9f739071e82e6d3db9f94..053bedd69fefc329a05000d3ff0493abc2918d7b 100755 (executable)
--- 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"
index 41ab566efcef9dddb27e03717d355203a241c11c..9f09ad3b0bd8c67a42a36a22982c70064e402069 100644 (file)
@@ -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 <ngtcp2/ngtcp2_crypto.h>
     ])
+    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