summaryrefslogtreecommitdiff
path: root/.local/bin/emacs-build
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2019-12-07 21:03:20 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2019-12-07 21:03:48 +0100
commita548a8aa39fda09600255b5ebcf2561513e6fae1 (patch)
tree0faa5061e08080114d7c39549f98ff3b0dfa22c1 /.local/bin/emacs-build
parent8f4fb413763d2485a32d9d5882f8e977e95fee9d (diff)
downloaddotfiles-a548a8aa39fda09600255b5ebcf2561513e6fae1.tar.xz
Add script to compile Emacs
Diffstat (limited to '.local/bin/emacs-build')
-rwxr-xr-x.local/bin/emacs-build29
1 files changed, 29 insertions, 0 deletions
diff --git a/.local/bin/emacs-build b/.local/bin/emacs-build
new file mode 100755
index 0000000..c367bfe
--- /dev/null
+++ b/.local/bin/emacs-build
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -eux
+
+make="make -j$(nproc --all)"
+configure_flags="--with-xwidgets --with-cairo"
+
+if ! test -f Makefile
+then
+ ${make} configure
+fi
+
+check-config ()
+{
+ if ! test -f src/config.h
+ then
+ return 1
+ fi
+
+ local pattern='#define EMACS_CONFIG_OPTIONS "'${configure_flags}'"'
+ grep "${pattern}" src/config.h
+}
+
+if ! check-config
+then
+ ./configure ${configure_flags}
+fi
+
+${make}