From: "plaisthos (Code Review)" Date: Fri, 5 Jan 2024 12:24:26 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., gert@...1296..., a@...2181... Message-ID: <22dd6cbb2661840cc71e3b762b3a585937cc4bfc-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="rHyeBeQrOXU="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Make it more explicit and visible when pkg-config is not found List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: cron2 , flichtenheld Cc: openvpn-devel --rHyeBeQrOXU= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, flichtenheld, ordex, plaisthos. Hello cron2, flichtenheld, ordex, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/465?usp=3Demail to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review+2 by cron2, Code-Review-1 by ordex The change is no longer submittable: Code-Review and checks~ChecksSubmitRul= e are unsatisfied now. Change subject: Make it more explicit and visible when pkg-config is not fo= und ...................................................................... Make it more explicit and visible when pkg-config is not found Users seem to struggle to read the full error message. This adds an indication if pkg-config is actually found to the warning/error message that use pkg-config. On platforms that do not require pkg-config and for optional libraries, the existence of pkg-config is mentioned as part of the error/warning messa= ge. When found: configure: error: libnl-genl-3.0 package not found or too old. Is the d= evelopment package and pkg-config (/usr/bin/pkg-config) installed? Must be = version 3.4.0 or newer for DCO not found: configure: error: libnl-genl-3.0 package not found or too old. Is the d= evelopment package and pkg-config (not found) installed? Must be version 3.= 4.0 or newer for DCO On platforms where pkg-config is required (only Linux at the moment), configure will abort when not detecting pkg-config: checking for pkg-config... no configure: error: pkg-config is required Change-Id: Iebaa35a23e217a4cd7739af229cbfc08a3d8854a Signed-off-by: Arne Schwabe --- M configure.ac 1 file changed, 17 insertions(+), 5 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/65/465/4 diff --git a/configure.ac b/configure.ac index f420612..17e2f49 100644 --- a/configure.ac +++ b/configure.ac @@ -323,6 +323,7 @@ AM_CONDITIONAL([TARGET_LINUX], [true]) AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["L"], [Target prefix]) have_sitnl=3D"yes" + pkg_config_required=3D"yes" ;; *-*-solaris*) AC_DEFINE([TARGET_SOLARIS], [1], [Are we running on Solaris?]) @@ -376,6 +377,16 @@ AM_CONDITIONAL([CROSS_COMPILING], test "${cross_compiling}" =3D "yes") PKG_PROG_PKG_CONFIG +# Add variable to print if pkg-config is found or not. Users often miss th= at +if test "${PKG_CONFIG}" =3D ""; then + if test "${pkg_config_required}" =3D "yes"; then + AC_MSG_ERROR([pkg-config is required]) + fi + pkg_config_found=3D"(not found)" +else + pkg_config_found=3D"(${PKG_CONFIG})" +fi + AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S @@ -810,7 +821,7 @@ [libnl-genl-3.0 >=3D 3.4.0], [have_libnl=3D"yes"], [ - AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the = development package and pkg-config installed? Must be version 3.4.0 or newe= r for DCO]) + AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the = development package and pkg-config ${pkg_config_found} installed? Must be v= ersion 3.4.0 or newer for DCO]) ] ) CFLAGS=3D"${CFLAGS} ${LIBNL_GENL_CFLAGS}" @@ -854,10 +865,11 @@ dnl case "$host" in *-*-linux*) + # We require pkg-config PKG_CHECK_MODULES([LIBCAPNG], [libcap-ng], [], - [AC_MSG_ERROR([libcap-ng package not found. Is the development packa= ge and pkg-config installed?])] + [AC_MSG_ERROR([libcap-ng package not found. Is the development packa= ge and pkg-config ${pkg_config_found} installed?])] ) AC_CHECK_HEADER([sys/prctl.h],,[AC_MSG_ERROR([sys/prctl.h not found!])]) @@ -878,7 +890,7 @@ [OPENSSL], [openssl >=3D 1.0.2], [have_openssl=3D"yes"], - [] # If this fails, we will do another test next + [AC_MSG_WARN([OpenSSL not found by pkg-config ${pkg_config_found}])] # = If this fails, we will do another test next ) OPENSSL_LIBS=3D${OPENSSL_LIBS:--lssl -lcrypto} fi @@ -1083,7 +1095,7 @@ [WOLFSSL], [wolfssl], [], - [AC_MSG_ERROR([Could not find wolfSSL.])] + [AC_MSG_ERROR([Could not find wolfSSL using pkg-config ${pkg_config_fou= nd}])] ) PKG_CHECK_VAR( [WOLFSSL_INCLUDEDIR], @@ -1508,7 +1520,7 @@ PKG_CHECK_MODULES( [CMOCKA], [cmocka], [have_cmocka=3D"yes"], - [AC_MSG_WARN([cmocka.pc not found on the system. Unit tests disabled])] + [AC_MSG_WARN([cmocka.pc not found on the system using pkg-config ${pkg_co= nfig_found}. Unit tests disabled])] ) AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" =3D "yes" = -a "${have_cmocka}" =3D "yes" ]) AC_SUBST([ENABLE_UNITTESTS]) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/465?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: Iebaa35a23e217a4cd7739af229cbfc08a3d8854a Gerrit-Change-Number: 465 Gerrit-PatchSet: 4 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Attention: flichtenheld Gerrit-Attention: ordex Gerrit-MessageType: newpatchset --rHyeBeQrOXU= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: cron2, flichtenheld, ordex, plais= thos.

plaisthos uploaded patch set #4 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/465?usp=3Demail">View Chang= e

The following approvals got outdated and were removed: Code-Review+2 by cron2, Code-Review-1 by ordex

The change is no longe= r submittable: Code-Review and checks~ChecksSubmitRule are unsatisfied now.=

Make it more explicit and visible when pkg-config is not found

User= s seem to struggle to read the full error message. This adds an
indicati= on if pkg-config is actually found to the warning/error message
that use= pkg-config.

On platforms that do not require pkg-config and for opt= ional libraries,
the existence of pkg-config is mentioned as part of the= error/warning message.

When found:

configure: error: lib= nl-genl-3.0 package not found or too old. Is the development package and pk= g-config (/usr/bin/pkg-config) installed? Must be version 3.4.0 or newer fo= r DCO

not found:

configure: error: libnl-genl-3.0 package= not found or too old. Is the development package and pkg-config (not found= ) installed? Must be version 3.4.0 or newer for DCO

On platforms whe= re pkg-config is required (only Linux at the moment),
configure will abo= rt when not detecting pkg-config:

checking for pkg-config... no
c= onfigure: error: pkg-config is required

Change-Id: Iebaa35a23e217a4c= d7739af229cbfc08a3d8854a
Signed-off-by: Arne Schwabe <arne@...1227...= >
---
M configure.ac
1 file changed, 17 insertions(+), 5 deleti= ons(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/chang=
es/65/465/4
diff --git a/configure.ac b/configure.ac
index f420612..17e2f49 100644
--- a/configure.ac+++ b/configure.ac
@@ -323,6 +323,7 @@
AM_CONDITIONAL([TARGET_LINUX], [true])
AC_DEFINE_= UNQUOTED([TARGET_PREFIX], ["L"], [Target prefix])
have_sitnl=3D"yes"
+ pkg_config_required=3D"yes"
;;<= /span>
*-*-solaris*)
AC_DEFINE([TARGET_SOLARI= S], [1], [Are we running on Solaris?])
@@ -376,6 +377,16 @@=
AM_CONDITIONAL([CROSS_COMPILING], test "${cross_comp= iling}" =3D "yes")

PKG_PR= OG_PKG_CONFIG
+# Add = variable to print if pkg-config is found or not. Users often miss that

+if test "${PKG_CONF= IG}" =3D ""; then
+ if test "${pkg_config_required}" =3D "yes&q= uot;; then
+ A= C_MSG_ERROR([pkg-config is required])
+ fi
+ pkg_config_found=3D"(not found)"
+else
+ pkg_config_found=3D"(${PKG_CONFIG})"
+fi
+
AC_PROG_CPP
<= span> AC_PROG_INSTALL

AC_PROG_LN_S
@@ -810= ,7 +821,7 @@
[libnl-genl-3.0 >=3D 3.4.0],=
[have_libnl=3D"yes"],
[=
- AC_MSG_ERROR(= [libnl-genl-3.0 package not found or too old. Is the development package an= d pkg-config installed? Must be version 3.4.0 or newer for DCO])
= + AC_MSG_ERROR([libnl-ge= nl-3.0 package not found or too old. Is the development package and pkg-con= fig ${pkg_config_found} installed? Must be version 3.4.0 or newer for DCO])=
]
)
CFLA= GS=3D"${CFLAGS} ${LIBNL_GENL_CFLAGS}"
@@ -854,10 = +865,11 @@
dnl
case "$host" in<= /span>
*-*-linux*)
+ # We require pkg-config
PKG_CHECK_MODULES([L= IBCAPNG],
[libcap-ng],
[],
- [AC_MSG_ERROR([lib= cap-ng package not found. Is the development package and pkg-config install= ed?])]
+ [AC_MSG= _ERROR([libcap-ng package not found. Is the development package and pkg-con= fig ${pkg_config_found} installed?])]
)
= AC_CHECK_HEADER([sys/prctl.h],,[AC_MSG_ERROR([sys/prctl.h not found!])])=

@@ -878,7 +890,7 @@
= [OPENSSL],
[openssl >=3D 1.0.2],
= [have_openssl=3D"yes"],
- [] # If this fails, we will do another test next
= + [AC_MSG_WARN([OpenSSL not f= ound by pkg-config ${pkg_config_found}])] # If this fails, we will do anoth= er test next
)
OPENSSL_LIBS=3D${OPENS= SL_LIBS:--lssl -lcrypto}
fi
@@ -1083,7 +1= 095,7 @@
[WOLFSSL],
[wolfssl],
[],
- = [AC_MSG_ERROR([Could not find wolfSSL.])]
+ [AC_MSG_ERROR([Could not find wolfSSL using pkg-c= onfig ${pkg_config_found}])]
)
PKG_CH= ECK_VAR(
[WOLFSSL_INCLUDEDIR],
@@ -1508= ,7 +1520,7 @@
PKG_CHECK_MODULES(
[CMOCKA= ], [cmocka],
[have_cmocka=3D"yes"],
<= span style=3D"color: hsl(0, 100%, 40%);">- [AC_MSG_WARN([cmocka.pc not foun= d on the system. Unit tests disabled])]

+ [AC_MSG_WARN([cmocka.pc not found on the system using= pkg-config ${pkg_config_found}. Unit tests disabled])]
)=
AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_u= nit_tests}" =3D "yes" -a "${have_cmocka}" =3D &quo= t;yes" ])
AC_SUBST([ENABLE_UNITTESTS])

To view, visit change 465. To unsubscribe, or for help wri= ting mail filters, visit set= tings.

=
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iebaa35a23e217a4cd7739af229c= bfc08a3d8854a
Gerrit-Change-Number: 465
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <a@...2181...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: cron2 <gert@...1296...>= ;
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: ordex <a@...2181...> <= /div>
Gerrit-MessageType: newpatchset
--rHyeBeQrOXU=--