subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwhitl...@apache.org
Subject svn commit: r1028125 - /subversion/trunk/build/ac-macros/java.m4
Date Wed, 27 Oct 2010 22:12:16 GMT
Author: jwhitlock
Date: Wed Oct 27 22:12:15 2010
New Revision: 1028125

URL: http://svn.apache.org/viewvc?rev=1028125&view=rev
Log:
Follow-up to r1028084 that will also search Xcode for a suitable JDK.

* build/ac-macros/java.m4: Enhanced to search for a suitable JDK in Xcode.

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=1028125&r1=1028124&r2=1028125&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/java.m4 (original)
+++ subversion/trunk/build/ac-macros/java.m4 Wed Oct 27 22:12:15 2010
@@ -81,32 +81,48 @@ 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"; then
+    OSX_VER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
+
+    if test "$OSX_VER" = "10.4"; then
+      dnl For OS X 10.4, the SDK version is 10.4u instead of 10.4.
+      OSX_VER = "$OSX_VERu"
+    fi
+
+    OSX_SYS_JAVA_FRAMEWORK="/System/Library/Frameworks/JavaVM.framework"
+    OSX_SDK_JAVA_FRAMEWORK="/Developer/SDKs/MacOSX$OSX_VER.sdk/System/Library"
+    OSX_SDK_JAVA_FRAMEWORK="$OSX_SDK_JAVA_FRAMEWORK/Frameworks/JavaVM.framework"
+  fi
+
   if test "$os_arch" = "Darwin" && test "$JDK" = "/usr" &&
      test -d "/Library/Java/Home"; then
-      JDK="/Library/Java/Home"
+    JDK="/Library/Java/Home"
   fi
+
   if test "$os_arch" = "Darwin" && test "$JDK" = "/Library/Java/Home"; then
-      JRE_LIB_DIR="$OSX_JAVA_FRAMEWORK_HOME/Classes"
+    JRE_LIB_DIR="$OSX_SYS_JAVA_FRAMEWORK/Classes"
   else
-      JRE_LIB_DIR="$JDK/jre/lib"
+    JRE_LIB_DIR="$JDK/jre/lib"
   fi
 
   if test -f "$JDK/include/jni.h"; then
     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
+  elif test "$os_arch" = "Darwin" && test -e "$JDK/Headers/jni.h"; then
+    dnl Search the Headers directory in the JDK
     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"
+  elif test "$os_arch" = "Darwin" &&
+       test -e "$OSX_SYS_JAVA_FRAMEWORK/Headers/jni.h"; then
+    dnl Search the System framework's Headers directory
+    JNI_INCLUDEDIR="$OSX_SYS_JAVA_FRAMEWORK/Headers"
+    JDK_SUITABLE=yes
+  elif test "$os_arch" = "Darwin" &&
+       test -e "$OSX_SDK_JAVA_FRAMEWORK/Headers/jni.h"; then
+    dnl Search the SDK's System framework's Headers directory
+    JNI_INCLUDEDIR="$OSX_SDK_JAVA_FRAMEWORK/Headers"
     JDK_SUITABLE=yes
   else
     AC_MSG_WARN([no JNI header files found.])
@@ -115,7 +131,7 @@ AC_DEFUN(SVN_FIND_JDK,
     fi
     JDK_SUITABLE=no
   fi
-  AC_MSG_RESULT([$JDK_SUITABLE])
+  AC_MSG_RESULT([$JNI_INCLUDEDIR/jni.h])
 
   if test "$JDK_SUITABLE" = "yes"; then
     JAVA_BIN='$(JDK)/bin'



Mime
View raw message