diff options
| author | Lars Ljung <lars@matholka.se> | 2016-03-02 22:24:24 +0100 |
|---|---|---|
| committer | Lars Ljung <lars@matholka.se> | 2016-03-02 22:24:24 +0100 |
| commit | d3fc29caafb21ba8b67152e1a3a970e8dd4e07d6 (patch) | |
| tree | 7f0c29e100bc6fb416c7cd137524339fa92d65f2 | |
| parent | 8e887a841e7fd229238668aebd8e448765ebff19 (diff) | |
Enable automatic build from within Emacs
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | lisp/pdf-tools.el | 23 |
2 files changed, 18 insertions, 9 deletions
@@ -89,8 +89,8 @@ install-server-deps: melpa-build: server/epdfinfo -cp -p server/epdfinfo .. @if [ "$(shell uname -o)" = "Msys" ]; then \ - for f in $(shell ldd server/epdfinfo | awk '/mingw/ {print $$1}'); do \ - cp /$(MSYSTEM)/bin/$$f ..; \ + for f in $(shell ldd server/epdfinfo | awk '/mingw/ {print $$3}'); do \ + cp $$f ..; \ done; \ fi $(MAKE) distclean diff --git a/lisp/pdf-tools.el b/lisp/pdf-tools.el index 12ce59b..ba1b667 100644 --- a/lisp/pdf-tools.el +++ b/lisp/pdf-tools.el @@ -259,8 +259,9 @@ CALLBACK may be a function, which will be locally put on `compilation-finish-functions', which see." (if (file-executable-p pdf-info-epdfinfo-program) (message "%s" "Server already build.") - (unless (executable-find "make") - (error "Executable `make' command not found")) + (if (not (eq system-type 'windows-nt)) + (unless (executable-find "make") + (error "Executable `make' command not found"))) (unless build-directory (setq build-directory (expand-file-name @@ -282,11 +283,19 @@ CALLBACK may be a function, which will be locally put on (lambda (&rest _) (setq compilation-buffer (generate-new-buffer-name "*compile pdf-tools*"))))) - (compile - (format "make V=0 -kC '%s' %smelpa-build" - build-directory - (if install-server-deps "install-server-deps " " ")) - install-server-deps) + (if (not (eq system-type 'windows-nt)) + (compile + (format "make V=0 -kC '%s' %smelpa-build" + build-directory + (if install-server-deps "install-server-deps " " ")) + install-server-deps) + (let* ((arch (upcase (nth 2 (split-string system-configuration "-")))) + (msys2-install-directory + (file-name-directory (read-file-name "Path to msys2_shell.bat: ")))) + (compile (format "%susr/bin/bash.exe --login -c 'MSYSTEM=%s source /etc/profile; LANG=C make V=0 -kC \"%s\" melpa-build'" + msys2-install-directory + arch + build-directory)))) (when (and compilation-buffer (buffer-live-p (get-buffer compilation-buffer))) (when callback |
