source: branches/r9/lang/cf/rpLangJava.m4 @ 4837

Last change on this file since 4837 was 4837, checked in by gah, 6 years ago
File size: 1.4 KB
Line 
1AC_DEFUN([RP_LANG_JAVA],[
2AC_ARG_WITH([java],
3    [AS_HELP_STRING([--with-java[=DIR]],[location of java @<:@default=yes@:>@])],
4    [],
5    [with_java=yes])
6JAVA=""
7JAVAH=""
8JAVAC=""
9JAVA_DEV_PKG="no"
10
11if test "${with_java}" != "no" ; then
12  if test "${with_java}" = "yes" ; then
13    AC_PATH_PROG(JAVA,  java)
14    AC_PATH_PROG(JAVAC, javac)
15    AC_PATH_PROG(JAVAH, javah)
16  else
17    AC_PATH_PROG(JAVA,  java,  [], [${with_java}/bin:${with_java}])
18    AC_PATH_PROG(JAVAC, javac, [], [${with_java}/bin:${with_java}])
19    AC_PATH_PROG(JAVAH, javah, [], [${with_java}/bin:${with_java}])
20  fi
21fi
22JDK=
23JAVA_INC_DIR=
24JAVA_INC_SPEC=
25
26# If java exists, let's look for the jni.h file.
27if test "x${JAVA}" != "x" ; then
28  for d in \
29   ${with_java} \
30   ${JAVA_HOME} \
31   /apps/java/jdk1.6* \
32   /usr/lib/jvm/oracle-jdk-*-1.8* \
33   /usr/lib/jvm/oracle-jdk-*-1.7* \
34   /usr/lib/jvm/oracle-jdk-*-1.6* \
35   /opt/sun-jdk-1.6* \
36   /opt/icedtea6-* \
37   /opt/sun-jdk-1.5* \
38   /usr/lib/jvm/*sun* \
39   /usr/lib/jvm/*icedtea* \
40   /usr/lib/jvm/*openjdk*
41  do
42    if test -r "${d}/include/jni.h" ; then
43      JDK=${d}
44      JAVA_HOME=$JDK
45      JAVA_INC_DIR=${JDK}/include
46      JAVA_INC_SPEC="-I${JDK}/include -I${JDK}/include/linux"
47      break;
48    fi
49    if test -r "${d}/Headers/jni.h" ; then
50      JDK=${d}
51      JAVA_HOME=$JDK
52      JAVA_INC_DIR=${JDK}/Headers
53      JAVA_INC_SPEC="-I${JDK}/Headers -I${JDK}/Headers/macos"
54      break;
55    fi
56  done
57fi
58])
Note: See TracBrowser for help on using the repository browser.