openbsd-ports/devel/cmake/patches/patch-Modules_FindJNI_cmake
dcoppa 3f852fbc8f Bugfix update to cmake-2.8.10.2.
Sync patches with what has been committed upstream (kudos to Amit)
2012-12-05 11:32:04 +00:00

201 lines
8.0 KiB
Plaintext

$OpenBSD: patch-Modules_FindJNI_cmake,v 1.8 2012/12/05 11:32:04 dcoppa Exp $
--- Modules/FindJNI.cmake.orig Tue Nov 27 14:26:32 2012
+++ Modules/FindJNI.cmake Wed Dec 5 10:18:21 2012
@@ -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
@@ -65,8 +67,10 @@ macro(java_append_library_directories _var)
# Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
# system is non-Linux (where the code above has not been well tested)
- if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
- list(APPEND _java_libarch "i386" "amd64" "ppc")
+ if(NOT MODJAVA_VER)
+ if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+ list(APPEND _java_libarch "i386" "amd64" "ppc")
+ endif()
endif()
# Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
@@ -88,39 +92,64 @@ endmacro()
get_filename_component(java_install_version
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
-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"
- )
-
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/lib/jvm/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}
- /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
- # 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\\.6$")
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
+ ${LOCALBASE}/jdk-1.6.0/jre/lib/{libarch}
+ ${LOCALBASE}/jre-1.6.0/lib/{libarch}
+ )
+ elseif(MODJAVA_VER MATCHES "^1\\.6\\+$")
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
+ ${LOCALBASE}/jdk-1.7.0/jre/lib/{libarch}
+ ${LOCALBASE}/jre-1.7.0/lib/{libarch}
+ ${LOCALBASE}/jdk-1.6.0/jre/lib/{libarch}
+ ${LOCALBASE}/jre-1.6.0/lib/{libarch}
+ )
+ else(MODJAVA_VER MATCHES "^1\\.6$")
+ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
+ ${LOCALBASE}/jdk-1.7.0/jre/lib/{libarch}
+ ${LOCALBASE}/jre-1.7.0/lib/{libarch}
+ )
+ endif(MODJAVA_VER MATCHES "^1\\.6$")
+else(MODJAVA_VER)
+ 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"
+ )
+ 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/lib/jvm/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}
+ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
+ # 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
+ # OpenBSD specific paths for default JVM
+ ${LOCALBASE}/jdk-1.7.0/jre/lib/{libarch}
+ ${LOCALBASE}/jre-1.7.0/lib/{libarch}
+ ${LOCALBASE}/jdk-1.6.0/jre/lib/{libarch}
+ ${LOCALBASE}/jre-1.6.0/lib/{libarch}
+ )
+endif(MODJAVA_VER)
set(JAVA_JVM_LIBRARY_DIRECTORIES)
foreach(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
@@ -132,29 +161,48 @@ foreach(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
)
endforeach()
+if(MODJAVA_VER)
+ if(MODJAVA_VER MATCHES "^1\\.6$")
+ set(JAVA_AWT_INCLUDE_DIRECTORIES
+ ${LOCALBASE}/jdk-1.6.0/include
+ )
+ elseif(MODJAVA_VER MATCHES "^1\\.6\\+$")
+ set(JAVA_AWT_INCLUDE_DIRECTORIES
+ ${LOCALBASE}/jdk-1.7.0/include
+ ${LOCALBASE}/jdk-1.6.0/include
+ )
+ else(MODJAVA_VER MATCHES "^1\\.6$")
+ set(JAVA_AWT_INCLUDE_DIRECTORIES
+ ${LOCALBASE}/jdk-1.7.0/include
+ )
+ endif(MODJAVA_VER MATCHES "^1\\.6$")
+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
+ # OpenBSD specific path for default JVM
+ ${LOCALBASE}/jdk-1.7.0/include
+ ${LOCALBASE}/jdk-1.6.0/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)
@@ -227,6 +275,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
${JAVA_INCLUDE_PATH}/hp-ux
${JAVA_INCLUDE_PATH}/alpha