[PATCH] configure: add set -u

Tomi Ollila tomi.ollila at iki.fi
Fri May 6 11:11:25 PDT 2016


In case of any unset variable, make ./configure exit with nonzero value;
an attempt to expand an unset variable is a bug in the script
(usually a spelling mistake) and those should not pass through
unnoticed.
---

I was also doing set -e support but that has quite a few nontrivial
things in it. Set -u catches all lagging c++ compilers and so on ;).
Perhaps later.

This change requires id:1462296224-768-1-git-send-email-tomi.ollila at iki.fi
to be applied first, otherwise ./configure will not pass.

 configure | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 6231d2b..3753e7f 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,7 @@
 #! /bin/sh
 
+set -u
+
 # Test whether this shell is capable of parameter substring processing.
 ( option='a/b'; : ${option#*/} ) 2>/dev/null || {
     echo "
@@ -480,6 +482,7 @@ if pkg-config --exists valgrind; then
 else
     printf "No (but that's fine).\n"
     have_valgrind=0
+    valgrind_cflags=
 fi
 
 printf "Checking for bash-completion (>= 1.90)... "
@@ -490,11 +493,11 @@ else
     WITH_BASH=0
 fi
 
-if [ -z "${EMACSLISPDIR}" ]; then
+if [ -z "${EMACSLISPDIR-}" ]; then
     EMACSLISPDIR="\$(prefix)/share/emacs/site-lisp"
 fi
 
-if [ -z "${EMACSETCDIR}" ]; then
+if [ -z "${EMACSETCDIR-}" ]; then
     EMACSETCDIR="\$(prefix)/share/emacs/site-lisp"
 fi
 
-- 
2.8.2



More information about the notmuch mailing list