- if (this.mProtocolList.size() > 0) {\r
- for (int i = 0; i < this.mProtocolList.size(); i++) {\r
- if (this.mProtocolList.get(i) != null) {\r
- cNameGuid = GlobalData\r
- .getProtocolInfoGuid(this.mProtocolList.get(i));\r
- if (cNameGuid != null) {\r
- fileBuffer\r
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
- fileBuffer.append(cNameGuid[0]);\r
- fileBuffer.append(" = { ");\r
- fileBuffer.append(cNameGuid[1]);\r
- fileBuffer.append(" } ;");\r
- }\r
- } else {\r
- throw new BuildException("Protocol name must set!");\r
- }\r
+\r
+ //\r
+ // Get the NAME and GUID from dependence SPD and write to Autogen.c\r
+ //\r
+ Iterator protocolIterator = this.mPpiList.iterator();\r
+ String protocolKeyWord = null;\r
+ while (protocolIterator.hasNext()) {\r
+ protocolKeyWord = protocolIterator.next().toString();\r
+ cNameGuid = GlobalData.getProtocolGuid(SurfaceAreaQuery\r
+ .getDependencePkg(this.arch), protocolKeyWord);\r
+ if (cNameGuid != null) {\r
+ fileBuffer\r
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
+ fileBuffer.append(cNameGuid[0]);\r
+ fileBuffer.append(" = { ");\r
+ fileBuffer.append(cNameGuid[1]);\r
+ fileBuffer.append(" } ;");\r
+ } else {\r
+ //\r
+ // If can't find protocol GUID declaration in every package\r
+ //\r
+ throw new BuildException("Can not find protocol Guid [" + cNameGuid + "] declaration in every packages. ");\r