source: trunk/cf/rp_lang_java.m4 @ 2206

Last change on this file since 2206 was 2206, checked in by gah, 10 years ago
File size: 1.3 KB
Line 
1AC_DEFUN([RP_LANG_JAVA],[
2JAVA=""
3JAVAH=""
4JAVAC=""
5JAVA_DEV_PKG="no"
6AC_ARG_WITH(
7    [java],
8    [AS_HELP_STRING([--with-java=DIR], [location of java @<:@default=yes@:>@])],
9    [rp_with_java=$withval])
10
11if test "${rp_with_java}" != "no" ; then
12  if test "${rp_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,  [], [${rp_with_java}/bin:${rp_with_java}])
18    AC_PATH_PROG(JAVAC, javac, [], [${rp_with_java}/bin:${rp_with_java}])
19    AC_PATH_PROG(JAVAH, javah, [], [${rp_with_java}/bin:${rp_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   ${JAVA_HOME} \
30   /apps/java/jdk1.6.0_01 \
31   /usr/lib/jvm/*sun-1.6* \
32   /opt/sun-jdk-1.6* \
33   /opt/icedtea6-* \
34   /opt/sun-jdk-1.5* \
35   /usr/lib/jvm/*sun-1.5*
36  do
37    if test -r "${d}/include/jni.h" ; then
38      JDK=${d}
39      JAVA_HOME=$JDK
40      JAVA_INC_DIR=${JDK}/include
41      JAVA_INC_SPEC="-I${JDK}/include -I${JDK}/include/linux"
42      break;
43    fi
44    if test -r "${d}/Headers/jni.h" ; then
45      JDK=${d}
46      JAVA_HOME=$JDK
47      JAVA_INC_DIR=${JDK}/Headers
48      JAVA_INC_SPEC="-I${JDK}/Headers -I${JDK}/Headers/macos"
49      break;
50    fi
51  done
52fi
53])
Note: See TracBrowser for help on using the repository browser.