diff options
-rw-r--r-- | config/arch/arm.in | 42 | ||||
-rw-r--r-- | config/libc.in | 17 | ||||
-rw-r--r-- | config/libc/newlib.in | 41 | ||||
-rw-r--r-- | config/libc/none.in | 14 | ||||
-rw-r--r-- | config/target.in | 10 | ||||
-rw-r--r-- | patches/uClibc/0.9.30.1/180-getline-conflict.patch | 30 | ||||
-rw-r--r-- | samples/arm-bare_newlib_cortex_m3_nommu-eabi/crosstool.config | 343 | ||||
-rw-r--r-- | samples/arm-bare_newlib_cortex_m3_nommu-eabi/reported.by | 3 | ||||
-rw-r--r-- | scripts/build/arch/arm.sh | 18 | ||||
-rw-r--r-- | scripts/build/debug/100-dmalloc.sh | 6 | ||||
-rw-r--r-- | scripts/build/libc/newlib.sh | 55 | ||||
-rw-r--r-- | scripts/functions | 21 |
12 files changed, 551 insertions, 49 deletions
diff --git a/config/arch/arm.in b/config/arch/arm.in index f1b0c8f..6daa603 100644 --- a/config/arch/arm.in +++ b/config/arch/arm.in @@ -1,7 +1,8 @@ # ARM specific configuration file config ARCH_arm - select ARCH_USE_MMU + select ARCH_SUPPORTS_BOTH_MMU + select ARCH_DEFAULT_HAS_MMU select ARCH_SUPPORTS_BOTH_ENDIAN select ARCH_DEFAULT_LE select ARCH_SUPPORT_ARCH @@ -12,6 +13,45 @@ config ARCH_arm The ARM architecture, as defined by: http://www.arm.com/ +config ARCH_ARM_MODE + string + default "arm" if ARCH_ARM_MODE_ARM + default "thumb" if ARCH_ARM_MODE_THUMB + +choice + bool + prompt "Default instruction set mode" + default ARCH_ARM_MODE_ARM + +config ARCH_ARM_MODE_ARM + bool + prompt "arm" + help + Defaults to emitting instructions in the ARM mode. + +config ARCH_ARM_MODE_THUMB + bool + prompt "thumb (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + Defaults to emitting instructions in the THUMB mode. + +endchoice + +config ARCH_ARM_INTERWORKING + bool + prompt "Use Thumb-interworking (READ HELP)" + default n + depends on EXPERIMENTAL + help + Excerpt from the gcc manual: + + > Generate code which supports calling between the ARM and Thumb + > instruction sets. Without this option the two instruction sets + > cannot be reliably used inside one program. The default is + > [not to use interwork], since slightly larger code is generated + > when [interwork] is specified. + config ARCH_ARM_EABI bool prompt "Use EABI" diff --git a/config/libc.in b/config/libc.in index 30e39e5..42fe272 100644 --- a/config/libc.in +++ b/config/libc.in @@ -1,11 +1,9 @@ # C library options +menu "C-library" + config LIBC string - default "newlib" if BARE_METAL && ARCH_avr32 && EXPERIMENTAL - default "none" if BARE_METAL - -menu "C-library" config LIBC_VERSION string @@ -23,8 +21,6 @@ config LIBC_VERSION source config.gen/libc.in -comment "Common C library options" - config LIBC_SUPPORT_NPTL bool default n @@ -37,7 +33,12 @@ config THREADS string default "nptl" if THREADS_NPTL default "linuxthreads" if THREADS_LINUXTHREADS - default "none" if THREADS_NONE + default "none" if THREADS_NONE || LIBC_none +# No C library, no threads! + +if ! LIBC_none + +comment "Common C library options" choice bool @@ -62,4 +63,6 @@ config THREADS_NONE endchoice +endif # ! LIBC_none + endmenu diff --git a/config/libc/newlib.in b/config/libc/newlib.in index e952278..446cb4d 100644 --- a/config/libc/newlib.in +++ b/config/libc/newlib.in @@ -1,14 +1,14 @@ # newlib options -# depends on EXPERIMENTAL +# depends on EXPERIMENTAL && BARE_METAL config LIBC_newlib help - Newlib is a C library intended for use on embedded systems. It is a - conglomeration of several library parts, all under free software - licenses that make them easily usable on embedded products. Newlib - is only available in source form. It can be compiled for a wide - array of processors, and will usually work on any architecture with - the addition of a few low-level routines. + Newlib is a C library intended for use on embedded systems. It is a + conglomeration of several library parts, all under free software + licenses that make them easily usable on embedded products. Newlib + is only available in source form. It can be compiled for a wide + array of processors, and will usually work on any architecture with + the addition of a few low-level routines. choice bool @@ -16,25 +16,46 @@ choice # Don't remove next line # CT_INSERT_VERSION_BELOW -config NEWLIB_V_1_17_0 +config LIBC_NEWLIB_V_1_17_0 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 NEWLIB_V_1_17_0 + 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 prompt "Install Atmel AVR32 headers" + depends on ARCH_avr32 default y help Install Atmel AVR32 headers for native AVR32 development. Most AVR32 MCU devices are supported. If you do native AVR32 development you want to say 'Y' here. - diff --git a/config/libc/none.in b/config/libc/none.in new file mode 100644 index 0000000..9507007 --- /dev/null +++ b/config/libc/none.in @@ -0,0 +1,14 @@ +# Dummy config file to not use a C library *at all* +# depends on BARE_METAL + +config LIBC_none + help + Do not use a C library. + + This is usefull if your project is self-contained, does not rely on + an external C library, and provides all the necessary bits. + + Most probably usefull to bootloaders, as they generally don't depend + on the C library. + + If unsure: do *not* choose that, and use another option in the choice. diff --git a/config/target.in b/config/target.in index 4734a34..ab6efe3 100644 --- a/config/target.in +++ b/config/target.in @@ -52,6 +52,16 @@ config ARCH_USE_MMU prompt "Use the MMU" if ARCH_SUPPORTS_BOTH_MMU default n if ! ARCH_DEFAULT_HAS_MMU default y if ARCH_DEFAULT_HAS_MMU + help + If your architecture has an MMU and you want to use it, + say 'Y' here. + + OTOH, if you don't want to use the MMU, or your arch + lacks an MMU, say 'N' here. + + Note that some architectures (eg. ARM) has variants that + lacks an MMU (eg. ARM Cortex-M3), while other variants + have one (eg. ARM Cortex-A8). #-------------------------------------- config ARCH_SUPPORTS_BOTH_ENDIAN diff --git a/patches/uClibc/0.9.30.1/180-getline-conflict.patch b/patches/uClibc/0.9.30.1/180-getline-conflict.patch new file mode 100644 index 0000000..50842f9 --- /dev/null +++ b/patches/uClibc/0.9.30.1/180-getline-conflict.patch @@ -0,0 +1,30 @@ +--- a/extra/scripts/unifdef.c ++++ b/extra/scripts/unifdef.c +@@ -206,7 +206,7 @@ + static void error(const char *); + static int findsym(const char *); + static void flushline(bool); +-static Linetype getline(void); ++static Linetype get_line(void); + static Linetype ifeval(const char **); + static void ignoreoff(void); + static void ignoreon(void); +@@ -512,7 +512,7 @@ + + for (;;) { + linenum++; +- lineval = getline(); ++ lineval = get_line(); + trans_table[ifstate[depth]][lineval](); + debug("process %s -> %s depth %d", + linetype_name[lineval], +@@ -526,7 +526,7 @@ + * help from skipcomment(). + */ + static Linetype +-getline(void) ++get_line(void) + { + const char *cp; + int cursym; + diff --git a/samples/arm-bare_newlib_cortex_m3_nommu-eabi/crosstool.config b/samples/arm-bare_newlib_cortex_m3_nommu-eabi/crosstool.config new file mode 100644 index 0000000..4d12ec1 --- /dev/null +++ b/samples/arm-bare_newlib_cortex_m3_nommu-eabi/crosstool.config @@ -0,0 +1,343 @@ +# +# Automatically generated make config: don't edit +# crosstool-NG version: hg_default@1595_6e87092d1076 +# Mon Oct 26 23:10:21 2009 +# + +# +# Paths and misc options +# + +# +# crosstool-NG behavior +# +# CT_OBSOLETE is not set +CT_EXPERIMENTAL=y +# CT_DEBUG_CT is not set + +# +# Paths +# +CT_LOCAL_TARBALLS_DIR="${HOME}/src" +CT_SAVE_TARBALLS=y +CT_WORK_DIR="${CT_TOP_DIR}/targets" +CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}" +CT_INSTALL_DIR="${CT_PREFIX_DIR}" +CT_REMOVE_DOCS=y +CT_INSTALL_DIR_RO=y + +# +# Downloading +# +# CT_FORBID_DOWNLOAD is not set +# CT_FORCE_DOWNLOAD is not set +CT_USE_MIRROR=y +# CT_PREFER_MIRROR is not set +CT_MIRROR_BASE_URL="http://ymorin.is-a-geek.org/mirrors/" +# CT_MIRROR_LS_R is not set +CT_CONNECT_TIMEOUT=10 +# CT_ONLY_DOWNLOAD is not set + +# +# Extracting +# +# CT_FORCE_EXTRACT is not set +CT_OVERIDE_CONFIG_GUESS_SUB=y +# CT_ONLY_EXTRACT is not set +CT_PATCH_BUNDLED=y +# CT_PATCH_LOCAL is not set +# CT_PATCH_BUNDLED_LOCAL is not set +# CT_PATCH_LOCAL_BUNDLED is not set +# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set +# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set +CT_PATCH_ORDER="bundled" +# CT_PATCH_SINGLE is not set +# CT_PATCH_USE_LOCAL is not set + +# +# Build behavior +# +CT_PARALLEL_JOBS=1 +CT_LOAD=0 +CT_NICE=0 +CT_USE_PIPES=y +# CT_CONFIG_SHELL_SH is not set +# CT_CONFIG_SHELL_ASH is not set +CT_CONFIG_SHELL_BASH=y +# CT_CONFIG_SHELL_CUSTOM is not set +CT_CONFIG_SHELL="bash" + +# +# Logging +# +# CT_LOG_ERROR is not set +# CT_LOG_WARN is not set +# CT_LOG_INFO is not set +CT_LOG_EXTRA=y +# CT_LOG_DEBUG is not set +# CT_LOG_ALL is not set +CT_LOG_LEVEL_MAX="EXTRA" +# CT_LOG_SEE_TOOLS_WARN is not set +CT_LOG_PROGRESS_BAR=y +CT_LOG_TO_FILE=y +CT_LOG_FILE_COMPRESS=y + +# +# Target options +# +CT_ARCH="arm" +# CT_ARCH_64 is not set +CT_ARCH_SUPPORTS_BOTH_MMU=y +CT_ARCH_SUPPORTS_BOTH_ENDIAN=y +CT_ARCH_SUPPORT_ARCH=y +# CT_ARCH_SUPPORT_ABI is not set +CT_ARCH_SUPPORT_CPU=y +CT_ARCH_SUPPORT_TUNE=y +CT_ARCH_SUPPORT_FPU=y +CT_ARCH_DEFAULT_HAS_MMU=y +# CT_ARCH_DEFAULT_BE is not set +CT_ARCH_DEFAULT_LE=y +CT_ARCH_ARCH="" +CT_ARCH_CPU="cortex-m3" +CT_ARCH_TUNE="cortex-m3" +CT_ARCH_FPU="" +# CT_ARCH_BE is not set +CT_ARCH_LE=y +# CT_ARCH_FLOAT_HW is not set +CT_ARCH_FLOAT_SW=y +CT_TARGET_CFLAGS="" +CT_TARGET_LDFLAGS="" + +# +# General target options +# +# CT_ARCH_alpha is not set +CT_ARCH_arm=y +# CT_ARCH_avr32 is not set +# CT_ARCH_ia64 is not set +# CT_ARCH_mips is not set +# CT_ARCH_powerpc is not set +# CT_ARCH_powerpc64 is not set +# CT_ARCH_sh is not set +# CT_ARCH_x86 is not set +# CT_ARCH_x86_64 is not set +CT_ARCH_ARM_MODE="thumb" +# CT_ARCH_ARM_MODE_ARM is not set +CT_ARCH_ARM_MODE_THUMB=y +# CT_ARCH_ARM_INTERWORKING is not set +CT_ARCH_ARM_EABI=y +# CT_ARCH_USE_MMU is not set + +# +# Target optimisations +# + +# +# Toolchain options +# + +# +# General toolchain options +# +CT_USE_SYSROOT=y +CT_SYSROOT_DIR_PREFIX="" + +# +# Tuple completion and aliasing +# +CT_TARGET_VENDOR="bare_newlib_cortex_m3_nommu" +CT_TARGET_ALIAS_SED_EXPR="" +CT_TARGET_ALIAS="" + +# +# Toolchain type +# +# CT_NATIVE is not set +CT_CROSS=y +# CT_CROSS_NATIVE is not set +# CT_CANADIAN is not set +CT_TOOLCHAIN_TYPE="cross" + +# +# Build system +# +CT_BUILD="" +CT_BUILD_PREFIX="" +CT_BUILD_SUFFIX="" + +# +# Operating System +# +CT_BARE_METAL=y +# CT_KERNEL_SUPPORTS_SHARED_LIBS is not set +CT_KERNEL="bare-metal" +CT_KERNEL_bare_metal=y +# CT_KERNEL_linux is not set + +# +# Common kernel options +# + +# +# Binary utilities +# +# CT_ARCH_BINFMT_ELF is not set +CT_ARCH_BINFMT_FLAT=y + +# +# GNU binutils +# +CT_BINUTILS_VERSION="2.19.1" +# CT_BINUTILS_V_2_19_51_0_2 is not set +# CT_BINUTILS_V_2_19_51_0_1 is not set +# CT_BINUTILS_V_2_19_50_0_1 is not set +CT_BINUTILS_V_2_19_1=y +# CT_BINUTILS_V_2_19 is not set +# CT_BINUTILS_V_2_18_93 is not set +# CT_BINUTILS_V_2_18_92 is not set +# CT_BINUTILS_V_2_18_91 is not set +# CT_BINUTILS_V_2_18_90 is not set +# CT_BINUTILS_V_2_18_50_0_9 is not set +# CT_BINUTILS_V_2_18_50_0_8 is not set +# CT_BINUTILS_V_2_18_50_0_7 is not set +# CT_BINUTILS_V_2_18_50_0_6 is not set +# CT_BINUTILS_V_2_18_50_0_4 is not set +# CT_BINUTILS_V_2_18 is not set +# CT_BINUTILS_V_2_17 is not set +# CT_BINUTILS_V_2_16_1 is not set +# CT_BINUTILS_V_2_15 is not set +# CT_BINUTILS_V_2_14 is not set +CT_BINUTILS_EXTRA_CONFIG="" + +# +# elf2flt +# +CT_ELF2FLT_VERSION="head" +CT_ELF2FLT_CVSHEAD=y +# CT_ELF2FLT_CVS_SNAPSHOT is not set +CT_ELF2FLT_EXTRA_CONFIG="" + +# +# C compiler +# +CT_CC="gcc" +CT_CC_VERSION="4.4.1" +CT_CC_gcc=y +CT_CC_V_4_4_1=y +# CT_CC_V_4_4_0 is not set +# CT_CC_V_4_3_4 is not set +# CT_CC_V_4_3_3 is not set +# CT_CC_V_4_3_2 is not set +# CT_CC_V_4_3_1 is not set +# CT_CC_V_4_3_0 is not set +# CT_CC_V_4_2_4 is not set +# CT_CC_V_4_2_3 is not set +# CT_CC_V_4_2_2 is not set +# CT_CC_V_4_2_1 is not set +# CT_CC_V_4_2_0 is not set +# CT_CC_V_4_1_2 is not set +# CT_CC_V_4_1_1 is not set +# CT_CC_V_4_1_0 is not set +# CT_CC_V_4_0_4 is not set +# CT_CC_V_4_0_3 is not set +# CT_CC_V_4_0_2 is not set +# CT_CC_V_4_0_1 is not set +# CT_CC_V_4_0_0 is not set +# CT_CC_V_3_4_6 is not set +# CT_CC_V_3_3_6 is not set +# CT_CC_V_3_2_3 is not set +CT_CC_GCC_4_3_or_later=y +CT_CC_GCC_4_4_or_later=y +CT_CC_ENABLE_CXX_FLAGS="" +CT_CC_CORE_EXTRA_CONFIG="" +CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}" +CT_CC_BUGURL="" +CT_CC_SUPPORT_CXX=y +CT_CC_SUPPORT_FORTRAN=y +CT_CC_SUPPORT_JAVA=y +CT_CC_SUPPORT_ADA=y +CT_CC_SUPPORT_OBJC=y +CT_CC_SUPPORT_OBJCXX=y + +# +# Additional supported languages: +# +CT_CC_LANG_CXX=y + +# +# C-library +# +CT_LIBC="newlib" +CT_LIBC_VERSION="" +# CT_LIBC_eglibc is not set +# CT_LIBC_glibc is not set +CT_LIBC_newlib=y +# CT_LIBC_none is not set +# CT_LIBC_uClibc is not set +# CT_LIBC_NEWLIB_V_1_17_0 is not set +CT_LIBC_NEWLIB_CVS=y + +# +# Architecture specific options +# +# CT_LIBC_SUPPORT_NPTL is not set +# CT_LIBC_SUPPORT_LINUXTHREADS is not set +CT_THREADS="none" + +# +# Common C library options +# +# CT_THREADS_NPTL is not set +# CT_THREADS_LINUXTHREADS is not set +CT_THREADS_NONE=y + +# +# Debug facilities +# +# CT_DEBUG_dmalloc is not set +# CT_DEBUG_duma is not set +# CT_DEBUG_gdb is not set +# CT_DEBUG_ltrace is not set +# CT_DEBUG_strace is not set + +# +# Tools facilities +# +# CT_TOOL_libelf is not set +# CT_TOOL_sstrip is not set + +# +# Companion libraries +# +CT_WRAPPER_NEEDED=y +CT_GMP_MPFR=y +CT_GMP_V_4_3_1=y +# CT_GMP_V_4_3_0 is not set +# CT_GMP_V_4_2_4 is not set +# CT_GMP_V_4_2_2 is not set +CT_GMP_VERSION="4.3.1" +CT_MPFR_V_2_4_1=y +# CT_MPFR_V_2_4_0 is not set +# CT_MPFR_V_2_3_2 is not set +# CT_MPFR_V_2_3_1 is not set +CT_MPFR_VERSION="2.4.1" +CT_PPL_CLOOG_MPC=y +CT_PPL_V_0_10_2=y +CT_PPL_VERSION="0.10.2" +CT_CLOOG_V_0_15_7=y +# CT_CLOOG_V_0_15_6 is not set +# CT_CLOOG_V_0_15_5 is not set +# CT_CLOOG_V_0_15_4 is not set +# CT_CLOOG_V_0_15_3 is not set +CT_CLOOG_VERSION="0.15.7" +CT_MPC_V_0_7=y +# CT_MPC_V_0_6 is not set +CT_MPC_VERSION="0.7" + +# +# Companion libraries common options +# +# CT_COMP_LIBS_CHECK is not set +CT_TOOLS_WRAPPER_SCRIPT=y +# CT_TOOLS_WRAPPER_EXEC is not set +CT_TOOLS_WRAPPER="script" diff --git a/samples/arm-bare_newlib_cortex_m3_nommu-eabi/reported.by b/samples/arm-bare_newlib_cortex_m3_nommu-eabi/reported.by new file mode 100644 index 0000000..d30237f --- /dev/null +++ b/samples/arm-bare_newlib_cortex_m3_nommu-eabi/reported.by @@ -0,0 +1,3 @@ +reporter_name="Yann E. MORIN" +reporter_url="http://ymorin.is-a-geek.org/projects/crosstool" +reporter_comment="Experimental toolchain for ARM cortex-m3 in Thumb-only, noMMU, and newlib." diff --git a/scripts/build/arch/arm.sh b/scripts/build/arch/arm.sh index fafd871..e049696 100644 --- a/scripts/build/arch/arm.sh +++ b/scripts/build/arch/arm.sh @@ -8,10 +8,20 @@ CT_DoArchTupleValues() { case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in *glibc,y) CT_TARGET_SYS=gnueabi;; uClibc,y) CT_TARGET_SYS=uclibcgnueabi;; - none,y) CT_TARGET_SYS=eabi;; + *,y) CT_TARGET_SYS=eabi;; esac - # In case we're EABI, do *not* specify any ABI! - # which means, either we do not have an ABI specified, or we're not EABI. - CT_TestOrAbort "Internal error: CT_ARCH_ABI should not be set for EABI build." -z "${CT_ARCH_ABI}" -o -z "${CT_ARCH_ARM_EABI}" + # Set the default instrcution set mode + case "${CT_ARCH_ARM_MODE}" in + arm) ;; + thumb) + CT_ARCH_CC_CORE_EXTRA_CONFIG="--with-mode=thumb" + CT_ARCH_CC_EXTRA_CONFIG="--with-mode=thumb" +# CT_ARCH_TARGET_CFLAGS="-mthumb" + ;; + esac + + if [ "${CT_ARCH_ARM_INTERWORKING}" = "y" ]; then + CT_ARCH_TARGET_CFLAGS+=" -mthumb-interwork" + fi } diff --git a/scripts/build/debug/100-dmalloc.sh b/scripts/build/debug/100-dmalloc.sh index f95a36d..e8965e9 100644 --- a/scripts/build/debug/100-dmalloc.sh +++ b/scripts/build/debug/100-dmalloc.sh @@ -22,9 +22,9 @@ do_debug_dmalloc_build() { y) extra_config+=("--enable-cxx");; *) extra_config+=("--disable-cxx");; esac - case "${CT_THREADS_NONE}" in - y) extra_config+=("--disable-threads");; - *) extra_config+=("--enable-threads");; + case "${CT_THREADS}" in + none) extra_config+=("--disable-threads");; + *) extra_config+=("--enable-threads");; esac case "${CT_SHARED_LIBS}" in y) extra_config+=("--enable-shlib");; diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh index 196334d..c4cf654 100644 --- a/scripts/build/libc/newlib.sh +++ b/scripts/build/libc/newlib.sh @@ -5,12 +5,27 @@ # Edited by Martin Lund <mgl@doredevelopment.dk> # +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_get() { } 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" @@ -46,23 +61,24 @@ do_libc() { CT_DoLog EXTRA "Configuring C library" -# CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \ - BUILD_CC="${CT_BUILD}-gcc" \ - CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \ - AR=${CT_TARGET}-ar \ - RANLIB=${CT_TARGET}-ranlib \ - CT_DoExecLog ALL \ - "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure" \ - --build=${CT_BUILD} \ - --host=${CT_HOST} \ - --target=${CT_TARGET} \ - --prefix=${CT_PREFIX_DIR} \ - ${extra_config} \ - ${CT_LIBC_GLIBC_EXTRA_CONFIG} + # Note: newlib handles the build/host/target a little bit differently + # than one would expect: + # 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}/$(libc_newlib_basename)/configure" \ + --host=${CT_BUILD} \ + --target=${CT_TARGET} \ + --prefix=${CT_PREFIX_DIR} CT_DoLog EXTRA "Building C library" - CT_DoExecLog ALL make + CT_DoExecLog ALL make ${PARALLELMFLAGS} CT_DoLog EXTRA "Installing C library" @@ -72,9 +88,10 @@ do_libc() { } do_libc_finish() { - CT_DoStep INFO "Installing Atmel AVR32 headers" + CT_DoStep INFO "Finishing C library" if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then + CT_DoLog EXTRA "Installing Atmel's AVR32 headers" CT_DoExecLog ALL cp -r ${CT_SRC_DIR}/avr32headers "${CT_PREFIX_DIR}/${CT_TARGET}/include/avr32" fi diff --git a/scripts/functions b/scripts/functions index 62a2f99..b9aa7e7 100644 --- a/scripts/functions +++ b/scripts/functions @@ -477,7 +477,8 @@ CT_GetFile() { # 'tag' is the tag to retrieve. Must be specified, but can be empty. # If dirname is specified, then module will be renamed to dirname # prior to building the tarball. -# Usage: CT_GetCVS <basename> <url> <module> <tag> [dirname] +# Usage: CT_GetCVS <basename> <url> <module> <tag> [dirname[=subdir]] +# Note: if '=subdir' is given, then it is used instead of 'module'. CT_GetCVS() { local basename="$1" local uri="$2" @@ -499,8 +500,18 @@ CT_GetCVS() { CT_Pushd "${tmp_dir}" CT_DoExecLog ALL cvs -z 9 -d "${uri}" co -P ${tag} "${module}" - [ -n "${dirname}" ] && CT_DoExecLog ALL mv "${module}" "${dirname}" - CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname:-${module}}" + 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 ALL mv "${module}" "${dirname}" + CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname:-${module}}" + ;; + esac + fi CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}.tar.bz2" CT_Popd @@ -612,7 +623,7 @@ CT_Patch() { CT_DoLog EXTRA "Patching '${basename}'" bundled_patch_dir="${CT_LIB_DIR}/patches/${base_file}/${ver_file}" - local_patch_dir="${CT_CUSTOM_PATCH_DIR}/${base_file}/${ver_file}" + local_patch_dir="${CT_LOCAL_PATCH_DIR}/${base_file}/${ver_file}" case "${CT_PATCH_ORDER}" in bundled) patch_dirs=("${bundled_patch_dir}");; @@ -696,9 +707,9 @@ CT_DoBuildTargetTuple() { # Set defaults for the system part of the tuple. Can be overriden # by architecture-specific values. case "${CT_LIBC}" in - none) CT_TARGET_SYS=elf;; *glibc) CT_TARGET_SYS=gnu;; uClibc) CT_TARGET_SYS=uclibc;; + *) CT_TARGET_SYS=elf;; esac # Transform the ARCH into a kernel-understandable ARCH |