File: configure.win

package info (click to toggle)
rjava 1.0-11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,184 kB
  • sloc: java: 13,223; ansic: 5,479; sh: 3,776; xml: 325; makefile: 250; perl: 33
file content (59 lines) | stat: -rw-r--r-- 1,733 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

# if CONFIGURED is set, then we don't attempt to run findjava
# (useful when building inside rJava)
if [ -z "$CONFIGURED" ]; then
    echo "Generate Windows-specific files (src/jvm-w32) ..."
    make -C src/win32

    if [ $? != 0 ]; then
	exit 1
    fi

    echo "Find Java..."
# findjava honors JAVA_HOME environment variable, so we can safely overwite it 
    if [ -e src/win32/findjava.exe ]; then
	JAVA_HOME=`src/win32/findjava -s -f`
	R_HOME=`src/win32/findjava -R -s -f`
    fi
fi

if [ x$JAVA_HOME = x ]; then
    echo "ERROR: cannot find Java Development Kit." >&2
    echo "       Please set JAVA_HOME to specify its location manually" >&2
    exit 1
fi

if [ x$R_HOME = x ]; then
    echo "ERROR: cannot find R. Please set R_HOME correspondingly." >&2
    exit 1
fi

echo "  JAVA_HOME=$JAVA_HOME"
echo "  R_HOME=$R_HOME"

echo "JAVAHOME:=$JAVA_HOME" > src/Makefile.wconf
echo "RHOME:=$R_HOME" >> src/Makefile.wconf

if [ -e "$JAVA_HOME/bin/javah.exe" ]; then ## does the JDK have javah?
    echo 'JDK includes javah.exe'
    echo 'JAVAH=$(JAVAHOME)/bin/javah' >> src/Makefile.wconf
else ## else we have to create headers during the compilation
    echo 'JDK has no javah.exe - using javac -h . instead'
    ## if this is at least 1.8 we can set source/target
    ## it is mandatory for 14 (and may be earlier) due to yield
    tgt=`"${JAVA_HOME}/bin/java" -cp tools getsp -minver 8`
    echo "Is the Java version at least 1.8 ... $tgt"
    if [ x$tgt = xyes ]; then
	echo 'JFLAGS=-source 1.8 -target 1.8 -h .' >> src/Makefile.wconf
    else
	echo 'JFLAGS=-h .' >> src/Makefile.wconf
    fi
fi

echo "Creating Makefiles ..."
cp Makefile.win Makefile
cp src/Makefile.win src/Makefile

echo "Configuration done."