From: Anders F Björklund Date: Fri, 26 Jan 2018 18:12:57 +0000 (+0100) Subject: Prefer bash, when running test.sh script X-Git-Tag: v3.4~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01e51695e34e0a8ba1d34b08980cc0c0a63362f1;p=thirdparty%2Fccache.git 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"). --- diff --git a/INSTALL.md b/INSTALL.md index 79952a4f5..50627042a 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 5aee02df2..3ddabaa06 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 4095f4b9c..f84d1e0f0 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"