mirror of https://github.com/acidanthera/audk.git
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:
parent
f3dcd51163
commit
42b787576f
|
@ -158,7 +158,7 @@ public class GenBuildTask extends Ant {
|
||||||
SurfaceAreaQuery.setDoc(doc);
|
SurfaceAreaQuery.setDoc(doc);
|
||||||
moduleId = SurfaceAreaQuery.getMsaHeader();
|
moduleId = SurfaceAreaQuery.getMsaHeader();
|
||||||
}
|
}
|
||||||
String[] producedLibraryClasses = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED");
|
String[] producedLibraryClasses = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED",null);
|
||||||
if (producedLibraryClasses.length == 0) {
|
if (producedLibraryClasses.length == 0) {
|
||||||
moduleId.setLibrary(false);
|
moduleId.setLibrary(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,10 +251,8 @@ public class AutoGen {
|
||||||
// Add #ifndef ${BaseName}_AUTOGENH
|
// Add #ifndef ${BaseName}_AUTOGENH
|
||||||
// #def ${BseeName}_AUTOGENH
|
// #def ${BseeName}_AUTOGENH
|
||||||
//
|
//
|
||||||
fileBuffer.append("#ifndef " + this.moduleId.getName().toUpperCase()
|
fileBuffer.append("#ifndef " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") +"\r\n");
|
||||||
+ "_AUTOGENH\r\n");
|
fileBuffer.append("#define " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") +"\r\n\r\n");
|
||||||
fileBuffer.append("#define " + this.moduleId.getName().toUpperCase()
|
|
||||||
+ "_AUTOGENH\r\n\r\n");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Write the specification version and release version at the begine
|
// 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.
|
// Write library class's related *.h file to autogen.h.
|
||||||
//
|
//
|
||||||
String[] libClassList = SurfaceAreaQuery
|
String[] libClassList = SurfaceAreaQuery
|
||||||
.getLibraryClasses(CommonDefinition.AlwaysConsumed);
|
.getLibraryClasses(CommonDefinition.AlwaysConsumed,this.arch);
|
||||||
if (libClassList != null) {
|
if (libClassList != null) {
|
||||||
libClassIncludeH = LibraryClassToAutogenH(libClassList);
|
libClassIncludeH = LibraryClassToAutogenH(libClassList);
|
||||||
item = libClassIncludeH.iterator();
|
item = libClassIncludeH.iterator();
|
||||||
|
@ -308,7 +306,7 @@ public class AutoGen {
|
||||||
}
|
}
|
||||||
|
|
||||||
libClassList = SurfaceAreaQuery
|
libClassList = SurfaceAreaQuery
|
||||||
.getLibraryClasses(CommonDefinition.AlwaysProduced);
|
.getLibraryClasses(CommonDefinition.AlwaysProduced, this.arch);
|
||||||
if (libClassList != null) {
|
if (libClassList != null) {
|
||||||
libClassIncludeH = LibraryClassToAutogenH(libClassList);
|
libClassIncludeH = LibraryClassToAutogenH(libClassList);
|
||||||
item = libClassIncludeH.iterator();
|
item = libClassIncludeH.iterator();
|
||||||
|
@ -493,10 +491,8 @@ public class AutoGen {
|
||||||
// Add #ifndef ${BaseName}_AUTOGENH
|
// Add #ifndef ${BaseName}_AUTOGENH
|
||||||
// #def ${BseeName}_AUTOGENH
|
// #def ${BseeName}_AUTOGENH
|
||||||
//
|
//
|
||||||
fileBuffer.append("#ifndef " + this.moduleId.getName().toUpperCase()
|
fileBuffer.append("#ifndef " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") + "\r\n");
|
||||||
+ "_AUTOGENH\r\n");
|
fileBuffer.append("#define " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") + "\r\n\r\n");
|
||||||
fileBuffer.append("#define " + this.moduleId.getName().toUpperCase()
|
|
||||||
+ "_AUTOGENH\r\n\r\n");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Write EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION
|
// 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
|
// Write library class's related *.h file to autogen.h
|
||||||
//
|
//
|
||||||
String[] libClassList = SurfaceAreaQuery
|
String[] libClassList = SurfaceAreaQuery
|
||||||
.getLibraryClasses(CommonDefinition.AlwaysConsumed);
|
.getLibraryClasses(CommonDefinition.AlwaysConsumed, this.arch);
|
||||||
if (libClassList != null) {
|
if (libClassList != null) {
|
||||||
libClassIncludeH = LibraryClassToAutogenH(libClassList);
|
libClassIncludeH = LibraryClassToAutogenH(libClassList);
|
||||||
item = libClassIncludeH.iterator();
|
item = libClassIncludeH.iterator();
|
||||||
|
@ -538,7 +534,7 @@ public class AutoGen {
|
||||||
}
|
}
|
||||||
|
|
||||||
libClassList = SurfaceAreaQuery
|
libClassList = SurfaceAreaQuery
|
||||||
.getLibraryClasses(CommonDefinition.AlwaysProduced);
|
.getLibraryClasses(CommonDefinition.AlwaysProduced, this.arch);
|
||||||
if (libClassList != null) {
|
if (libClassList != null) {
|
||||||
libClassIncludeH = LibraryClassToAutogenH(libClassList);
|
libClassIncludeH = LibraryClassToAutogenH(libClassList);
|
||||||
item = libClassIncludeH.iterator();
|
item = libClassIncludeH.iterator();
|
||||||
|
@ -1772,7 +1768,7 @@ public class AutoGen {
|
||||||
if (compDiagList != null && compDiagList.length != 0) {
|
if (compDiagList != null && compDiagList.length != 0) {
|
||||||
if (drvBindList.length != compDiagList.length) {
|
if (drvBindList.length != compDiagList.length) {
|
||||||
throw new BuildException(
|
throw new BuildException(
|
||||||
"Different number of Driver Binding and Driver Configuration protocols!");
|
"Different number of Driver Binding and Driver Diagnosis protocols!");
|
||||||
}
|
}
|
||||||
|
|
||||||
BitMask |= 0x04;
|
BitMask |= 0x04;
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class AutogenLibOrder {
|
||||||
// libInstanceMap.
|
// libInstanceMap.
|
||||||
//
|
//
|
||||||
libClassConsmList = SurfaceAreaQuery
|
libClassConsmList = SurfaceAreaQuery
|
||||||
.getLibraryClasses(CommonDefinition.AlwaysConsumed);
|
.getLibraryClasses(CommonDefinition.AlwaysConsumed, arch);
|
||||||
if (libClassConsmList != null) {
|
if (libClassConsmList != null) {
|
||||||
String[] classStr = new String[libClassConsmList.length];
|
String[] classStr = new String[libClassConsmList.length];
|
||||||
for (int k = 0; k < libClassConsmList.length; k++) {
|
for (int k = 0; k < libClassConsmList.length; k++) {
|
||||||
|
@ -95,7 +95,7 @@ public class AutogenLibOrder {
|
||||||
// Add library class and library instance map.
|
// Add library class and library instance map.
|
||||||
//
|
//
|
||||||
libClassDeclList = SurfaceAreaQuery
|
libClassDeclList = SurfaceAreaQuery
|
||||||
.getLibraryClasses(CommonDefinition.AlwaysProduced);
|
.getLibraryClasses(CommonDefinition.AlwaysProduced, arch);
|
||||||
if (libClassDeclList != null) {
|
if (libClassDeclList != null) {
|
||||||
for (int j = 0; j < libClassDeclList.length; j++) {
|
for (int j = 0; j < libClassDeclList.length; j++) {
|
||||||
if (this.libClassMap.containsKey(libClassDeclList[j])) {
|
if (this.libClassMap.containsKey(libClassDeclList[j])) {
|
||||||
|
|
|
@ -598,9 +598,8 @@ public class SurfaceAreaQuery {
|
||||||
* xpath
|
* xpath
|
||||||
* @returns null if nothing is there
|
* @returns null if nothing is there
|
||||||
*/
|
*/
|
||||||
public static String[] getLibraryClasses(String usage) {
|
public static String[] getLibraryClasses(String usage, String arch) {
|
||||||
String[] xPath;
|
String[] xPath;
|
||||||
|
|
||||||
if (usage == null || usage.equals("")) {
|
if (usage == null || usage.equals("")) {
|
||||||
xPath = new String[] { "/LibraryClass" };
|
xPath = new String[] { "/LibraryClass" };
|
||||||
} else {
|
} else {
|
||||||
|
@ -613,11 +612,19 @@ public class SurfaceAreaQuery {
|
||||||
}
|
}
|
||||||
|
|
||||||
LibraryClassDocument.LibraryClass[] libraryClassList = (LibraryClassDocument.LibraryClass[]) returns;
|
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++) {
|
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
|
@return boolean
|
||||||
**/
|
**/
|
||||||
public static boolean contains(List list, String str) {
|
public static boolean contains(List list, String str) {
|
||||||
|
if (list == null || list.size()== 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Iterator it = list.iterator();
|
Iterator it = list.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
String s = (String)it.next();
|
String s = (String)it.next();
|
||||||
|
|
Loading…
Reference in New Issue