summaryrefslogtreecommitdiff
path: root/Tools/Source/GenBuild/org
diff options
context:
space:
mode:
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-09 02:18:20 +0000
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-09 02:18:20 +0000
commit8a9783c1f3f75ec5cd6e869f812e62fb5bcf1406 (patch)
tree8604660244fea73e736bd806adb5d4daf7cd62a1 /Tools/Source/GenBuild/org
parenta8a9de7cbbfc0146a1c6c5c9a9dc4abfe48fca6e (diff)
downloadedk2-8a9783c1f3f75ec5cd6e869f812e62fb5bcf1406.zip
edk2-8a9783c1f3f75ec5cd6e869f812e62fb5bcf1406.tar.gz
edk2-8a9783c1f3f75ec5cd6e869f812e62fb5bcf1406.tar.bz2
Enhance FfsLayout parsing. When specify a file for a section, then just use the file as section file.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1219 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/GenBuild/org')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java41
1 files changed, 38 insertions, 3 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
index 2d8ed0b..5541be4 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
@@ -345,20 +345,55 @@ public class FfsProcess {
**/
private void dealSection(int mode, Document doc, Element root, XmlCursor cursor, Vector<String> list) {
String type = cursor.getAttributeText(new QName("SectionType"));
- list.addElement(type);
+
+ //
+ // Judge if file is specified? Yes, just use the file, else call Build Macro
+ // If fileName is null, means without FileNames specify in FPD file
+ //
+ String fileName = null;
+ cursor.push();
+ if (cursor.toFirstChild()) {
+ do {
+ if (cursor.getName().getLocalPart().equalsIgnoreCase("Filenames")) {
+ cursor.push();
+ if (cursor.toFirstChild()) {
+ do {
+ if (cursor.getName().getLocalPart().equalsIgnoreCase("Filename")) {
+ fileName = cursor.getTextValue();
+ }
+ } while (cursor.toNextSibling());
+ }
+ cursor.pop();
+ }
+ } while (cursor.toNextSibling());
+ }
+
+ cursor.pop();
+
+ if (fileName == null) {
+ list.addElement(type);
+ }
if (mode == MODE_GUID_DEFINED) {
//
// <input file="${DEST_DIR_OUTPUT}\Bds.pe32"/>
//
Element ele = doc.createElement("input");
- ele.setAttribute("file", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));
+ if (fileName == null) {
+ ele.setAttribute("file", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));
+ } else {
+ ele.setAttribute("file", "${PLATFORM_DIR}" + File.separatorChar + fileName);
+ }
root.appendChild(ele);
} else {
//
// <sectFile fileName= "..."/>
//
Element ele = doc.createElement("sectFile");
- ele.setAttribute("fileName", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));
+ if (fileName == null) {
+ ele.setAttribute("fileName", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));
+ } else {
+ ele.setAttribute("fileName", "${PLATFORM_DIR}" + File.separatorChar + fileName);
+ }
root.appendChild(ele);
}
}