From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WFfYBNhVFWFdNwEAgWs5BA (envelope-from ) for ; Thu, 12 Aug 2021 19:09:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id IGSjANhVFWGicAAA1q6Kng (envelope-from ) for ; Thu, 12 Aug 2021 17:09:44 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A149E6D26 for ; Thu, 12 Aug 2021 19:09:43 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0E2DF2BFC7; Thu, 12 Aug 2021 13:08:54 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 41FF12B12F for ; Thu, 12 Aug 2021 13:08:49 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 19D235FD5C; Thu, 12 Aug 2021 13:08:49 -0400 (EDT) Received: (nullmailer pid 1348722 invoked by uid 1000); Thu, 12 Aug 2021 17:07:43 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 01/31] configure: optional library sfsexp Date: Thu, 12 Aug 2021 10:06:58 -0700 Message-Id: <20210812170728.1348333-2-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210812170728.1348333-1-david@tethera.net> References: <20210812170728.1348333-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 37HC4KRVQQXRTIZXKNDYPPSZNSXSJCUC X-Message-ID-Hash: 37HC4KRVQQXRTIZXKNDYPPSZNSXSJCUC 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; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628788183; 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-unsubscribe:list-subscribe:list-post; bh=gzSsVBhX8Fw/b2vPq7K4VOZntkZo9m7kFYcw+Be0oWo=; b=AgYNSGTgqnecWwQTqIAHle0+N2IMDj+5JAzPZdqXd7lRP5MO2xjIHRPEHg2K1pblu4AFbW IXaUsLWpdlLZoiA1khiK4I1RIaBI4K4qqn9JVvEIKZovQI4JGsNUsTD2ID4yaBVhRcsLzO X3wSb29M6XXiGGD2Vw+KypBV20sgHOC+dF+F4tT2H7C/25USH6w6s9bs3Jp2uwZHK9RndC i+6jdkjon8PcA5j33UZYNL2bSgQBPzGjvSU3Y8tmf36FeGvwN9y7A1olQSygoHIjQhZiLk lEFE/5ZfkDG06gQUTXifIaXRs73oKpgybzju0A4nyddWx/LMbxadKVFBImBpEg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628788183; a=rsa-sha256; cv=none; b=ZBHcXUkQ7Y3l9MP1qdpGLskrphTnbTLjxZ2dd1ixsYP0QPFXqHMQPcg6wFpmQ6NZXGheTs LG15fPm9FZgOjfhocY3v7f3irjW6NaMlAdjKpySlvHbQRUISer4UnWEPzTcboF4oEwOaDa LrXpzc0FnHK5E75cjHAgev1t9N0+uF/sZNwSMA1EMYLsEjU4LgZdtKy5YBMMvIwZwRldVx fFWYejvpvQSwQCe2uAKlG7Rwf9SIt0vvVlup2ZKcFovwV1Fb8WO0AQOtyD7SSbg+KLhRYB Sz2AbOKxCxoa58cwXrv6f1GqTNWfYfb2AFxD3WJJEuoMobkpQfYhKWw6zbGK6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.56 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: A149E6D26 X-Spam-Score: 0.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: XBj9tkXbE5qq The configure part is essentially the same as the other checks using pkg-config. Since the optional inclusion of this feature changes what options are available to the user, include it in the "built_with" pseudo-configuration keys. --- configure | 26 +++++++++++++++++++++++++- lib/built-with.c | 2 ++ notmuch-config.c | 3 +++ test/T030-config.sh | 1 + test/T055-path-config.sh | 9 +++++---- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/configure b/configure index cfa9c09b..4262d122 100755 --- a/configure +++ b/configure @@ -820,6 +820,19 @@ else WITH_BASH=0 fi +printf "Checking for sfsexp... " +if pkg-config --exists sfsexp; then + printf "Yes.\n" + have_sfsexp=1 + sfsexp_cflags=$(pkg-config --cflags sfsexp) + sfsexp_ldflags=$(pkg-config --libs sfsexp) +else + printf "No (will not enable s-expression queries).\n" + have_sfsexp=0 + sfsexp_cflags= + sfsexp_ldflags= +fi + if [ -z "${EMACSLISPDIR-}" ]; then EMACSLISPDIR="\$(prefix)/share/emacs/site-lisp" fi @@ -1443,6 +1456,13 @@ HAVE_VALGRIND = ${have_valgrind} # And if so, flags needed at compile time for valgrind macros VALGRIND_CFLAGS = ${valgrind_cflags} +# Whether the sfsexp library is available +HAVE_SFSEXP = ${have_sfsexp} + +# And if so, flags needed at compile/link time for sfsexp +SFSEXP_CFLAGS = ${sfsexp_cflags} +SFSEXP_LDFLAGS = ${sfsexp_ldflags} + # Support for emacs WITH_EMACS = ${WITH_EMACS} @@ -1459,6 +1479,7 @@ WITH_ZSH = ${WITH_ZSH} COMMON_CONFIGURE_CFLAGS = \\ \$(GMIME_CFLAGS) \$(TALLOC_CFLAGS) \$(ZLIB_CFLAGS) \\ -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \$(VALGRIND_CFLAGS) \\ + -DHAVE_SFSEXP=\$(HAVE_SFSEXP) \$(SFSEXP_CFLAGS) \\ -DHAVE_GETLINE=\$(HAVE_GETLINE) \\ -DWITH_EMACS=\$(WITH_EMACS) \\ -DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\ @@ -1475,7 +1496,7 @@ CONFIGURE_CFLAGS = \$(COMMON_CONFIGURE_CFLAGS) CONFIGURE_CXXFLAGS = \$(COMMON_CONFIGURE_CFLAGS) \$(XAPIAN_CXXFLAGS) -CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS) +CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS) \$(SFSEXP_LDFLAGS) EOF # construct the sh.config @@ -1524,6 +1545,9 @@ NOTMUCH_HAVE_PYTHON3_CFFI=${have_python3_cffi} # Is the python pytest package available? NOTMUCH_HAVE_PYTHON3_PYTEST=${have_python3_pytest} +# Is the sfsexp library available? +NOTMUCH_HAVE_SFSEXP=${have_sfsexp} + # Platform we are run on PLATFORM=${platform} EOF diff --git a/lib/built-with.c b/lib/built-with.c index 0c70010b..89958e12 100644 --- a/lib/built-with.c +++ b/lib/built-with.c @@ -32,6 +32,8 @@ notmuch_built_with (const char *name) return HAVE_XAPIAN_DB_RETRY_LOCK; } else if (STRNCMP_LITERAL (name, "session_key") == 0) { return true; + } else if (STRNCMP_LITERAL (name, "sexpr_query") == 0) { + return HAVE_SFSEXP; } else { return false; } diff --git a/notmuch-config.c b/notmuch-config.c index 3430a3d3..328446ae 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -672,6 +672,9 @@ _notmuch_config_list_built_with () printf ("%sretry_lock=%s\n", BUILT_WITH_PREFIX, notmuch_built_with ("retry_lock") ? "true" : "false"); + printf ("%ssexpr_query=%s\n", + BUILT_WITH_PREFIX, + notmuch_built_with ("sexpr_query") ? "true" : "false"); } static int diff --git a/test/T030-config.sh b/test/T030-config.sh index 751feaf3..05c68653 100755 --- a/test/T030-config.sh +++ b/test/T030-config.sh @@ -51,6 +51,7 @@ cat < EXPECTED built_with.compact=something built_with.field_processor=something built_with.retry_lock=something +built_with.sexpr_query=something database.autocommit=8000 database.mail_root=MAIL_DIR database.path=MAIL_DIR diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index bb3bf665..9e9b9df8 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -250,15 +250,16 @@ EOF test_expect_equal "${output}+${output2}" "${value}+" test_begin_subtest "Config list ($config)" - notmuch config list | notmuch_dir_sanitize | sed -e "s/^database.backup_dir=.*$/database.backup_dir/" \ + notmuch config list | notmuch_config_sanitize | sed -e "s/^database.backup_dir=.*$/database.backup_dir/" \ -e "s/^database.hook_dir=.*$/database.hook_dir/" \ -e "s/^database.path=.*$/database.path/" \ -e "s,^database.mail_root=CWD/home/mail,database.mail_root=MAIL_DIR," \ > OUTPUT cat < EXPECTED -built_with.compact=true -built_with.field_processor=true -built_with.retry_lock=true +built_with.compact=something +built_with.field_processor=something +built_with.retry_lock=something +built_with.sexpr_query=something database.autocommit=8000 database.backup_dir database.hook_dir -- 2.30.2