From patchwork Wed Jun 26 16:19:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3748 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:990b:b0:57d:b2cb:6cf with SMTP id f11csp2605093mav; Wed, 26 Jun 2024 09:20:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXHpfBwp5f9IWtxb94xEyLX3h7EiJkVOHmNXAGMMdTyz+tUh3Q/akR2HmbfatOpG/v2YoL9ZwHx7I+FhdLk6HDHJgvwEXE= X-Google-Smtp-Source: AGHT+IF96grxnEOEOuis+Ad3GncgJJrGJYH/m3SmjzfAiAq285luBjxE8tNTzyRR3jBLn0r4JULl X-Received: by 2002:a17:903:1c7:b0:1f7:2576:7fbe with SMTP id d9443c01a7336-1fa09e8a5e7mr136048185ad.5.1719418804756; Wed, 26 Jun 2024 09:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719418804; cv=none; d=google.com; s=arc-20160816; b=XYYKi7Aphk2501VAmont4bhhMZwn/whiqtuoNRmoGD4cUgMesozuB2tEzfDSKsDUIO siL08x3RPxi4kwg+kBVMfTlHYB9WUCfMOi7v3IfoMIMLTjOxmvDjrHz6NVvAn2Z73piJ 4UFMLPERFvHfn9J0SLt6UGWz/Ng3yM28erAMck9UL1V4UAkFla6HMOqU2/bXxeihUZoX t+nGmdhhh6ND5KHdi3MDnxgaGiIyYrCGy/bYy6l2rb44vzt9F5/7DbFbVf5CjOuP6Ser JzixZeUYGYIVruDBp9OjIdrLY0O8T7MnP2FP/yed4YXHEiPbwvDl9B6Ynrcnzj9aFY9W 7SNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:cc: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:dkim-signature; bh=JQdf/VGTMiI+laH9K7htRys1Ecg1x8AcEjZNm0K0q38=; fh=Ah1vny6GT2h2jkNHfYFPIaYOg4hzkNSW0Qsu7DwT6uI=; b=AdEcVDYTjgWl4FcJxJWWQRbWavP9E20+Y72JqMbGS0TdTqcShWoxFI0VEm7rOpHhio 5kx23Bc3t6fz+7tOZQiyxqLEtKNTQSWGfz/Up0UM76y6v03U5hkk5gseNUv1J1lSNztO ZQ2o8fRGnUc+YMZUAcqRWOhyGAe6c2swFtbnjNLjFHPm58qWZr1YsJg/8/F+DUpe3LLd VsXdQsqKkw9sCkGSooBcuJzAg116O9IxA4M3qXILiyryvaxGymITXD3emBn5/P5DR5LE TaopzmP/QY49qACrdgi6ocIfQ4XPQpfNDAknFJputcm43lXcTaofxTMXBRHVzI2rwaeS riog==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ISsi6dV6; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=I61g2fpK; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=uOj3vgup; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id d9443c01a7336-1f9ebab9e60si112588015ad.579.2024.06.26.09.20.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2024 09:20:04 -0700 (PDT) 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=ISsi6dV6; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=I61g2fpK; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=uOj3vgup; 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 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.95) (envelope-from ) id 1sMVMu-0002GJ-Fz; Wed, 26 Jun 2024 16:19:36 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sMVMr-0002Fy-PJ for openvpn-devel@lists.sourceforge.net; Wed, 26 Jun 2024 16:19:35 +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:Cc:To:From:Sender:Reply-To: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=LtOK1478FXj5T4fWSn/hjabJs619OgzghadiApgjv0U=; b=ISsi6dV6tex2gT4tv58PEYceF6 dLcPGk2wSYQ+1z1sCGoPdkRbGXy95RlUhGFhSTZ8+R2VDXFtj4MVMMWz+Zh5UFuzCDZ38gKovLw0x bFgO5vU79ts0S4hq2x3XwQnAB7VMGVtvzjhpnqNpfmIU/vKzo3LCp4WExk8LGWNgFsSE=; 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:Cc:To:From:Sender:Reply-To: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=LtOK1478FXj5T4fWSn/hjabJs619OgzghadiApgjv0U=; b=I61g2fpKVvQ0vUJaEf7ZlYulpi VxUj7+O6zWAbK9wZOGl2V6Qt8cCAU2DFZA4RkFR2E1s6SpkLKqsmmz1OS0gKN555QzUOLJ061tS1+ s4+oB5lG3NYjV1cD+UTxwza9uJ0UDDjFXhXpBspc1EyfOlQQhXQtk8tgvXk4OaLmpK24=; Received: from mout-p-102.mailbox.org ([80.241.56.152]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1sMVMq-00028m-JV for openvpn-devel@lists.sourceforge.net; Wed, 26 Jun 2024 16:19:34 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4W8RjR1w2Jz9t2D; Wed, 26 Jun 2024 18:19:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1719418763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LtOK1478FXj5T4fWSn/hjabJs619OgzghadiApgjv0U=; b=uOj3vgupFsifW8uP9mFw68UEPLaiCVUgYp/CL61RRB95mJo9kbzC899NaeV5NVy3YPBlqQ /sH6iqhJpkDu4RiT7gnsk9TAQpisVKcEUQQEVbW7dXsFaZL1VtgECVVxV9wzpAM2UtEg3Z dq2IV9mh9HuuB4GT2gmleZPuyYY1aatXwAjWSn37W58fPLo8buuuOCTaR8kTYlMAJcCwN1 ESvOwNFgCPJ72UJLWFmQOhj+BkFDEVXbVSo6LOky50rbBXalUu/FBe2YHIkEQJxzrzQQcB AKky5Y1zUld/C1RPkSD86gwSByLVqTdKBBcPq8DO3DVj+SPph1QxDmH+OUdHkQ== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Wed, 26 Jun 2024 18:19:21 +0200 Message-Id: <20240626161921.179301-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.9 (/) 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: On most systems this should work just fine. v2: - simplify code by removing -llzo special handling v3: - reintroduce support for autodetection without pkg-config, no need to break backwards compatibility right now v7: - Handle case correctly wh [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: configure.ac] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [80.241.56.152 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [80.241.56.152 listed in bl.score.senderscore.com] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.152 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1sMVMq-00028m-JV Subject: [Openvpn-devel] [PATCH v8] configure: Try to detect LZO with pkg-config 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: , Cc: Gert Doering Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1802941292758625802?= X-GMAIL-MSGID: =?utf-8?q?1802941292758625802?= On most systems this should work just fine. v2: - simplify code by removing -llzo special handling v3: - reintroduce support for autodetection without pkg-config, no need to break backwards compatibility right now v7: - Handle case correctly where lzo/lzo1x.h can not be included at all. On most distros this works even though the .pc file suggests to use it without. We had some partly solution for that but it wasn't really working. v8: - Handle systems that do not implicitly include limits.h in configure test builds. lzodefs.h usually relies on lzoconf.h to include it. Change-Id: I1c038dc4ec80d3499582d81eee61fee74f26e693 Signed-off-by: Frank Lichtenheld 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/+/556 This mail reflects revision 8 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/config.h.cmake.in b/config.h.cmake.in index effca2a..720d679 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -178,9 +178,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LINUX_TYPES_H -/* Define to 1 if you have the header file. */ -#define HAVE_LZO_CONF_H - /* Define to 1 if you have the header file. */ #define HAVE_LZO1X_H 1 diff --git a/configure.ac b/configure.ac index c01ad09..555c97e 100644 --- a/configure.ac +++ b/configure.ac @@ -1143,8 +1143,17 @@ AC_ARG_VAR([LZO_CFLAGS], [C compiler flags for lzo]) AC_ARG_VAR([LZO_LIBS], [linker flags for lzo]) -have_lzo="yes" -if test -z "${LZO_LIBS}"; then +if test -z "${LZO_CFLAGS}" -a -z "${LZO_LIBS}"; then + # if the user did not explicitly specify flags, try to autodetect + PKG_CHECK_MODULES([LZO], + [lzo2], + [have_lzo="yes"], + [] + ) + + if test "${have_lzo}" != "yes"; then + # try to detect without pkg-config + have_lzo="yes" AC_CHECK_LIB( [lzo2], [lzo1x_1_15_compress], @@ -1156,6 +1165,10 @@ [have_lzo="no"] )] ) + fi +else + # assume the user configured it correctly + have_lzo="yes" fi if test "${have_lzo}" = "yes"; then saved_CFLAGS="${CFLAGS}" @@ -1166,8 +1179,11 @@ [AC_CHECK_HEADERS( [lzo1x.h], , - [AC_MSG_ERROR([lzo1x.h is missing])] - )] + [AC_MSG_ERROR([lzo1x.h is missing])], + [#include + #include + #include ] + )], ) CFLAGS="${saved_CFLAGS}" fi diff --git a/src/openvpn/lzo.h b/src/openvpn/lzo.h index 62d73a1..c271527 100644 --- a/src/openvpn/lzo.h +++ b/src/openvpn/lzo.h @@ -37,17 +37,15 @@ * @addtogroup compression * @{ */ -#if defined(HAVE_LZO_CONF_H) +#if defined(HAVE_LZO_LZO1X_H) +#include +#elif defined(HAVE_LZO1X_H) /* The lzo.h magic gets confused and still wants * to include lzo/lzoconf.h even if our include paths * are setup to include the paths without lzo/ */ #include #include -#endif -#if defined(HAVE_LZO_LZO1X_H) -#include -#elif defined(HAVE_LZO1X_H) #include #endif