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").
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/)
installcmd = @INSTALL@
AR = @AR@
+SH = @SH@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
.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)
.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 $@ $<
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"