From patchwork Fri Mar 13 13:59:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 1043 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id +MJ1C7fkbF4jDAAAIUCqbw for ; Sat, 14 Mar 2020 10:05:43 -0400 Received: from proxy7.mail.ord1d.rsapps.net ([172.30.191.6]) by director11.mail.ord1d.rsapps.net with LMTP id UIBbC7fkbF4ZSwAAvGGmqA ; Sat, 14 Mar 2020 10:05:43 -0400 Received: from smtp31.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy7.mail.ord1d.rsapps.net with LMTP id OPBJC7fkbF4QTAAAMe1Fpw ; Sat, 14 Mar 2020 10:05:43 -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: smtp31.gate.ord1d.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: e438108e-65fc-11ea-927f-525400b3ac8c-1-1 Received: from [216.105.38.7] ([216.105.38.7:34258] helo=lists.sourceforge.net) by smtp31.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 8C/78-20476-6B4EC6E5; Sat, 14 Mar 2020 10:05:43 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jD7P2-0002oM-EM; Sat, 14 Mar 2020 14:04:36 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jD7P0-0002nw-Pb for openvpn-devel@lists.sourceforge.net; Sat, 14 Mar 2020 14:04:34 +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=Qnz0WxhYTk1b2MbN/60+xm4MyrpCAvxZ0tGe1p4rGEA=; b=fWXHQKZ3Qf+phGNXD3jHR7yb6B oFkoocyQuZ+bj5DWUih3WiYUBs/DqWQle3RosI8W3xZIYHNXiQ2PFCZK/k0sd+fvAd+59DG7gFV5M c/qQZnHY+XrJ/toA/mZdgzvhq0TObYa2pVL5HwpuJYLhmck9oRnZthLC8n84Q7oWMCN8=; 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=Qnz0WxhYTk1b2MbN/60+xm4MyrpCAvxZ0tGe1p4rGEA=; b=kumGpur9mPYNIRR5bw0f+AE3cq ngMhYMIEwtCTMCgbC7DEziAGd5Y3c0fY/IcDoE+cDrfC+HfglqTpx63YDmu9vOER5Fbaqa+B3wEVE oBm4kgkcKQEry/g9LUbtJ/HnKHt3JxEYJLkuRTi3/wncUYAKwBdcExikq5DSSaJ1yhpc=; Received: from mail-lj1-f174.google.com ([209.85.208.174]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1jD7Ou-0019eq-PY for openvpn-devel@lists.sourceforge.net; Sat, 14 Mar 2020 14:04:34 +0000 Received: by mail-lj1-f174.google.com with SMTP id s13so13700851ljm.1 for ; Sat, 14 Mar 2020 07:04:28 -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=Qnz0WxhYTk1b2MbN/60+xm4MyrpCAvxZ0tGe1p4rGEA=; b=ek/oejo6VXQonGCsEf8MOXY1Oxv+gTf38tK70hx03ZuPuccSM2MuaM75MYcTMwuBlO 2CIyIlTMiVNODkTNkYd0mAGQBS4dKKT/QOnlrwpSOXbd8v58Q91/+pCeh122431IzoMy e4vM0QcqXKRY1n7ZhQ3/U5rdLkxWV52XycH0mhC3kf9N4z7Z2dvK7GYLn1vVuoZyuhCH YYfvrjcebdkPOuENq3DbbR/kRrhaEbdgpuWz0R8iDc18JYcvzYnA9G1lZhkSOVLb9Yyy YUrelERdoHYMWFuTHvIIPYAm+iTBGlDyjwmZCwDFYzOJPOz75DeiXrBl36oRoGlJ2Qij xYEg== 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=Qnz0WxhYTk1b2MbN/60+xm4MyrpCAvxZ0tGe1p4rGEA=; b=POSfO3774ws9P4wrlp0gcpSywrgup/+o1Wsa4j6rd2Km54xyZX6Txl/0rQzkI1/q53 u7PQhNy6tIPBxVhwb5qhNIx6CGWmc1Z35/I1KWo4M5un05CNXL5z71a1w7pO/m0KaZqi bYwmoBpJAmzik6wtiCApklEJS5VxuB4jgtUz1cnnR0U8LX6STtnn50PLlsrSaTOD1cLd EJQHGjNjlFJk23N9fkttEKvrvsQVRi4t1CjdPCVpecSaPNTDir+2q+b1gY0o49gfJCUh 78SxPEf/3H5JSC7Cb3sTi5Mi2fUQXQ9raLqvrxRc1MSlEOfF6W3vxPn34P2S9oTH2+Ls ubnQ== X-Gm-Message-State: ANhLgQ0KBVuUBBjECEjBoXdmZth79J0FRVx4b1qmPSH91FGPSxn3i8N2 50lgsKZakUJ1xDz4FErOtsJcI/h2 X-Google-Smtp-Source: ADFU+vsDPGcwUChuTT3i5coBl3SPXlCDJeGU3X+2YadD+TuZSANpkt9dv7pm4paGOA/18TS/Qj/shA== X-Received: by 2002:a2e:95da:: with SMTP id y26mr6496640ljh.101.1584194661419; Sat, 14 Mar 2020 07:04:21 -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 y9sm22606233ljm.49.2020.03.14.07.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Mar 2020 07:04:20 -0700 (PDT) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Sat, 14 Mar 2020 02:59:57 +0200 Message-Id: <20200314005957.20411-1-lstipakov@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314123531.GD1431@greenie.muc.de> References: <20200314123531.GD1431@greenie.muc.de> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lstipakov[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.174 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.174 listed in wl.mailspike.net] 0.8 DATE_IN_PAST_12_24 Date: is 12 to 24 hours before Received: date -0.0 SPF_PASS SPF: sender matches SPF record 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 X-Headers-End: 1jD7Ou-0019eq-PY Subject: [Openvpn-devel] [PATCH v3] 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 --- 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..4a86089b 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