Make scripts work from $WORKSPACE/BaseTools.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4152 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -11,11 +11,11 @@
|
|||||||
# Setup the environment for unix-like systems running a bash-like shell.
|
# Setup the environment for unix-like systems running a bash-like shell.
|
||||||
# This file must be "sourced" not merely executed. For example: ". edksetup.sh"
|
# This file must be "sourced" not merely executed. For example: ". edksetup.sh"
|
||||||
|
|
||||||
if [ ! -e ./Tools/BaseTools/BuildEnv.py ]
|
if [ ! -e ./BaseTools/BuildEnv.py ]
|
||||||
then
|
then
|
||||||
echo Run this script from the base of your tree. For example:
|
echo Run this script from the base of your tree. For example:
|
||||||
echo " cd /Path/To/Edk/Root"
|
echo " cd /Path/To/Edk/Root"
|
||||||
echo " . Tools/BuildEnv"
|
echo " . BaseTools/BuildEnv"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ fi
|
|||||||
# First, we run a python tool that will ask the user to configure
|
# First, we run a python tool that will ask the user to configure
|
||||||
# the environment in a (relatively) user friendly manner.
|
# the environment in a (relatively) user friendly manner.
|
||||||
#
|
#
|
||||||
python ./Tools/BaseTools/BuildEnv.py $*
|
python ./BaseTools/BuildEnv.py $*
|
||||||
|
|
||||||
#
|
#
|
||||||
# The python tool will write ./Conf/BuildEnv.sh to actually configure
|
# The python tool will write ./Conf/BuildEnv.sh to actually configure
|
||||||
|
@ -65,7 +65,7 @@ class SetupBuildEnvironmentApp:
|
|||||||
}
|
}
|
||||||
|
|
||||||
def ProcessCommandLine(self):
|
def ProcessCommandLine(self):
|
||||||
Parser = OptionParser(description=__copyright__,version=__version__,prog="Tools/BuildEnv")
|
Parser = OptionParser(description=__copyright__,version=__version__,prog="BaseTools/BuildEnv")
|
||||||
Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
|
Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
|
||||||
Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed, "\
|
Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed, "\
|
||||||
"including library instances selected, final dependency expression, "\
|
"including library instances selected, final dependency expression, "\
|
||||||
@ -198,7 +198,7 @@ class SetupBuildEnvironmentApp:
|
|||||||
todo = self.conf['templates and Conf directory']
|
todo = self.conf['templates and Conf directory']
|
||||||
workspace = os.path.realpath(self.Opt.workspace)
|
workspace = os.path.realpath(self.Opt.workspace)
|
||||||
templatesDir = \
|
templatesDir = \
|
||||||
os.path.join(workspace, 'Tools', 'BaseTools', 'ConfTemplates', sys.platform.title())
|
os.path.join(workspace, 'BaseTools', 'ConfTemplates', sys.platform.title())
|
||||||
confDir = \
|
confDir = \
|
||||||
os.path.join(workspace, 'Conf')
|
os.path.join(workspace, 'Conf')
|
||||||
print
|
print
|
||||||
@ -249,12 +249,18 @@ class SetupBuildEnvironmentApp:
|
|||||||
print >> script, 'export TOOLCHAIN="%s"' % self.conf['compiler']
|
print >> script, 'export TOOLCHAIN="%s"' % self.conf['compiler']
|
||||||
print >> script, 'export EDK_CC_PATH_PREFIX="%s"' % self.conf['compiler-prefix']
|
print >> script, 'export EDK_CC_PATH_PREFIX="%s"' % self.conf['compiler-prefix']
|
||||||
|
|
||||||
|
EDK_TOOLS_PATH = os.path.join(workspace, 'BaseTools')
|
||||||
|
print >> script, 'if [ $EDK_TOOLS_PATH=="" ]'
|
||||||
|
print >> script, 'then'
|
||||||
|
print >> script, ' export EDK_TOOLS_PATH="%s"' % EDK_TOOLS_PATH
|
||||||
|
print >> script, 'fi'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Change PATH variable
|
# Change PATH variable
|
||||||
#
|
#
|
||||||
newPath = os.environ['PATH'].split(os.path.pathsep)
|
newPath = os.environ['PATH'].split(os.path.pathsep)
|
||||||
binDir = \
|
binDir = \
|
||||||
os.path.join(workspace, 'Tools', 'BaseTools', 'Bin', sys.platform.title())
|
os.path.join(workspace, 'BaseTools', 'Bin', sys.platform.title())
|
||||||
if binDir not in newPath:
|
if binDir not in newPath:
|
||||||
newPath.append(binDir)
|
newPath.append(binDir)
|
||||||
newPath = os.path.pathsep.join(newPath)
|
newPath = os.path.pathsep.join(newPath)
|
||||||
|
Reference in New Issue
Block a user