diff options
5 files changed, 53 insertions, 15 deletions
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java index 5aa717fbdd..a849530109 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java @@ -207,6 +207,7 @@ public class GenBuildTask extends Ant { } else {
moduleId.setLibrary(true);
}
+ moduleId.setBinary(saq.getBinaryModule());
//
// Judge whether it is single module build or not
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java b/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java index 9c65d673d9..4f038ae25b 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java @@ -424,7 +424,7 @@ public class ModuleBuildFileGenerator { // Parse AutoGen.c & AutoGen.h
//
if (!fpdModuleId.getModule().isLibrary()
- && !fpdModuleId.getModule().getName().equalsIgnoreCase("Shell")) {
+ && !fpdModuleId.getModule().isBinary()) {
fileProcess.parseFile(project.getProperty("DEST_DIR_DEBUG") + File.separatorChar + "AutoGen.c", null, root, false);
}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java index 98737ba2bf..2d9178cfdf 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java @@ -120,6 +120,7 @@ public class AutoGen { private List<String> exitBootServiceList = new ArrayList<String>();
private StringBuffer functionDeclarations = new StringBuffer(10240);
+ private StringBuffer globalDeclarations = new StringBuffer(10240);
//
// flag of PcdComponentNameDisable, PcdDriverDiagnosticDisable
@@ -384,6 +385,7 @@ public class AutoGen { fileBuffer.append(this.myPcdAutogen.getHAutoGenString());
}
+ fileBuffer.append(globalDeclarations);
fileBuffer.append(functionDeclarations);
//
// Append the #endif at AutoGen.h
@@ -1798,9 +1800,9 @@ public class AutoGen { //
for (int i = 0; i < driverBindingGroup.length; i++) {
if (driverBindingGroup[i][0] != null) {
- fileBuffer.append("extern EFI_DRIVER_BINDING_PROTOCOL ");
- fileBuffer.append(driverBindingGroup[i][0]);
- fileBuffer.append(";\r\n");
+ globalDeclarations.append("extern EFI_DRIVER_BINDING_PROTOCOL ");
+ globalDeclarations.append(driverBindingGroup[i][0]);
+ globalDeclarations.append(";\r\n");
}
}
@@ -1812,9 +1814,9 @@ public class AutoGen { if (driverBindingGroup[i][1]!= null) {
if (driverBindingGroup[i][0] != null) {
BitMask |= 0x01;
- fileBuffer.append("extern EFI_COMPONENT_NAME_PROTOCOL ");
- fileBuffer.append(driverBindingGroup[i][1]);
- fileBuffer.append(";\r\n");
+ globalDeclarations.append("extern EFI_COMPONENT_NAME_PROTOCOL ");
+ globalDeclarations.append(driverBindingGroup[i][1]);
+ globalDeclarations.append(";\r\n");
} else {
throw new AutoGenException("DriverBinding can't be empty!!");
}
@@ -1829,9 +1831,9 @@ public class AutoGen { if (driverBindingGroup[i][2] != null) {
if (driverBindingGroup[i][0] != null) {
BitMask |= 0x02;
- fileBuffer.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL ");
- fileBuffer.append(driverBindingGroup[i][2]);
- fileBuffer.append(";\r\n");
+ globalDeclarations.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL ");
+ globalDeclarations.append(driverBindingGroup[i][2]);
+ globalDeclarations.append(";\r\n");
} else {
throw new AutoGenException("DriverBinding can't be empty!!");
}
@@ -1846,9 +1848,9 @@ public class AutoGen { if (driverBindingGroup[i][3] != null) {
if (driverBindingGroup[i][0] != null) {
BitMask |= 0x04;
- fileBuffer.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL ");
- fileBuffer.append(driverBindingGroup[i][3]);
- fileBuffer.append(";\r\n");
+ globalDeclarations.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL ");
+ globalDeclarations.append(driverBindingGroup[i][3]);
+ globalDeclarations.append(";\r\n");
} else {
throw new AutoGenException("DriverBinding can't be empty!!");
}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java index b95c389592..933b5d4e0d 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java @@ -23,11 +23,12 @@ import java.util.Stack; import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.tianocore.ExternsDocument.Externs.Extern;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlString;
import org.tianocore.*;
+import org.tianocore.ExternsDocument.Externs.Extern;
import org.tianocore.FilenameDocument.Filename;
+import org.tianocore.ModuleDefinitionsDocument.ModuleDefinitions;
import org.tianocore.MsaHeaderDocument.MsaHeader;
import org.tianocore.ProtocolsDocument.Protocols.Protocol;
import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;
@@ -37,8 +38,8 @@ import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.PackageIdentification;
import org.tianocore.build.id.PlatformIdentification;
import org.tianocore.build.toolchain.ToolChainInfo;
-import org.tianocore.common.exception.EdkException;
import org.tianocore.common.definitions.EdkDefinitions;
+import org.tianocore.common.exception.EdkException;
import org.w3c.dom.Node;
/**
@@ -544,6 +545,24 @@ public class SurfaceAreaQuery { }
/**
+ * Retrieve <ModuleDefinitions>/<BinaryModule>
+ *
+ * @returns The module type name if elements are found at the known xpath
+ * @returns null if nothing is there
+ */
+ public boolean getBinaryModule() {
+ String[] xPath = new String[] { "/" };
+
+ Object[] returns = get("ModuleDefinitions", xPath);
+ if (returns != null && returns.length > 0) {
+ ModuleDefinitionsDocument.ModuleDefinitions def = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];
+ return def.getBinaryModule();
+ }
+
+ return false;
+ }
+
+ /**
* Retrieve PackageDependencies/Package
*
* @param arch
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java b/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java index dc5f87bab4..7082184dfd 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java @@ -31,6 +31,8 @@ public class ModuleIdentification extends Identification { private boolean isLibrary = false;
+ private boolean isBinary = false;
+
private String constructor = "";
private String destructor = "";
@@ -88,6 +90,20 @@ public class ModuleIdentification extends Identification { }
/**
+ @return boolean is this module is binary
+ **/
+ public boolean isBinary() {
+ return isBinary;
+ }
+
+ /**
+ @param isBinary
+ **/
+ public void setBinary(boolean isBinary) {
+ this.isBinary = isBinary;
+ }
+
+ /**
@return MSA File
**/
public File getMsaFile() {
|