binutils/binutils: Add CUSTOM version and CUSTOM_LOCATION config options and GetCustom
authorDavid Holsgrove <david.holsgrove@xilinx.com>
Thu Oct 11 14:39:41 2012 +1000 (2012-10-11)
changeset 30893662412ddd59
parent 3088 7f5a3382968f
child 3090 a221c86d9b33
binutils/binutils: Add CUSTOM version and CUSTOM_LOCATION config options and GetCustom

CUSTOM_LOCATION config options only presented in menuconfig if component
CUSTOM version selected.

Signed-off-by: "David Holsgrove" <david.holsgrove@xilinx.com>
[yann.morin.1998@free.fr: fix indentation, don't patch custom dir location]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <7a604b5df9c84a1e20c3.1349931195@localhost.localdomain>
PatchWork-Id: 190788
config/binutils/binutils.in
scripts/build/binutils/binutils.sh
     1.1 --- a/config/binutils/binutils.in	Thu Oct 11 14:39:41 2012 +1000
     1.2 +++ b/config/binutils/binutils.in	Thu Oct 11 14:39:41 2012 +1000
     1.3 @@ -50,8 +50,26 @@
     1.4      prompt "2.16.1a (OBSOLETE)"
     1.5      depends on OBSOLETE
     1.6  
     1.7 +config BINUTILS_CUSTOM
     1.8 +    bool
     1.9 +    prompt "Custom binutils"
    1.10 +    depends on EXPERIMENTAL
    1.11 +    select BINUTILS_2_22_or_later
    1.12 +
    1.13  endchoice
    1.14  
    1.15 +if BINUTILS_CUSTOM
    1.16 +
    1.17 +config BINUTILS_CUSTOM_LOCATION
    1.18 +    string
    1.19 +    prompt "Full path to custom binutils source"
    1.20 +    default ""
    1.21 +    help
    1.22 +      Enter the path to the directory (or tarball) of your source for binutils,
    1.23 +      or leave blank to use default CT_CUSTOM_LOCATION_ROOT_DIR/binutils
    1.24 +
    1.25 +endif # BINUTILS_CUSTOM
    1.26 +
    1.27  config BINUTILS_VERSION
    1.28      string
    1.29  # Don't remove next line
    1.30 @@ -64,6 +82,7 @@
    1.31      default "2.18a" if BINUTILS_V_2_18a
    1.32      default "2.17a" if BINUTILS_V_2_17a
    1.33      default "2.16.1a" if BINUTILS_V_2_16_1a
    1.34 +    default "custom" if BINUTILS_CUSTOM
    1.35  
    1.36  config BINUTILS_2_22_or_later
    1.37      bool
     2.1 --- a/scripts/build/binutils/binutils.sh	Thu Oct 11 14:39:41 2012 +1000
     2.2 +++ b/scripts/build/binutils/binutils.sh	Thu Oct 11 14:39:41 2012 +1000
     2.3 @@ -4,13 +4,24 @@
     2.4  
     2.5  # Download binutils
     2.6  do_binutils_get() {
     2.7 -    CT_GetFile "binutils-${CT_BINUTILS_VERSION}"                                        \
     2.8 -               {ftp,http}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils   \
     2.9 -               ftp://gcc.gnu.org/pub/binutils/{releases,snapshots}
    2.10 +    if [ "${CT_BINUTILS_CUSTOM}" = "y" ]; then
    2.11 +        CT_GetCustom "binutils" "${CT_BINUTILS_VERSION}" \
    2.12 +                     "${CT_BINUTILS_CUSTOM_LOCATION}"
    2.13 +    else
    2.14 +        CT_GetFile "binutils-${CT_BINUTILS_VERSION}"                                        \
    2.15 +                   {ftp,http}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils   \
    2.16 +                   ftp://gcc.gnu.org/pub/binutils/{releases,snapshots}
    2.17 +    fi
    2.18  }
    2.19  
    2.20  # Extract binutils
    2.21  do_binutils_extract() {
    2.22 +    # If using custom directory location, nothing to do
    2.23 +    if [ "${CT_BINUTILS_CUSTOM}" = "y" \
    2.24 +         -a -d "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" ]; then
    2.25 +        return 0
    2.26 +    fi
    2.27 +
    2.28      CT_Extract "binutils-${CT_BINUTILS_VERSION}"
    2.29      CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
    2.30  }