mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
build: drop variable HAVE_EMACS. use WITH_EMACS instead
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.
This commit is contained in:
parent
0a2929c341
commit
a6a8df7e03
4 changed files with 16 additions and 20 deletions
16
configure
vendored
16
configure
vendored
|
@ -677,13 +677,14 @@ if [ -z "${EMACSETCDIR-}" ]; then
|
||||||
EMACSETCDIR="\$(prefix)/share/emacs/site-lisp"
|
EMACSETCDIR="\$(prefix)/share/emacs/site-lisp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Checking if emacs (>= 24) is available... "
|
if [ $WITH_EMACS = "1" ]; then
|
||||||
if emacs --quick --batch --eval '(if (< emacs-major-version 24) (kill-emacs 1))' > /dev/null 2>&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"
|
printf "Yes.\n"
|
||||||
have_emacs=1
|
else
|
||||||
else
|
printf "No (disabling emacs related parts of build)\n"
|
||||||
printf "No (so will not byte-compile emacs code)\n"
|
WITH_EMACS=0
|
||||||
have_emacs=0
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
have_doxygen=0
|
have_doxygen=0
|
||||||
|
@ -1165,9 +1166,6 @@ BASH_ABSOLUTE = ${bash_absolute}
|
||||||
HAVE_PERL = ${have_perl}
|
HAVE_PERL = ${have_perl}
|
||||||
PERL_ABSOLUTE = ${perl_absolute}
|
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
|
# Whether there's a sphinx-build binary available for building documentation
|
||||||
HAVE_SPHINX=${have_sphinx}
|
HAVE_SPHINX=${have_sphinx}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ dir := doc
|
||||||
|
|
||||||
# You can set these variables from the command line.
|
# You can set these variables from the command line.
|
||||||
SPHINXOPTS := -q
|
SPHINXOPTS := -q
|
||||||
SPHINXBUILD = HAVE_EMACS=${HAVE_EMACS} WITH_EMACS=${WITH_EMACS} sphinx-build
|
SPHINXBUILD = WITH_EMACS=${WITH_EMACS} sphinx-build
|
||||||
DOCBUILDDIR := $(dir)/_build
|
DOCBUILDDIR := $(dir)/_build
|
||||||
|
|
||||||
# Internal variables.
|
# 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))
|
MAN5_TEXI := $(patsubst $(srcdir)/doc/man5/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN5_RST))
|
||||||
MAN7_TEXI := $(patsubst $(srcdir)/doc/man7/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN7_RST))
|
MAN7_TEXI := $(patsubst $(srcdir)/doc/man7/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN7_RST))
|
||||||
INFO_TEXI_FILES := $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI)
|
INFO_TEXI_FILES := $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI)
|
||||||
ifeq ($(HAVE_EMACS)$(WITH_EMACS),11)
|
ifeq ($(WITH_EMACS),1)
|
||||||
INFO_TEXI_FILES := $(INFO_TEXI_FILES) $(DOCBUILDDIR)/texinfo/notmuch-emacs.texi
|
INFO_TEXI_FILES += $(DOCBUILDDIR)/texinfo/notmuch-emacs.texi
|
||||||
endif
|
endif
|
||||||
|
|
||||||
INFO_INFO_FILES := $(INFO_TEXI_FILES:.texi=.info)
|
INFO_INFO_FILES := $(INFO_TEXI_FILES:.texi=.info)
|
||||||
|
|
|
@ -32,7 +32,7 @@ exclude_patterns = ['_build']
|
||||||
# If we don't have emacs (or the user configured --without-emacs),
|
# 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
|
# don't build the notmuch-emacs docs, as they need emacs to generate
|
||||||
# the docstring include files
|
# 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')
|
exclude_patterns.append('notmuch-emacs.rst')
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
|
|
|
@ -47,7 +47,7 @@ emacs_images := \
|
||||||
emacs_bytecode = $(emacs_sources:.el=.elc)
|
emacs_bytecode = $(emacs_sources:.el=.elc)
|
||||||
emacs_docstrings = $(emacs_sources:.el=.rsti)
|
emacs_docstrings = $(emacs_sources:.el=.rsti)
|
||||||
|
|
||||||
ifneq ($(HAVE_SPHINX)$(HAVE_EMACS),11)
|
ifneq ($(HAVE_SPHINX)$(WITH_EMACS),11)
|
||||||
docstring.stamp:
|
docstring.stamp:
|
||||||
@echo "Missing prerequisites, not collecting docstrings"
|
@echo "Missing prerequisites, not collecting docstrings"
|
||||||
else
|
else
|
||||||
|
@ -60,7 +60,7 @@ endif
|
||||||
# the byte compiler may load an old .elc file when processing a
|
# 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
|
# "require" or we may fail to rebuild a .elc that depended on a macro
|
||||||
# from an updated file.
|
# from an updated file.
|
||||||
ifeq ($(HAVE_EMACS),1)
|
ifeq ($(WITH_EMACS),1)
|
||||||
$(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)
|
$(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)
|
||||||
$(call quiet,EMACS) --directory emacs -batch -l make-deps.el \
|
$(call quiet,EMACS) --directory emacs -batch -l make-deps.el \
|
||||||
-f batch-make-deps $(emacs_sources) > $@.tmp && \
|
-f batch-make-deps $(emacs_sources) > $@.tmp && \
|
||||||
|
@ -82,7 +82,7 @@ $(dir)/notmuch-lib.elc: $(dir)/notmuch-version.elc
|
||||||
endif
|
endif
|
||||||
CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x
|
CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x
|
||||||
|
|
||||||
ifeq ($(HAVE_EMACS),1)
|
ifeq ($(WITH_EMACS),1)
|
||||||
%.elc: %.el $(global_deps)
|
%.elc: %.el $(global_deps)
|
||||||
$(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
|
$(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
|
||||||
%.rsti: %.el
|
%.rsti: %.el
|
||||||
|
@ -103,10 +103,8 @@ endif
|
||||||
rm -r .elpa-build
|
rm -r .elpa-build
|
||||||
|
|
||||||
ifeq ($(WITH_EMACS),1)
|
ifeq ($(WITH_EMACS),1)
|
||||||
ifeq ($(HAVE_EMACS),1)
|
|
||||||
all: $(emacs_bytecode) $(emacs_docstrings)
|
all: $(emacs_bytecode) $(emacs_docstrings)
|
||||||
install-emacs: $(emacs_bytecode)
|
install-emacs: $(emacs_bytecode)
|
||||||
endif
|
|
||||||
|
|
||||||
install: install-emacs
|
install: install-emacs
|
||||||
endif
|
endif
|
||||||
|
@ -115,7 +113,7 @@ endif
|
||||||
install-emacs: $(emacs_sources) $(emacs_images)
|
install-emacs: $(emacs_sources) $(emacs_images)
|
||||||
mkdir -p "$(DESTDIR)$(emacslispdir)"
|
mkdir -p "$(DESTDIR)$(emacslispdir)"
|
||||||
install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
|
install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
|
||||||
ifeq ($(HAVE_EMACS),1)
|
ifeq ($(WITH_EMACS),1)
|
||||||
install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)"
|
install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)"
|
||||||
endif
|
endif
|
||||||
mkdir -p "$(DESTDIR)$(emacsetcdir)"
|
mkdir -p "$(DESTDIR)$(emacsetcdir)"
|
||||||
|
|
Loading…
Reference in a new issue