Fixed EdkT35, EdkT89.
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 10 Jul 2006 06:19:15 +0000 (06:19 +0000)
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 10 Jul 2006 06:19:15 +0000 (06:19 +0000)
Fixed the "#ifndef  _AUTOGENH_" issue when the moduleBase name include the whiteSpace.
Change "#ifndef {moduleBaseName}__AUTOGENH" to "ifndef  _AUTOGENH_${MoudleGuild}".

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

Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
Tools/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java
Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java

index 6dd0a4fff0d55c82235152ce6341c9c0294b9264..bc484a29e428c6c1f49b3114324328ce47fa1fa6 100644 (file)
@@ -158,7 +158,7 @@ public class GenBuildTask extends Ant {
             SurfaceAreaQuery.setDoc(doc);\r
             moduleId = SurfaceAreaQuery.getMsaHeader();\r
         }\r
-        String[] producedLibraryClasses = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED");\r
+        String[] producedLibraryClasses = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED",null);\r
         if (producedLibraryClasses.length == 0) {\r
             moduleId.setLibrary(false);\r
         }\r
index 300433081dd212e3ae056197f661a98ba596435b..3aff06f9569303bc3c56946ec39210d1e33ad11e 100644 (file)
@@ -251,10 +251,8 @@ public class AutoGen {
                // Add #ifndef ${BaseName}_AUTOGENH\r
                // #def ${BseeName}_AUTOGENH\r
                //\r
-               fileBuffer.append("#ifndef    " + this.moduleId.getName().toUpperCase()\r
-                               + "_AUTOGENH\r\n");\r
-               fileBuffer.append("#define    " + this.moduleId.getName().toUpperCase()\r
-                               + "_AUTOGENH\r\n\r\n");\r
+               fileBuffer.append("#ifndef    " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") +"\r\n");\r
+               fileBuffer.append("#define    " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") +"\r\n\r\n");\r
 \r
                //\r
                // Write the specification version and release version at the begine\r
@@ -298,7 +296,7 @@ public class AutoGen {
                // Write library class's related *.h file to autogen.h.\r
                //\r
                String[] libClassList = SurfaceAreaQuery\r
-                               .getLibraryClasses(CommonDefinition.AlwaysConsumed);\r
+                               .getLibraryClasses(CommonDefinition.AlwaysConsumed,this.arch);\r
                if (libClassList != null) {\r
                        libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
                        item = libClassIncludeH.iterator();\r
@@ -308,7 +306,7 @@ public class AutoGen {
                }\r
 \r
                libClassList = SurfaceAreaQuery\r
-                               .getLibraryClasses(CommonDefinition.AlwaysProduced);\r
+                               .getLibraryClasses(CommonDefinition.AlwaysProduced, this.arch);\r
                if (libClassList != null) {\r
                        libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
                        item = libClassIncludeH.iterator();\r
@@ -493,10 +491,8 @@ public class AutoGen {
                // Add #ifndef ${BaseName}_AUTOGENH\r
                // #def ${BseeName}_AUTOGENH\r
                //\r
-               fileBuffer.append("#ifndef    " + this.moduleId.getName().toUpperCase()\r
-                               + "_AUTOGENH\r\n");\r
-               fileBuffer.append("#define    " + this.moduleId.getName().toUpperCase()\r
-                               + "_AUTOGENH\r\n\r\n");\r
+               fileBuffer.append("#ifndef    " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") + "\r\n");\r
+               fileBuffer.append("#define    " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") + "\r\n\r\n");\r
 \r
                //\r
                // Write EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION\r
@@ -528,7 +524,7 @@ public class AutoGen {
                // Write library class's related *.h file to autogen.h\r
                //\r
                String[] libClassList = SurfaceAreaQuery\r
-                               .getLibraryClasses(CommonDefinition.AlwaysConsumed);\r
+                               .getLibraryClasses(CommonDefinition.AlwaysConsumed, this.arch);\r
                if (libClassList != null) {\r
                        libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
                        item = libClassIncludeH.iterator();\r
@@ -538,7 +534,7 @@ public class AutoGen {
                }\r
 \r
                libClassList = SurfaceAreaQuery\r
-                               .getLibraryClasses(CommonDefinition.AlwaysProduced);\r
+                               .getLibraryClasses(CommonDefinition.AlwaysProduced, this.arch);\r
                if (libClassList != null) {\r
                        libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
                        item = libClassIncludeH.iterator();\r
@@ -1772,7 +1768,7 @@ public class AutoGen {
                if (compDiagList != null && compDiagList.length != 0) {\r
                        if (drvBindList.length != compDiagList.length) {\r
                                throw new BuildException(\r
-                                               "Different number of Driver Binding and Driver Configuration protocols!");\r
+                                               "Different number of Driver Binding and Driver Diagnosis protocols!");\r
                        }\r
 \r
                        BitMask |= 0x04;\r
index f08fec70e718266e404eaf5602d709cc88b028ca..5ab585c4713fc268d7bc645545ba80e4cc00f9f0 100644 (file)
@@ -76,7 +76,7 @@ public class AutogenLibOrder {
             // libInstanceMap.\r
             //\r
             libClassConsmList = SurfaceAreaQuery\r
-                    .getLibraryClasses(CommonDefinition.AlwaysConsumed);\r
+                    .getLibraryClasses(CommonDefinition.AlwaysConsumed, arch);\r
             if (libClassConsmList != null) {\r
                 String[] classStr = new String[libClassConsmList.length];\r
                 for (int k = 0; k < libClassConsmList.length; k++) {\r
@@ -95,7 +95,7 @@ public class AutogenLibOrder {
             // Add library class and library instance map.\r
             //\r
             libClassDeclList = SurfaceAreaQuery\r
-                    .getLibraryClasses(CommonDefinition.AlwaysProduced);\r
+                    .getLibraryClasses(CommonDefinition.AlwaysProduced, arch);\r
             if (libClassDeclList != null) {\r
                 for (int j = 0; j < libClassDeclList.length; j++) {\r
                     if (this.libClassMap.containsKey(libClassDeclList[j])) {\r
index 235c604eb3c391ab68495842378ed767341e7f4c..321a87a827a7dfd3219c220edf4e0c9cbc231e96 100644 (file)
@@ -598,9 +598,8 @@ public class SurfaceAreaQuery {
      *          xpath\r
      * @returns null if nothing is there\r
      */\r
-    public static String[] getLibraryClasses(String usage) {\r
+    public static String[] getLibraryClasses(String usage, String arch) {\r
         String[] xPath;\r
-\r
         if (usage == null || usage.equals("")) {\r
             xPath = new String[] { "/LibraryClass" };\r
         } else {\r
@@ -613,11 +612,19 @@ public class SurfaceAreaQuery {
         }\r
 \r
         LibraryClassDocument.LibraryClass[] libraryClassList = (LibraryClassDocument.LibraryClass[]) returns;\r
-        String[] libraryClassName = new String[libraryClassList.length];\r
+        List<String> libraryClassName = new ArrayList<String>();\r
         for (int i = 0; i < libraryClassList.length; i++) {\r
-            libraryClassName[i] = libraryClassList[i].getKeyword();\r
+                       List archList = libraryClassList[i].getSupArchList();\r
+                       \r
+                       if (arch == null || contains(archList, arch)) {\r
+                libraryClassName.add(libraryClassList[i].getKeyword());\r
+                       }\r
         }\r
-        return libraryClassName;\r
+               String[] libraryArray = new String[libraryClassName.size()];\r
+               for (int i = 0; i < libraryClassName.size(); i++) {\r
+                       libraryArray[i] = libraryClassName.get(i);\r
+               }\r
+        return libraryArray;\r
     }\r
 \r
     /**\r
@@ -1885,6 +1892,9 @@ public class SurfaceAreaQuery {
      @return boolean\r
      **/\r
     public static boolean contains(List list, String str) {\r
+               if (list == null || list.size()== 0) {\r
+                       return true;\r
+               }\r
         Iterator it = list.iterator();\r
         while (it.hasNext()) {\r
             String s = (String)it.next();\r