From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7B2116DE1081 for ; Tue, 11 Jun 2019 17:12:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.047 X-Spam-Level: X-Spam-Status: No, score=-0.047 tagged_above=-999 required=5 tests=[AWL=-0.046, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4yDBvw9qnx0j for ; Tue, 11 Jun 2019 17:12:24 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 8DB326DE104E for ; Tue, 11 Jun 2019 17:12:24 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1haqsJ-0001aD-Ap; Tue, 11 Jun 2019 20:12:23 -0400 Received: (nullmailer pid 12931 invoked by uid 1000); Wed, 12 Jun 2019 00:12:40 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH] build: drop variable HAVE_EMACS. use WITH_EMACS instead Date: Tue, 11 Jun 2019 21:12:38 -0300 Message-Id: <20190612001238.12885-1-david@tethera.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jun 2019 00:12:25 -0000 The extra flexibility of having both HAVE_EMACS (for yes, there is an emacs we can use) and WITH_EMACS (the user wants emacs support) lead to confusion and bugs. We now just force WITH_EMACS to 0 if no suitable emacs is detected. --- configure | 18 ++++++++---------- doc/Makefile.local | 6 +++--- doc/conf.py | 2 +- emacs/Makefile.local | 10 ++++------ 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 8b80f0e0..554e10c9 100755 --- a/configure +++ b/configure @@ -677,13 +677,14 @@ if [ -z "${EMACSETCDIR-}" ]; then EMACSETCDIR="\$(prefix)/share/emacs/site-lisp" fi -printf "Checking if emacs (>= 24) is available... " -if emacs --quick --batch --eval '(if (< emacs-major-version 24) (kill-emacs 1))' > /dev/null 2>&1; then - printf "Yes.\n" - have_emacs=1 -else - printf "No (so will not byte-compile emacs code)\n" - have_emacs=0 +if [ $WITH_EMACS = "1" ]; then + printf "Checking if emacs (>= 24) is available... " + if emacs --quick --batch --eval '(if (< emacs-major-version 24) (kill-emacs 1))' > /dev/null 2>&1; then + printf "Yes.\n" + else + printf "No (disabling emacs related parts of build)\n" + WITH_EMACS=0 + fi fi have_doxygen=0 @@ -1165,9 +1166,6 @@ BASH_ABSOLUTE = ${bash_absolute} HAVE_PERL = ${have_perl} PERL_ABSOLUTE = ${perl_absolute} -# Whether there's an emacs binary available for byte-compiling -HAVE_EMACS = ${have_emacs} - # Whether there's a sphinx-build binary available for building documentation HAVE_SPHINX=${have_sphinx} diff --git a/doc/Makefile.local b/doc/Makefile.local index d733b51e..b4e0c955 100644 --- a/doc/Makefile.local +++ b/doc/Makefile.local @@ -4,7 +4,7 @@ dir := doc # You can set these variables from the command line. SPHINXOPTS := -q -SPHINXBUILD = HAVE_EMACS=${HAVE_EMACS} WITH_EMACS=${WITH_EMACS} sphinx-build +SPHINXBUILD = WITH_EMACS=${WITH_EMACS} sphinx-build DOCBUILDDIR := $(dir)/_build # Internal variables. @@ -29,8 +29,8 @@ MAN1_TEXI := $(patsubst $(srcdir)/doc/man1/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$ MAN5_TEXI := $(patsubst $(srcdir)/doc/man5/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN5_RST)) MAN7_TEXI := $(patsubst $(srcdir)/doc/man7/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN7_RST)) INFO_TEXI_FILES := $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI) -ifeq ($(HAVE_EMACS)$(WITH_EMACS),11) - INFO_TEXI_FILES := $(INFO_TEXI_FILES) $(DOCBUILDDIR)/texinfo/notmuch-emacs.texi +ifeq ($(WITH_EMACS),1) + INFO_TEXI_FILES += $(DOCBUILDDIR)/texinfo/notmuch-emacs.texi endif INFO_INFO_FILES := $(INFO_TEXI_FILES:.texi=.info) diff --git a/doc/conf.py b/doc/conf.py index 8afff929..fc9738ff 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -32,7 +32,7 @@ exclude_patterns = ['_build'] # If we don't have emacs (or the user configured --without-emacs), # don't build the notmuch-emacs docs, as they need emacs to generate # the docstring include files -if os.environ.get('HAVE_EMACS') != '1' or os.environ.get('WITH_EMACS') != '1': +if os.environ.get('WITH_EMACS') != '1': exclude_patterns.append('notmuch-emacs.rst') # The name of the Pygments (syntax highlighting) style to use. diff --git a/emacs/Makefile.local b/emacs/Makefile.local index 40b7c14f..141f5868 100644 --- a/emacs/Makefile.local +++ b/emacs/Makefile.local @@ -47,7 +47,7 @@ emacs_images := \ emacs_bytecode = $(emacs_sources:.el=.elc) emacs_docstrings = $(emacs_sources:.el=.rsti) -ifneq ($(HAVE_SPHINX)$(HAVE_EMACS),11) +ifneq ($(HAVE_SPHINX)$(WITH_EMACS),11) docstring.stamp: @echo "Missing prerequisites, not collecting docstrings" else @@ -60,7 +60,7 @@ endif # the byte compiler may load an old .elc file when processing a # "require" or we may fail to rebuild a .elc that depended on a macro # from an updated file. -ifeq ($(HAVE_EMACS),1) +ifeq ($(WITH_EMACS),1) $(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources) $(call quiet,EMACS) --directory emacs -batch -l make-deps.el \ -f batch-make-deps $(emacs_sources) > $@.tmp && \ @@ -82,7 +82,7 @@ $(dir)/notmuch-lib.elc: $(dir)/notmuch-version.elc endif CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x -ifeq ($(HAVE_EMACS),1) +ifeq ($(WITH_EMACS),1) %.elc: %.el $(global_deps) $(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $< %.rsti: %.el @@ -103,10 +103,8 @@ endif rm -r .elpa-build ifeq ($(WITH_EMACS),1) -ifeq ($(HAVE_EMACS),1) all: $(emacs_bytecode) $(emacs_docstrings) install-emacs: $(emacs_bytecode) -endif install: install-emacs endif @@ -115,7 +113,7 @@ endif install-emacs: $(emacs_sources) $(emacs_images) mkdir -p "$(DESTDIR)$(emacslispdir)" install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)" -ifeq ($(HAVE_EMACS),1) +ifeq ($(WITH_EMACS),1) install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)" endif mkdir -p "$(DESTDIR)$(emacsetcdir)" -- 2.20.1