summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders F Björklund <anders.f.bjorklund@gmail.com>2018-01-26 19:12:57 +0100
committerJoel Rosdahl <joel@rosdahl.net>2018-01-29 20:55:31 +0100
commit01e51695e34e0a8ba1d34b08980cc0c0a63362f1 (patch)
treef324517279458f5d1ffd3da591bb1044ac8b4b1f
parent13db1e5d366bbad2939745a15bfc663badeea4a1 (diff)
downloadccache-01e51695e34e0a8ba1d34b08980cc0c0a63362f1.tar.gz
Prefer bash, when running test.sh script
Look for bash, to make it possible to run "make test" on platforms where it is not the /bin/sh implementation. It is possible to build ccache without it, when only running the limited unit tests (with "make quicktest").
-rw-r--r--INSTALL.md1
-rw-r--r--Makefile.in5
-rw-r--r--configure.ac3
3 files changed, 7 insertions, 2 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 79952a4f..50627042 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -7,6 +7,7 @@ Prerequisites
To build ccache from the source repository, you need:
- A C compiler (for instance GCC)
+- GNU Bourne Again SHell (bash) for tests.
- [AsciiDoc](http://www.methods.co.nz/asciidoc/) to build the documentation.
- [Autoconf](http://www.gnu.org/software/autoconf/)
- [gperf](http://www.gnu.org/software/gperf/)
diff --git a/Makefile.in b/Makefile.in
index 5aee02df..3ddabaa0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -10,6 +10,7 @@ sysconfdir = @sysconfdir@
installcmd = @INSTALL@
AR = @AR@
+SH = @SH@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
@@ -101,7 +102,7 @@ perf: ccache$(EXEEXT)
.PHONY: test
test: ccache$(EXEEXT) test/main$(EXEEXT)
test/main$(EXEEXT)
- CC='$(CC)' $(srcdir)/test.sh
+ CC='$(CC)' $(SH) $(srcdir)/test.sh
.PHONY: quicktest
quicktest: test/main$(EXEEXT)
@@ -125,7 +126,7 @@ distclean: clean
.PHONY: installcheck
installcheck: ccache$(EXEEXT) test/main$(EXEEXT)
test/main$(EXEEXT)
- CCACHE=$(bindir)/ccache CC='$(CC)' $(srcdir)/test.sh
+ CCACHE=$(bindir)/ccache CC='$(CC)' $(SH) $(srcdir)/test.sh
.c.o:
$(CC) $(all_cppflags) $(all_cflags) -c -o $@ $<
diff --git a/configure.ac b/configure.ac
index 4095f4b9..f84d1e0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,9 @@ if test -z "$AR"; then
AC_MSG_ERROR(cannot find ar)
fi
+# Prefer bash, needed for test.sh
+AC_PATH_TOOL(SH, bash, "/bin/sh")
+
# If GCC, turn on warnings.
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall -W"