-
Notifications
You must be signed in to change notification settings - Fork 62
/
configure
executable file
·67 lines (58 loc) · 1.6 KB
/
configure
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
62
63
64
65
66
67
#! /usr/bin/env sh
echo "** Running ./configure"
# Check that this is not just ./configure. We need to run this
# from R CMD INSTALL, to have the R env vars set.
if [ -z "$R_HOME" ]; then
echo >&2 R_HOME is not set, are you running R CMD INSTALL?
exit 1
fi
# Find the R binary we need to use. This is a bit trickier on
# Windows, because it has two architectures. On windows R_ARCH_BIN
# is set, so this should work everywhere.
export RBIN="${R_HOME}/bin${R_ARCH_BIN}/R"
"$RBIN" --vanilla --slave -f tools/dynamic-help.R
BUILD_PLATFORM=
TARGET_PLATFORM=
while [ -n "$1" ]; do
case $1 in
--build)
if [ -n "$2" ]; then
BUILD_PLATFORM="$2"
shift
else
printf 'ERROR: "--build" requires a non-empty option argument.\n' >&2
exit 1
fi
;;
--build=?*)
BUILD_PLATFORM="${1#*=}"
;;
--build=)
printf 'ERROR: "--build" requires a non-empty option argument.\n' >&2
exit 1
;;
--host)
if [ -n "$2" ]; then
TARGET_PLATFORM="$2"
shift
else
printf 'ERROR: "--hosr" requires a non-empty option argument.\n' >&2
exit 1
fi
;;
--host=)
printf 'ERROR: "--host" requires a non-empty option argument.\n' >&2
exit 1
;;
--host=?*)
TARGET_PLATFORM=${1#*=}
;;
esac
shift
done
cat src/Makevars.in | \
sed "s|@BUILD_PLATFORM@|${BUILD_PLATFORM}|" | \
sed "s|@TARGET_PLATFORM@|${TARGET_PLATFORM}|" > src/Makevars
cat R/build-data.R.in | \
sed "s|@BUILD_PLATFORM@|${BUILD_PLATFORM}|" | \
sed "s|@TARGET_PLATFORM@|${TARGET_PLATFORM}|" > R/build-data.R