Add in the 1st version of ECP.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2832 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
121
EdkCompatibilityPkg/Sample/Tools/Source/VcCheck/VcCheck.c
Normal file
121
EdkCompatibilityPkg/Sample/Tools/Source/VcCheck/VcCheck.c
Normal file
@@ -0,0 +1,121 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
VcCheck.c
|
||||
|
||||
Abstract:
|
||||
|
||||
We have found problems with the Visual C++ SP4 and the /O1 flag.
|
||||
If this tests ask a question you have the wrong version of Visual C++
|
||||
on your system
|
||||
|
||||
This test assumes the tools are being compiled with the same complier
|
||||
as the Tiano code.
|
||||
|
||||
Please see $(EFI_SOURCE)\EFI2.0 Developer's Manual.doc to get the
|
||||
correct version of Visual C++
|
||||
|
||||
--*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
_int16 gGloba16;
|
||||
|
||||
int
|
||||
CheckLostCode (
|
||||
int Value
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
This routine is used to test for compiler isseus with /O1.
|
||||
If the /O1 compiler option, and C2.dll is got from Visual C++ SP5
|
||||
(version: 6.00.8168.0), the assember codes after default branch will be
|
||||
losted. (Execute "cl Visual Ccheck.c /O1 /FAsc" to get detail information)
|
||||
|
||||
Arguments:
|
||||
Value - Test case
|
||||
|
||||
Returns:
|
||||
Test to see if comiler error is present.
|
||||
|
||||
--*/
|
||||
{
|
||||
switch (Value) {
|
||||
case 0:
|
||||
break;
|
||||
|
||||
default:
|
||||
_asm
|
||||
{
|
||||
mov bx, 1
|
||||
mov gGloba16, bx
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
_asm
|
||||
{
|
||||
mov bx, 0
|
||||
mov gGloba16, bx
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (
|
||||
void
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
This utility is checking for a known Visual C++ compiler issues. To remove this
|
||||
question from the build follow the steps in the developers manual.
|
||||
|
||||
Arguments:
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
0 - Compiler version is O.K.
|
||||
1 - Compiler version is Bad
|
||||
|
||||
--*/
|
||||
{
|
||||
int result;
|
||||
char select;
|
||||
|
||||
gGloba16 = 0xFF;
|
||||
result = 0;
|
||||
|
||||
CheckLostCode (0);
|
||||
result += (gGloba16 == 0) ? 0 : 1;
|
||||
|
||||
CheckLostCode (1);
|
||||
result += (gGloba16 == 1) ? 0 : 1;
|
||||
|
||||
if (result != 0) {
|
||||
printf ("Warning: C2.dll is incorrect.\n Please see $(EFI_SOURCE)\\EFI2.0 Developer's Manual.doc for corrective action.\n");
|
||||
printf ("Would you want to continue?(Y/N)");
|
||||
|
||||
scanf ("%c", &select);
|
||||
if ((select == 'Y') || (select == 'y')) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
92
EdkCompatibilityPkg/Sample/Tools/Source/VcCheck/makefile
Normal file
92
EdkCompatibilityPkg/Sample/Tools/Source/VcCheck/makefile
Normal file
@@ -0,0 +1,92 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2007, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
# Module Name: makefile
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# This file is used to build the EFI utility.
|
||||
#
|
||||
#--*/
|
||||
|
||||
#
|
||||
# Do this if you want to compile from this directory
|
||||
#
|
||||
!IFNDEF TOOLCHAIN
|
||||
TOOLCHAIN = TOOLCHAIN_MSVC
|
||||
!ENDIF
|
||||
|
||||
!INCLUDE $(BUILD_DIR)\PlatformTools.env
|
||||
|
||||
#
|
||||
# Define some macros we use here. Should get rid of them someday and
|
||||
# get rid of the extra level of indirection.
|
||||
#
|
||||
COMMON_SOURCE = $(EDK_TOOLS_COMMON)
|
||||
|
||||
#
|
||||
# Common information
|
||||
#
|
||||
|
||||
INC=$(INC)
|
||||
|
||||
#
|
||||
# Target specific information
|
||||
#
|
||||
|
||||
TARGET_NAME=VcCheck
|
||||
|
||||
TARGET_SOURCE_DIR = $(EDK_TOOLS_SOURCE)\$(TARGET_NAME)
|
||||
|
||||
TARGET_EXE = $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).exe
|
||||
|
||||
TARGET_EXE_SOURCE = "$(TARGET_SOURCE_DIR)\VcCheck.c"
|
||||
TARGET_EXE_INCLUDE =
|
||||
OBJECTS = $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj
|
||||
|
||||
#
|
||||
# Replace /Od with "" to fix the Command line warning D4025
|
||||
#
|
||||
C_FLAGS = $(C_FLAGS:/Od=) /O1
|
||||
|
||||
#
|
||||
# Build targets
|
||||
#
|
||||
|
||||
all: $(TARGET_EXE)
|
||||
|
||||
#
|
||||
# Build EXE
|
||||
#
|
||||
|
||||
$(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj: $(TARGET_EXE_SOURCE) $(TARGET_EXE_INCLUDE)
|
||||
$(CC) $(C_FLAGS) $(INC) $(TARGET_EXE_SOURCE) /Fo$(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj
|
||||
|
||||
#
|
||||
# Add Binary Build description for this tools.
|
||||
#
|
||||
|
||||
!IF (("$(EFI_BINARY_TOOLS)" == "YES") && EXIST($(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe))
|
||||
$(TARGET_EXE): $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe
|
||||
copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe $(TARGET_EXE) /Y
|
||||
if exist $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb \
|
||||
copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb /Y
|
||||
!ELSE
|
||||
$(TARGET_EXE) : $(OBJECTS)
|
||||
$(LINK) $(MSVS_LINK_LIBPATHS) $(L_FLAGS) $(LIBS) /out:$(TARGET_EXE) $(OBJECTS)
|
||||
if not exist $(EFI_PLATFORM_BIN)\Tools mkdir $(EFI_PLATFORM_BIN)\Tools
|
||||
if exist $(TARGET_EXE) copy $(TARGET_EXE) $(EFI_PLATFORM_BIN)\tools\$(TARGET_NAME).exe /Y
|
||||
if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb \
|
||||
copy $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb /Y
|
||||
!ENDIF
|
||||
|
||||
clean:
|
||||
@if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* del $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* > NUL
|
Reference in New Issue
Block a user