#!/bin/sh

# Fail if not run by R CMD INSTALL
if [ -z "$R_HOME" ]; then
  echo >&2 "R_HOME is not set. Are you running this via R CMD INSTALL?"
  exit 1
fi

# Use Rscript, not R
R_SCRIPT="${R_HOME}/bin${R_ARCH_BIN}/Rscript"

# Run the actual configure logic
exec "$R_SCRIPT" --vanilla --slave -e "source('tools/configure.R')"
