]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
configure.ac: emit feature summary as C macro
authorDaiki Ueno <ueno@gnu.org>
Sun, 16 Jan 2022 11:17:39 +0000 (12:17 +0100)
committerDaiki Ueno <ueno@gnu.org>
Sun, 16 Jan 2022 16:58:32 +0000 (17:58 +0100)
Signed-off-by: Daiki Ueno <ueno@gnu.org>
configure.ac

index a4f8c183ae69b36e783926a8bbe9333778931afc..ef4878d7ea357dce0f14a44f871aa58ae294dd78 100644 (file)
@@ -864,7 +864,7 @@ AM_CONDITIONAL(P11KIT_0_23_11_API, $PKG_CONFIG --atleast-version=0.23.11 p11-kit
 
 AM_CONDITIONAL(ENABLE_PKCS11, test "$with_p11_kit" != "no")
 
-AC_ARG_WITH(tpm,
+AC_ARG_WITH(tpm2,
        AS_HELP_STRING([--without-tpm2],
                [Disable TPM2 support.]),
        [with_tpm2=$withval], [with_tpm2=auto])
@@ -1142,6 +1142,70 @@ AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
 
 AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
 
+hw_features=
+if test "$enable_cryptodev" = yes; then
+       hw_features="$hw_features cryptodev"
+fi
+if test "$enable_afalg" = yes; then
+       hw_features="$hw_features afalg"
+fi
+if test "$use_padlock" = yes; then
+       hw_features="$hw_features padlock"
+fi
+if test "$with_p11_kit" = yes; then
+       hw_features="$hw_features pkcs11"
+fi
+if test "$with_tpm" = yes; then
+       hw_features="$hw_features tpm"
+fi
+if test "$have_tpm2" = yes; then
+       hw_features="$hw_features tpm2"
+fi
+if test "$enable_ktls" = yes; then
+       hw_features="$hw_features ktls"
+fi
+hw_features=`eval 'expr "$hw_features" : " \(.*\)"'`
+AC_DEFINE_UNQUOTED([HW_FEATURES], ["$hw_features"],
+       [The enabled hardware features])
+
+tls_features=
+if test "$ac_enable_ssl3" = yes; then
+       tls_features="$tls_features ssl3"
+fi
+if test "$ac_enable_ssl2" = yes; then
+       tls_features="$tls_features ssl2-compat"
+fi
+if test "$ac_enable_srtp" = yes; then
+       tls_features="$tls_features srtp"
+fi
+if test "$ac_enable_alpn" = yes; then
+       tls_features="$tls_features alpn"
+fi
+if test "$ac_enable_ocsp" = yes; then
+       tls_features="$tls_features ocsp"
+fi
+if test "$ac_enable_srp" = yes; then
+       tls_features="$tls_features srp"
+fi
+if test "$ac_enable_psk" = yes; then
+       tls_features="$tls_features psk"
+fi
+if test "$ac_enable_dhe" = yes; then
+       tls_features="$tls_features dhe"
+fi
+if test "$ac_enable_ecdhe" = yes; then
+       tls_features="$tls_features ecdhe"
+fi
+if test "$ac_enable_anon" = yes; then
+       tls_features="$tls_features auth-anon"
+fi
+if test "$ac_enable_heartbeat" = yes; then
+       tls_features="$tls_features heartbeat"
+fi
+tls_features=`eval 'expr "$tls_features" : " \(.*\)"'`
+AC_DEFINE_UNQUOTED([TLS_FEATURES], ["$tls_features"],
+       [The enabled TLS features])
+
 AC_DEFINE([fread_file], [_gnutls_fread_file], [static lib rename])
 AC_DEFINE([read_file], [_gnutls_read_file], [static lib rename])