Fixed EdkT35, EdkT89.

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
This commit is contained in:
qouyang 2006-07-10 06:19:15 +00:00
parent f3dcd51163
commit 42b787576f
4 changed files with 27 additions and 21 deletions

View File

@ -158,7 +158,7 @@ public class GenBuildTask extends Ant {
SurfaceAreaQuery.setDoc(doc);
moduleId = SurfaceAreaQuery.getMsaHeader();
}
String[] producedLibraryClasses = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED");
String[] producedLibraryClasses = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED",null);
if (producedLibraryClasses.length == 0) {
moduleId.setLibrary(false);
}

View File

@ -251,10 +251,8 @@ public class AutoGen {
// Add #ifndef ${BaseName}_AUTOGENH
// #def ${BseeName}_AUTOGENH
//
fileBuffer.append("#ifndef " + this.moduleId.getName().toUpperCase()
+ "_AUTOGENH\r\n");
fileBuffer.append("#define " + this.moduleId.getName().toUpperCase()
+ "_AUTOGENH\r\n\r\n");
fileBuffer.append("#ifndef " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") +"\r\n");
fileBuffer.append("#define " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") +"\r\n\r\n");
//
// Write the specification version and release version at the begine
@ -298,7 +296,7 @@ public class AutoGen {
// Write library class's related *.h file to autogen.h.
//
String[] libClassList = SurfaceAreaQuery
.getLibraryClasses(CommonDefinition.AlwaysConsumed);
.getLibraryClasses(CommonDefinition.AlwaysConsumed,this.arch);
if (libClassList != null) {
libClassIncludeH = LibraryClassToAutogenH(libClassList);
item = libClassIncludeH.iterator();
@ -308,7 +306,7 @@ public class AutoGen {
}
libClassList = SurfaceAreaQuery
.getLibraryClasses(CommonDefinition.AlwaysProduced);
.getLibraryClasses(CommonDefinition.AlwaysProduced, this.arch);
if (libClassList != null) {
libClassIncludeH = LibraryClassToAutogenH(libClassList);
item = libClassIncludeH.iterator();
@ -493,10 +491,8 @@ public class AutoGen {
// Add #ifndef ${BaseName}_AUTOGENH
// #def ${BseeName}_AUTOGENH
//
fileBuffer.append("#ifndef " + this.moduleId.getName().toUpperCase()
+ "_AUTOGENH\r\n");
fileBuffer.append("#define " + this.moduleId.getName().toUpperCase()
+ "_AUTOGENH\r\n\r\n");
fileBuffer.append("#ifndef " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") + "\r\n");
fileBuffer.append("#define " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") + "\r\n\r\n");
//
// Write EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION
@ -528,7 +524,7 @@ public class AutoGen {
// Write library class's related *.h file to autogen.h
//
String[] libClassList = SurfaceAreaQuery
.getLibraryClasses(CommonDefinition.AlwaysConsumed);
.getLibraryClasses(CommonDefinition.AlwaysConsumed, this.arch);
if (libClassList != null) {
libClassIncludeH = LibraryClassToAutogenH(libClassList);
item = libClassIncludeH.iterator();
@ -538,7 +534,7 @@ public class AutoGen {
}
libClassList = SurfaceAreaQuery
.getLibraryClasses(CommonDefinition.AlwaysProduced);
.getLibraryClasses(CommonDefinition.AlwaysProduced, this.arch);
if (libClassList != null) {
libClassIncludeH = LibraryClassToAutogenH(libClassList);
item = libClassIncludeH.iterator();
@ -1772,7 +1768,7 @@ public class AutoGen {
if (compDiagList != null && compDiagList.length != 0) {
if (drvBindList.length != compDiagList.length) {
throw new BuildException(
"Different number of Driver Binding and Driver Configuration protocols!");
"Different number of Driver Binding and Driver Diagnosis protocols!");
}
BitMask |= 0x04;

View File

@ -76,7 +76,7 @@ public class AutogenLibOrder {
// libInstanceMap.
//
libClassConsmList = SurfaceAreaQuery
.getLibraryClasses(CommonDefinition.AlwaysConsumed);
.getLibraryClasses(CommonDefinition.AlwaysConsumed, arch);
if (libClassConsmList != null) {
String[] classStr = new String[libClassConsmList.length];
for (int k = 0; k < libClassConsmList.length; k++) {
@ -95,7 +95,7 @@ public class AutogenLibOrder {
// Add library class and library instance map.
//
libClassDeclList = SurfaceAreaQuery
.getLibraryClasses(CommonDefinition.AlwaysProduced);
.getLibraryClasses(CommonDefinition.AlwaysProduced, arch);
if (libClassDeclList != null) {
for (int j = 0; j < libClassDeclList.length; j++) {
if (this.libClassMap.containsKey(libClassDeclList[j])) {

View File

@ -598,9 +598,8 @@ public class SurfaceAreaQuery {
* xpath
* @returns null if nothing is there
*/
public static String[] getLibraryClasses(String usage) {
public static String[] getLibraryClasses(String usage, String arch) {
String[] xPath;
if (usage == null || usage.equals("")) {
xPath = new String[] { "/LibraryClass" };
} else {
@ -613,11 +612,19 @@ public class SurfaceAreaQuery {
}
LibraryClassDocument.LibraryClass[] libraryClassList = (LibraryClassDocument.LibraryClass[]) returns;
String[] libraryClassName = new String[libraryClassList.length];
List<String> libraryClassName = new ArrayList<String>();
for (int i = 0; i < libraryClassList.length; i++) {
libraryClassName[i] = libraryClassList[i].getKeyword();
List archList = libraryClassList[i].getSupArchList();
if (arch == null || contains(archList, arch)) {
libraryClassName.add(libraryClassList[i].getKeyword());
}
}
return libraryClassName;
String[] libraryArray = new String[libraryClassName.size()];
for (int i = 0; i < libraryClassName.size(); i++) {
libraryArray[i] = libraryClassName.get(i);
}
return libraryArray;
}
/**
@ -1885,6 +1892,9 @@ public class SurfaceAreaQuery {
@return boolean
**/
public static boolean contains(List list, String str) {
if (list == null || list.size()== 0) {
return true;
}
Iterator it = list.iterator();
while (it.hasNext()) {
String s = (String)it.next();