summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Mike Burns <mike@mike-burns.com>2014-03-28 15:12:03 +0100
committerGravatar Mike Burns <mike@mike-burns.com>2014-03-28 15:59:03 +0100
commitc2c7d34973a97c3efb76cf91cce81ffffe131985 (patch)
treeeebb53b98f4acb50794c5256079a70c78adf831c
parent9805390bda7bfe213770c525065e06b111143996 (diff)
Discover a POSIX shell for Solaris
Under Solaris, use ksh instead of `/bin/sh`. This uses `$SHELL` as a POSIX shell, coupled with a `configure` check that sets it correctly. Note that the POSIX shell might end up being bash, so this actually introduces more fragmentation than it reduces. Taken from https://github.com/freedreno/mesa/blob/master/configure.ac
-rw-r--r--.gitignore4
-rwxr-xr-xbin/lsrc.in (renamed from bin/lsrc)2
-rwxr-xr-xbin/mkrc.in (renamed from bin/mkrc)2
-rwxr-xr-xbin/rcdn.in (renamed from bin/rcdn)2
-rwxr-xr-xbin/rcup.in (renamed from bin/rcup)2
-rw-r--r--configure.ac9
6 files changed, 16 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index c039fa7..d7d26c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,10 @@ depcomp
debian/rcm
debian/rcm.debhelper.log
share/rcm.sh
+bin/lsrc
+bin/mkrc
+bin/rcup
+bin/rcdn
*deb
NEWS.md
rcm-*.tar.gz
diff --git a/bin/lsrc b/bin/lsrc.in
index 9055eec..1402fec 100755
--- a/bin/lsrc
+++ b/bin/lsrc.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@SHELL@
: ${RCM_LIB:=$(dirname "$0")/../share/rcm}
. "$RCM_LIB/rcm.sh"
diff --git a/bin/mkrc b/bin/mkrc.in
index 3d9b749..398996a 100755
--- a/bin/mkrc
+++ b/bin/mkrc.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@SHELL@
: ${RCM_LIB:=$(dirname "$0")/../share/rcm}
. "$RCM_LIB/rcm.sh"
diff --git a/bin/rcdn b/bin/rcdn.in
index 2caa340..2ca6dae 100755
--- a/bin/rcdn
+++ b/bin/rcdn.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@SHELL@
: ${RCM_LIB:=$(dirname "$0")/../share/rcm}
. "$RCM_LIB/rcm.sh"
diff --git a/bin/rcup b/bin/rcup.in
index b45157b..849a0f7 100755
--- a/bin/rcup
+++ b/bin/rcup.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@SHELL@
: ${RCM_LIB:=$(dirname "$0")/../share/rcm}
. "$RCM_LIB/rcm.sh"
diff --git a/configure.ac b/configure.ac
index d938afc..4eb0b00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,13 @@ AC_INIT(rcm, 1.2.1, mburns@thoughtbot.com)
AM_INIT_AUTOMAKE
# Checks for programs.
+case "$host_os" in
+solaris*)
+ AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
+ SHELL="$POSIX_SHELL"
+ ;;
+esac
+AC_SUBST([SHELL])
# Checks for libraries.
@@ -16,4 +23,4 @@ AM_INIT_AUTOMAKE
# Checks for library functions.
AM_EXTRA_RECURSIVE_TARGETS([release_build_man_html release_push_man_html release_clean_man_html])
-AC_OUTPUT(Makefile bin/Makefile man/Makefile share/Makefile share/rcm.sh NEWS.md)
+AC_OUTPUT(Makefile bin/Makefile man/Makefile share/Makefile share/rcm.sh NEWS.md bin/lsrc bin/mkrc bin/rcdn bin/rcup)