source: trunk/cf/rpLangJava.m4 @ 2209

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