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 311DF6DE0F0D for ; Wed, 12 Jun 2019 12:09:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.419 X-Spam-Level: X-Spam-Status: No, score=0.419 tagged_above=-999 required=5 tests=[AWL=-0.233, SPF_NEUTRAL=0.652] 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 tDLjSroH9shh for ; Wed, 12 Jun 2019 12:09:19 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 59C566DE0EA6 for ; Wed, 12 Jun 2019 12:09:18 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 422C4100084; Wed, 12 Jun 2019 22:09:13 +0300 (EEST) From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] build: drop variable HAVE_EMACS. use WITH_EMACS instead In-Reply-To: <20190612001238.12885-1-david@tethera.net> References: <20190612001238.12885-1-david@tethera.net> User-Agent: Notmuch/0.28.3+84~g41389bb (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain 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 19:09:21 -0000 On Tue, Jun 11 2019, David Bremner wrote: > 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. LGTM. Tomi > --- > 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 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch