Skip to content

Commit

Permalink
update configure
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiahParry committed May 8, 2024
1 parent 5680c80 commit a8cb0dc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 59 deletions.
69 changes: 17 additions & 52 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,7 @@ PACKAGE_STRING=''
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

ac_subst_vars='RSCRIPT
RUSTC
ac_subst_vars='RUSTC
target_alias
host_alias
build_alias
Expand Down Expand Up @@ -1790,67 +1789,33 @@ if ! command -v cargo &> /dev/null; then
fi

# Check for Rscript
# Extract the first word of "Rscript", so it can be a program name with args.
set dummy Rscript; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_RSCRIPT+y}
then :
printf %s "(cached) " >&6
else case e in #(
e) case $RSCRIPT in
[\\/]* | ?:[\\/]*)
ac_cv_path_RSCRIPT="$RSCRIPT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_RSCRIPT="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

;;
esac ;;
esac
fi
RSCRIPT=$ac_cv_path_RSCRIPT
if test -n "$RSCRIPT"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RSCRIPT" >&5
printf "%s\n" "$RSCRIPT" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if test -z "$R_HOME"; then
echo "----------------------- R_HOME NOT SET------------------------"
echo "The 'R_HOME' environment variable is not set. Please make sure R"
echo "is installed and set the R_HOME environment variable."
echo "-------------------------------------------------------------------"
echo ""
exit 1
fi

RSCRIPT="${R_HOME}/bin/Rscript"

if test -z "$RSCRIPT"; then
echo "----------------------- RSCRIPT NOT FOUND------------------------"
echo "The 'Rscript' interpreter was not found on the PATH. Please make sure R"
echo "is installed and in your PATH."
echo "-------------------------------------------------------------------"
# Check if Rscript is executable
if ! test -x "$RSCRIPT"; then
echo "----------------------- RSCRIPT NOT EXECUTABLE------------------------"
echo "The 'Rscript' executable is not found or not executable. Please make sure R"
echo "is installed correctly and 'Rscript' is executable."
echo "--------------------------------------------------------------------------"
echo ""
exit 1
fi

# Output status
echo "Rust is installed, Cargo is found, and Rscript is found."
echo "Rust is installed, Cargo is found, R_HOME is set, and Rscript is found."
echo "Running tools/get-deps.R script..."

# Execute the get-deps.R script
if ! $RSCRIPT ./tools/get-deps.R; then
if ! "$RSCRIPT" ./tools/get-deps.R; then
echo "Error: Failed to execute tools/get-deps.R."
exit 1
fi
Expand Down
25 changes: 18 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,33 @@ if ! command -v cargo &> /dev/null; then
fi

# Check for Rscript
AC_PATH_PROG([RSCRIPT], [Rscript])
if test -z "$RSCRIPT"; then
echo "----------------------- [RSCRIPT NOT FOUND]------------------------"
echo "The 'Rscript' interpreter was not found on the PATH. Please make sure R"
echo "is installed and in your PATH."
if test -z "$R_HOME"; then
echo "----------------------- [R_HOME NOT SET]------------------------"
echo "The 'R_HOME' environment variable is not set. Please make sure R"
echo "is installed and set the R_HOME environment variable."
echo "-------------------------------------------------------------------"
echo ""
exit 1
fi

RSCRIPT="${R_HOME}/bin/Rscript"

# Check if Rscript is executable
if ! test -x "$RSCRIPT"; then
echo "----------------------- [RSCRIPT NOT EXECUTABLE]------------------------"
echo "The 'Rscript' executable is not found or not executable. Please make sure R"
echo "is installed correctly and 'Rscript' is executable."
echo "--------------------------------------------------------------------------"
echo ""
exit 1
fi

# Output status
echo "Rust is installed, Cargo is found, and Rscript is found."
echo "Rust is installed, Cargo is found, R_HOME is set, and Rscript is found."
echo "Running tools/get-deps.R script..."

# Execute the get-deps.R script
if ! $RSCRIPT ./tools/get-deps.R; then
if ! "$RSCRIPT" ./tools/get-deps.R; then
echo "Error: Failed to execute tools/get-deps.R."
exit 1
fi

0 comments on commit a8cb0dc

Please sign in to comment.