- Move global declarations from AutoGen.c to AutoGen.h
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 29 Jan 2007 04:41:58 +0000 (04:41 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 29 Jan 2007 04:41:58 +0000 (04:41 +0000)
- Stop building AutoGen.c for binary module

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2331 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java
Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java
Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java

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