Reviewed-by: Michael D Kinney <michael.d.kin...@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jayaprakash, N
> Sent: Monday, June 17, 2024 11:46 PM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N <n.jayaprak...@intel.com>; Rebecca Cran
> <rebe...@bsdio.com>; Kinney, Michael D <michael.d.kin...@intel.com>
> Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc : make python368.inf
> compile conditionally in AppPkg.dsc
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4789
> 
> This commit adds necessary changes to AppPkg.dsc file for
> conditional compilation of python368.inf. To enable compilation
> of python368.inf users need to pass an additional parameter
> to the build command as -D BUILD_PYTHON368.
> Also updated the Py368ReadMe.txt and the GCCCompilationBKMs.rst
> to include this additional information for building python368.inf.
> 
> Cc: Rebecca Cran <rebe...@bsdio.com>
> Cc: Michael D Kinney <michael.d.kin...@intel.com>
> Cc: Jayaprakash N <n.jayaprak...@intel.com>
> Signed-off-by: Jayaprakash N <n.jayaprak...@intel.com>
> ---
>  AppPkg/AppPkg.dsc                                        | 9 ++++++---
>  .../Python/Python-3.6.8/GCCCompilationBKMs.rst           | 6 ++----
>  AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt  | 9 +++------
>  3 files changed, 11 insertions(+), 13 deletions(-)
> 
> diff --git a/AppPkg/AppPkg.dsc b/AppPkg/AppPkg.dsc
> index e5a6c5e..89f9f1d 100644
> --- a/AppPkg/AppPkg.dsc
> +++ b/AppPkg/AppPkg.dsc
> @@ -7,7 +7,7 @@
>  #   for important information about configuring this package for your
>  #   environment.
>  #
> -#   Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
> +#   Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR>
>  #   SPDX-License-Identifier: BSD-2-Clause-Patent
>  ##
> 
> @@ -120,8 +120,11 @@
>        gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80400040
>    }
> 
> -#### Un-comment the following line to build Python 3.6.8.
> -# AppPkg/Applications/Python/Python-3.6.8/Python368.inf
> +#### Conditional compilation of python368.inf by passing -D BUILD_PYTHON368
> +#### through build command
> +  !if $(BUILD_PYTHON368)
> +    AppPkg/Applications/Python/Python-3.6.8/Python368.inf
> +  !endif
> 
>  #### Un-comment the following line to build Lua.
>  #  AppPkg/Applications/Lua/Lua.inf
> diff --git a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
> b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
> index 525bef8..0574977 100644
> --- a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
> +++ b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
> @@ -150,17 +150,15 @@ Copy the contents of edk2-libc to edk2 folder::
> 
>  2.5.  Build Python Interpreter using GCC
>  ----------------------------------------
> -Uncomment the line containing following inf file name in AppPkg/AppPkg.dsc
> file
> -AppPkg/Applications/Python/Python-3.6.8/Python368.inf
> 
>  Execute the below command to build the X64 version of the Python 3.6.8
> interpreter using GCC tool chain::
> 
>          bash$ cd AppPkg/Applications/Python/Python-3.6.8/
>          bash$ python srcprep.py
>          bash$ cd ~/src/edk2
> -        bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -m
> AppPkg/Applications/Python/Python-3.6.8/Python368.inf
> +        bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -m
> AppPkg/Applications/Python/Python-3.6.8/Python368.inf -D BUILD_PYTHON368
>               or
> -        bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc
> +        bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -D
> BUILD_PYTHON368
> 
> 
>  2.5  Create Python UEFI package with all dependencies
> diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> index a6e65fe..5753443 100644
> --- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> +++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> @@ -68,12 +68,9 @@ and that you can successfully build packages within that
> distribution.
>          gc          itertools       math          _operator
>          time
> 
> -  C.  Edit AppPkg/AppPkg.dsc to enable (uncomment) the Python368.inf line
> -    within the [Components] section.
> -
> -  D.  Build AppPkg using the standard "build" command:
> +  C.  Build AppPkg using the standard "build" command:
>      For example, to build Python for an X64 CPU architecture:
> -                    build -a X64 -p AppPkg\AppPkg.dsc
> +                    build -a X64 -p AppPkg\AppPkg.dsc -D BUILD_PYTHON368
> 
>  4. Python-related paths and files
>  =================================
> @@ -133,7 +130,7 @@ system as follows:
>    2. Uncomment BsdSocketLib and EfiSocketLib LibraryClasses in Python368.inf
>    3. Uncomment the statement #Modules/socketmodule.c in Python368.inf
>    4. Build Python interpreter application using below command
> -          build -a X64 -p AppPkg\AppPkg.dsc
> +          build -a X64 -p AppPkg\AppPkg.dsc -D BUILD_PYTHON368
>    5. Copy Build\AppPkg\RELEASE_VS2017\X64\Python.efi to \Efi\Tools on your
>       target system. Replace "RELEASE_VS2017", in the source path, with
>       values appropriate for your tool chain.
> --
> 2.45.1.windows.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119610): https://edk2.groups.io/g/devel/message/119610
Mute This Topic: https://groups.io/mt/106736573/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to