]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Prefer bash, when running test.sh script
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Fri, 26 Jan 2018 18:12:57 +0000 (19:12 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 29 Jan 2018 19:55:31 +0000 (20:55 +0100)
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").

INSTALL.md
Makefile.in
configure.ac

index 79952a4f5890567a5530b8d707023e7a4621d3ad..50627042a9326d3de1051dbb3cb604a3866bff37 100644 (file)
@@ -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/)
index 5aee02df2116a16609365945abe563b9888828cc..3ddabaa06ef9fa408318f92dc2f13722628f0047 100644 (file)
@@ -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 $@ $<
index 4095f4b9cc7170c092592b76e2f2b97f71a33e46..f84d1e0f041cdbce497f9f638ae97e4276c4229c 100644 (file)
@@ -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"