From patchwork Thu Jan 4 16:30:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3549 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:2791:b0:100:d2e5:60d with SMTP id hm17csp3265058dyb; Thu, 4 Jan 2024 08:31:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEguwpcpZ46Tjk+UBjrzDiSimQimuiT/YkQiM6Shpb6ptvroz7ro0Bgmt5vCMXYn5Sy1iTh X-Received: by 2002:a05:6a20:3c8c:b0:195:123c:d5b9 with SMTP id b12-20020a056a203c8c00b00195123cd5b9mr1607997pzj.4.1704385861450; Thu, 04 Jan 2024 08:31:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704385861; cv=none; d=google.com; s=arc-20160816; b=o6ZGVGJQo6p+iriU6s7Zoy9EBjCiQhcnETLthXwoxfhGCsR4pfcp2P/3lbzZUdEelq ITJs1uqzlDB/9K17vPtkWWjgC8+91iwg/dMpD2Top5u/YiLvy6uNQWLVHJXEVm3TdGEY 1tThqwae4SFuFsC3ZXuJEQDOaJSyMe9fMrLbxRvndu4Uh4eIvhft3ttfVBGwdT1gHwYT BOrcq/TtLRfeRZz5vMAOggpBlO64/2pmcO/lzsTuvF0WcTxpUrBQiSWoeThV0ro8rqNw 1g3Za39IHYVAUVh9jPqTuMgw/OBvildNpkOWvfopf/bm/FWfUJ4R9DaTNiK6UzW7daC4 qzMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=jqaOMET7e2DouKQaJeueLNEyVuTt2mXx8G6+GybzaAk=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=HMGBDlxH7UeHu2ROFs2DRqspKGcDWs0f2eE7nS8tk5eu5oyuV0iVA5wwSUc/D61nLb YMUwP7eetQae3QoktMeI2aGYrOu+pbGaSNO/sAtyyl2vFQZise4/lGsZtzidk+azfFpY lMoDTjfrFBv+IZqZziNBQFPUNWx4BbyXUp81yUp0x3uqauAgt7jfolUsvseWqhVfYxnC /AtrgZGc63vi1nTiKRdUOgFvrOHnoNUtToNktuYRbwmM3QXX5LwmiPUy6czj6R47//cP +mUohGqFWG4pOmAaFJUf/fFffB6rju+FDCoe/lQeY+A94lXL6octZ7Qu/+o/xuXEjxBU bjew== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=U2QfrTv1; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eSw3misw; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id l123-20020a632581000000b005cdfc9d11b8si20795472pgl.647.2024.01.04.08.31.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2024 08:31:01 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=U2QfrTv1; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eSw3misw; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rLQc7-0006dZ-KZ; Thu, 04 Jan 2024 16:30:36 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rLQc5-0006dN-4d for openvpn-devel@lists.sourceforge.net; Thu, 04 Jan 2024 16:30:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=i/RgJ4OUxHRK/KKCArL79RSbiv7WYhv8Jw/KVmAp004=; b=U2QfrTv1ncqW41eiEYe6rs2Ecl vV+YRq0FcMm03jdWlsdL0SGdK+Y5OBcfZfI+Jn9d8DFQNtBCdXFCda/GBDpmzTFXJ9oSe07yZwaR0 3s7HaotmO4DmmCi94ptv/9wUJquHVQte2X6ggZSZm4HwxINDaEyVIzlCeq5bTcpIj7mo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=i/RgJ4OUxHRK/KKCArL79RSbiv7WYhv8Jw/KVmAp004=; b=eSw3misw8mBehIwnvyWIG75Lbu opFwNpzzrjPf70VplVtFM6RHBau0hpr9uRGqoKjiUapcwHtf5GUrVllaikkPGdm4MABWoxIZmupBe yt8mOZmw11L4x57tGp0vQEcL65N5s88MvuDYVi7spHBIBvisg8IEb7JM5q7Uz6+wv5MM=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rLQc1-0008MF-H8 for openvpn-devel@lists.sourceforge.net; Thu, 04 Jan 2024 16:30:33 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 404GUMBT022885 for ; Thu, 4 Jan 2024 17:30:22 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 404GUM7x022884 for openvpn-devel@lists.sourceforge.net; Thu, 4 Jan 2024 17:30:22 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 4 Jan 2024 17:30:21 +0100 Message-ID: <20240104163022.22875-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe 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 message. Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1rLQc1-0008MF-H8 Subject: [Openvpn-devel] [PATCH v3] Make it more explicit and visible when pkg-config is not found X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1785163904632683307?= X-GMAIL-MSGID: =?utf-8?q?1787178109215563639?= From: Arne Schwabe 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 message. When found: configure: error: libnl-genl-3.0 package not found or too old. Is the development package and pkg-config (using /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 development 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 Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/465 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/configure.ac b/configure.ac index f420612..f009fe2 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="yes" + pkg_config_required="yes" ;; *-*-solaris*) AC_DEFINE([TARGET_SOLARIS], [1], [Are we running on Solaris?]) @@ -376,6 +377,16 @@ AM_CONDITIONAL([CROSS_COMPILING], test "${cross_compiling}" = "yes") PKG_PROG_PKG_CONFIG +# Add variable to print if pkg-config is found or not. Users often miss that +if test "${PKG_CONFIG}" = ""; then + if test "${pkg_config_required}" = "yes"; then + AC_MSG_ERROR([pkg-config is required]) + fi + pkg_config_found="(not found)" +else + pkg_config_found="(using ${PKG_CONFIG})" +fi + AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S @@ -810,7 +821,7 @@ [libnl-genl-3.0 >= 3.4.0], [have_libnl="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 newer 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 version 3.4.0 or newer for DCO]) ] ) CFLAGS="${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 package and pkg-config installed?])] + [AC_MSG_ERROR([libcap-ng package not found. Is the development package 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 >= 1.0.2], [have_openssl="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=${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_found}])] ) PKG_CHECK_VAR( [WOLFSSL_INCLUDEDIR], @@ -1508,7 +1520,7 @@ PKG_CHECK_MODULES( [CMOCKA], [cmocka], [have_cmocka="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_config_found}. Unit tests disabled])] ) AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) AC_SUBST([ENABLE_UNITTESTS])