libc/newlib: allow using CVS snapshots
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Oct 26 22:00:30 2009 +0100 (2009-10-26)
changeset 159366b2463743af
parent 1592 c08132a93049
child 1594 9c0766bed0d2
libc/newlib: allow using CVS snapshots

The newlib "team" rolls new releases about once a year (december).
This is quite a long time between releases, in case code was fixed.
So, allow user to use a CVS snapshot to benefit early from fixes
and enhancements to newlib.
config/libc/newlib.in
scripts/build/libc/newlib.sh
scripts/functions
     1.1 --- a/config/libc/newlib.in	Mon Oct 26 19:49:50 2009 +0100
     1.2 +++ b/config/libc/newlib.in	Mon Oct 26 22:00:30 2009 +0100
     1.3 @@ -20,13 +20,34 @@
     1.4      bool
     1.5      prompt "1.17.0"
     1.6  
     1.7 +config LIBC_NEWLIB_CVS
     1.8 +    bool
     1.9 +    prompt "Use CVS snapshot"
    1.10 +    help
    1.11 +      The newlib "team" rolls new releases about once a year (december).
    1.12 +      This is quite a long time between releases, in case code was fixed.
    1.13 +      
    1.14 +      Saying 'Y' here will allow you to use the bleeding-edge code from
    1.15 +      the CVS repository. This may or may not fix your issues, may or may
    1.16 +      not build, may or may not crash your machine, may or may not withdraw
    1.17 +      money from your bank account, may or may not date your girlfriend,
    1.18 +      may or may not resurect Elvis... :-)
    1.19 +      
    1.20 +      In a word: use the CVS snapshot at your own risk! 
    1.21 +
    1.22  endchoice
    1.23  
    1.24  config LIBC_VERSION
    1.25      string
    1.26 +    prompt "use CVS tag" if LIBC_NEWLIB_CVS
    1.27  # Don't remove next line
    1.28  # CT_INSERT_VERSION_STRING_BELOW
    1.29      default "1.17.0" if LIBC_NEWLIB_V_1_17_0
    1.30 +    help
    1.31 +      Enter the tag you want to use.
    1.32 +      Leave empty to use the 'head' of the repository.
    1.33 +
    1.34 +comment "Architecture specific options"
    1.35  
    1.36  config ATMEL_AVR32_HEADERS
    1.37      bool
     2.1 --- a/scripts/build/libc/newlib.sh	Mon Oct 26 19:49:50 2009 +0100
     2.2 +++ b/scripts/build/libc/newlib.sh	Mon Oct 26 22:00:30 2009 +0100
     2.3 @@ -5,12 +5,27 @@
     2.4  # Edited by Martin Lund <mgl@doredevelopment.dk>
     2.5  #
     2.6  
     2.7 +libc_newlib_basename() {
     2.8 +    if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
     2.9 +        echo "newlib-${CT_LIBC_VERSION}"
    2.10 +    else
    2.11 +        echo "newlib-cvs${CT_LIBC_VERSION:+-${CT_LIBC_VERSION}}"
    2.12 +    fi
    2.13 +}
    2.14  
    2.15  do_libc_get() {
    2.16      libc_src="ftp://sources.redhat.com/pub/newlib"
    2.17      avr32headers_src="http://dev.doredevelopment.dk/avr32-toolchain/sources"
    2.18 -    
    2.19 -    CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
    2.20 +
    2.21 +    if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
    2.22 +        CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
    2.23 +    else
    2.24 +        CT_GetCVS "$(libc_newlib_basename)"                         \
    2.25 +                  ":pserver:anoncvs@sources.redhat.com:/cvs/src"    \
    2.26 +                  "newlib"                                          \
    2.27 +                  "${CT_LIBC_VERSION}"                              \
    2.28 +                  "$(libc_newlib_basename)=src"
    2.29 +    fi
    2.30  
    2.31      if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
    2.32          CT_GetFile "avr32headers" ${avr32headers_src}
    2.33 @@ -18,8 +33,8 @@
    2.34  }
    2.35  
    2.36  do_libc_extract() {
    2.37 -    CT_Extract "newlib-${CT_LIBC_VERSION}"
    2.38 -    CT_Patch "newlib-${CT_LIBC_VERSION}"
    2.39 +    CT_Extract "$(libc_newlib_basename)"
    2.40 +    CT_Patch "$(libc_newlib_basename)"
    2.41  
    2.42      if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
    2.43          CT_Extract "avr32headers"
    2.44 @@ -51,14 +66,14 @@
    2.45      #   build  : not used
    2.46      #   host   : the machine building newlib
    2.47      #   target : the machine newlib runs on
    2.48 -    CC_FOR_BUILD="${CT_BUILD}-gcc"                          \
    2.49 -    CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS} -O"              \
    2.50 -    AR=${CT_TARGET}-ar                                      \
    2.51 -    RANLIB=${CT_TARGET}-ranlib                              \
    2.52 -    CT_DoExecLog ALL                                        \
    2.53 -    "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure"     \
    2.54 -        --host=${CT_BUILD}                                  \
    2.55 -        --target=${CT_TARGET}                               \
    2.56 +    CC_FOR_BUILD="${CT_BUILD}-gcc"                      \
    2.57 +    CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS} -O"          \
    2.58 +    AR=${CT_TARGET}-ar                                  \
    2.59 +    RANLIB=${CT_TARGET}-ranlib                          \
    2.60 +    CT_DoExecLog ALL                                    \
    2.61 +    "${CT_SRC_DIR}/$(libc_newlib_basename)/configure"   \
    2.62 +        --host=${CT_BUILD}                              \
    2.63 +        --target=${CT_TARGET}                           \
    2.64          --prefix=${CT_PREFIX_DIR}
    2.65      
    2.66      CT_DoLog EXTRA "Building C library"
     3.1 --- a/scripts/functions	Mon Oct 26 19:49:50 2009 +0100
     3.2 +++ b/scripts/functions	Mon Oct 26 22:00:30 2009 +0100
     3.3 @@ -503,8 +503,8 @@
     3.4      if [ -n "${dirname}" ]; then
     3.5          case "${dirname}" in
     3.6              *=*)
     3.7 -                CT_DoExecLog DEBUG mv "${dirname%%=*}" "${dirname#*=}"
     3.8 -                CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname#*=}"
     3.9 +                CT_DoExecLog DEBUG mv "${dirname#*=}" "${dirname%%=*}"
    3.10 +                CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname%%=*}"
    3.11                  ;;
    3.12              *)
    3.13                  CT_DoExecLog ALL mv "${module}" "${dirname}"