diff options
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/emacs-build | 34 | ||||
| -rwxr-xr-x | .local/bin/emacs-install | 20 |
2 files changed, 24 insertions, 30 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} "$@" diff --git a/.local/bin/emacs-install b/.local/bin/emacs-install index b8a98aa..301d897 100755 --- a/.local/bin/emacs-install +++ b/.local/bin/emacs-install @@ -2,18 +2,22 @@ set -eux -build=${EMACS_BUILD:-.} +build_dir=${EMACS_BUILD:-.} + +cd "${build_dir}" +make install # Retrieve installation directory. Many ways to do this; parsing # 'config.status --config' might be TRT in principle; for simplicity, # just: -prefix=$(sed -n s/'^prefix *= *'//p "${build}"/Makefile) - -cd "${build}" -make install +prefix_dir=$(sed -n s/'^prefix *= *'//p Makefile) +apps_dir=~/apps -[[ ${prefix} =~ ~/apps/(.*) ]] || exit -target=${BASH_REMATCH[1]} +case ${prefix_dir} +in + ${apps_dir}/*) target=${prefix_dir##${apps_dir}/} ;; + *) exit ;; +esac -cd ~/apps +cd ${apps_dir} ln -fsvT "${target}" emacs |
