diff options
-rw-r--r-- | EdkNt32Pkg/Dxe/PlatformBds/PlatformBds.msa | 6 | ||||
-rw-r--r-- | Tools/CCode/Source/VfrCompile/VfrCompile.g | 120 | ||||
-rw-r--r-- | Tools/CCode/Source/VfrCompile/VfrServices.cpp | 4 | ||||
-rw-r--r-- | Tools/Conf/BuildMacro.xml | 13 | ||||
-rw-r--r-- | Tools/Conf/tools_def.template | 13 |
5 files changed, 89 insertions, 67 deletions
diff --git a/EdkNt32Pkg/Dxe/PlatformBds/PlatformBds.msa b/EdkNt32Pkg/Dxe/PlatformBds/PlatformBds.msa index bca2117a93..3508095ad7 100644 --- a/EdkNt32Pkg/Dxe/PlatformBds/PlatformBds.msa +++ b/EdkNt32Pkg/Dxe/PlatformBds/PlatformBds.msa @@ -88,7 +88,7 @@ <Filename>Generic\FrontPage.h</Filename>
<Filename>Generic\FrontPage.c</Filename>
<Filename>Generic\FrontPageStrings.uni</Filename>
- <Filename>Generic\FrontPageVfr.vfr</Filename>
+ <Filename>Generic\FrontPageVfr.Vfr</Filename>
<Filename>Generic\Language.h</Filename>
<Filename>Generic\Language.c</Filename>
<Filename>Generic\String.h</Filename>
@@ -114,11 +114,11 @@ <Filename>Generic\BootMngr\BootManager.h</Filename>
<Filename>Generic\BootMngr\BootManager.c</Filename>
<Filename>Generic\BootMngr\BootManagerStrings.uni</Filename>
- <Filename>Generic\BootMngr\BootManagerVfr.vfr</Filename>
+ <Filename>Generic\BootMngr\BootManagerVfr.Vfr</Filename>
<Filename>Generic\DeviceMngr\DeviceManager.h</Filename>
<Filename>Generic\DeviceMngr\DeviceManager.c</Filename>
<Filename>Generic\DeviceMngr\DeviceManagerStrings.uni</Filename>
- <Filename>Generic\DeviceMngr\DeviceManagerVfr.vfr</Filename>
+ <Filename>Generic\DeviceMngr\DeviceManagerVfr.Vfr</Filename>
<Filename>Generic\Bds.dxs</Filename>
</SourceFiles>
<PackageDependencies>
diff --git a/Tools/CCode/Source/VfrCompile/VfrCompile.g b/Tools/CCode/Source/VfrCompile/VfrCompile.g index 44820bc31b..9fdd7caca6 100644 --- a/Tools/CCode/Source/VfrCompile/VfrCompile.g +++ b/Tools/CCode/Source/VfrCompile/VfrCompile.g @@ -172,69 +172,69 @@ Returns: // on it.
//
fclose (VfrFptr);
- Len = strlen (PREPROCESSOR_OPTIONS) + strlen (gOptions.VfrFileName) + 10;
- if (gOptions.CPreprocessorOptions != NULL) {
- Len += strlen (gOptions.CPreprocessorOptions) + 1;
- }
- if (gOptions.IncludePaths != NULL) {
- Len += strlen (gOptions.IncludePaths) + 1;
- }
- Cmd = (char *)malloc (Len);
- if (Cmd == NULL) {
- Error (PROGRAM_NAME, 0, 0, NULL, "could not allocate memory");
- Cleanup();
- return STATUS_ERROR;
- }
- strcpy (Cmd, PREPROCESSOR_OPTIONS);
- if (gOptions.IncludePaths != NULL) {
- strcat (Cmd, gOptions.IncludePaths);
- strcat (Cmd, " ");
- }
- if (gOptions.CPreprocessorOptions != NULL) {
- strcat (Cmd, gOptions.CPreprocessorOptions);
- strcat (Cmd, " ");
- }
- strcat (Cmd, gOptions.VfrFileName);
-#ifndef __GNUC__
- Status = _spawnlp (_P_WAIT, PREPROCESSOR_COMMAND, Cmd, NULL);
-#else
- {
- char CommandLine[1000];
- char *p;
-
- //
- // Lean the slashes forward.
- //
- for (p = gOptions.PreprocessorOutputFileName; *p; p++) {
- if (*p=='\\') {
- *p=FILE_SEP_CHAR;
- }
- }
-
- //
- // Lean the slashes forward.
- //
- for (p = Cmd; *p; p++) {
- if (*p=='\\') {
- *p=FILE_SEP_CHAR;
- }
- }
-
- sprintf(CommandLine, "%s %s > %s", PREPROCESSOR_COMMAND, Cmd, gOptions.PreprocessorOutputFileName);
- Status = system (CommandLine);
- }
-#endif
- if (Status != 0) {
- Error (PROGRAM_NAME, 0, 0, gOptions.VfrFileName, "failed to spawn C preprocessor on VFR file");
- printf ("Command: '%s %s'\n", PREPROCESSOR_COMMAND, Cmd);
- Cleanup();
- return STATUS_ERROR;
- }
- free (Cmd);
+// Len = strlen (PREPROCESSOR_OPTIONS) + strlen (gOptions.VfrFileName) + 10;
+// if (gOptions.CPreprocessorOptions != NULL) {
+// Len += strlen (gOptions.CPreprocessorOptions) + 1;
+// }
+// if (gOptions.IncludePaths != NULL) {
+// Len += strlen (gOptions.IncludePaths) + 1;
+// }
+// Cmd = (char *)malloc (Len);
+// if (Cmd == NULL) {
+// Error (PROGRAM_NAME, 0, 0, NULL, "could not allocate memory");
+// Cleanup();
+// return STATUS_ERROR;
+// }
+// strcpy (Cmd, PREPROCESSOR_OPTIONS);
+// if (gOptions.IncludePaths != NULL) {
+// strcat (Cmd, gOptions.IncludePaths);
+// strcat (Cmd, " ");
+// }
+// if (gOptions.CPreprocessorOptions != NULL) {
+// strcat (Cmd, gOptions.CPreprocessorOptions);
+// strcat (Cmd, " ");
+// }
+// strcat (Cmd, gOptions.VfrFileName);
+//#ifndef __GNUC__
+// Status = _spawnlp (_P_WAIT, PREPROCESSOR_COMMAND, Cmd, NULL);
+//#else
+// {
+// char CommandLine[1000];
+// char *p;
+//
+// //
+// // Lean the slashes forward.
+// //
+// for (p = gOptions.PreprocessorOutputFileName; *p; p++) {
+// if (*p=='\\') {
+// *p=FILE_SEP_CHAR;
+// }
+// }
+//
+// //
+// // Lean the slashes forward.
+// //
+// for (p = Cmd; *p; p++) {
+// if (*p=='\\') {
+// *p=FILE_SEP_CHAR;
+// }
+// }
+//
+// sprintf(CommandLine, "%s %s > %s", PREPROCESSOR_COMMAND, Cmd, gOptions.PreprocessorOutputFileName);
+// Status = system (CommandLine);
+// }
+//#endif
+// if (Status != 0) {
+// Error (PROGRAM_NAME, 0, 0, gOptions.VfrFileName, "failed to spawn C preprocessor on VFR file");
+// printf ("Command: '%s %s'\n", PREPROCESSOR_COMMAND, Cmd);
+// Cleanup();
+// return STATUS_ERROR;
+// }
+// free (Cmd);
//
// Open the preprocessor output file
//
- if ((VfrFptr = fopen (gOptions.PreprocessorOutputFileName, "r")) == NULL) {
+ if ((VfrFptr = fopen (gOptions.VfrFileName, "r")) == NULL) {
Error (PROGRAM_NAME, 0, 0, "failed to open input VFR preprocessor output file",
gOptions.PreprocessorOutputFileName);
Cleanup();
diff --git a/Tools/CCode/Source/VfrCompile/VfrServices.cpp b/Tools/CCode/Source/VfrCompile/VfrServices.cpp index 359256a358..d338672060 100644 --- a/Tools/CCode/Source/VfrCompile/VfrServices.cpp +++ b/Tools/CCode/Source/VfrCompile/VfrServices.cpp @@ -332,8 +332,8 @@ Returns: //
// Open the input VFR file and the output list file
//
- if ((InFptr = fopen (gOptions.PreprocessorOutputFileName, "r")) == NULL) {
- Warning (PROGRAM_NAME, 0, 0, gOptions.PreprocessorOutputFileName, "could not open file for creating a list file");
+ if ((InFptr = fopen (gOptions.VfrFileName, "r")) == NULL) {
+ Warning (PROGRAM_NAME, 0, 0, gOptions.VfrFileName, "could not open file for creating a list file");
} else {
if ((OutFptr = fopen (gOptions.VfrListFileName, "w")) == NULL) {
Warning (PROGRAM_NAME, 0, 0, gOptions.VfrListFileName, "could not open output list file for writing");
diff --git a/Tools/Conf/BuildMacro.xml b/Tools/Conf/BuildMacro.xml index 679a57744d..2e1eec1fa8 100644 --- a/Tools/Conf/BuildMacro.xml +++ b/Tools/Conf/BuildMacro.xml @@ -709,7 +709,18 @@ 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}">
+ <cc userdefine="on">
+ <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}"
+ dpath="${PP_DPATH}" libpath="${PP_LIBPATH}" include="${PP_INCLUDEPATH}">
+ <argument value="${VFR_FLAGS}"/>
+ <!-- Output file of the preprocess -->
+ <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>
+ <EXTRA.INC/>
+ <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
+ </command>
+ </cc>
+
+ <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i">
<EXTRA.INC/>
</vfrcompile>
diff --git a/Tools/Conf/tools_def.template b/Tools/Conf/tools_def.template index 98898d41f9..99d9a7b941 100644 --- a/Tools/Conf/tools_def.template +++ b/Tools/Conf/tools_def.template @@ -59,6 +59,7 @@ IDENTIFIER = Default TOOL_CHAIN_CONF *_VS2003_IA32_*_FAMILY = MSFT
*_VS2003_IA32_CC_NAME = cl.exe
+*_VS2003_IA32_VFR_NAME = cl.exe
*_VS2003_IA32_SLINK_NAME = lib.exe
*_VS2003_IA32_DLINK_NAME = link.exe
*_VS2003_IA32_ASMLINK_NAME = link.exe
@@ -74,6 +75,7 @@ IDENTIFIER = Default TOOL_CHAIN_CONF *_VS2003_IA32_*_DPATH = C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
*_VS2003_IA32_PP_FLAGS = /nologo /P /TC /FI${DEST_DIR_DEBUG}/AutoGen.h
+*_VS2003_IA32_VFR_FLAGS = /nologo /P /TC /DVFRCOMPILE
DEBUG_VS2003_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DSTRING_ARRAY_NAME=${BASE_NAME}Strings /FI${DEST_DIR_DEBUG}/AutoGen.h /EHs-c- /GF /Gs8192 /Fp${DEST_DIR_OUTPUT}/AutoGen.h.gch /Yu${DEST_DIR_DEBUG}/AutoGen.h /Zi /Gm
RELEASE_VS2003_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DSTRING_ARRAY_NAME=${BASE_NAME}Strings /FI${DEST_DIR_DEBUG}/AutoGen.h /EHs-c- /GF /Gs8192 /Fp${DEST_DIR_OUTPUT}/AutoGen.h.gch /Yu${DEST_DIR_DEBUG}/AutoGen.h
DEBUG_VS2003_IA32_PCH_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /D EFI32 /O1ib2 /GL /DSTRING_ARRAY_NAME=${BASE_NAME}Strings /FI${DEST_DIR_DEBUG}/AutoGen.h /EHs-c- /GF /Gs8192 /Fp${DEST_DIR_OUTPUT}/AutoGen.h.gch /Yc /TC /Zi /Gm
@@ -93,6 +95,7 @@ RELEASE_VS2003_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4086 /OPT:REF /O *_WINDDK3790x1830_*_*_FAMILY = MSFT
*_WINDDK3790x1830_*_CC_NAME = cl.exe
+*_WINDDK3790x1830_*_VFR_NAME = cl.exe
*_WINDDK3790x1830_*_SLINK_NAME = lib.exe
*_WINDDK3790x1830_*_DLINK_NAME = link.exe
*_WINDDK3790x1830_*_ASMLINK_NAME = link.exe
@@ -100,7 +103,7 @@ RELEASE_VS2003_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4086 /OPT:REF /O *_WINDDK3790x1830_*_PCH_NAME = cl.exe
*_WINDDK3790x1830_*_SLINK_FLAGS = /nologo /LTCG
-
+*_WINDDK3790x1830_*_VFR_FLAGS = /nologo /P /TC /DVFRCOMPILE
##################
# IA32 definitions
##################
@@ -202,10 +205,12 @@ RELEASE_WINDDK3790x1830_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4086 /OP *_VS2005PRO_*_DLINK_NAME = link.exe
*_VS2005PRO_*_ASMLINK_NAME = link.exe
*_VS2005PRO_*_PP_NAME = cl.exe
+*_VS2005PRO_*_VFR_NAME = cl.exe
*_VS2005PRO_*_PCH_NAME = cl.exe
*_VS2005PRO_*_SLINK_FLAGS = /NOLOGO /LTCG
*_VS2005PRO_*_PP_FLAGS = /nologo /P /TC /FI${DEST_DIR_DEBUG}/AutoGen.h
+*_VS2005PRO_*_VFR_FLAGS = /nologo /P /TC /DVFRCOMPILE
##################
# IA32 definitions
@@ -287,11 +292,13 @@ RELEASE_VS2005PRO_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4086 /OPT:REF *_UNIXGCC_IA32_DLINK_NAME = ld
*_UNIXGCC_IA32_ASM_NAME = gcc
*_UNIXGCC_IA32_PP_NAME = gcc
+*_UNIXGCC_IA32_VFR_NAME = gcc
*_UNIXGCC_IA32_CC_FLAGS = -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -c -include ${DEST_DIR_DEBUG}/AutoGen.h
*_UNIXGCC_*_DLINK_FLAGS = -nostdlib -O2 --gc-sections --dll --export-all-symbols --entry _${ENTRYPOINT}
*_UNIXGCC_IA32_ASM_FLAGS = -c -imacros ${DEST_DIR_DEBUG}/AutoGen.h
*_UNIXGCC_*_PP_FLAGS = -E -x assembler-with-cpp -include ${DEST_DIR_DEBUG}/AutoGen.h
+*_UNIXGCC_*_VFR_FLAGS = -x c -E -P -DVFRCOMPILE
*_UNIXGCC_IA32_ASM_EXT = .S
*_UNIXGCC_IA32_*_PATH = /opt/tiano/i386-tiano-pe/i386-tiano-pe/bin
@@ -343,6 +350,7 @@ RELEASE_VS2005PRO_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4086 /OPT:REF *_CYGWINGCC_IA32_DLINK_NAME = ld
*_CYGWINGCC_IA32_ASM_NAME = gcc
*_CYGWINGCC_IA32_PP_NAME = gcc
+*_CYGWINGCC_IA32_VFR_NAME = gcc
*_CYGWINGCC_X64_CC_NAME = gcc
*_CYGWINGCC_X64_SLINK_NAME = ar
@@ -355,6 +363,7 @@ RELEASE_VS2005PRO_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4086 /OPT:REF *_CYGWINGCC_*_DLINK_FLAGS = -nostdlib -O2 --gc-sections --dll --export-all-symbols --entry _${ENTRYPOINT}
*_CYGWINGCC_*_ASM_FLAGS = -c -imacros ${DEST_DIR_DEBUG}/AutoGen.h
*_CYGWINGCC_*_PP_FLAGS = -E -x assembler-with-cpp -include ${DEST_DIR_DEBUG}/AutoGen.h
+*_CYGWINGCC_*_VFR_FLAGS = -x c -E -P -DVFRCOMPILE
*_CYGWINGCC_*_ASM_EXT = .S
*_CYGWINGCC_IA32_*_PATH = c:/Cygwin/opt/tiano/i386-tiano-pe/i386-tiano-pe/bin
@@ -452,9 +461,11 @@ RELEASE_MIXED_X64_ASM_FLAGS = /nologo /W3 /WX /c /Cx /Zd *_MYTOOLS_*_DLINK_NAME = link.exe
*_MYTOOLS_*_ASMLINK_NAME = link.exe
*_MYTOOLS_*_PP_NAME = cl.exe
+*_MYTOOLS_*_VFR_NAME = cl.exe
*_MYTOOLS_*_APP_NAME = cl.exe
*_MYTOOLS_*_ASM_NAME = ml.exe
+*_MYTOOLS_*_VFR_FLAGS = /nologo /P /TC /DVFRCOMPILE
##################
# IA32 definitions
##################
|