From patchwork Fri Jan 5 14:05:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3550 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:2791:b0:100:d2e5:60d with SMTP id hm17csp3784234dyb; Fri, 5 Jan 2024 06:06:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFy1VK2hFANc0CsG9R9xfhZC3N6EvzbSwhIV4UIOSIFhlj65AmH+Ek7B5KS/KYz0HkcU+UU X-Received: by 2002:a17:90a:9f02:b0:28d:19d3:8c57 with SMTP id n2-20020a17090a9f0200b0028d19d38c57mr356940pjp.3.1704463586508; Fri, 05 Jan 2024 06:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704463586; cv=none; d=google.com; s=arc-20160816; b=U/3pn6vm5B8+KLVrTtDK/YtBbwABNQWJilI8GjUg60aeA2url9jvHsMeLPPDgrLLML uwo7/+Wru9QXPxAHQNAmV24GKXfbF0pt4XQ0JfjIRoxtcFJf9MFZCKylJlCPsAXluTDh 1/EsEQiAA0zaBx0MdCZRgrWgZQaTstyALvpIyJhn/JEZ+/6qksFglzmJasj1iwn5eTjy Ai3SPrNmhoJgVwqHcOAfX3PCt/rGoiGM8gnY4CogNGsZ9SF7UmnIkE02XClrZ0ki2KzJ QvGuLQfyOeKFvOAU1OIVKy7HfNE7Himf/lETF5IhCm7smpx0rvlWk8HQTbJG7a1Mz+nY CFpQ== 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=iCzUj6UHA+I/PGLsfHSOq3Y15a/iVL+4zwp6ubapyHk=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=VoZPIEcNW+lrrsQwHba7apfxv7PNzZlIWRqnYQUnobwtyd1tGaNZw4Fsh88adNc/Cp 3Z6AFDSQ2BtZ47GKoUgVUC79phzrg851mb5rXe4er3UfXYN+z6OCL1zV1L+IeSroiY7m akJ33xSRIIUdiCl0yqLPnfkDDsPkTOAwaUWf2IzJNhqJCm/Y4o5bw6NV7Ss4NanMUHDX wJhvFc+4TTGEwxjVx7v7vATjV/6x7Bv/QbPlgrJDLqrVDEthCiIpkUTUF3z4Ed5wmi5h YRosGeVWtGz594mivuYPUvLWKsinXT0ez12gzDICB8vIs9f8MpGsKtT49Y6jQ9Z48mgD tSBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=i+Ds2H2P; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=GVmTMGJB; 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 gx15-20020a17090b124f00b0028c28cff71dsi895207pjb.154.2024.01.05.06.06.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2024 06:06:26 -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=i+Ds2H2P; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=GVmTMGJB; 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-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rLkpj-0006oK-0m; Fri, 05 Jan 2024 14:05:59 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rLkph-0006oC-Rj for openvpn-devel@lists.sourceforge.net; Fri, 05 Jan 2024 14:05:58 +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=hxbg4CDXcRkkqCpltzcMQ/bIpgakeaold+mlowrbIhk=; b=i+Ds2H2Pqcbsf7HCqfap9HM1Jp Hr8L+hZ2ocWHRLh2ay84dbQy1bL1wkq7jL9mfPgms+RY07JnzUN3Your4q+WR5OW+/PHO2PmY3dFG SB6aYajauy4dnfu+HNnh0NCaiEjjhEwCzd8Qnahb9JxDqaN7tjH5pxPfaDA5YTcg6dEY=; 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=hxbg4CDXcRkkqCpltzcMQ/bIpgakeaold+mlowrbIhk=; b=GVmTMGJBs/05Aogu+/642MLAbO p4rZRdmfkMedAkNiFkBd2m32W/KdFrE8X/3EaJHZzKXKg0Zf+ZlEWEcadkTitUTRqEHsfOLcOiRrV V0BqwkT0t534tYIZyXvY7DPbNdMUAQtZ6BWCxrCy7tpOCS2YVxcozgA2S0attSfX3UWE=; 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 1rLkpg-0002IX-DA for openvpn-devel@lists.sourceforge.net; Fri, 05 Jan 2024 14:05:58 +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 405E5fVo014767 for ; Fri, 5 Jan 2024 15:05:41 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 405E5fMs014766 for openvpn-devel@lists.sourceforge.net; Fri, 5 Jan 2024 15:05:41 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 5 Jan 2024 15:05:40 +0100 Message-ID: <20240105140540.14757-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-1.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: 1rLkpg-0002IX-DA Subject: [Openvpn-devel] [PATCH v5] 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?1787259609957415124?= 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 (/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: Antonio Quartulli --- 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 5 of this Change. Acked-by according to Gerrit (reflected above): Antonio Quartulli diff --git a/configure.ac b/configure.ac index f420612..3ad9f14 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="(${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])