Commit 63463b93bc5f08a60a276949cd644160d16cead6

Peter Breitenlohner 2013-03-21T19:58:40

Respect CONFIG_SHELL from the environment. Some large packages using FreeType have to use a broken (deficient) /bin/sh. The configure scripts (as generated by Autoconf) are clever enough to find a better shell and put that one into the environment variable CONFIG_SHELL. If that environment variable is already set the script skips the test and assumes to be already running under a good shell. * builds/unix/detect.mk: Honour CONFIG_SHELL. * builds/unix/unix-def.in (SHELL): Define.

diff --git a/ChangeLog b/ChangeLog
index 516b378..8d744e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-03-21  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+	Respect CONFIG_SHELL from the environment.
+
+	Some large packages using FreeType have to use a broken (deficient)
+	/bin/sh.  The configure scripts (as generated by Autoconf) are
+	clever enough to find a better shell and put that one into the
+	environment variable CONFIG_SHELL.  If that environment variable is
+	already set the script skips the test and assumes to be already
+	running under a good shell.
+
+	* builds/unix/detect.mk: Honour CONFIG_SHELL.
+	* builds/unix/unix-def.in (SHELL): Define.
+
 2013-03-21  Werner Lemberg  <wl@gnu.org>
 
 	Fix Savannah patch #7971.
diff --git a/builds/unix/detect.mk b/builds/unix/detect.mk
index b2ae4f4..0506e7d 100644
--- a/builds/unix/detect.mk
+++ b/builds/unix/detect.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004, 2006 by
+# Copyright 1996-2000, 2002-2004, 2006, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -76,13 +76,14 @@ ifeq ($(PLATFORM),unix)
 
   have_Makefile := $(wildcard $(OBJ_DIR)/Makefile)
 
+      CONFIG_SHELL ?= /bin/sh
       setup: std_setup
   ifdef must_configure
     ifneq ($(have_Makefile),)
       # we are building FT2 not in the src tree
-	      $(TOP_DIR)/builds/unix/configure $(value CFG)
+	      $(CONFIG_SHELL) $(TOP_DIR)/builds/unix/configure $(value CFG)
     else
-	      cd builds/unix; ./configure $(value CFG)
+	      cd builds/unix; $(CONFIG_SHELL) ./configure $(value CFG)
     endif
   endif
 
diff --git a/builds/unix/unix-def.in b/builds/unix/unix-def.in
index 9c5e941..010607b 100644
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -12,6 +12,7 @@
 # indicate that you have read the license and understand and accept it
 # fully.
 
+SHELL := @SHELL@
 
 TOP_DIR := $(shell cd $(TOP_DIR); pwd)