From: "flichtenheld (Code Review)" Date: Thu, 27 Jun 2024 16:53:11 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <869e7a84d0034d95718c1cd9b1454753bc8118b2-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="6tGpGIf/QB4="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: configure: Try to use pkg-config to detect mbedTLS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --6tGpGIf/QB4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/671?usp=3Demail to review the following change. Change subject: configure: Try to use pkg-config to detect mbedTLS ...................................................................... configure: Try to use pkg-config to detect mbedTLS mbedTLS does not seem to have pkg-config support on e.g. Debian/Ubuntu, so we definitely need to keep the fallback check as well. Change-Id: I5d0da76018e874cda5dbab9202a2b817ad5e4692 Signed-off-by: Frank Lichtenheld --- M configure.ac 1 file changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/71/671/1 diff --git a/configure.ac b/configure.ac index 555c97e..b2d27cd 100644 --- a/configure.ac +++ b/configure.ac @@ -1000,14 +1000,21 @@ if test -z "${MBEDTLS_CFLAGS}" -a -z "${MBEDTLS_LIBS}"; then # if the user did not explicitly specify flags, try to autodetect - LIBS=3D"${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto" - AC_CHECK_LIB( - [mbedtls], - [mbedtls_ssl_init], - [MBEDTLS_LIBS=3D"-lmbedtls -lmbedx509 -lmbedcrypto"], - [AC_MSG_ERROR([Could not find mbed TLS.])], - [${PKCS11_HELPER_LIBS}] + PKG_CHECK_MODULES([MBEDTLS], + [mbedtls >=3D 2.0.0 mbedx509 >=3D 2.0.0 mbedcrypto >=3D 2.0.0], + [have_mbedtls=3D"yes"], + [LIBS=3D"${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto"] ) + # mbedtls might not have pkgconfig integration, so try manually + if test "${have_mbedtls}" !=3D "yes"; then + AC_CHECK_LIB( + [mbedtls], + [mbedtls_ssl_init], + [MBEDTLS_LIBS=3D"-lmbedtls -lmbedx509 -lmbedcrypto"], + [AC_MSG_ERROR([Could not find mbed TLS.])], + [${PKCS11_HELPER_LIBS}] + ) + fi fi CFLAGS=3D"${MBEDTLS_CFLAGS} ${PKCS11_HELPER_CFLAGS} ${CFLAGS}" -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/671?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I5d0da76018e874cda5dbab9202a2b817ad5e4692 Gerrit-Change-Number: 671 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --6tGpGIf/QB4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

Vi= ew Change

configure: Try to use pkg-config to detect mbedTLS

mbe= dTLS does not seem to have pkg-config support on e.g.
Debian/Ubuntu, so = we definitely need to keep the
fallback check as well.

Change-Id:= I5d0da76018e874cda5dbab9202a2b817ad5e4692
Signed-off-by: Frank Lichtenh= eld <frank@...2641...>
---
M configure.ac
1 file changed, 14= insertions(+), 7 deletions(-)

git pull ssh://gerrit.openvpn.net:=
29418/openvpn refs/changes/71/671/1
diff --git a/configure.ac b/con=
figure.ac
index 555c97e..b2d27cd 100644
---= a/configure.ac
+++ b/configure.ac
@@ -1000= ,14 +1000,21 @@

if test -z "${MBED= TLS_CFLAGS}" -a -z "${MBEDTLS_LIBS}"; then
= # if the user did not explicitly specify flags, try to autodetect<= br>- LIBS=3D"${LIBS} -lmbed= tls -lmbedx509 -lmbedcrypto"
- AC_CHECK_LIB(
- [mbedtls],
- = [mbedtls_ssl_init],
- = [MBEDTLS_LIBS=3D"-lmbedtls -lmbedx509 -lmbedcrypto"],- [AC_MSG_ERROR([Could not fin= d mbed TLS.])],
- [${= PKCS11_HELPER_LIBS}]
= + PKG_CHECK_MODULES([MBEDTLS],
+ [mbedtls >=3D 2.0.0 mbedx509 >=3D 2.0.0 mbedcrypto >= ;=3D 2.0.0],
+ [hav= e_mbedtls=3D"yes"],
+ [LIBS=3D"${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto"]=
)
+ # mbedtls might not have pkgconfig integration, so try manually<= br>+ if test &qu= ot;${have_mbedtls}" !=3D "yes"; then
+ AC_CHECK_LIB(
+ [mbedtls],
+ [mbedtls_ssl_init],
+ [MBEDTLS_LIBS=3D"-lmbedtls -lmbedx50= 9 -lmbedcrypto"],
+ [${PKCS11_HELPER_LIBS}]
+ )
+ fi
fi
<= br> CFLAGS=3D"${MBEDTLS_CFLAGS} ${PKCS11_HELPER_CFLAGS} ${CFLAG= S}"

To view, visit change 671. To unsub= scribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5d0da76018e874cda5dbab9202a= 2b817ad5e4692
Gerrit-Change-Number: 671
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--6tGpGIf/QB4=--