source: trunk/cf/rpLangJava.m4 @ 5732

Last change on this file since 5732 was 3275, checked in by gah, 12 years ago

fix java search, fix error message for logger

File size: 1.3 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   /opt/sun-jdk-1.6* \
33   /opt/icedtea6-* \
34   /opt/sun-jdk-1.5* \
35   /usr/lib/jvm/*sun* \
36   /usr/lib/jvm/*icedtea* \
37   /usr/lib/jvm/*openjdk*
38  do
39    if test -r "${d}/include/jni.h" ; then
40      JDK=${d}
41      JAVA_HOME=$JDK
42      JAVA_INC_DIR=${JDK}/include
43      JAVA_INC_SPEC="-I${JDK}/include -I${JDK}/include/linux"
44      break;
45    fi
46    if test -r "${d}/Headers/jni.h" ; then
47      JDK=${d}
48      JAVA_HOME=$JDK
49      JAVA_INC_DIR=${JDK}/Headers
50      JAVA_INC_SPEC="-I${JDK}/Headers -I${JDK}/Headers/macos"
51      break;
52    fi
53  done
54fi
55])
Note: See TracBrowser for help on using the repository browser.