-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.win
75 lines (67 loc) · 2.11 KB
/
configure.win
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
68
69
70
71
72
73
74
75
#!/bin/sh
echo " checking JPEG headers and libraries"
allok=yes
use_local=no
## In the future we should be able to use
## local=`${R_HOME}/bin/R CMD config LOCAL_SOFT`
## but up to at least R 3.0.1 that doesn't work
if [ -z "$MAKE" ]; then
MAKE=`${R_HOME}/bin/R CMD config MAKE`
if [ -z "$MAKE" ]; then
MAKE=make
fi
fi
makefiles="-f ${R_HOME}/etc${R_ARCH}/Makeconf -f ${R_SHARE_DIR}/make/config.mk"
local=`${MAKE} -s ${makefiles} print R_HOME=${R_HOME} VAR=LOCAL_SOFT`
if [ -e $local/lib ]; then
if ls $local/lib/libjpeg.* 2>/dev/null; then
echo " found libjpeg in LOCAL_SOFT: $local/lib"
use_local=yes
elif ls $local/lib${R_ARCH}/libjpeg.* 2>/dev/null; then
echo " found libjpeg in LOCAL_SOFT: $local/lib${R_ARCH}"
use_local=yes
else
echo " LOCAL_SOFT does not contain libjpeg, fall back to external jpeg"
fi
else
echo " LOCAL_SOFT does not exist, fall back to external jpeg"
fi
if [ ${use_local} = yes ]; then
mv src/Makevars.win src/Makevars-in.win
mv src/Makevars-ls.win src/Makevars.win
else
if [ ! -e src/win32/libjpeg.a ]; then
if [ ! -e src/libjpeg-current-win.tar.gz ]; then
echo " cannot find current JPEG files"
echo " attempting to download them"
echo 'download.file("http://www.rforge.net/jpeg/files/libjpeg-current-win.tar.gz","src/libjpeg-current-win.tar.gz",mode="wb",quiet=TRUE)'|${R_HOME}/bin/R --vanilla --slave
fi
if [ ! -e src/libjpeg-current-win.tar.gz ]; then
allok=no
else
echo " unpacking current JPEG"
tar fxz src/libjpeg-current-win.tar.gz -C src
if [ ! -e src/win32/libjpeg.a ]; then
allok=no
fi
fi
fi
if [ ! -e src/win32/libjpeg.a ]; then
allok=no
fi
fi
if [ ${allok} != yes ]; then
echo ""
echo " *** ERROR: unable to find JPEG files"
echo ""
echo " They must be either in src/win32, in a tar-ball"
echo " src/libjpeg-current-win.tar.gz or"
echo " available via the LOCAL_SOFT R make setting."
echo ""
echo " You can get the latest binary tar ball from"
echo " http://www.rforge.net/jpeg/files/"
echo ""
exit 1
fi
echo " seems ok, ready to go"
exit 0