Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1 | From 0aac3047cd7681d610b22d79501c297fa3433148 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ross Burton <ross.burton@intel.com> |
| 3 | Date: Thu, 12 Mar 2020 17:25:41 +0000 |
| 4 | Subject: [PATCH 2/7] m4sh: prefer bash over sh |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 6 | _AS_DETECT_BETTER_SHELL looks for a good shell to use, and tries to look for |
| 7 | 'sh' before 'bash'. Whilst for many systems sh is a symlink to bash, |
| 8 | there are many where sh is a symlink to a more minimal sh implementation. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 10 | For example, Debian by default has /bin/sh -> /bin/dash: dash is a faster |
| 11 | shell to start (which makes a notable difference to boot speed) but is not |
| 12 | as fast as bash at executing long scripts (and configure scripts are not |
| 13 | known for their conciseness). |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 15 | Change the search order to bash then sh, so that a known-good shell (bash) |
| 16 | is used if available over something which is merely POSIX compliant. |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 17 | |
| 18 | Upstream-Status: Inappropriate [oe specific] |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 19 | --- |
| 20 | lib/m4sugar/m4sh.m4 | 2 +- |
| 21 | 1 file changed, 1 insertion(+), 1 deletion(-) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 22 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 23 | diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 |
| 24 | index 9d543952..84ef84a9 100644 |
| 25 | --- a/lib/m4sugar/m4sh.m4 |
| 26 | +++ b/lib/m4sugar/m4sh.m4 |
| 27 | @@ -230,7 +230,7 @@ dnl Remove any tests from suggested that are also required |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | [_AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH], |
| 29 | [case $as_dir in @%:@( |
| 30 | /*) |
| 31 | - for as_base in sh bash ksh sh5; do |
| 32 | + for as_base in bash sh ksh sh5; do |
| 33 | # Try only shells that exist, to save several forks. |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 34 | as_shell=$as_dir$as_base |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | AS_IF([{ test -f "$as_shell" || test -f "$as_shell.exe"; } && |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 36 | -- |
| 37 | 2.25.1 |
| 38 | |