[Openvpn-devel] configure.ac: simplify AC_CHECK_FUNCS statements

Message ID 20200121080828.1310-1-lstipakov@gmail.com
State Accepted
Headers show
Series
  • [Openvpn-devel] configure.ac: simplify AC_CHECK_FUNCS statements
Related show

Commit Message

Lev Stipakov Jan. 21, 2020, 8:08 a.m.
From: Lev Stipakov <lev@openvpn.net>

AC_CHECK_FUNCS checks availability of each function
in argument list and defines HAVE_function macro.
AC_CHECK_FUNC takes single function as an argument and
doesn't automatically define any macros.

When we check for availability of a single function and
define own macro, it is enough to use AC_CHECK_FUNC.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
---
 configure.ac | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Arne Schwabe Feb. 13, 2020, 9:36 a.m. | #1
Am 21.01.20 um 09:08 schrieb Lev Stipakov:
> From: Lev Stipakov <lev@openvpn.net>
> 
> AC_CHECK_FUNCS checks availability of each function
> in argument list and defines HAVE_function macro.
> AC_CHECK_FUNC takes single function as an argument and
> doesn't automatically define any macros.
> 
> When we check for availability of a single function and
> define own macro, it is enough to use AC_CHECK_FUNC.

Looks good to me

Acked-by: Arne Schwabe <arne@rfc2549.org>
Gert Doering Feb. 13, 2020, 7:21 p.m. | #2
Your patch has been applied to the master branch.

Very lighty tested with FreeBSD and Linux builds with mbedtls/openssl
"it builds and tests" (no idea if it produces the right result for 
the relevant library versions).

commit 91d84530d7eb24718b99478ebac6ba40b0615b28
Author: Lev Stipakov
Date:   Tue Jan 21 10:08:28 2020 +0200

     configure.ac: simplify AC_CHECK_FUNCS statements

     Signed-off-by: Lev Stipakov <lev@openvpn.net>
     Acked-by: Arne Schwabe <arne@rfc2549.org>
     Message-Id: <20200121080828.1310-1-lstipakov@gmail.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19333.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/configure.ac b/configure.ac
index 98fd39ce..3c057295 100644
--- a/configure.ac
+++ b/configure.ac
@@ -906,17 +906,17 @@  if test "${with_crypto_library}" = "openssl"; then
 	fi
 
 	have_crypto_aead_modes="yes"
-	AC_CHECK_FUNCS(
+	AC_CHECK_FUNC(
 		[EVP_aes_256_gcm],
 		,
-		[have_crypto_aead_modes="no"; break]
+		[have_crypto_aead_modes="no"]
 	)
 
 	have_export_keying_material="yes"
-	AC_CHECK_FUNCS(
+	AC_CHECK_FUNC(
 		[SSL_export_keying_material],
 		,
-		[have_export_keying_material="no"; break]
+		[have_export_keying_material="no"]
 	)
 
 	AC_CHECK_FUNCS(
@@ -1018,10 +1018,10 @@  elif test "${with_crypto_library}" = "mbedtls"; then
 	)
 
 	have_export_keying_material="yes"
-	AC_CHECK_FUNCS(
+	AC_CHECK_FUNC(
 		[mbedtls_ssl_conf_export_keys_ext_cb],
 		,
-		[have_export_keying_material="no"; break]
+		[have_export_keying_material="no"]
 	)
 
 	CFLAGS="${saved_CFLAGS}"