Sync EDKII BaseTools to BaseTools project r1971
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10502 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
## @file
|
||||
# Generate AutoGen.h, AutoGen.c and *.depex files
|
||||
#
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
@ -1953,8 +1953,10 @@ class ModuleAutoGen(AutoGen):
|
||||
return
|
||||
|
||||
for ModuleType in self.DepexList:
|
||||
if len(self.DepexList[ModuleType]) == 0:
|
||||
# Ignore empty [depex] section or [depex] section for "USER_DEFINED" module
|
||||
if len(self.DepexList[ModuleType]) == 0 or ModuleType == "USER_DEFINED":
|
||||
continue
|
||||
|
||||
Dpx = GenDepex.DependencyExpression(self.DepexList[ModuleType], ModuleType, True)
|
||||
DpxFile = gAutoGenDepexFileName % {"module_name" : self.Name}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
## @file
|
||||
# The engine for building files
|
||||
#
|
||||
# Copyright (c) 2007, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
|
@ -1,8 +1,8 @@
|
||||
## @file
|
||||
# Routines for generating AutoGen.h and AutoGen.c
|
||||
#
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
|
@ -1,8 +1,8 @@
|
||||
## @file
|
||||
# This file is used to generate DEPEX file for module's dependency expression
|
||||
#
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
|
@ -1,8 +1,8 @@
|
||||
## @file
|
||||
# Create makefile for MS nmake and GNU make
|
||||
#
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2007, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
@ -15,6 +15,7 @@
|
||||
# Import Modules
|
||||
#
|
||||
import os, codecs, re
|
||||
import distutils.util
|
||||
import Common.EdkLogger as EdkLogger
|
||||
from Common.BuildToolError import *
|
||||
from Common.String import GetLineNo
|
||||
@ -125,6 +126,8 @@ def GetLanguageCode(LangName, IsCompatibleMode, File):
|
||||
else:
|
||||
EdkLogger.error("Unicode File Parser", FORMAT_INVALID, "Invalid ISO 639-2 language code : %s" % LangName, File)
|
||||
|
||||
if (LangName[0] == 'X' or LangName[0] == 'x') and LangName[1] == '-':
|
||||
return LangName
|
||||
if length == 2:
|
||||
if LangName.isalpha():
|
||||
return LangName
|
||||
@ -193,20 +196,20 @@ class UniFileClassObject(object):
|
||||
# Get Language definition
|
||||
#
|
||||
def GetLangDef(self, File, Line):
|
||||
Lang = Line.split(u"//")[0].split()
|
||||
Lang = distutils.util.split_quoted((Line.split(u"//")[0]))
|
||||
if len(Lang) != 3:
|
||||
try:
|
||||
FileIn = codecs.open(File, mode='rb', encoding='utf-16').read()
|
||||
FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').read()
|
||||
except UnicodeError, X:
|
||||
EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File);
|
||||
except:
|
||||
EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=File);
|
||||
LineNo = GetLineNo(FileIn, Line, False)
|
||||
EdkLogger.error("Unicode File Parser", PARSER_ERROR, "Wrong language definition",
|
||||
ExtraData="""%s\n\t*Correct format is like '#langdef eng "English"'""" % Line, File = File, Line = LineNo)
|
||||
ExtraData="""%s\n\t*Correct format is like '#langdef en-US "English"'""" % Line, File = File, Line = LineNo)
|
||||
else:
|
||||
LangName = GetLanguageCode(Lang[1], self.IsCompatibleMode, self.File)
|
||||
LangPrintName = Lang[2][1:-1]
|
||||
LangPrintName = Lang[2]
|
||||
|
||||
IsLangInDef = False
|
||||
for Item in self.LanguageDef:
|
||||
|
@ -4,8 +4,8 @@
|
||||
# This file is required to make Python interpreter treat the directory
|
||||
# as containing package.
|
||||
#
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation<BR>
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
|
Reference in New Issue
Block a user