summaryrefslogtreecommitdiff
path: root/personal/setup
diff options
context:
space:
mode:
Diffstat (limited to 'personal/setup')
-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
```