From patchwork Fri Mar 13 18:29:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 1044 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id CFYRBN2Mbl5qMAAAIUCqbw for ; Sun, 15 Mar 2020 16:15:25 -0400 Received: from proxy15.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id cBomBN2Mbl6EbQAAalYnBA ; Sun, 15 Mar 2020 16:15:25 -0400 Received: from smtp16.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.ord1d.rsapps.net with LMTP id IHnMA92Mbl4CAgAAAY1PeQ ; Sun, 15 Mar 2020 16:15:25 -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: smtp16.gate.ord1c.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; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: b4105102-66f9-11ea-96e3-bc305bf036a4-1-1 Received: from [216.105.38.7] ([216.105.38.7:45798] helo=lists.sourceforge.net) by smtp16.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 36/C8-16281-CDC8E6E5; Sun, 15 Mar 2020 16:15:24 -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.90_1) (envelope-from ) id 1jDZeD-0002hO-4B; Sun, 15 Mar 2020 20:14:09 +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.90_1) (envelope-from ) id 1jDZeB-0002hB-PY for openvpn-devel@lists.sourceforge.net; Sun, 15 Mar 2020 20:14:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=/tGeO0gsWAVB5k5Grn51dqJ00EIa7vUzEV/+1eeSFl0=; b=Fu+WC6btEA+jK8NgiNqAhWpLky GbSIzlE2V0JakLxiJ/eW5OgrjPLiqNbfuUNfJ0UWlaIzakeOKIfdPwSKRH7nRgiWVb9qB9uTL8rvF zrANDE9i/5vFJhP08XIcniYaHYNYiFsJnECMjcCVifpmbu+m1vdHwlBNFopYGvwMT7es=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To :MIME-Version:Content-Type:Content-Transfer-Encoding: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=/tGeO0gsWAVB5k5Grn51dqJ00EIa7vUzEV/+1eeSFl0=; b=GM9ovIr47jBGqloXUppub04N/4 18EGlaFXh8RYuj0gJkv+audH8HWV2D9l0DmU+bZmT8HBFSOyMJQkTNWt+35ElUmhjrdT3speesyCo vaddCu9WgEZfRLw5xCrlPt9EzaBjRVt6S7lykUhxLLNqqpfYWeVwqNABJsurhPwA6zjs=; Received: from mail-lj1-f181.google.com ([209.85.208.181]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1jDZe3-008IDM-01 for openvpn-devel@lists.sourceforge.net; Sun, 15 Mar 2020 20:14:07 +0000 Received: by mail-lj1-f181.google.com with SMTP id f13so16281777ljp.0 for ; Sun, 15 Mar 2020 13:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/tGeO0gsWAVB5k5Grn51dqJ00EIa7vUzEV/+1eeSFl0=; b=ttAFHpzfWuTCuWcU/loRwUfxLESunBPgmE6BemJktk7LZcoHho6vxhDN3onLYLAlvX PFezIQM5mwpKvY1MRFqIDkG2vavWAftN/VZtzHG3k4I7hu82MZvPrGsIMfoEarw257Bc XlS4DcKEQefgue/sT9DfB31deohmFRM+TU6g5wlhnP/qakS2oVJhlxQf65Lvszg+5see 3J1yKotYl5vuDvUyC5RMY2pNsf9+KMSwfqU2307W7iwVjCT30SGIPtKvZMUuaUZy6ftQ 4NtFxtsutlp/1XtzLUZG5hqcWszQ/CnyfHl/WjgFAinHILI83OrV78je/g2jHtMpDaB3 SnxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/tGeO0gsWAVB5k5Grn51dqJ00EIa7vUzEV/+1eeSFl0=; b=Zso/31qJZV/aihtlaU5RUd/TAvP2TY8Be7Qee/CfjkFJL6PAJa/KqgSsz9ExXbTID4 4aDtt3+P0EUUIbPxX7CpYbwN4YYoay8mPN2fVvUVOhZLBocvewKCctZf5deCZw35VIz+ t5MbiRnvuwSU4SAxPl/9EkZWuRgfooROj2MlC52HIDJ530axXv9/2vFVDyYSefl88Qxm IvyOEQ5cdULTeaIe6xbEiVZ9X3QoY9KgSvXc84lhABCgeL52+cNwJeca8muQcHUK5bBA +kQxWBwE0v4A6OfAZTAKIzi4lg7puCZCE7ZSZRz45vAXhdDmAyUx8l1j3QG1AeNbCzi8 LOUg== X-Gm-Message-State: ANhLgQ0r64jFqRsbTOo0uWVlJ6KpMFSSBQ4f7UTn9qDH8rPMXMYpyZ/7 ZfkHtyD+VmmVMBM4WLmrqmht+asT X-Google-Smtp-Source: ADFU+vuQSMK8t5nvd3im3WgY96I4EsMpETPEl2DPnBSAGpTdbt4M76AkIkdIVlksK843ongUq/nMTQ== X-Received: by 2002:a2e:94d5:: with SMTP id r21mr7080582ljh.81.1584303231768; Sun, 15 Mar 2020 13:13:51 -0700 (PDT) Received: from LAPTOP-4L3N7KFS.localdomain (81-175-130-136.bb.dnainternet.fi. [81.175.130.136]) by smtp.gmail.com with ESMTPSA id g25sm33479503ljn.107.2020.03.15.13.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 13:13:51 -0700 (PDT) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Sat, 14 Mar 2020 07:29:06 +0200 Message-Id: <20200314052906.28095-1-lstipakov@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200315092331.GF1431@greenie.muc.de> References: <20200315092331.GF1431@greenie.muc.de> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lstipakov[at]gmail.com) 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: makefile.am] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.181 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.181 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.5 DATE_IN_PAST_24_48 Date: is 24 to 48 hours before Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.2 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1jDZe3-008IDM-01 Subject: [Openvpn-devel] [PATCH v4] Fix building with --enable-async-push in FreeBSD 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 This option can be used in FreedBSD with devel/libinotify installed. Detect presence of libinotify with pkgconf and use its word to compile and link. Signed-off-by: Lev Stipakov Acked-by: Gert Doering Acked-by: Gert Doering --- v4: remove unneeded commas in configure.ac v3: use _CFLAGS from pkgconf to get include dir v2: use _LIBS from pkgcong instead of hardcoded -linotify configure.ac | 26 +++++++++++++++++++++----- src/openvpn/Makefile.am | 4 +++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index a47ef3e7..fcec7389 100644 --- a/configure.ac +++ b/configure.ac @@ -1339,11 +1339,25 @@ if test "${enable_plugin_auth_pam}" = "yes"; then fi if test "${enable_async_push}" = "yes"; then - AC_CHECK_HEADERS( - [sys/inotify.h], - AC_DEFINE([ENABLE_ASYNC_PUSH], [1], [Enable async push]), - AC_MSG_ERROR([inotify.h not found.]) - ) + case "$host" in + *-*-freebsd*) + PKG_CHECK_MODULES( + [OPTIONAL_INOTIFY], + [libinotify], + [ + AC_DEFINE([HAVE_SYS_INOTIFY_H]) + AC_DEFINE([ENABLE_ASYNC_PUSH], [1], [Enable async push]) + ] + ) + ;; + *) + AC_CHECK_HEADERS( + [sys/inotify.h], + AC_DEFINE([ENABLE_ASYNC_PUSH], [1], [Enable async push]), + AC_MSG_ERROR([inotify.h not found.]) + ) + ;; + esac fi CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`" @@ -1370,6 +1384,8 @@ AC_SUBST([OPTIONAL_LZ4_LIBS]) AC_SUBST([OPTIONAL_SYSTEMD_LIBS]) AC_SUBST([OPTIONAL_PKCS11_HELPER_CFLAGS]) AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS]) +AC_SUBST([OPTIONAL_INOTIFY_CFLAGS]) +AC_SUBST([OPTIONAL_INOTIFY_LIBS]) AC_SUBST([PLUGIN_AUTH_PAM_CFLAGS]) AC_SUBST([PLUGIN_AUTH_PAM_LIBS]) diff --git a/src/openvpn/Makefile.am b/src/openvpn/Makefile.am index 2ea47cda..f0e0ad23 100644 --- a/src/openvpn/Makefile.am +++ b/src/openvpn/Makefile.am @@ -28,6 +28,7 @@ AM_CFLAGS = \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_LZ4_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \ + $(OPTIONAL_INOTIFY_CFLAGS) \ -DPLUGIN_LIBDIR=\"${plugindir}\" if WIN32 @@ -137,7 +138,8 @@ openvpn_LDADD = \ $(OPTIONAL_CRYPTO_LIBS) \ $(OPTIONAL_SELINUX_LIBS) \ $(OPTIONAL_SYSTEMD_LIBS) \ - $(OPTIONAL_DL_LIBS) + $(OPTIONAL_DL_LIBS) \ + $(OPTIONAL_INOTIFY_LIBS) if WIN32 openvpn_SOURCES += openvpn_win32_resources.rc block_dns.c block_dns.h ring_buffer.c ring_buffer.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi