-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure
executable file
·32 lines (29 loc) · 1017 Bytes
/
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
#!/bin/bash
set -e
unset GCC
while [ $# -gt 0 ] ; do
maybe_gcc=${1#--with-gcc=}
if [ "$maybe_gcc" != "$1" ]; then
GCC=$maybe_gcc
fi
shift
done
rm -f foreign-jni.buildinfo
if ! echo '#include <jni.h>' | $GCC -E - 2>&1 > /dev/null ; then
JNI_GCC_INCLUDES="-I${JAVA_HOME}/include/"
if [ -d "${JAVA_HOME}/include/linux" ] ; then
JNI_GCC_INCLUDES="$JNI_GCC_INCLUDES -I${JAVA_HOME}/include/linux/"
fi
if [ -d "${JAVA_HOME}/include/darwin" ] ; then
JNI_GCC_INCLUDES="$JNI_GCC_INCLUDES -I${JAVA_HOME}/include/darwin/"
fi
if [ -d "${JAVA_HOME}/include/win32" ] ; then
JNI_GCC_INCLUDES="$JNI_GCC_INCLUDES -I${JAVA_HOME}/include/win32/"
fi
if ! echo '#include <jni.h>' | $GCC ${JNI_GCC_INCLUDES} -E - 2>&1 > /dev/null ; then
echo "Include file jni.h not found! Please set \$JAVA_HOME or install jni.h in your compiler include path."
exit 1
else
echo cc-options: ${JNI_GCC_INCLUDES} >> foreign-jni.buildinfo
fi
fi