From patchwork Sun Mar 21 21:43:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 1648 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id CLT1DBFZWGABBAAAIUCqbw (envelope-from ) for ; Mon, 22 Mar 2021 04:45:05 -0400 Received: from proxy18.mail.iad3b.rsapps.net ([172.31.255.6]) by director11.mail.ord1d.rsapps.net with LMTP id eOvGDBFZWGDKcgAAvGGmqA (envelope-from ) for ; Mon, 22 Mar 2021 04:45:05 -0400 Received: from smtp22.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy18.mail.iad3b.rsapps.net with LMTPS id 2Bx+BRFZWGBNVwAA3NpJmQ (envelope-from ) for ; Mon, 22 Mar 2021 04:45:05 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp22.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; 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=greenie.muc.de X-Suspicious-Flag: YES X-Classification-ID: e4f9da3e-8aea-11eb-ba67-52540041dff8-1-1 Received: from [216.105.38.7] ([216.105.38.7:37668] helo=lists.sourceforge.net) by smtp22.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C2/BD-26206-F0958506; Mon, 22 Mar 2021 04:45:04 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1lOGAA-0003fC-OZ; Mon, 22 Mar 2021 08:43:50 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lOGA8-0003f3-Ej for openvpn-devel@lists.sourceforge.net; Mon, 22 Mar 2021 08:43:48 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=riPHx3mnFwOUlGsTwEf3kgp5vGgJaxqOac8cgGEwjZs=; b=m8QYVAuwZRf2r/oM/tQ4MzPrBj aVyqtoBAn6A1ek7TAbCwSN/fkFtXNYlxbkHQPezB9iFnEeJHtYKp1HALS6ztdUbjB2k+OoSIPD9RY WGCM7U6Vo9H8mg0MIyQAi9C080H/zEECBJRqRQrzFZAI50defe/OherILdfOmGlaemWk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=riPHx3mnFwOUlGsTwEf3kgp5vGgJaxqOac8cgGEwjZs=; b=f GDNa5C/FVJK8UYb2aHofw5Ugj2ItXyqnUuJkecgYGIG5eSvtna9w9irvQcOrz4lZfbPThndSuCOWy zaTWWLph4/uz+hE5A0m9NGm8UjYIArg8fOzc7PQSqLhEL9auGVm0qjd8ldbAodz/Vh12qqSMcaE2D m5uYyZjamkU2jgmA=; Received: from chekov.greenie.muc.de ([193.149.48.178]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lOG9y-0003ik-Qx for openvpn-devel@lists.sourceforge.net; Mon, 22 Mar 2021 08:43:48 +0000 Received: from chekov.greenie.muc.de (localhost [127.0.0.1]) by chekov.greenie.muc.de (8.15.2/8.15.2) with ESMTPS id 12M8hVea094814 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Mar 2021 09:43:32 +0100 (CET) (envelope-from gert@chekov.greenie.muc.de) Received: (from gert@localhost) by chekov.greenie.muc.de (8.15.2/8.15.2/Submit) id 12M8hV02094813 for openvpn-devel@lists.sourceforge.net; Mon, 22 Mar 2021 09:43:31 +0100 (CET) (envelope-from gert) From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 22 Mar 2021 09:43:31 +0100 Message-Id: <20210322084331.94770-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lOG9y-0003ik-Qx Subject: [Openvpn-devel] [PATCH] Add LZ4 prerequisite building. 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 commit 24596b258aa3a removed the bundled compat-lz4 from OpenVPN, thus breaking windows/nsis builds with default config ("--enable-lz4"). Add download URLs and build invocation. Since LZ4 has no "configure" script, we pass the appropriate CC=/LD=/WINDRES= statement to "make". Only static library is installed, since static linking is easier here than to extend NSIS to bundle lz4.dll (+ whatever else is needed). Tested with and without depcache. 32 and 64 bit binaries have been built, though only 64 bit binary was tested (on Win10). Signed-off-by: Gert Doering --- generic/build | 33 ++++++++++++++++++++++++++++++++- generic/build.vars | 2 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/generic/build b/generic/build index cf2c7c6..fb12d62 100755 --- a/generic/build +++ b/generic/build @@ -61,6 +61,10 @@ download1() { local url="$1" local prefix="$(basename "${url}" | sed 's/-[0-9].*//g')" + # LZ4 download is just "v1.9.3.tar.gz", so check for exact file exist + if [ -f "${SOURCESROOT}/${prefix}" ] ; then + return + fi if ! [ -n "$(ls "${SOURCESROOT}/${prefix}-"[0-9]* 2> /dev/null)" ]; then geturl ${url} || die "Cannot download ${url}" fi @@ -69,6 +73,7 @@ download1() { download() { for url in \ ${LZO_URL} \ + ${LZ4_URL} \ ${OPENSSL_URL} \ ${PKCS11_HELPER_URL} \ ${TAP_WINDOWS_URL} \ @@ -78,7 +83,7 @@ download() { download1 "${url}" done - if [ "$(ls "${SOURCESROOT}" | wc -l | sed 's/[ \t]//g')" != 6 ]; then + if [ "$(ls "${SOURCESROOT}" | wc -l | sed 's/[ \t]//g')" != 7 ]; then die "sources is unclean." fi } @@ -226,6 +231,30 @@ build_dep() { [ -n "${SAVE_DEP_CACHE}" ] && depcache_save lzo fi + if [ -n "${USE_DEP_CACHE}" ]; then + depcache_extract lz4 + else + echo "Build lz4" + cd "${BUILDROOT}/lz4"* || die "cd lz4" + echo ./configure ${CONFIGOPTS} ${EXTRA_LZ4_CONFIG} \ + $(empty_ifelse "${DO_STATIC}" --enable-shared --disable-shared) \ + || die "Configure lz4" + # lz4 does not have a configure, so pass CC/LD instead + # ... and we only want the static library + ${MAKE} ${MAKEOPTS} CC=${CHOST}-gcc LD=${CHOST}-gcc \ + WINDRES=${CHOST}-windres TARGET_OS=MINGW32 \ + BUILD_STATIC=yes BUILD_SHARED=no \ + PREFIX=/ DESTDIR="${INSTALL_ROOT}" V=1 \ + || die "make lz4" + ${MAKE} ${MAKEOPTS} CC=${CHOST}-gcc LD=${CHOST}-gcc \ + WINDRES=${CHOST}-windres TARGET_OS=MINGW32 \ + BUILD_STATIC=yes BUILD_SHARED=no \ + PREFIX=/ DESTDIR="${INSTALL_ROOT}" V=1 install \ + || die "make lz4" + + [ -n "${SAVE_DEP_CACHE}" ] && depcache_save lz4 + fi + if [ -z "${DO_STATIC}" ]; then if [ -n "${USE_DEP_CACHE}" ]; then depcache_extract pkcs11-helper @@ -387,6 +416,8 @@ export OPENSSL_CFLAGS="-I${OPENVPN_ROOT}/include" export OPENSSL_LIBS="-L${OPENVPN_ROOT}/lib -lssl -lcrypto" export LZO_CFLAGS="-I${OPENVPN_ROOT}/include" export LZO_LIBS="-L${OPENVPN_ROOT}/lib -llzo2" +export LZ4_CFLAGS="-I${OPENVPN_ROOT}/include" +export LZ4_LIBS="-L${OPENVPN_ROOT}/lib -llz4" export PKCS11_HELPER_CFLAGS="-I${OPENVPN_ROOT}/include" export PKCS11_HELPER_LIBS="-L${OPENVPN_ROOT}/lib -lpkcs11-helper" export TAP_CFLAGS="-I${OPENVPN_ROOT}/include" diff --git a/generic/build.vars b/generic/build.vars index 28f2075..e10b3b4 100644 --- a/generic/build.vars +++ b/generic/build.vars @@ -4,6 +4,7 @@ BUILD_VERSION="001" OPENSSL_VERSION="${OPENSSL_VERSION:-1.1.1f}" PKCS11_HELPER_VERSION="${PKCS11_HELPER_VERSION:-1.22}" LZO_VERSION="${LZO_VERSION:-2.10}" +LZ4_VERSION="${LZ4_VERSION:-1.9.3}" TAP_WINDOWS_VERSION="${TAP_WINDOWS_VERSION:-9.24.2}" OPENVPN_VERSION="${OPENVPN_VERSION:-2.4.9}" OPENVPN_GUI_VERSION="${OPENVPN_GUI_VERSION:-11}" @@ -12,6 +13,7 @@ OPENSSL_URL="${OPENSSL_URL:-https://www.openssl.org/source/openssl-${OPENSSL_VER PKCS11_HELPER_URL="${PKCS11_HELPER_URL:-https://github.com/OpenSC/pkcs11-helper/releases/download/pkcs11-helper-${PKCS11_HELPER_VERSION}/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.bz2}" TAP_WINDOWS_URL="${TAP_WINDOWS_URL:-http://build.openvpn.net/downloads/releases/tap-windows-${TAP_WINDOWS_VERSION}.zip}" LZO_URL="${LZO_URL:-http://www.oberhumer.com/opensource/lzo/download/lzo-${LZO_VERSION}.tar.gz}" +LZ4_URL="${LZ4_URL:-https://github.com/lz4/lz4/archive/refs/tags/v${LZ4_VERSION}.tar.gz}" OPENVPN_URL="${OPENVPN_URL:-http://build.openvpn.net/downloads/snapshots/openvpn-${OPENVPN_VERSION}.tar.gz}" OPENVPN_GUI_URL="${OPENVPN_GUI_URL:-http://build.openvpn.net/downloads/releases/openvpn-gui-${OPENVPN_GUI_VERSION}.tar.gz}"