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
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}
# 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.
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)
# 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.
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
# 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 && \
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
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
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)"