Separate SH used to run Configure from SH used on target system
authorJess Robinson <castaway@desert-island.me.uk>
Thu, 31 Jan 2013 14:15:17 +0000 (14:15 +0000)
committerBrian Fraser <fraserbn@gmail.com>
Thu, 23 Jan 2014 18:46:03 +0000 (19:46 +0100)
This is because, for example, on the host system, sh might be /bin/sh,
but on the target system, it's /system/bin/sh.

The new variable is "targetsh" and defaults to "sh" unless changed by the hints file/Configure params.

Configure
config_h.SH

index a81e3a4..e4e5570 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -217,6 +217,7 @@ usecrosscompile=''
 hostperl=''
 hostgenerate=''
 hostosname=''
+targetsh=''
 extern_C=''
 mistrustnm=''
 usedevel=''
@@ -1439,6 +1440,10 @@ EOM
        ;;
 esac
 
+: When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
+: default both to the same thing, cross-compilers can then set targetsh differently if they like
+targetsh=$sh
+
 : see if sh knows # comments
 if `$sh -c '#' >/dev/null 2>&1`; then
        shsharp=true
@@ -23817,6 +23822,7 @@ targetdir='$targetdir'
 targethost='$targethost'
 targetmkdir='$targetmkdir'
 targetport='$targetport'
+targetsh='$targetsh'
 tbl='$tbl'
 tee='$tee'
 test='$test'
index 010bb6a..c027ac4 100755 (executable)
@@ -3141,7 +3141,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
  *     /bin/pdksh, /bin/ash, /bin/bash, or even something such as
  *     D:/bin/sh.exe.
  */
-#define SH_PATH "$sh"  /**/
+#define SH_PATH "$targetsh"  /**/
 
 /* SIG_NAME:
  *     This symbol contains a list of signal names in order of