changeset 4854:990b5e6b1970

use AC_PATH_PROG to check for ccache; use result in ccache-links Makefile rule
author John W. Eaton <jwe@octave.org>
date Wed, 10 Oct 2018 14:39:43 -0400
parents 2ee6a02e6f28
children ab2f299ccd4c
files Makefile.in configure.ac
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Wed Oct 10 14:31:19 2018 -0400
+++ b/Makefile.in	Wed Oct 10 14:39:43 2018 -0400
@@ -30,6 +30,7 @@
 
 # Set to "yes" to use ccache
 USE_CCACHE := @USE_CCACHE@
+CCACHE := @CCACHE@
 
 # Set to "yes" to use the versions of GCC and binutils already
 # installed on your system (default is yes if doing native build).
@@ -622,12 +623,12 @@
 	@mkdir -p usr/bin/ccache && \
 	for f in gcc g++ gfortran; do \
 	  if test ! -e usr/bin/ccache/$(MXE_TOOL_PREFIX)$$f; then \
-	    ln -s /usr/bin/ccache usr/bin/ccache/$(MXE_TOOL_PREFIX)$$f; \
+	    ln -s "$(CCACHE)" usr/bin/ccache/$(MXE_TOOL_PREFIX)$$f; \
 	  fi; \
 	done && \
 	for f in gcc g++ gfortran; do \
 	  if test ! -e usr/bin/ccache/$$f; then \
-	    ln -s /usr/bin/ccache usr/bin/ccache/$$f; \
+	    ln -s "$(CCACHE)" usr/bin/ccache/$$f; \
 	  fi; \
 	done
 
--- a/configure.ac	Wed Oct 10 14:31:19 2018 -0400
+++ b/configure.ac	Wed Oct 10 14:39:43 2018 -0400
@@ -82,7 +82,7 @@
      *) AC_MSG_ERROR([bad value "$enableval" for --with-ccache]) ;;
    esac], [USE_CCACHE=no])
 if test "$USE_CCACHE" = yes; then
-  AC_CHECK_PROG(CCACHE, ccache, ccache)
+  AC_PATH_PROG(CCACHE, ccache)
   if test -z "$CCACHE"; then
     AC_MSG_WARN([ccache program not found; not using ccache for build])
     USE_CCACHE=no