libc/newlib: Add CUSTOM version and CUSTOM_LOCATION config options and GetCustom
authorDavid Holsgrove <david.holsgrove@xilinx.com>
Thu Oct 11 14:39:45 2012 +1000 (2012-10-11)
changeset 309407a87075fa2d
parent 3093 f5af323f7805
child 3095 ee3bc44bf7f9
libc/newlib: 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]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <d02252752d4dc5e68ae3.1349931202@localhost.localdomain>
PatchWork-Id: 190795
config/libc/newlib.in
scripts/build/libc/newlib.sh
     1.1 --- a/config/libc/newlib.in	Tue Oct 30 00:30:47 2012 +0100
     1.2 +++ b/config/libc/newlib.in	Thu Oct 11 14:39:45 2012 +1000
     1.3 @@ -52,8 +52,25 @@
     1.4        
     1.5        In a word: use the CVS snapshot at your own risk! 
     1.6  
     1.7 +config LIBC_NEWLIB_CUSTOM
     1.8 +    bool
     1.9 +    prompt "Custom newlib"
    1.10 +    depends on EXPERIMENTAL
    1.11 +
    1.12  endchoice
    1.13  
    1.14 +if LIBC_NEWLIB_CUSTOM
    1.15 +
    1.16 +config LIBC_NEWLIB_CUSTOM_LOCATION
    1.17 +    string
    1.18 +    prompt "Full path to custom newlib source"
    1.19 +    default ""
    1.20 +    help
    1.21 +      Enter the path to the directory (or tarball) of your source for newlib,
    1.22 +      or leave blank to use default CT_CUSTOM_LOCATION_ROOT_DIR/newlib
    1.23 +
    1.24 +endif # LIBC_NEWLIB_CUSTOM
    1.25 +
    1.26  config LIBC_VERSION
    1.27      string
    1.28      prompt "use CVS tag" if LIBC_NEWLIB_CVS
    1.29 @@ -63,6 +80,7 @@
    1.30      default "1.19.0" if LIBC_NEWLIB_V_1_19_0
    1.31      default "1.18.0" if LIBC_NEWLIB_V_1_18_0
    1.32      default "1.17.0" if LIBC_NEWLIB_V_1_17_0
    1.33 +    default "custom" if LIBC_NEWLIB_CUSTOM
    1.34      help
    1.35        Enter the tag you want to use.
    1.36        Leave empty to use the 'head' of the repository.
     2.1 --- a/scripts/build/libc/newlib.sh	Tue Oct 30 00:30:47 2012 +0100
     2.2 +++ b/scripts/build/libc/newlib.sh	Thu Oct 11 14:39:45 2012 +1000
     2.3 @@ -20,7 +20,10 @@
     2.4      libc_src="ftp://sources.redhat.com/pub/newlib"
     2.5      avr32headers_src="http://dev.doredevelopment.dk/avr32-toolchain/sources"
     2.6  
     2.7 -    if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
     2.8 +    if [ "${CT_LIBC_NEWLIB_CUSTOM}" = "y" ]; then
     2.9 +        CT_GetCustom "newlib" "${CT_LIBC_VERSION}"      \
    2.10 +                     "${CT_LIBC_NEWLIB_CUSTOM_LOCATION}"
    2.11 +    elif [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
    2.12          CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
    2.13      else
    2.14          CT_GetCVS "newlib-$(libc_newlib_version)"                   \
    2.15 @@ -36,6 +39,12 @@
    2.16  }
    2.17  
    2.18  do_libc_extract() {
    2.19 +    # If using custom directory location, nothing to do
    2.20 +    if [    "${CT_LIBC_NEWLIB_CUSTOM}" != "y"                \
    2.21 +         -a -d "${CT_SRC_DIR}/newlib-$(libc_newlib_version)" ]; then
    2.22 +        return 0
    2.23 +    fi
    2.24 +
    2.25      CT_Extract "newlib-$(libc_newlib_version)"
    2.26      CT_Patch "newlib" "$(libc_newlib_version)"
    2.27