diff --git a/tools/build_absl.sh b/tools/build_absl.sh index 8270683f..86f24d25 100755 --- a/tools/build_absl.sh +++ b/tools/build_absl.sh @@ -1,9 +1,15 @@ # https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-cmake +: ${R_HOME=`R RHOME`} +if test -z "${R_HOME}"; then + echo "could not determine R_HOME" + exit 1 +fi + # Do our best to pass on the user MAKEFLAGS. This can result in much faster # compilation of the vendored library. -MAKEFLAGS=`Rscript -e 'readRenviron("~/.R/Makevars"); cat(Sys.getenv("MAKEFLAGS"))'` +MAKEFLAGS=`${R_HOME}/bin/Rscript -e 'readRenviron("~/.R/Makevars"); cat(Sys.getenv("MAKEFLAGS"))'` if test -z "$MAKE"; then MAKE="`which make`"; fi if ${MAKE} --version ; then @@ -23,12 +29,6 @@ else exit 1 fi -: ${R_HOME=`R RHOME`} -if test -z "${R_HOME}"; then - echo "could not determine R_HOME" - exit 1 -fi - CC=`"${R_HOME}/bin/R" CMD config CC` CXX="`${R_HOME}/bin/R CMD config CXX17` `${R_HOME}/bin/R CMD config CXX17STD`" CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`