From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id Fj/GLWOlWWJHRgEAgWs5BA (envelope-from ) for ; Fri, 15 Apr 2022 19:03:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YJnlJWOlWWLvMQEAG6o9tA (envelope-from ) for ; Fri, 15 Apr 2022 19:03:31 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 39BD2A2FE for ; Fri, 15 Apr 2022 19:03:31 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id C53805F70E; Fri, 15 Apr 2022 17:03:28 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 245AB5F706 for ; Fri, 15 Apr 2022 17:03:26 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id CD50D5FBD7; Fri, 15 Apr 2022 13:03:24 -0400 (EDT) Received: (nullmailer pid 931082 invoked by uid 1000); Fri, 15 Apr 2022 17:03:23 -0000 From: David Bremner To: Michael J Gruber , David Bremner Subject: [PATCH] lib: don't compile sexp: prefix if no sfsexp library Date: Fri, 15 Apr 2022 14:03:18 -0300 Message-Id: <20220415170318.931068-1-david@tethera.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: 7F4ZDH27OKN55WXHUL36T5YQSCLX7LA3 X-Message-ID-Hash: 7F4ZDH27OKN55WXHUL36T5YQSCLX7LA3 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: notmuch@notmuchmail.org X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650042211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=ppVLvuidEgxzHxCkscSCzhArntvikKFhH3Q+tT4eHuU=; b=qHMm3SNdLtSZ9EqGcjMzOcN9P6FyoVfDg/UFHMdZKoQCoXZ3Ytk2vwws/2U7otO2d8NowX Sm0hVANVTcL4p+n/EziKf/kTUo4JoZjdctQDo+DgCdP8vmfxmjiwjLGXKTbSzpIDogXWlC 5bHeequeCyUR8kc36CaH0h1UceackcMHPGu7EXhfoH99TBJ72effcVZl8ME8IlxRmB/O8S Cd79kJHZ6I1IOXjRtGkhzzcDgshM3qACxktRGddMr7afW707/lO3SGV8SzEz1BW0OQWeGZ dk0wWCKE/HgIwnSC+WeQtCnadkYwlVqQ+PYto5tsZ4qPs0/Nd7RKRWCMv6D+yg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650042211; a=rsa-sha256; cv=none; b=GtZbf1paMF/EF5WlaTePHHJxJorc2B7IifSasAm21LZ8B/1HjNnZ5EuR888rcVVt1ClKs+ GBkOPAO5XkW4Rsp2Xtr0g7vHrV+MPWp9guH1URaAYMA/QVjxtsErVvJN7YyuJ5u95SYiF3 zRxabdPXtY4IeUIGCTxQ9hU8gbjkr3u/vdTDDhEwNkIGmKZ4oh0Zg8qFOK+eCj8BR2GL3S /D+RC+fDTdFfqBI9TuLzLCt/3J1Z1hC6AuSDpdhkaIOc840ZpZLhRD8HcxQzVKmFJXnJxg G5/XwEE/K9cWiraGWaeiRzfLr7yVdaj/ADgKkK8/z4iWnWI9Uj7OvR10E2UO6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 6.32 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 39BD2A2FE X-Spam-Score: 6.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: EKxuASYWkBl2 As Michael Gruber pointed out, the build is otherwise broken on systems without libsfsexp. --- lib/prefix.cc | 4 ++++ lib/sexp-fp.cc | 3 +++ lib/sexp-fp.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/lib/prefix.cc b/lib/prefix.cc index 06e2333a..538a2dd1 100644 --- a/lib/prefix.cc +++ b/lib/prefix.cc @@ -61,8 +61,10 @@ prefix_t prefix_table[] = { NOTMUCH_FIELD_PROCESSOR }, { "query", NULL, NOTMUCH_FIELD_EXTERNAL | NOTMUCH_FIELD_PROCESSOR }, +#if HAVE_SFSEXP { "sexp", NULL, NOTMUCH_FIELD_EXTERNAL | NOTMUCH_FIELD_PROCESSOR }, +#endif { "from", "XFROM", NOTMUCH_FIELD_EXTERNAL | NOTMUCH_FIELD_PROBABILISTIC | NOTMUCH_FIELD_PROCESSOR }, @@ -141,8 +143,10 @@ _setup_query_field (const prefix_t *prefix, notmuch_database_t *notmuch) fp = (new QueryFieldProcessor (*notmuch->query_parser, notmuch))->release (); else if (STRNCMP_LITERAL (prefix->name, "thread") == 0) fp = (new ThreadFieldProcessor (*notmuch->query_parser, notmuch))->release (); +#if HAVE_SFSEXP else if (STRNCMP_LITERAL (prefix->name, "sexp") == 0) fp = (new SexpFieldProcessor (notmuch))->release (); +#endif else fp = (new RegexpFieldProcessor (prefix->name, prefix->flags, *notmuch->query_parser, notmuch))->release (); diff --git a/lib/sexp-fp.cc b/lib/sexp-fp.cc index ed26f6ec..eeb8be98 100644 --- a/lib/sexp-fp.cc +++ b/lib/sexp-fp.cc @@ -21,6 +21,8 @@ */ #include "database-private.h" + +#if HAVE_SFSEXP #include "sexp-fp.h" #include @@ -38,3 +40,4 @@ SexpFieldProcessor::operator() (const std::string & query_string) return output; } +#endif /* HAVE_SFSEXP */ diff --git a/lib/sexp-fp.h b/lib/sexp-fp.h index 341dfa7e..0e55b961 100644 --- a/lib/sexp-fp.h +++ b/lib/sexp-fp.h @@ -23,6 +23,7 @@ #ifndef NOTMUCH_SEXP_FP_H #define NOTMUCH_SEXP_FP_H +#if HAVE_SFSEXP #include #include "notmuch.h" @@ -38,4 +39,5 @@ public: Xapian::Query operator() (const std::string & query_string); }; +#endif /* HAVE_SFSEXP */ #endif /* NOTMUCH_SEXP_FP_H */ -- 2.35.1