You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cmake/debian/patches/FindJNI_fix_libarch_determi...

78 lines
3.6 KiB

From: Modestas Vainius <modax@debian.org>
Subject: Fix libarch determination based on openjdk 1.6.0_18 + icedtea code
This new version is based on the openjdk 1.6.0_18 + icedtea patches:
- acinclude.m4 (JRE_ARCH_DIR)
- openjdk/jdk/make/common/shared/Platform.gmk (libarch)
This should fix libarch determination on armel and mipsel, add support for
hppa and sh. However, it would be more reliable to base this guess on the
first part of the GNU config.guess platform triplet but it is generally not
available for cmake yet.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=544674
Bug: http://public.kitware.com/Bug/view.php?id=9611
Origin: vendor
Forwarded: no
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -29,24 +29,42 @@
# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
MACRO(java_append_library_directories _var)
# Determine java arch-specific library subdir
- IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
- # Based on openjdk/jdk/make/common/shared/Platform.gmk as of 6b16
- # and kaffe as of 1.1.8 which uses the first part of the
- # GNU config.guess platform triplet.
- IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- SET(_java_libarch "i386")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
- SET(_java_libarch "amd64" "x86_64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
- SET(_java_libarch "ppc" "powerpc" "ppc64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
- SET(_java_libarch "sparc" "sparcv9")
- ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
- ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux")
- SET(_java_libarch "i386" "amd64" "ppc") # previous default
- ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ # Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
+ # 1.6.0_18 + icedtea patches. However, it would be much better to base the
+ # guess on the first part of the GNU config.guess platform triplet.
+ IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ SET(_java_libarch "amd64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
+ SET(_java_libarch "i386")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
+ SET(_java_libarch "alpha")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+ SET(_java_libarch "arm")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
+ IF(CMAKE_CROSSCOMPILING)
+ SET(_java_libarch "mips" "mipsel" "mipseb")
+ ELSE(CMAKE_CROSSCOMPILING)
+ INCLUDE(TestBigEndian)
+ TEST_BIG_ENDIAN(_java_bigendian)
+ IF(_java_bigendian)
+ SET(_java_libarch "mips" "mipseb")
+ ELSE(_java_bigendian)
+ SET(_java_libarch "mipsel")
+ ENDIF(_java_bigendian)
+ ENDIF(CMAKE_CROSSCOMPILING)
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
+ SET(_java_libarch "ppc64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
+ SET(_java_libarch "ppc")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
+ SET(_java_libarch "sparc" "sparcv9")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
+ SET(_java_libarch "parisc" "parisc64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
+ SET(_java_libarch "sh")
+ ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ SET(_java_libarch ${CMAKE_SYSTEM_PROCESSOR})
+ ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
FOREACH(_path ${ARGN})
IF(_path MATCHES "{libarch}")