Author: jwhitlock
Date: Wed Oct 27 20:16:36 2010
New Revision: 1028084

URL: http://svn.apache.org/viewvc?rev=1028084&view=rev
Log:
Fixed the problem where comiling JavaHL on OS X fails after Apple's latest
Java update.

* build/ac-macros/java.m4: Added two new paths to check for the jni.h when
   on the Darwin platform.

Modified:
    subversion/trunk/build/ac-macros/java.m4

Modified: subversion/trunk/build/ac-macros/java.m4
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/java.m4?rev=1028084&r1=1028083&r2=1028084&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/java.m4 (original)
+++ subversion/trunk/build/ac-macros/java.m4 Wed Oct 27 20:16:36 2010
@@ -81,13 +81,14 @@ AC_DEFUN(SVN_FIND_JDK,
   dnl but Darwin doesn't have that utility.  /usr/bin/java is a symlink into
   dnl /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Commands
   dnl See http://developer.apple.com/qa/qa2001/qa1170.html
+  OSX_JAVA_FRAMEWORK_HOME="/System/Library/Frameworks/JavaVM.framework"
   os_arch="`uname`"
   if test "$os_arch" = "Darwin" && test "$JDK" = "/usr" &&
      test -d "/Library/Java/Home"; then
       JDK="/Library/Java/Home"
   fi
   if test "$os_arch" = "Darwin" && test "$JDK" = "/Library/Java/Home"; then
-      JRE_LIB_DIR="/System/Library/Frameworks/JavaVM.framework/Classes"
+      JRE_LIB_DIR="$OSX_JAVA_FRAMEWORK_HOME/Classes"
   else
       JRE_LIB_DIR="$JDK/jre/lib"
   fi
@@ -96,6 +97,17 @@ AC_DEFUN(SVN_FIND_JDK,
     dnl This *must* be fully expanded, or we'll have problems later in find.
     JNI_INCLUDEDIR="$JDK/include"
     JDK_SUITABLE=yes
+  elif test "$os_arch" = "Darwin" && test -f "$JDK/Headers/jni.h" -o \
+                                          -h "$JDK/Headers/jni.h"; then
+    dnl This works around the JDK issue on Snow Leopard
+    JNI_INCLUDEDIR="$JDK/Headers"
+    JDK_SUITABLE=yes
+  elif test "$os_arch" = "Darwin" && \
+       test -f "$OSX_JAVA_FRAMEWORK_HOME/Versions/Current/Headers/jni.h" -o \
+            -h "$OSX_JAVA_FRAMEWORK_HOME/Versions/Current/Headers/jni.h"; then
+    dnl This works around the JDK issue on Snow Leopard
+    JNI_INCLUDEDIR="$OSX_JAVA_FRAMEWORK_HOME/Versions/Current/Headers"
+    JDK_SUITABLE=yes
   else
     AC_MSG_WARN([no JNI header files found.])
     if test "$os_arch" = "Darwin"; then


Reply via email to