From a57bb38367d0902914974a7bc2c85bdc55657e4c Mon Sep 17 00:00:00 2001
From: Stefan Roese <sr@denx.de>
Date: Wed, 8 Aug 2012 19:42:21 +0200
Subject: [PATCH] Enable usage of Yocto/Eclipse plugin for DENX ELDK 5.x

This patch enables the usage of this plugin with the ELDK 5.x.
For this, the search name has to be changed from "pokysdk" to
"eldk" and the check for 32bit toolchain usage on 64bit host
system has to be removed.

Signed-off-by: Stefan Roese <sr@denx.de>
---
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java                | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
index 6be90be..4289593 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
@@ -77,7 +77,7 @@ public class YoctoSDKUtils {
 	private static final String SYSROOTS_DIR = "sysroots";
 
 	public static SDKCheckResults checkYoctoSDK(YoctoUIElement elem) {		
-		
+
 		if (elem.getStrToolChainRoot().isEmpty())
 			return SDKCheckResults.TOOLCHAIN_LOCATION_EMPTY;
 		else {
@@ -103,8 +103,11 @@ public class YoctoSDKUtils {
 			String toolchain_host_arch = findHostArch(sysroot_dir);
 			
 			if (!toolchain_host_arch.equalsIgnoreCase(platform)) {
-				if (!platform.matches("i\\d86") || !toolchain_host_arch.matches("i\\d86"))
-					return SDKCheckResults.TOOLCHAIN_HOST_MISMATCH;
+/*
+ * Disable check for 32bit toolchain vs 64bit host for ELDK 5.x
+ */ 
+//				if (!platform.matches("i\\d86") || !toolchain_host_arch.matches("i\\d86"))
+//					return SDKCheckResults.TOOLCHAIN_HOST_MISMATCH;
 			}
 		}
 		if (elem.getIntTargetIndex() < 0 || elem.getStrTarget().isEmpty())
@@ -576,7 +579,7 @@ public class YoctoSDKUtils {
 	static private String findHostArch(File sysroot_dir) {
 		FilenameFilter nativeFilter = new FilenameFilter() {
 			public boolean accept(File dir, String name) {
-				if (name.endsWith("-pokysdk-linux")) {
+				if (name.endsWith("-eldk-linux")) {
 					return true;
 				} else {
 					return false;
@@ -590,7 +593,7 @@ public class YoctoSDKUtils {
 		for (File file : files) {
 			if (file.isDirectory()) {
 				String path = file.getName();
-				arch = path.substring(0, path.indexOf("-pokysdk-linux"));
+				arch = path.substring(0, path.indexOf("-eldk-linux"));
 			} else 
 				continue;
         }
-- 
1.7.11.3

