Fixed the build error.
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 6 Nov 2006 03:55:24 +0000 (03:55 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 6 Nov 2006 03:55:24 +0000 (03:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1899 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java

index 2837979..7d86c64 100644 (file)
@@ -49,6 +49,7 @@ import org.tianocore.build.id.PlatformIdentification;
 import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding;\r
 import org.tianocore.build.toolchain.ToolChainElement;\r
 import org.tianocore.build.toolchain.ToolChainMap;\r
 import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding;\r
 import org.tianocore.build.toolchain.ToolChainElement;\r
 import org.tianocore.build.toolchain.ToolChainMap;\r
+import org.tianocore.build.toolchain.ToolChainInfo;\r
 import org.w3c.dom.NamedNodeMap;\r
 import org.w3c.dom.Node;\r
 import org.w3c.dom.NodeList;\r
 import org.w3c.dom.NamedNodeMap;\r
 import org.w3c.dom.Node;\r
 import org.w3c.dom.NodeList;\r
@@ -447,6 +448,11 @@ public class FpdParserTask extends Task {
             parseToolChainFamilyOptions();\r
             parseToolChainOptions();\r
 \r
             parseToolChainFamilyOptions();\r
             parseToolChainOptions();\r
 \r
+            //\r
+            // check if the tool chain is valid or not\r
+            // \r
+            checkToolChain();\r
+\r
             saq.push(map);\r
 \r
             //\r
             saq.push(map);\r
 \r
             //\r
@@ -768,4 +774,25 @@ public class FpdParserTask extends Task {
             }\r
         }\r
     }\r
             }\r
         }\r
     }\r
+\r
+\r
+    private void checkToolChain() throws EdkException {\r
+        ToolChainInfo toolChainInfo = GlobalData.getToolChainInfo();\r
+\r
+        if (toolChainInfo.getTargets().length == 0) {\r
+            throw new EdkException("No valid target specified! Please check your TARGET definition in Tools/Conf/target.txt.");\r
+        }\r
+\r
+        if (toolChainInfo.getTagnames().length == 0) {\r
+            throw new EdkException("No valid tool chain specified! Please check your TOOL_CHAIN_TAG definition in Tools/Conf/target.txt.");\r
+        }\r
+\r
+        if (toolChainInfo.getArchs().length == 0) {\r
+            throw new EdkException("No valid ARCH specified! Please check your TARGET_ARCH definition in Tools/Conf/target.txt.");\r
+        }\r
+\r
+        if (toolChainInfo.getCommands().length == 0) {\r
+            throw new EdkException("No valid COMMAND specified! Please check your TARGET definition in Tools/Conf/tools_def.txt.");\r
+        }\r
+    }\r
 }\r
 }\r
index b79e505..9655887 100644 (file)
@@ -682,7 +682,7 @@ public class GlobalData {
     ///\r
     /// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
     ///\r
     ///\r
     /// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
     ///\r
-    public synchronized static ToolChainInfo getToolChainInfo() throws EdkException {\r
+    public synchronized static ToolChainInfo getToolChainInfo() {\r
         if (toolChainInfo == null) {\r
             toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);\r
             if (toolChainPlatformInfo != null) {\r
         if (toolChainInfo == null) {\r
             toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);\r
             if (toolChainPlatformInfo != null) {\r
@@ -691,22 +691,6 @@ public class GlobalData {
             toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());\r
             toolChainInfo.normalize();\r
 \r
             toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());\r
             toolChainInfo.normalize();\r
 \r
-            if (toolChainInfo.getTargets().length == 0) {\r
-                throw new EdkException("No valid target specified! Please check your TARGET definition in Tools/Conf/target.txt.");\r
-            }\r
-\r
-            if (toolChainInfo.getTagnames().length == 0) {\r
-                throw new EdkException("No valid tool chain specified! Please check your TOOL_CHAIN_TAG definition in Tools/Conf/target.txt.");\r
-            }\r
-\r
-            if (toolChainInfo.getArchs().length == 0) {\r
-                throw new EdkException("No valid ARCH specified! Please check your TARGET_ARCH definition in Tools/Conf/target.txt.");\r
-            }\r
-\r
-            if (toolChainInfo.getCommands().length == 0) {\r
-                throw new EdkException("No valid COMMAND specified! Please check your TARGET definition in Tools/Conf/tools_def.txt.");\r
-            }\r
-\r
             EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Current build tool chain information summary: ");\r
             EdkLog.log("Init", EdkLog.EDK_ALWAYS, toolChainInfo + "");\r
         }\r
             EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Current build tool chain information summary: ");\r
             EdkLog.log("Init", EdkLog.EDK_ALWAYS, toolChainInfo + "");\r
         }\r