]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: check CONF_PATH env to get the configure files
authorYonghong Zhu <yonghong.zhu@intel.com>
Thu, 18 Aug 2016 02:07:36 +0000 (10:07 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 19 Aug 2016 02:54:52 +0000 (10:54 +0800)
Add CONF_PATH env check. First priority is user set the conf dir by
--conf option, then the CONF_PATH env, the last one is the standard
WORKSPACE(PACKAGE_PATH)/Conf.
Also print the conf path directory in the build log.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/GenFds/GenFds.py
BaseTools/Source/Python/build/build.py

index 68232c5e6d74fd8fee7dd0f7b2022bb0d1a6dfc7..f2de47ea83e66eed02471ddaaeb7b25ab28b5f23 100644 (file)
@@ -152,8 +152,11 @@ def main():
                 # This also handles someone specifying the Conf directory in the workspace. Using --conf=Conf\r
                 ConfDirectoryPath = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ConfDirectoryPath)\r
         else:\r
                 # This also handles someone specifying the Conf directory in the workspace. Using --conf=Conf\r
                 ConfDirectoryPath = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ConfDirectoryPath)\r
         else:\r
-            # Get standard WORKSPACE/Conf, use the absolute path to the WORKSPACE/Conf\r
-            ConfDirectoryPath = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 'Conf')\r
+            if "CONF_PATH" in os.environ.keys():\r
+                ConfDirectoryPath = os.path.normcase(os.environ["CONF_PATH"])\r
+            else:\r
+                # Get standard WORKSPACE/Conf, use the absolute path to the WORKSPACE/Conf\r
+                ConfDirectoryPath = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 'Conf')\r
         GenFdsGlobalVariable.ConfDir = ConfDirectoryPath\r
         BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))\r
         if os.path.isfile(BuildConfigurationFile) == True:\r
         GenFdsGlobalVariable.ConfDir = ConfDirectoryPath\r
         BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))\r
         if os.path.isfile(BuildConfigurationFile) == True:\r
index d9afdcc6b2dab9118e84a17fac53ee096f285e3e..be02119042f6a88776963beb50c1c4ee6f0b7b60 100644 (file)
@@ -775,8 +775,11 @@ class Build():
                 # This also handles someone specifying the Conf directory in the workspace. Using --conf=Conf\r
                 ConfDirectoryPath = mws.join(self.WorkspaceDir, ConfDirectoryPath)\r
         else:\r
                 # This also handles someone specifying the Conf directory in the workspace. Using --conf=Conf\r
                 ConfDirectoryPath = mws.join(self.WorkspaceDir, ConfDirectoryPath)\r
         else:\r
-            # Get standard WORKSPACE/Conf use the absolute path to the WORKSPACE/Conf\r
-            ConfDirectoryPath = mws.join(self.WorkspaceDir, 'Conf')\r
+            if "CONF_PATH" in os.environ:\r
+                ConfDirectoryPath = os.path.normcase(os.path.normpath(os.environ["CONF_PATH"]))\r
+            else:\r
+                # Get standard WORKSPACE/Conf use the absolute path to the WORKSPACE/Conf\r
+                ConfDirectoryPath = mws.join(self.WorkspaceDir, 'Conf')\r
         GlobalData.gConfDirectory = ConfDirectoryPath\r
         GlobalData.gDatabasePath = os.path.normpath(os.path.join(ConfDirectoryPath, GlobalData.gDatabasePath))\r
 \r
         GlobalData.gConfDirectory = ConfDirectoryPath\r
         GlobalData.gDatabasePath = os.path.normpath(os.path.join(ConfDirectoryPath, GlobalData.gDatabasePath))\r
 \r
@@ -812,7 +815,7 @@ class Build():
         if "EDK_TOOLS_BIN" in os.environ:\r
             # Print the same path style with WORKSPACE env. \r
             EdkLogger.quiet("%-16s = %s" % ("EDK_TOOLS_BIN", os.path.normcase(os.path.normpath(os.environ["EDK_TOOLS_BIN"]))))\r
         if "EDK_TOOLS_BIN" in os.environ:\r
             # Print the same path style with WORKSPACE env. \r
             EdkLogger.quiet("%-16s = %s" % ("EDK_TOOLS_BIN", os.path.normcase(os.path.normpath(os.environ["EDK_TOOLS_BIN"]))))\r
-\r
+        EdkLogger.quiet("%-16s = %s" % ("CONF_PATH", GlobalData.gConfDirectory))\r
         self.InitPreBuild()\r
         self.InitPostBuild()\r
         if self.PrebuildScript:\r
         self.InitPreBuild()\r
         self.InitPostBuild()\r
         if self.PrebuildScript:\r