summaryrefslogtreecommitdiff
path: root/.local/bin/emacs-build
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2025-08-25 21:05:07 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2025-08-25 21:05:07 +0200
commitc53b1a4845841cf7b306247f18bbfecbed19e51c (patch)
tree64cba9ef720ec1ffcf6bdaa2d436155455bd819f /.local/bin/emacs-build
parent28637f8c2a318f3c752f00d979a79fd1f9b4845f (diff)
downloaddotfiles-c53b1a4845841cf7b306247f18bbfecbed19e51c.tar.xz
Simplify Emacs build script
With some gratuitous variable renaming (add some _dir suffixes) & bashism banishment (port a [[ =~ ]] to plain case).
Diffstat (limited to '.local/bin/emacs-build')
-rwxr-xr-x.local/bin/emacs-build34
1 files changed, 12 insertions, 22 deletions
diff --git a/.local/bin/emacs-build b/.local/bin/emacs-build
index 375a402..c63338f 100755
--- a/.local/bin/emacs-build
+++ b/.local/bin/emacs-build
@@ -2,9 +2,9 @@
set -eux
-src=$(realpath "${EMACS_SRC:-.}")
-build=$(realpath "${EMACS_BUILD:-.}")
-config_h=${build}/src/config.h
+src_dir=$(realpath "${EMACS_SRC:-.}")
+build_dir=$(realpath "${EMACS_BUILD:-.}")
+config_h=${build_dir}/src/config.h
make="make -j$(nproc --all)"
configure_flags=(
@@ -77,27 +77,17 @@ then
)
fi
-if ! test -f "${src}"/Makefile
+if ! test -f "${src_dir}"/Makefile
then
- ${make} -C "${src}" configure
+ ${make} -C "${src_dir}" configure
fi
-check-config ()
-{
- if ! test -f "${config_h}"
- then
- return 1
- fi
-
- local pattern="#define EMACS_CONFIG_OPTIONS \"${configure_flags[@]}\""
- grep "${pattern}" "${config_h}"
-}
-
-cd "${build}"
-
-if ! check-config
-then
- "${src}"/configure "${configure_flags[@]}"
-fi
+cd "${build_dir}"
+# Had logic to check src/config.h:EMACS_CONFIG_OPTIONS to determine
+# whether running 'configure' is redundant. Threw it all to the wind:
+# date-based --prefix changes everyday; build times are not as long as
+# they used to be; I can always invoke 'make' if I want fast iteration
+# over build errors.
+"${src_dir}"/configure "${configure_flags[@]}"
${make} "$@"