From 7c23690234f9e9af434e98cd8f9d3e0c49113608 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Thu, 23 May 2019 20:01:43 +0200 Subject: Update Emacs build script To handle changes in configuration flags. Also add Cairo support, now that font hinting works. --- personal/setup/emacs.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'personal/setup/emacs.md') 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 ``` -- cgit v1.2.3