From b609c89b77876ef144a2acdb31defbf1881437c2 Mon Sep 17 00:00:00 2001 From: qouyang Date: Thu, 16 Nov 2006 10:19:07 +0000 Subject: Fixed EDKT419. Removing C Pre-Processing from VfrCompile Tool. Now the input file for VfrCompile tool should be *.i file which was preprocessed by compiler. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1964 6f19259b-4bc3-4df7-8a09-765794883524 --- Tools/CCode/Source/VfrCompile/VfrCompile.g | 120 +++++++++++++------------- Tools/CCode/Source/VfrCompile/VfrServices.cpp | 4 +- 2 files changed, 62 insertions(+), 62 deletions(-) (limited to 'Tools/CCode/Source') 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"); -- cgit v1.2.3