# HG changeset patch # User "Yann E. MORIN" # Date 1256590830 -3600 # Node ID 66b2463743afabfcd3a5c4bcfa77303790b42449 # Parent c08132a930493dc593b23c8034b2e922d402d669 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. diff -r c08132a93049 -r 66b2463743af config/libc/newlib.in --- a/config/libc/newlib.in Mon Oct 26 19:49:50 2009 +0100 +++ b/config/libc/newlib.in Mon Oct 26 22:00:30 2009 +0100 @@ -20,13 +20,34 @@ bool prompt "1.17.0" +config LIBC_NEWLIB_CVS + bool + prompt "Use CVS snapshot" + help + The newlib "team" rolls new releases about once a year (december). + This is quite a long time between releases, in case code was fixed. + + Saying 'Y' here will allow you to use the bleeding-edge code from + the CVS repository. This may or may not fix your issues, may or may + not build, may or may not crash your machine, may or may not withdraw + money from your bank account, may or may not date your girlfriend, + may or may not resurect Elvis... :-) + + In a word: use the CVS snapshot at your own risk! + endchoice config LIBC_VERSION string + prompt "use CVS tag" if LIBC_NEWLIB_CVS # Don't remove next line # CT_INSERT_VERSION_STRING_BELOW default "1.17.0" if LIBC_NEWLIB_V_1_17_0 + help + Enter the tag you want to use. + Leave empty to use the 'head' of the repository. + +comment "Architecture specific options" config ATMEL_AVR32_HEADERS bool diff -r c08132a93049 -r 66b2463743af scripts/build/libc/newlib.sh --- a/scripts/build/libc/newlib.sh Mon Oct 26 19:49:50 2009 +0100 +++ b/scripts/build/libc/newlib.sh Mon Oct 26 22:00:30 2009 +0100 @@ -5,12 +5,27 @@ # Edited by Martin Lund # +libc_newlib_basename() { + if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then + echo "newlib-${CT_LIBC_VERSION}" + else + echo "newlib-cvs${CT_LIBC_VERSION:+-${CT_LIBC_VERSION}}" + fi +} do_libc_get() { libc_src="ftp://sources.redhat.com/pub/newlib" avr32headers_src="http://dev.doredevelopment.dk/avr32-toolchain/sources" - - CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src} + + if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then + CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src} + else + CT_GetCVS "$(libc_newlib_basename)" \ + ":pserver:anoncvs@sources.redhat.com:/cvs/src" \ + "newlib" \ + "${CT_LIBC_VERSION}" \ + "$(libc_newlib_basename)=src" + fi if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then CT_GetFile "avr32headers" ${avr32headers_src} @@ -18,8 +33,8 @@ } do_libc_extract() { - CT_Extract "newlib-${CT_LIBC_VERSION}" - CT_Patch "newlib-${CT_LIBC_VERSION}" + CT_Extract "$(libc_newlib_basename)" + CT_Patch "$(libc_newlib_basename)" if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then CT_Extract "avr32headers" @@ -51,14 +66,14 @@ # build : not used # host : the machine building newlib # target : the machine newlib runs on - CC_FOR_BUILD="${CT_BUILD}-gcc" \ - CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS} -O" \ - AR=${CT_TARGET}-ar \ - RANLIB=${CT_TARGET}-ranlib \ - CT_DoExecLog ALL \ - "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure" \ - --host=${CT_BUILD} \ - --target=${CT_TARGET} \ + CC_FOR_BUILD="${CT_BUILD}-gcc" \ + CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS} -O" \ + AR=${CT_TARGET}-ar \ + RANLIB=${CT_TARGET}-ranlib \ + CT_DoExecLog ALL \ + "${CT_SRC_DIR}/$(libc_newlib_basename)/configure" \ + --host=${CT_BUILD} \ + --target=${CT_TARGET} \ --prefix=${CT_PREFIX_DIR} CT_DoLog EXTRA "Building C library" diff -r c08132a93049 -r 66b2463743af scripts/functions --- a/scripts/functions Mon Oct 26 19:49:50 2009 +0100 +++ b/scripts/functions Mon Oct 26 22:00:30 2009 +0100 @@ -503,8 +503,8 @@ if [ -n "${dirname}" ]; then case "${dirname}" in *=*) - CT_DoExecLog DEBUG mv "${dirname%%=*}" "${dirname#*=}" - CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname#*=}" + CT_DoExecLog DEBUG mv "${dirname#*=}" "${dirname%%=*}" + CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname%%=*}" ;; *) CT_DoExecLog ALL mv "${module}" "${dirname}"