195d9f90cf
OK sthen@, landry@ (who also tested this in a bulk build)
166 lines
6.2 KiB
Plaintext
166 lines
6.2 KiB
Plaintext
$OpenBSD: patch-Modules_FindJNI_cmake,v 1.2 2010/11/15 11:39:09 dcoppa Exp $
|
|
--- Modules/FindJNI.cmake.orig Wed Nov 3 20:58:27 2010
|
|
+++ Modules/FindJNI.cmake Wed Nov 10 09:01:25 2010
|
|
@@ -26,6 +26,8 @@
|
|
# (To distribute this file outside of CMake, substitute the full
|
|
# 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
|
|
@@ -96,29 +98,51 @@ SET(JAVA_AWT_LIBRARY_DIRECTORIES
|
|
|
|
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}
|
|
- /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}
|
|
- # 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
|
|
+ ${JAVA_AWT_LIBRARY_DIRECTORIES}
|
|
+ /usr/local/jdk-1.5.0/jre/lib/{libarch}
|
|
+ /usr/local/jre-1.5.0/lib/{libarch}
|
|
+ )
|
|
+ ELSEIF(MODJAVA_VER MATCHES "^1\\.6.*")
|
|
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
|
+ ${JAVA_AWT_LIBRARY_DIRECTORIES}
|
|
+ /usr/local/jdk-1.6.0/jre/lib/{libarch}
|
|
+ /usr/local/jre-1.6.0/lib/{libarch}
|
|
+ )
|
|
+ ELSE(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
|
|
+ ${JAVA_AWT_LIBRARY_DIRECTORIES}
|
|
+ /usr/local/jdk-1.7.0/jre/lib/{libarch}
|
|
+ /usr/local/jre-1.7.0/lib/{libarch}
|
|
+ )
|
|
+ ENDIF(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
+ELSE(MODJAVA_VER)
|
|
+ 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}
|
|
+ /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}
|
|
+ # 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)
|
|
|
|
SET(JAVA_JVM_LIBRARY_DIRECTORIES)
|
|
FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
|
|
@@ -130,29 +154,47 @@ FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
|
|
)
|
|
ENDFOREACH(dir)
|
|
|
|
+IF(MODJAVA_VER)
|
|
+ IF(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
|
+ ${JAVA_AWT_INCLUDE_DIRECTORIES}
|
|
+ /usr/local/jdk-1.5.0/include
|
|
+ )
|
|
+ ELSEIF(MODJAVA_VER MATCHES "^1\\.6.*")
|
|
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
|
+ ${JAVA_AWT_INCLUDE_DIRECTORIES}
|
|
+ /usr/local/jdk-1.6.0/include
|
|
+ )
|
|
+ ELSE(MODJAVA_VER MATCHES "^1\\.5.*")
|
|
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES
|
|
+ ${JAVA_AWT_INCLUDE_DIRECTORIES}
|
|
+ /usr/local/jdk-1.7.0/include
|
|
+ )
|
|
+ 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
|
|
+ /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)
|
|
@@ -225,6 +267,7 @@ FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
|
|
${JAVA_INCLUDE_PATH}/win32
|
|
${JAVA_INCLUDE_PATH}/linux
|
|
${JAVA_INCLUDE_PATH}/freebsd
|
|
+ ${JAVA_INCLUDE_PATH}/openbsd
|
|
${JAVA_INCLUDE_PATH}/solaris
|
|
)
|
|
|