From patchwork Mon Oct 2 05:18:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sommerseth X-Patchwork-Id: 7 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director3.mail.ord1d.rsapps.net ([172.30.157.9]) by backend31.mail.ord1d.rsapps.net (Dovecot) with LMTP id cTVSMAVn0llOSgAAgoeIoA for ; Mon, 02 Oct 2017 12:19:17 -0400 Received: from director8.mail.ord1c.rsapps.net ([172.28.130.196]) by director3.mail.ord1d.rsapps.net (Dovecot) with LMTP id gMOZAnBV0lmhDAAAkXNnRw ; Mon, 02 Oct 2017 12:19:17 -0400 Received: from smtp48.gate.ord1a ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by director8.mail.ord1c.rsapps.net (Dovecot) with LMTP id gSV+NPRm0lnhUgAAPBwpBw ; Mon, 02 Oct 2017 12:19:17 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-MessageSniffer-Scan-Result: 0 X-MessageSniffer-Rules: 0-298-1066-1283-w 0-298-1066-1647-w 0-298-0-11093-f X-CMAE-Scan-Result: 0 X-CNFS-Analysis: v=2.2 cv=H5iZ+KQi c=1 sm=1 tr=0 a=Q8DxjiC8O3VT/NpP1XjEZQ==:117 a=Q8DxjiC8O3VT/NpP1XjEZQ==:17 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=02M-m0pO-4AA:10 a=WiVod9pSvdkA:10 a=uDo-SIiEAAAA:8 a=pGLkceISAAAA:8 a=9sSjY8p1AAAA:8 a=P_JWiMecAAAA:8 a=FP58Ms26AAAA:8 a=7p-rqi79pl-OpBtc9GcA:9 a=yAx3vSfQgmYtOEFa:21 a=kzctHh_kuW8gWcu1:21 a=CjuIK1q_8ugA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=Rkhf4GTZPwEC63LfVcCP:22 a=ub54wNWiXv_DzeFsgEJW:22 a=D0-HAvA3Hk9NMREbgwuX:22 X-Orig-To: justin@openvpn.net X-Originating-Ip: [216.34.181.88] Authentication-Results: smtp48.gate.ord1a.rsapps.net; iprev=pass policy.iprev="216.34.181.88"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=openvpn.net X-Classification-ID: 702e25aa-a78d-11e7-9d5b-0022192d68d3-1-1 Received: from [216.34.181.88] ([216.34.181.88:49041] helo=lists.sourceforge.net) by smtp48.gate.ord1a.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id F1/60-15937-50762D95; Mon, 02 Oct 2017 12:19:17 -0400 Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1dz3Qj-0007Nh-NB; Mon, 02 Oct 2017 16:18:53 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from ) id 1dz3Qi-0007Nb-R4 for openvpn-devel@lists.sourceforge.net; Mon, 02 Oct 2017 16:18:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:To:From; bh=f6Q8RncWQp/YDKH5cttmsniE1sLhBCzxcXyxtBKOahs=; b=M2YvEBF2Bvds86vN0gnrKJc4nyQNi+kc8PZkVz/Sz/xaGD+CuiWP/g0VfNJR4TOMv8Bhv1tMx77C1UVcMeelnptp6Evz6IAivv5FSvsHZpksbs3Om5kg38oiAiclDlMR3+mLLn3B/c1364SrMhm3VlHdUYTRUdeXyUgygNrJOzU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x; h=Message-Id:Date:Subject:To:From; bh=f6Q8RncWQp/YDKH5cttmsniE1sLhBCzxcXyxtBKOahs=; b=J9vX2xT6dzeWPXcnNw2166xmzeiLAMBOJ6cqDBvY/dT0MrhK18yyhUQiccEnPoRzgxqPZBNZwyqRtxvKo5KCOohnE274IW2GmU8dAoViIvJJ3tK0dco1WM39ktpPuOz+ux7etW+x1/mbw5YRAEK2yP0qpwfAPNBiC1J4yRrDjz4=; Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of sf.lists.topphemmelig.net designates 83.243.40.96 as permitted sender) client-ip=83.243.40.96; envelope-from=openvpn@sf.lists.topphemmelig.net; helo=winterfell.topphemmelig.net; Received: from [83.243.40.96] (helo=winterfell.topphemmelig.net) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1dz3Qg-0000OJ-Lp for openvpn-devel@lists.sourceforge.net; Mon, 02 Oct 2017 16:18:52 +0000 Received: from localhost (unknown [IPv6:::1]) by winterfell.topphemmelig.net (Postfix) with ESMTP id 3244781A021 for ; Mon, 2 Oct 2017 16:18:24 +0000 (UTC) Received: from winterfell.topphemmelig.net ([127.0.0.1]) by localhost (winterfell.topphemmelig.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kiQFVQWtutHR for ; Mon, 2 Oct 2017 18:18:20 +0200 (CEST) Received: from zimbra.sommerseth.email (zimbra.sommerseth.email [172.16.33.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by winterfell.topphemmelig.net (Postfix) with ESMTPS id 32CC18189F3 for ; Mon, 2 Oct 2017 18:18:20 +0200 (CEST) Received: from localhost (localhost [IPv6:::1]) by zimbra.sommerseth.email (Postfix) with ESMTP id BD5F64157F58 for ; Mon, 2 Oct 2017 18:18:19 +0200 (CEST) Received: from zimbra.sommerseth.email ([IPv6:::1]) by localhost (zimbra.sommerseth.email [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id c3Om53hq3COX for ; Mon, 2 Oct 2017 18:18:19 +0200 (CEST) Received: from optimus.homebase.sommerseths.net (unknown [10.35.7.2]) by zimbra.sommerseth.email (Postfix) with ESMTPS id 3C9CD4128C96 for ; Mon, 2 Oct 2017 18:18:19 +0200 (CEST) From: David Sommerseth To: openvpn-devel@lists.sourceforge.net Date: Mon, 2 Oct 2017 18:18:12 +0200 Message-Id: <20171002161812.9376-1-davids@openvpn.net> X-Mailer: git-send-email 2.13.5 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record 1.0 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1dz3Qg-0000OJ-Lp Subject: [Openvpn-devel] [PATCH] lz4: Fix confused version check 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Older LZ4 library versions used a version number > 100 and not the current x.y.z versioning scheme. This results in version 122 being numberically higher than the check we have liblz4 > 1.7.1. And since that old version (122) does not have the LZ4_compress_default(), the building explodes later on. This patch enhances the version check to also ensure the version number is lower than 100. In addition the function checking we had was not triggered if system library was found via pkg-config, so this have now been reworked to really check if we have at least two of the most important LZ4 functions - as long as a system library have been found or been accepted via the LZ4_{CFLAGS,LIBS} variables. There are more ways to check for functions in autoconf. I opted for AC_CHECK_LIB() instead of AC_CHECK_FUNC{,S}() as the latter ones does not test if a function exists in a specific library. This have the downside of needing to tests instead of AC_CHECK_FUNCS() which could test for more functions in one go. We also do not overwrite the LZ4_LIBS variable on success, as that could change already set library paths (-L) Finally, a stupid typo got fixed as well. Trac: 939 Signed-off-by: David Sommerseth Tested-by: Richard Bonhomme --- configure.ac | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 74443353..394f5b09 100644 --- a/configure.ac +++ b/configure.ac @@ -1091,7 +1091,7 @@ if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then if test -z "${LZ4_CFLAGS}" -a -z "${LZ4_LIBS}"; then # if the user did not explicitly specify flags, try to autodetect PKG_CHECK_MODULES([LZ4], - [liblz4 >= 1.7.1], + [liblz4 >= 1.7.1 liblz4 < 100], [have_lz4="yes"], [] # If this fails, we will do another test next ) @@ -1131,16 +1131,20 @@ if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then fi fi - # if LZ4_LIBS is set, we assume it will work, otherwise test - if test -z "${LZ4_LIBS}"; then + # Double check we have a few needed functions + if test "${have_lz4}" = "yes" ; then AC_CHECK_LIB([lz4], - [LZ4_compress], - [LZ4_LIBS="-llz4"], + [LZ4_compress_default], + [], + [have_lz4="no"]) + AC_CHECK_LIB([lz4], + [LZ4_decompress_safe], + [], [have_lz4="no"]) fi if test "${have_lz4}" != "yes" ; then - AC_MSG_RESULT([ usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) + AC_MSG_RESULT([ usable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) LZ4_LIBS="" fi