summaryrefslogtreecommitdiff
blob: 963b01380c2307457f932aa1bc9abae8e7b6b8b2 (plain)
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
33
34
35
36
37
38
--- db-6.2.23/dist/aclocal_java/ac_jni_include_dirs.m4
+++ db-6.2.23/dist/aclocal_java/ac_jni_include_dirs.m4
@@ -43,18 +43,23 @@
 *)	AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
 esac
 
-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
-case "$host_os" in
-	darwin*)	_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
-			if test -d "$_JTOPDIR/include"; then
-				_JINC="$_JTOPDIR/include"
-			else
-				_JINC="$_JTOPDIR/Headers"
-			fi;;
-	*)		_JINC="$_JTOPDIR/include";;
-esac
-
+# If JAVAPREFIX is defined, look there first
+if test -r "$JAVAPREFIX/include/jni.h"; then
+	_JTOPDIR="$JAVAPREFIX"
+	_JINC="$JAVAPREFIX/include"
+else
+	_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+	_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+	case "$host_os" in
+		darwin*)	_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+				if test -d "$_JTOPDIR/include"; then
+					_JINC="$_JTOPDIR/include"
+				else
+					_JINC="$_JTOPDIR/Headers"
+				fi;;
+		*)		_JINC="$_JTOPDIR/include";;
+	esac
+fi
 # If we find jni.h in /usr/include, then it's not a java-only tree, so
 # don't add /usr/include or subdirectories to the list of includes.
 # An extra -I/usr/include can foul things up with newer gcc's.