# HG changeset patch
# User R. Andrew Ohana <andrew.ohana@gmail.com>
# Date 1338148660 25200
# Node ID 0b444adcf030c129e6929f58c41228dbc437ebbe
# Parent 423244dca2d7ebaf91401931230736bde1da57eb
setup ccache in build scripts
diff git a/spkg/bin/sageenv b/spkg/bin/sageenv
a

b


473  473  done 
474  474  fi 
475  475  
 476  # Setup env varariables if ccache is installed 
 477  if [ d "$SAGE_LOCAL/libexec/ccache" ]; then 
 478  PATH="$SAGE_LOCAL/libexec/ccache:$PATH"; export PATH 
 479  fi 
 480  if [ z "$CCACHE_DIR" ]; then 
 481  CCACHE_DIR="$DOT_SAGE/ccache" 
 482  fi 
 483  if [ z "$CYCACHE_DIR" ]; then 
 484  CYCACHE_DIR="$DOT_SAGE/cycache" 
 485  fi 
 486  if [ z "$CCACHE_BASEDIR" ]; then 
 487  CCACHE_BASEDIR="$SAGE_ROOT" 
 488  fi 
 489  export CCACHE_DIR CYCACHE_DIR 
 490  export CCACHE_BASEDIR 
476  491  
477  492  if [ "$LD" = "" ]; then 
478  493  LD="ld" && export LD 
diff git a/spkg/install b/spkg/install
a

b


443  443  EOF 
444  444  
445  445  # $(TOOLCHAIN) variable containing prerequisites for the build 
446   if [ "$need_to_install_gcc" = yes ]; then 
447   echo >&3 'TOOLCHAIN=$(INST)/$(GCC)' 
448   else 
449   echo >&3 'TOOLCHAIN=' 
 446  echo >&3 n 'TOOLCHAIN =' 
 447  if [ "$SAGE_INSTALL_CCACHE" == yes ]; then 
 448  echo >&3 n ' $(INST)/ccache' 
450  449  fi 
 450  if [ "$need_to_install_gcc" == yes ]; then 
 451  echo >&3 n ' $(INST)/$(GCC)' 
 452  fi 
 453  echo >&3 
451  454  
452  455  # Copy spkg/standard/deps 
453  456  cat >&3 <<EOF 
diff git a/spkg/standard/deps b/spkg/standard/deps
a

b


489  489  +$(PIPE) "$(SAGE_SPKG) $(SAGE_SCRIPTS) 2>&1" "tee a $(SAGE_LOGS)/$(SAGE_SCRIPTS).log" 
490  490  
491  491  ############################################################################### 
492   # Further receipts for normal packages: 
 492  # Receipts for toolchain packages: 
493  493  ############################################################################### 
494  494  
 495  $(INST)/ccache: $(BASE) $(INST)/$(ZLIB) 
 496  +$(PIPE) "$(SAGE_SPKG) ccache 2>&1" "tee a $(SAGE_LOGS)/ccache.log" 
 497  touch $(INST)/ccache 
 498  
495  499  $(INST)/$(GCC): $(BASE) $(INST)/$(MPIR) $(INST)/$(MPFR) $(INST)/$(MPC) \ 
496  500  $(INST)/$(ZLIB) $(INST)/$(PATCH) 
497  501  +$(PIPE) "$(SAGE_SPKG) $(GCC) 2>&1" "tee a $(SAGE_LOGS)/$(GCC).log" 
498  502  
 503  ############################################################################### 
 504  # Further receipts for normal packages: 
 505  ############################################################################### 
 506  
499  507  $(INST)/$(PIL): $(BASE) $(INST)/$(PYTHON) $(INST)/$(PATCH) 
500  508  +$(PIPE) "$(SAGE_SPKG) $(PIL) 2>&1" "tee a $(SAGE_LOGS)/$(PIL).log" 
501  509  