summaryrefslogtreecommitdiff
path: root/m4/fp_prog_sh.m4
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-05-05 13:11:33 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-06 12:45:19 -0400
commit30f6923a834ccaca30c3622a0a82421fabcab119 (patch)
treeb0cee6f3aa869e652d409963bdf9bec005ade5d8 /m4/fp_prog_sh.m4
parent0281dae8b3fe3384939c415ae72ca2440b3cafb3 (diff)
downloadhaskell-30f6923a834ccaca30c3622a0a82421fabcab119.tar.gz
hadrian: Don't depend upon bash from PATH
Previously Hadrian depended implicitly upon whatever `bash` it found in `PATH`, offerring no way for the user to override. Fix this by detecting `sh` in `configure` and passing the result to Hadrian. Fixes #19797.
Diffstat (limited to 'm4/fp_prog_sh.m4')
-rw-r--r--m4/fp_prog_sh.m415
1 files changed, 15 insertions, 0 deletions
diff --git a/m4/fp_prog_sh.m4 b/m4/fp_prog_sh.m4
new file mode 100644
index 0000000000..f7c2c49fe8
--- /dev/null
+++ b/m4/fp_prog_sh.m4
@@ -0,0 +1,15 @@
+# FP_PROG_SH
+# ------------
+# Find a functional Bourne shell
+AC_DEFUN([FP_PROG_SH],
+[
+ AC_REQUIRE([FPTOOLS_SET_PLATFORM_VARS]) dnl for $windows
+ AC_ARG_VAR(SH,[Use as the full path to a Bourne shell. [default=autodetect]])
+ AC_PATH_PROGS([SH], [sh bash])
+ if test "$windows" = "YES"; then
+ dnl use mixed (-m) mode to get C:/mingw64/... with forward slashes.
+ dnl windows (-w) mode will give us C:\... and mess with escaping.
+ SH=`cygpath -m "$SH"`
+ fi
+ AC_SUBST([SH])[]dnl
+])# FP_PROG_SH