[smuxi/stable] configure.ac: check if shell supports +=
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi/stable] configure.ac: check if shell supports +=
- Date: Fri, 9 Oct 2015 19:37:02 +0000 (UTC)
commit e094b140cdfc4b68a3549a4a98c7520d852094b2
Author: Mirco Bauer <meebey meebey net>
Date: Fri Oct 9 21:26:12 2015 +0200
configure.ac: check if shell supports +=
On systems with non-bash /bin/sh appending variables using += will fail. The
issue is that the configure script continues if it doesn't. This led to a
failing build in some obscure place because the variable wasn't appended. So we
bail now in the configure script early and give the user a hint how to fix it.
configure.ac | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7f9b1cc..d70659e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,6 +16,16 @@ AC_DISABLE_STATIC
AC_PROG_LIBTOOL
#LT_INIT([disable-static])
+AC_MSG_CHECKING([whether the shell understands "+="])
+shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && shell_append=yes
+AC_MSG_RESULT([$shell_append])
+if test "x$shell_append" = "xno"; then
+ AC_MSG_ERROR([Your shell (/bin/sh) is not supporting += which is required by this configure script.
Try CONFIG_SHELL="env bash" ./configure instead.])
+fi
+
# I18N
IT_PROG_INTLTOOL([0.25])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]