2011-10-14 13:22:10 -04:00
|
|
|
$OpenBSD: patch-Modules_FindJNI_cmake,v 1.4 2011/10/14 17:22:10 dcoppa Exp $
|
|
|
|
--- Modules/FindJNI.cmake.orig Tue Oct 4 18:09:24 2011
|
|
|
|
+++ Modules/FindJNI.cmake Fri Oct 14 09:48:33 2011
|
2010-05-28 16:21:48 -04:00
|
|
|
@@ -26,6 +26,8 @@
|
2010-11-15 06:39:08 -05:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2010-05-28 16:21:48 -04:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
|
|
|
+SET(MODJAVA_VER $ENV{MODJAVA_VER})
|
|
|
|
+
|
|
|
|
# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
|
|
|
|
MACRO(java_append_library_directories _var)
|
|
|
|
# Determine java arch-specific library subdir
|
2011-10-14 13:22:10 -04:00
|
|
|
@@ -88,40 +90,65 @@ ENDMACRO(java_append_library_directories)
|
|
|
|
GET_FILENAME_COMPONENT(java_install_version
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
|
2010-05-28 16:21:48 -04:00
|
|
|
|
2011-10-14 13:22:10 -04:00
|
|
|
-SET(JAVA_AWT_LIBRARY_DIRECTORIES
|
|
|
|
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
|
|
|
|
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
|
|
|
|
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
|
|
|
|
- )
|
|
|
|
-
|
2010-05-28 16:21:48 -04:00
|
|
|
FILE(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
|
|
|
|
|
|
|
|
-JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
|
|
|
- ${_JAVA_HOME}/jre/lib/{libarch}
|
|
|
|
- ${_JAVA_HOME}/jre/lib
|
|
|
|
- ${_JAVA_HOME}/lib
|
|
|
|
- ${_JAVA_HOME}
|
|
|
|
- /usr/lib
|
|
|
|
- /usr/local/lib
|
|
|
|
- /usr/lib/jvm/java/lib
|
|
|
|
- /usr/lib/java/jre/lib/{libarch}
|
2011-09-20 07:32:36 -04:00
|
|
|
- /usr/lib/jvm/jre/lib/{libarch}
|
2010-05-28 16:21:48 -04:00
|
|
|
- /usr/local/lib/java/jre/lib/{libarch}
|
|
|
|
- /usr/local/share/java/jre/lib/{libarch}
|
|
|
|
- /usr/lib/j2sdk1.4-sun/jre/lib/{libarch}
|
|
|
|
- /usr/lib/j2sdk1.5-sun/jre/lib/{libarch}
|
|
|
|
- /opt/sun-jdk-1.5.0.04/jre/lib/{libarch}
|
|
|
|
- /usr/lib/jvm/java-6-sun/jre/lib/{libarch}
|
|
|
|
- /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
|
|
|
|
- /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex
|
|
|
|
- /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
|
2011-09-20 07:32:36 -04:00
|
|
|
- /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
|
2010-05-28 16:21:48 -04:00
|
|
|
- # Debian specific paths for default JVM
|
|
|
|
- /usr/lib/jvm/default-java/jre/lib/{libarch}
|
|
|
|
- /usr/lib/jvm/default-java/jre/lib
|
|
|
|
- /usr/lib/jvm/default-java/lib
|
|
|
|
- )
|
|
|
|
+IF(MODJAVA_VER)
|
|
|
|
+ IF(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
|
|
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
2011-10-14 13:22:10 -04:00
|
|
|
+ ${LOCALBASE}/jdk-1.5.0/jre/lib/{libarch}
|
|
|
|
+ ${LOCALBASE}/jre-1.5.0/lib/{libarch}
|
2010-05-28 16:21:48 -04:00
|
|
|
+ )
|
|
|
|
+ ELSEIF(MODJAVA_VER MATCHES "^1\\.6.*")
|
|
|
|
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
2011-10-14 13:22:10 -04:00
|
|
|
+ ${LOCALBASE}/jdk-1.6.0/jre/lib/{libarch}
|
|
|
|
+ ${LOCALBASE}/jre-1.6.0/lib/{libarch}
|
2010-05-28 16:21:48 -04:00
|
|
|
+ )
|
|
|
|
+ ELSE(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
|
|
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
2011-10-14 13:22:10 -04:00
|
|
|
+ ${LOCALBASE}/jdk-1.7.0/jre/lib/{libarch}
|
|
|
|
+ ${LOCALBASE}/jre-1.7.0/lib/{libarch}
|
2010-05-28 16:21:48 -04:00
|
|
|
+ )
|
|
|
|
+ ENDIF(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
|
|
+ELSE(MODJAVA_VER)
|
2011-10-14 13:22:10 -04:00
|
|
|
+ SET(JAVA_AWT_LIBRARY_DIRECTORIES
|
|
|
|
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
|
|
|
|
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
|
|
|
|
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
|
|
|
|
+ )
|
|
|
|
|
2010-05-28 16:21:48 -04:00
|
|
|
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
|
|
|
+ ${_JAVA_HOME}/jre/lib/{libarch}
|
|
|
|
+ ${_JAVA_HOME}/jre/lib
|
|
|
|
+ ${_JAVA_HOME}/lib
|
|
|
|
+ ${_JAVA_HOME}
|
2011-10-14 13:22:10 -04:00
|
|
|
+ ${LOCALBASE}/jdk-1.7.0/jre/lib/{libarch}
|
|
|
|
+ ${LOCALBASE}/jdk-1.6.0/jre/lib/{libarch}
|
|
|
|
+ ${LOCALBASE}/jdk-1.5.0/jre/lib/{libarch}
|
|
|
|
+ ${LOCALBASE}/jre-1.7.0/lib/{libarch}
|
|
|
|
+ ${LOCALBASE}/jre-1.6.0/lib/{libarch}
|
|
|
|
+ ${LOCALBASE}/jre-1.5.0/lib/{libarch}
|
2010-05-28 16:21:48 -04:00
|
|
|
+ /usr/lib
|
|
|
|
+ /usr/local/lib
|
|
|
|
+ /usr/lib/jvm/java/lib
|
|
|
|
+ /usr/lib/java/jre/lib/{libarch}
|
2011-09-20 07:32:36 -04:00
|
|
|
+ /usr/lib/jvm/jre/lib/{libarch}
|
2010-05-28 16:21:48 -04:00
|
|
|
+ /usr/local/lib/java/jre/lib/{libarch}
|
|
|
|
+ /usr/local/share/java/jre/lib/{libarch}
|
|
|
|
+ /usr/lib/j2sdk1.4-sun/jre/lib/{libarch}
|
|
|
|
+ /usr/lib/j2sdk1.5-sun/jre/lib/{libarch}
|
|
|
|
+ /opt/sun-jdk-1.5.0.04/jre/lib/{libarch}
|
|
|
|
+ /usr/lib/jvm/java-6-sun/jre/lib/{libarch}
|
|
|
|
+ /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
|
|
|
|
+ /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex
|
|
|
|
+ /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
|
2011-09-20 07:32:36 -04:00
|
|
|
+ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
|
2010-05-28 16:21:48 -04:00
|
|
|
+ # Debian specific paths for default JVM
|
|
|
|
+ /usr/lib/jvm/default-java/jre/lib/{libarch}
|
|
|
|
+ /usr/lib/jvm/default-java/jre/lib
|
|
|
|
+ /usr/lib/jvm/default-java/lib
|
|
|
|
+ )
|
|
|
|
+ENDIF(MODJAVA_VER)
|
2011-10-14 13:22:10 -04:00
|
|
|
+
|
2010-05-28 16:21:48 -04:00
|
|
|
SET(JAVA_JVM_LIBRARY_DIRECTORIES)
|
|
|
|
FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
|
2011-10-14 13:22:10 -04:00
|
|
|
SET(JAVA_JVM_LIBRARY_DIRECTORIES
|
|
|
|
@@ -132,29 +159,47 @@ FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
|
2010-05-28 16:21:48 -04:00
|
|
|
)
|
|
|
|
ENDFOREACH(dir)
|
|
|
|
|
|
|
|
+IF(MODJAVA_VER)
|
|
|
|
+ IF(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
|
|
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
2011-10-14 13:22:10 -04:00
|
|
|
+ ${LOCALBASE}/jdk-1.5.0/include
|
2010-05-28 16:21:48 -04:00
|
|
|
+ )
|
|
|
|
+ ELSEIF(MODJAVA_VER MATCHES "^1\\.6.*")
|
|
|
|
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
2011-10-14 13:22:10 -04:00
|
|
|
+ ${LOCALBASE}/jdk-1.6.0/include
|
2010-05-28 16:21:48 -04:00
|
|
|
+ )
|
|
|
|
+ ELSE(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
|
|
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
2011-10-14 13:22:10 -04:00
|
|
|
+ ${LOCALBASE}/jdk-1.7.0/include
|
2010-05-28 16:21:48 -04:00
|
|
|
+ )
|
|
|
|
+ ENDIF(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
|
|
+ELSE(MODJAVA_VER)
|
|
|
|
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
|
|
|
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
|
|
|
|
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
|
|
|
|
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
|
|
|
|
+ ${_JAVA_HOME}/include
|
2011-10-14 13:22:10 -04:00
|
|
|
+ ${LOCALBASE}/jdk-1.7.0/include
|
|
|
|
+ ${LOCALBASE}/jdk-1.6.0/include
|
|
|
|
+ ${LOCALBASE}/jdk-1.5.0/include
|
2010-05-28 16:21:48 -04:00
|
|
|
+ /usr/include
|
|
|
|
+ /usr/local/include
|
|
|
|
+ /usr/lib/java/include
|
|
|
|
+ /usr/local/lib/java/include
|
|
|
|
+ /usr/lib/jvm/java/include
|
|
|
|
+ /usr/lib/jvm/java-6-sun/include
|
|
|
|
+ /usr/lib/jvm/java-1.5.0-sun/include
|
|
|
|
+ /usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex
|
|
|
|
+ /usr/lib/jvm/java-6-openjdk/include
|
|
|
|
+ /usr/local/share/java/include
|
|
|
|
+ /usr/lib/j2sdk1.4-sun/include
|
|
|
|
+ /usr/lib/j2sdk1.5-sun/include
|
|
|
|
+ /opt/sun-jdk-1.5.0.04/include
|
|
|
|
+ # Debian specific path for default JVM
|
|
|
|
+ /usr/lib/jvm/default-java/include
|
|
|
|
+ )
|
|
|
|
+ENDIF(MODJAVA_VER)
|
|
|
|
|
|
|
|
-SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
|
|
|
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
|
|
|
|
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
|
|
|
|
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
|
|
|
|
- ${_JAVA_HOME}/include
|
|
|
|
- /usr/include
|
|
|
|
- /usr/local/include
|
|
|
|
- /usr/lib/java/include
|
|
|
|
- /usr/local/lib/java/include
|
|
|
|
- /usr/lib/jvm/java/include
|
|
|
|
- /usr/lib/jvm/java-6-sun/include
|
|
|
|
- /usr/lib/jvm/java-1.5.0-sun/include
|
|
|
|
- /usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex
|
|
|
|
- /usr/lib/jvm/java-6-openjdk/include
|
|
|
|
- /usr/local/share/java/include
|
|
|
|
- /usr/lib/j2sdk1.4-sun/include
|
|
|
|
- /usr/lib/j2sdk1.5-sun/include
|
|
|
|
- /opt/sun-jdk-1.5.0.04/include
|
|
|
|
- # Debian specific path for default JVM
|
|
|
|
- /usr/lib/jvm/default-java/include
|
|
|
|
- )
|
|
|
|
-
|
|
|
|
FOREACH(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
|
|
|
|
GET_FILENAME_COMPONENT(jpath "${JAVA_PROG}" PATH)
|
|
|
|
FOREACH(JAVA_INC_PATH ../include ../java/include ../share/java/include)
|
2011-10-14 13:22:10 -04:00
|
|
|
@@ -227,6 +272,7 @@ FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
|
2010-05-28 16:21:48 -04:00
|
|
|
${JAVA_INCLUDE_PATH}/win32
|
|
|
|
${JAVA_INCLUDE_PATH}/linux
|
|
|
|
${JAVA_INCLUDE_PATH}/freebsd
|
|
|
|
+ ${JAVA_INCLUDE_PATH}/openbsd
|
|
|
|
${JAVA_INCLUDE_PATH}/solaris
|
2011-09-20 07:32:36 -04:00
|
|
|
${JAVA_INCLUDE_PATH}/hp-ux
|
|
|
|
${JAVA_INCLUDE_PATH}/alpha
|