summaryrefslogtreecommitdiff
path: root/guides/setups/emacs.md
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2019-07-11 18:10:53 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2019-07-11 18:10:53 +0200
commit8cfe656fbb312398244d6f0e820d4f179db3cfc7 (patch)
tree31102175eb71b82eece64ba62cf494e1014b0fc9 /guides/setups/emacs.md
parent66d44f9dbb1f6a6e8af5d51677ee39c496c46caa (diff)
downloadmemory-leaks-8cfe656fbb312398244d6f0e820d4f179db3cfc7.tar.xz
Move some things around
Diffstat (limited to 'guides/setups/emacs.md')
-rw-r--r--guides/setups/emacs.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/guides/setups/emacs.md b/guides/setups/emacs.md
new file mode 100644
index 0000000..53fb75f
--- /dev/null
+++ b/guides/setups/emacs.md
@@ -0,0 +1,42 @@
+# Compiling
+
+This script seems to handle most cases I care about:
+
+- a freshly cloned copy of the repository,
+- a repository where compilation has already happened,
+- a repository where I want to change the `configure` flags…
+
+``` bash
+#!/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
+
+if ! ${MAKE}
+then
+ ${MAKE} bootstrap
+fi
+```