summaryrefslogtreecommitdiff
path: root/personal
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2019-05-23 20:01:43 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2019-05-23 20:01:57 +0200
commit7c23690234f9e9af434e98cd8f9d3e0c49113608 (patch)
treef14bbb1505dbfeeaba9cd44a0634c7f8f653d1a0 /personal
parentfcfb5a08bb478167384183ca3a3721fba0668cba (diff)
downloadmemory-leaks-7c23690234f9e9af434e98cd8f9d3e0c49113608.tar.xz
Update Emacs build script
To handle changes in configuration flags. Also add Cairo support, now that font hinting works.
Diffstat (limited to 'personal')
-rw-r--r--personal/setup/emacs.md27
1 files changed, 19 insertions, 8 deletions
diff --git a/personal/setup/emacs.md b/personal/setup/emacs.md
index 4ac1143..52552a7 100644
--- a/personal/setup/emacs.md
+++ b/personal/setup/emacs.md
@@ -1,7 +1,10 @@
# Compiling
-This script seems to handle both a freshly cloned copy of the
-repository, and a repository where compilation has already happened:
+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
@@ -9,16 +12,24 @@ repository, and a repository where compilation has already happened:
set -eux
MAKE="make -j$(nproc --all)"
-CONFIGURE_FLAGS="--with-xwidgets"
+CONFIGURE_FLAGS="--with-xwidgets --with-cairo"
+
+check-config ()
+{
+ local define=$(grep EMACS_CONFIG_OPTIONS src/config.h)
+ local pattern='^#define EMACS_CONFIG_OPTIONS "(.+)"$'
+
+ [[ ${define} =~ ${pattern} ]]
+ test "${BASH_REMATCH[1]}" = "${CONFIGURE_FLAGS}"
+}
-if ! test -f Makefile
+if ! test -f src/config.h || ! check-config
then
- ${MAKE} configure
- ./configure ${CONFIGURE_FLAGS}
+ ./configure ${CONFIGURE_FLAGS}
fi
-if ! ${MAKE} CONFIGURE_FLAGS="${CONFIGURE_FLAGS}"
+if ! ${MAKE}
then
- ${MAKE} CONFIGURE_FLAGS="${CONFIGURE_FLAGS}" bootstrap
+ ${MAKE} bootstrap
fi
```