OpenBSD: Add paths for Java 1.6.0/1.7.0 JRE/JDK

This commit is contained in:
Amit Kulkarni 2012-12-03 17:23:10 -06:00 committed by Brad King
parent 288f75edee
commit 6e7a3453b4
3 changed files with 18 additions and 0 deletions

View File

@ -63,6 +63,8 @@ if(NOT CMAKE_Java_COMPILER)
/usr/java/j2sdk1.4.2_09/bin /usr/java/j2sdk1.4.2_09/bin
/usr/lib/j2sdk1.5-sun/bin /usr/lib/j2sdk1.5-sun/bin
/opt/sun-jdk-1.5.0.04/bin /opt/sun-jdk-1.5.0.04/bin
/usr/local/jdk-1.7.0/bin
/usr/local/jdk-1.6.0/bin
) )
# if no compiler has been specified yet, then look for one # if no compiler has been specified yet, then look for one
if(CMAKE_Java_COMPILER_INIT) if(CMAKE_Java_COMPILER_INIT)

View File

@ -120,6 +120,11 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
/usr/lib/jvm/default-java/jre/lib/{libarch} /usr/lib/jvm/default-java/jre/lib/{libarch}
/usr/lib/jvm/default-java/jre/lib /usr/lib/jvm/default-java/jre/lib
/usr/lib/jvm/default-java/lib /usr/lib/jvm/default-java/lib
# OpenBSD specific paths for default JVM
/usr/local/jdk-1.7.0/jre/lib/{libarch}
/usr/local/jre-1.7.0/lib/{libarch}
/usr/local/jdk-1.6.0/jre/lib/{libarch}
/usr/local/jre-1.6.0/lib/{libarch}
) )
set(JAVA_JVM_LIBRARY_DIRECTORIES) set(JAVA_JVM_LIBRARY_DIRECTORIES)
@ -153,6 +158,9 @@ set(JAVA_AWT_INCLUDE_DIRECTORIES
/opt/sun-jdk-1.5.0.04/include /opt/sun-jdk-1.5.0.04/include
# Debian specific path for default JVM # Debian specific path for default JVM
/usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include
# OpenBSD specific path for default JVM
/usr/local/jdk-1.7.0/include
/usr/local/jdk-1.6.0/include
) )
foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}") foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
@ -227,6 +235,7 @@ find_path(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_INCLUDE_PATH}/win32 ${JAVA_INCLUDE_PATH}/win32
${JAVA_INCLUDE_PATH}/linux ${JAVA_INCLUDE_PATH}/linux
${JAVA_INCLUDE_PATH}/freebsd ${JAVA_INCLUDE_PATH}/freebsd
${JAVA_INCLUDE_PATH}/openbsd
${JAVA_INCLUDE_PATH}/solaris ${JAVA_INCLUDE_PATH}/solaris
${JAVA_INCLUDE_PATH}/hp-ux ${JAVA_INCLUDE_PATH}/hp-ux
${JAVA_INCLUDE_PATH}/alpha ${JAVA_INCLUDE_PATH}/alpha

View File

@ -80,6 +80,8 @@ set(_JAVA_PATHS
/usr/java/j2sdk1.4.2_09/bin /usr/java/j2sdk1.4.2_09/bin
/usr/lib/j2sdk1.5-sun/bin /usr/lib/j2sdk1.5-sun/bin
/opt/sun-jdk-1.5.0.04/bin /opt/sun-jdk-1.5.0.04/bin
/usr/local/jdk-1.7.0/bin
/usr/local/jdk-1.6.0/bin
) )
find_program(Java_JAVA_EXECUTABLE find_program(Java_JAVA_EXECUTABLE
NAMES java NAMES java
@ -107,6 +109,7 @@ if(Java_JAVA_EXECUTABLE)
# 2. OpenJDK 1.6 # 2. OpenJDK 1.6
# 3. GCJ 1.5 # 3. GCJ 1.5
# 4. Kaffe 1.4.2 # 4. Kaffe 1.4.2
# 5. OpenJDK 1.7.x on OpenBSD
if(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*") if(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
# This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
string( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*" string( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
@ -115,6 +118,10 @@ if(Java_JAVA_EXECUTABLE)
# Kaffe style # Kaffe style
string( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*" string( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
"\\1" Java_VERSION_STRING "${var}" ) "\\1" Java_VERSION_STRING "${var}" )
elseif(var MATCHES "openjdk version \"[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
# OpenJDK ver 1.7.x on OpenBSD
string( REGEX REPLACE "openjdk version \"([0-9]+\\.[0-9]+\\.[0-9_]+).*"
"\\1" Java_VERSION_STRING "${var}" )
else() else()
if(NOT Java_FIND_QUIETLY) if(NOT Java_FIND_QUIETLY)
message(WARNING "regex not supported: ${var}. Please report") message(WARNING "regex not supported: ${var}. Please report")