From 6de9dfac1d25ea9440a47a06fcb39507f87ca4ec Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 26 May 2014 18:42:57 +0200 Subject: [PATCH] configure: try to detect using JDK with wrong bitness Another option would be to try -d32 / -d64, not obvious which is better. Change-Id: I2836d8a07e55971999f91dd417916aca394ccfa6 --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index e507cb508664..4130928b5abf 100644 --- a/configure.ac +++ b/configure.ac @@ -6836,6 +6836,21 @@ if test "$ENABLE_JAVA" != ""; then else AC_MSG_RESULT([no]) fi + else # ? not sure if it's valid for all OS, and all JVMs? + case $CPUNAME in + AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64) + if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then + AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit]) + AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK]) + fi + ;; + *) # assumption: everything else 32-bit + if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then + AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit]) + AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK]) + fi + ;; + esac fi fi