mirror of https://github.com/acidanthera/audk.git
To fix EDKT341. Still existing issues for VfrCompile.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1633 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
16c490eb07
commit
32c8b5a947
|
@ -76,7 +76,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<cc userdefine="on">
|
||||
<command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${CC_DPATH}">
|
||||
<EXTRA.INC/>
|
||||
<argument value="${LOCAL_CC_FLAGS}"/>
|
||||
<EXTRA.ARG/>
|
||||
|
@ -138,7 +138,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /TC /Yc /Fp${DEST_DIR_DEBUG}/AutoGen.h.gch"/>
|
||||
<cc userdefine="on">
|
||||
<command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/AutoGen.h.obj">
|
||||
outputFile="${DEST_DIR_OUTPUT}/AutoGen.h.obj" dpath="${CC_DPATH}">
|
||||
<EXTRA.INC/>
|
||||
<argument value="${LOCAL_CC_FLAGS}"/>
|
||||
<EXTRA.ARG/>
|
||||
|
@ -183,7 +183,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<cc userdefine="on">
|
||||
<command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${CC_DPATH}">
|
||||
<EXTRA.INC/>
|
||||
<argument value="${LOCAL_CC_FLAGS}"/>
|
||||
<EXTRA.ARG/>
|
||||
|
@ -230,7 +230,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<sequential>
|
||||
<cc userdefine="on">
|
||||
<command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${CC_FAMILY}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i">
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i" dpath="${CC_DPATH}">
|
||||
<EXTRA.INC/>
|
||||
<argument value="${PP_FLAGS}"/>
|
||||
<fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
|
@ -312,7 +312,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<sequential>
|
||||
<cc userdefine="on">
|
||||
<command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}">
|
||||
<command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" dpath="${PP_DPATH}">
|
||||
<EXTRA.INC.1/>
|
||||
<argument value="${PP_FLAGS}"/>
|
||||
<fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
|
@ -335,7 +335,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<cc userdefine="on">
|
||||
<command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${ASM_DPATH}">
|
||||
<EXTRA.INC.1/>
|
||||
|
||||
<argument value="${ASM_FLAGS}"/>
|
||||
|
@ -386,7 +386,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<sequential>
|
||||
<cc userdefine="on">
|
||||
<command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${ASM_DPATH}">
|
||||
<EXTRA.INC.1/>
|
||||
|
||||
<argument value="${ASM_FLAGS}"/>
|
||||
|
@ -445,7 +445,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<sequential>
|
||||
<cc userdefine="on">
|
||||
<command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}">
|
||||
<command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" dpath="${PP_DPATH}">
|
||||
<EXTRA.INC.1/>
|
||||
<argument value="${PP_FLAGS}"/>
|
||||
<fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
|
@ -454,7 +454,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<cc userdefine="on">
|
||||
<command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"
|
||||
includepathDelimiter="-I" outputDelimiter="-o"
|
||||
includepathDelimiter="-I" outputDelimiter="-o" dpath="${ASM_DPATH}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
|
||||
<EXTRA.INC.1/>
|
||||
<argument value="${ASM_FLAGS}"/>
|
||||
|
@ -490,7 +490,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
|
||||
|
||||
<cc userdefine="on">
|
||||
<command type="ASM" includepathDelimiter="-I">
|
||||
<command type="ASM" includepathDelimiter="-I" dpath="${ASM_DPATH}">
|
||||
<includepath path="${WORKSPACE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}/${ARCH}"/>
|
||||
|
@ -530,7 +530,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<sequential>
|
||||
<cc userdefine="on">
|
||||
<command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}"
|
||||
outputFile="${BIN_DIR}/@{FILENAME}.lib">
|
||||
outputFile="${BIN_DIR}/@{FILENAME}.lib" dpath="${SLINK_DPATH}">
|
||||
<argument value="${SLINK_FLAGS}"/>
|
||||
|
||||
<fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>
|
||||
|
@ -655,7 +655,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<cc userdefine="on">
|
||||
<command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"
|
||||
includepathDelimiter="-I"
|
||||
includepathDelimiter="-I" dpath="${CC_DPATH}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj">
|
||||
<argument value="${LOCAL_CC_FLAGS}"/>
|
||||
<EXTRA.INC />
|
||||
|
@ -712,7 +712,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</targetfiles>
|
||||
|
||||
<sequential>
|
||||
<vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" DllPath="${DPATH}">
|
||||
<vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">
|
||||
<EXTRA.INC/>
|
||||
</vfrcompile>
|
||||
|
||||
|
@ -732,7 +732,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<cc userdefine="on">
|
||||
<command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}"
|
||||
includepathDelimiter="-I" family="${CC_FAMILY}"
|
||||
includepathDelimiter="-I" family="${CC_FAMILY}" dpath="${CC_DPATH}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" >
|
||||
<argument value="${LOCAL_CC_FLAGS}"/>
|
||||
<EXTRA.INC/>
|
||||
|
@ -799,7 +799,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<sequential>
|
||||
<cc userdefine="on">
|
||||
<command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}"
|
||||
<command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}" dpath="${SLINK_DPATH}"
|
||||
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">
|
||||
<argument value="${SLINK_FLAGS}"/>
|
||||
|
||||
|
@ -808,7 +808,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</cc>
|
||||
<cc userdefine="on">
|
||||
<command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"
|
||||
outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" >
|
||||
outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" dpath="${DLINK_DPATH}" >
|
||||
<argument value="${DLINK_FLAGS}"/>
|
||||
<libset libs="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib ${LIBS} ${DLINK_SPATH}"/>
|
||||
<LINK.ARG/>
|
||||
|
|
|
@ -19,6 +19,7 @@ package net.sf.antcontrib.cpptasks.userdefine;
|
|||
import java.io.File;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.Vector;
|
||||
|
@ -31,6 +32,9 @@ import net.sf.antcontrib.cpptasks.types.ConditionalFileSet;
|
|||
import org.apache.tools.ant.BuildException;
|
||||
import org.apache.tools.ant.DirectoryScanner;
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.types.Environment;
|
||||
import org.apache.tools.ant.types.Path;
|
||||
import org.apache.tools.ant.types.Environment.Variable;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -40,7 +44,9 @@ public class CommandLineUserDefine {
|
|||
String includePathDelimiter = null;
|
||||
|
||||
String outputDelimiter = null;
|
||||
|
||||
|
||||
private static String pathName = null;
|
||||
|
||||
public void command(CCTask cctask, UserDefineDef userdefine) {
|
||||
boolean isGccCommand = userdefine.getFamily().equalsIgnoreCase("GCC");
|
||||
File workdir;
|
||||
|
@ -136,6 +142,7 @@ public class CommandLineUserDefine {
|
|||
// if have source file append source file in command line.
|
||||
//
|
||||
Set allSrcFiles = new LinkedHashSet();
|
||||
|
||||
for (int i = 0; i < srcSets.size(); i++) {
|
||||
ConditionalFileSet srcSet = (ConditionalFileSet) srcSets
|
||||
.elementAt(i);
|
||||
|
@ -144,7 +151,6 @@ public class CommandLineUserDefine {
|
|||
// Find matching source files
|
||||
//
|
||||
DirectoryScanner scanner = srcSet.getDirectoryScanner(project);
|
||||
|
||||
//
|
||||
// Check each source file - see if it needs compilation
|
||||
//
|
||||
|
@ -207,19 +213,57 @@ public class CommandLineUserDefine {
|
|||
for (int j = 0; j < fileNames.length; j++) {
|
||||
cmd[index++] = fileNames[j];
|
||||
}
|
||||
|
||||
int retval = runCommand(cctask, workdir, cmd);
|
||||
|
||||
// StringBuffer logLine = new StringBuffer();
|
||||
// for(int i = 0; i < cmd.length; i++) {
|
||||
// logLine.append(cmd[i] + " ");
|
||||
// }
|
||||
// project.log(logLine.toString(), Project.MSG_VERBOSE);
|
||||
|
||||
int retval = 0;
|
||||
|
||||
if (userdefine.getDpath() == null || userdefine.getDpath().trim().length() == 0) {
|
||||
retval = runCommand(cctask, workdir, cmd, null);
|
||||
} else {
|
||||
String existPath = System.getenv(getPathName());
|
||||
Environment newEnv = new Environment();
|
||||
Variable var = new Variable();
|
||||
var.setKey(getPathName());
|
||||
var.setPath(new Path(project, userdefine.getDpath() + ";" + existPath));
|
||||
newEnv.addVariable(var);
|
||||
retval = runCommand(cctask, workdir, cmd, newEnv);
|
||||
}
|
||||
|
||||
|
||||
if (retval != 0) {
|
||||
throw new BuildException(userdefine.getCmd()
|
||||
+ " failed with return code " + retval, cctask
|
||||
.getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
private String getPathName() {
|
||||
if (pathName != null) {
|
||||
return pathName;
|
||||
}
|
||||
Map allEnv = System.getenv();
|
||||
Iterator iter = allEnv.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
String key = (String)iter.next();
|
||||
if(key.equalsIgnoreCase("PATH")) {
|
||||
pathName = key;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
return pathName;
|
||||
}
|
||||
|
||||
protected int runCommand(CCTask task, File workingDir, String[] cmdline)
|
||||
protected int runCommand(CCTask task, File workingDir, String[] cmdline, Environment env)
|
||||
throws BuildException {
|
||||
return CUtil.runCommand(task, workingDir, cmdline, false, null);
|
||||
//
|
||||
// Write command to File
|
||||
//
|
||||
return CUtil.runCommand(task, workingDir, cmdline, false, env);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@ public class UserDefineDef extends ProcessorDef {
|
|||
private String outputFile;
|
||||
|
||||
private Vector allLibraries = new Vector();
|
||||
|
||||
private String dpath = null;
|
||||
|
||||
public void addLibset(LibrarySet libset) {
|
||||
if (isReference()) {
|
||||
|
@ -293,4 +295,12 @@ public class UserDefineDef extends ProcessorDef {
|
|||
this.outputDelimiter = outputDelimiter;
|
||||
}
|
||||
|
||||
public String getDpath() {
|
||||
return dpath;
|
||||
}
|
||||
|
||||
public void setDpath(String dpath) {
|
||||
this.dpath = dpath;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue