-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·61 lines (57 loc) · 1.89 KB
/
configure
File metadata and controls
executable file
·61 lines (57 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/sh
## For the time being, this is a simple shell script ...
## Find the R home directory.
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo "Could not determine R_HOME."
exit 1
fi
## Find the configured Java interpreter.
## If JAVA is set in the environment, use it.
if test -z "${JAVA}" || test ! -x "${JAVA}"; then
## Argh. R CMD config JAVA works only from 2.5.0 onwards ...
JAVA=`"${R_HOME}/bin/R" CMD config | grep JAVA`
if test -n "${JAVA}"; then
JAVA=`"${R_HOME}/bin/R" CMD config JAVA`
fi
if test -z "${JAVA}" || test ! -x "${JAVA}"; then
## Keep this in sync with what is used in R CMD javareconf.
## Sort of ...
JAVA_PATH="${PATH}"
if test -n "${JAVA_HOME}" && test -d "${JAVA_HOME}"; then
JAVA_PATH="${JAVA_HOME}:${JAVA_HOME}/jre/bin:${JAVA_HOME}/bin:${JAVA_PATH}"
fi
JAVA_PATH="${JAVA_PATH}":/usr/java/bin:/usr/jdk/bin:/usr/lib/java/bin:/usr/lib/jdk/bin:/usr/local/java/bin:/usr/local/jdk/bin:/usr/local/lib/java/bin:/usr/local/lib/jdk/bin
save_IFS="${IFS}"
IFS=":"
for dir in ${JAVA_PATH}; do
test "${dir}" = "." && continue
if test -x "${dir}/java"; then
JAVA="${dir}/java"
break
fi
done
IFS="${save_IFS}"
fi
if test -z "${JAVA}"; then
echo "Could not determine the Java interpreter."
echo "Maybe run R CMD javareconf?"
exit 1
fi
fi
## Check Java version requirement.
RWeka_cv_java_version_8=no
## See <http://openjdk.java.net/jeps/223>.
java_version=`${JAVA} -cp tools getsp "java.version" | sed 's/[+-].*//'`
java_version_maj=`echo "${java_version}" | cut -f1 -d.`
java_version_min=`echo "${java_version}" | cut -f2 -d.`
if test ${java_version_maj} -ge 8 || \
{ test ${java_version_maj} -eq 1 && \
test ${java_version_min} -ge 8; } ;
then
RWeka_cv_java_version_8=yes
fi
if test "${RWeka_cv_java_version_8}" = no; then
echo "Need at least Java version 8."
exit 1
fi