diff options
author | Alexey Neyman <stilor@att.net> | 2017-05-30 05:32:38 (GMT) |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-07-08 17:57:56 (GMT) |
commit | 567277099a487508fd228a4c56f3583db3fa96c9 (patch) | |
tree | 19b7f40c0f6e4e6284e799dbac1098bd8805dc2d /scripts | |
parent | 57426168ad2c7e8367786ed466c86f6aeb49b3c3 (diff) |
Fix the references to old config variables
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts')
35 files changed, 250 insertions, 563 deletions
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh index f378b4f..74139bc 100644 --- a/scripts/build/binutils/binutils.sh +++ b/scripts/build/binutils/binutils.sh @@ -4,44 +4,18 @@ # Download binutils do_binutils_get() { - if [ "${CT_BINUTILS_CUSTOM}" = "y" ]; then - CT_GetCustom "binutils" "${CT_BINUTILS_CUSTOM_VERSION}" \ - "${CT_BINUTILS_CUSTOM_LOCATION}" - else - case "${CT_BINUTILS_VERSION}" in - linaro-*) - CT_GetLinaro "binutils" "${CT_BINUTILS_VERSION}" - ;; - *) - CT_GetFile "binutils-${CT_BINUTILS_VERSION}" \ - {http,ftp}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils \ - ftp://{sourceware.org,gcc.gnu.org}/pub/binutils/{releases,snapshots} - ;; - esac - fi - + CT_Fetch BINUTILS if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then - if [ "${CT_ELF2FLT_CUSTOM}" = "y" ]; then - CT_GetCustom "elf2flt" "${CT_ELF2FLT_CUSTOM_VERSION}" \ - "${CT_ELF2FLT_CUSTOM_LOCATION}" - else - CT_GetGit elf2flt "${CT_ELF2FLT_GIT_CSET}" https://github.com/uclinux-dev/elf2flt.git - fi + CT_Fetch ELF2FLT fi } # Extract binutils do_binutils_extract() { - CT_Extract "binutils-${CT_BINUTILS_VERSION}" - CT_Patch "binutils" "${CT_BINUTILS_VERSION}" - + # TBD handle xtensa overlays in CT_ExtractPatch + CT_ExtractPatch BINUTILS if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then - CT_Extract "elf2flt-${CT_ELF2FLT_GIT_CSET}" - CT_Patch "elf2flt" "${CT_ELF2FLT_GIT_CSET}" - fi - - if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then - CT_ConfigureXtensa "binutils" "${CT_BINUTILS_VERSION}" + CT_ExtractPatch ELF2FLT fi } @@ -67,7 +41,7 @@ do_binutils_for_build() { if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then # We re-use binutils' options, plus our owns - binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" ) + binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils" ) binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_BUILD}" ) CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}" @@ -100,7 +74,7 @@ do_binutils_for_host() { if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then # We re-use binutils' options, plus our owns - binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" ) + binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils" ) binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" ) CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-host-${CT_HOST}" @@ -207,7 +181,7 @@ do_binutils_backend() { CXXFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure" \ + "${CT_SRC_DIR}/binutils/configure" \ --build=${CT_BUILD} \ --host=${host} \ --target=${CT_TARGET} \ @@ -351,7 +325,7 @@ do_binutils_for_target() { CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure" \ + "${CT_SRC_DIR}/binutils/configure" \ --build=${CT_BUILD} \ --host=${CT_TARGET} \ --target=${CT_TARGET} \ diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/gcc.sh index 2ca8e6f..449aafb 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -7,30 +7,14 @@ do_gcc_get() { local linaro_version="" local linaro_series="" - if [ "${CT_CC_GCC_CUSTOM}" = "y" ]; then - CT_GetCustom "gcc" "${CT_CC_GCC_CUSTOM_VERSION}" \ - "${CT_CC_GCC_CUSTOM_LOCATION}" - else - case "${CT_CC_GCC_VERSION}" in - linaro-*) - CT_GetLinaro "gcc" "${CT_CC_GCC_VERSION}" - ;; - *) - # The official gcc hosts put gcc under a gcc/release/ directory, - # whereas the mirrors put it in the gcc/ directory. - CT_GetFile "gcc-${CT_CC_GCC_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/gcc/gcc-${CT_CC_GCC_VERSION} \ - ftp://{gcc.gnu.org,sourceware.org}/pub/gcc/releases/gcc-${CT_CC_GCC_VERSION} - ;; - esac - fi # ! custom location + CT_Fetch GCC + # Starting with GCC 4.3, ecj is used for Java, and will only be # built if the configure script finds ecj.jar at the top of the # GCC source tree, which will not be there unless we get it and # put it there ourselves if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" ]; then CT_GetFile ecj-latest .jar http://mirrors.kernel.org/sourceware/java/ \ - http://crosstool-ng.org/pub/java \ ftp://gcc.gnu.org/pub/java \ ftp://sourceware.org/pub/java fi @@ -38,18 +22,12 @@ do_gcc_get() { # Extract gcc do_gcc_extract() { - CT_Extract "gcc-${CT_CC_GCC_VERSION}" - CT_Patch "gcc" "${CT_CC_GCC_VERSION}" + # TBD handle xtensa overlays + CT_ExtractPatch GCC # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree - if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \ - -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/ecj.jar" \ - ]; then - CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/ecj.jar" - fi - - if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then - CT_ConfigureXtensa "gcc" "${CT_CC_GCC_VERSION}" + if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" -a ! -f "${CT_SRC_DIR}/gcc/ecj.jar" ]; then + CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc/ecj.jar" fi } @@ -575,7 +553,7 @@ do_gcc_core_backend() { CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/configure" \ + "${CT_SRC_DIR}/gcc/configure" \ --build=${CT_BUILD} \ --host=${host} \ --target=${CT_TARGET} \ @@ -603,7 +581,7 @@ do_gcc_core_backend() { # so we configure then build it. # Next we have to configure gcc, create libgcc.mk then edit it... # So much easier if we just edit the source tree, but hey... - if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then + if [ ! -f "${CT_SRC_DIR}/gcc/gcc/BASE-VER" ]; then CT_DoExecLog CFG make ${JOBSFLAGS} configure-libiberty CT_DoExecLog ALL make ${JOBSFLAGS} -C libiberty libiberty.a CT_DoExecLog CFG make ${JOBSFLAGS} configure-gcc configure-libcpp @@ -613,12 +591,12 @@ do_gcc_core_backend() { CT_DoExecLog ALL make ${JOBSFLAGS} all-libcpp all-build-libiberty fi # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here. - if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libdecnumber" ]; then + if [ -d "${CT_SRC_DIR}/gcc/libdecnumber" ]; then CT_DoExecLog CFG make ${JOBSFLAGS} configure-libdecnumber CT_DoExecLog ALL make ${JOBSFLAGS} -C libdecnumber libdecnumber.a fi # HACK: gcc-4.8 uses libbacktrace to make libgcc.mvars, so make it here. - if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libbacktrace" ]; then + if [ -d "${CT_SRC_DIR}/gcc/libbacktrace" ]; then CT_DoExecLog CFG make ${JOBSFLAGS} configure-libbacktrace CT_DoExecLog ALL make ${JOBSFLAGS} -C libbacktrace fi @@ -1121,7 +1099,7 @@ do_gcc_backend() { CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/configure" \ + "${CT_SRC_DIR}/gcc/configure" \ --build=${CT_BUILD} \ --host=${host} \ --target=${CT_TARGET} \ diff --git a/scripts/build/companion_libs/050-zlib.sh b/scripts/build/companion_libs/050-zlib.sh index a3ba638..868bf3d 100644 --- a/scripts/build/companion_libs/050-zlib.sh +++ b/scripts/build/companion_libs/050-zlib.sh @@ -13,14 +13,12 @@ if [ "${CT_ZLIB}" = "y" ]; then # Download zlib do_zlib_get() { - CT_GetFile "zlib-${CT_ZLIB_VERSION}" \ - "http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION}" + CT_Fetch ZLIB } # Extract zlib do_zlib_extract() { - CT_Extract "zlib-${CT_ZLIB_VERSION}" - CT_Patch "zlib" "${CT_ZLIB_VERSION}" + CT_ExtractPatch ZLIB } # Build zlib for running on build @@ -87,7 +85,7 @@ do_zlib_backend() { # zlib treats mingw host differently and requires using a different # makefile rather than configure+make. It also does not support # out-of-tree building. - cp -av "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/." . + cp -av "${CT_SRC_DIR}/zlib/." . extra_make=( -f win32/Makefile.gcc \ PREFIX="${host}-" \ SHAREDLIB= \ @@ -107,7 +105,7 @@ do_zlib_backend() { LDFLAGS="${ldflags}" \ CHOST="${host}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/configure" \ + "${CT_SRC_DIR}/zlib/configure" \ --prefix="${prefix}" \ --static \ "${extra_config[@]}" diff --git a/scripts/build/companion_libs/100-gmp.sh b/scripts/build/companion_libs/100-gmp.sh index 0fc5875..272af66 100644 --- a/scripts/build/companion_libs/100-gmp.sh +++ b/scripts/build/companion_libs/100-gmp.sh @@ -13,15 +13,12 @@ if [ "${CT_GMP}" = "y" ]; then # Download GMP do_gmp_get() { - CT_GetFile "gmp-${CT_GMP_VERSION}" \ - https://gmplib.org/download/gmp \ - {http,ftp,https}://ftp.gnu.org/gnu/gmp + CT_Fetch GMP } # Extract GMP do_gmp_extract() { - CT_Extract "gmp-${CT_GMP_VERSION}" - CT_Patch "gmp" "${CT_GMP_VERSION}" + CT_ExtractPatch GMP } # Build GMP for running on build @@ -97,7 +94,7 @@ do_gmp_backend() { CFLAGS="${cflags} -fexceptions" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \ + "${CT_SRC_DIR}/gmp/configure" \ --build=${CT_BUILD} \ --host=${host} \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/110-mpfr.sh b/scripts/build/companion_libs/110-mpfr.sh index 5a89077..b4be3f4 100644 --- a/scripts/build/companion_libs/110-mpfr.sh +++ b/scripts/build/companion_libs/110-mpfr.sh @@ -13,16 +13,14 @@ if [ "${CT_MPFR}" = "y" ]; then # Download MPFR do_mpfr_get() { - CT_GetFile "mpfr-${CT_MPFR_VERSION}" \ - {https,http,ftp}://ftp.gnu.org/gnu/mpfr \ - http://www.mpfr.org/mpfr-${CT_MPFR_VERSION} + CT_Fetch MPFR } # Extract MPFR do_mpfr_extract() { - CT_Extract "mpfr-${CT_MPFR_VERSION}" - CT_Patch "mpfr" "${CT_MPFR_VERSION}" + CT_ExtractPatch MPFR + # TBD is it a problem with 2.4.x? The comment says it is not, yet the code is run # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the # same version number. Unfortunately, some tarballs of MPFR are not # built sanely, and thus ./configure fails on Gentoo. @@ -115,7 +113,7 @@ do_mpfr_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure" \ + "${CT_SRC_DIR}/mpfr/configure" \ --build=${CT_BUILD} \ --host=${host} \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/121-isl.sh b/scripts/build/companion_libs/121-isl.sh index 0b8777b..d96e9ce 100644 --- a/scripts/build/companion_libs/121-isl.sh +++ b/scripts/build/companion_libs/121-isl.sh @@ -13,14 +13,12 @@ if [ "${CT_ISL}" = "y" ]; then # Download ISL do_isl_get() { - CT_GetFile "isl-${CT_ISL_VERSION}" \ - http://isl.gforge.inria.fr + CT_Fetch ISL } # Extract ISL do_isl_extract() { - CT_Extract "isl-${CT_ISL_VERSION}" - CT_Patch "isl" "${CT_ISL_VERSION}" + CT_ExtractPatch ISL } # Build ISL for running on build @@ -100,7 +98,7 @@ do_isl_backend() { CXXFLAGS="${cxxflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/isl-${CT_ISL_VERSION}/configure" \ + "${CT_SRC_DIR}/isl/configure" \ --build=${CT_BUILD} \ --host=${host} \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/130-cloog.sh b/scripts/build/companion_libs/130-cloog.sh index 6090b27..445d259 100644 --- a/scripts/build/companion_libs/130-cloog.sh +++ b/scripts/build/companion_libs/130-cloog.sh @@ -13,18 +13,12 @@ if [ "${CT_CLOOG}" = "y" ]; then # Download CLooG do_cloog_get() { - CT_GetFile "cloog-${CT_CLOOG_VERSION}" \ - http://www.bastoul.net/cloog/pages/download \ - ftp://gcc.gnu.org/pub/gcc/infrastructure + CT_Fetch CLOOG } # Extract CLooG do_cloog_extract() { - CT_Extract "cloog-${CT_CLOOG_VERSION}" - CT_Patch "cloog" "${CT_CLOOG_VERSION}" - - # Help the autostuff in case it thinks there are things to regenerate... - CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/cloog-${CT_CLOOG_VERSION}/m4" + CT_ExtractPatch CLOOG } # Build CLooG for running on build @@ -98,7 +92,7 @@ do_cloog_backend() { LDFLAGS="${ldflags}" \ LIBS="-lm" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/cloog-${CT_CLOOG_VERSION}/configure" \ + "${CT_SRC_DIR}/cloog/configure" \ --build=${CT_BUILD} \ --host=${host} \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/140-mpc.sh b/scripts/build/companion_libs/140-mpc.sh index e6efb4f..3136ab4 100644 --- a/scripts/build/companion_libs/140-mpc.sh +++ b/scripts/build/companion_libs/140-mpc.sh @@ -13,15 +13,12 @@ if [ "${CT_MPC}" = "y" ]; then # Download MPC do_mpc_get() { - CT_GetFile "mpc-${CT_MPC_VERSION}" .tar.gz \ - {http,ftp,https}://ftp.gnu.org/gnu/mpc \ - http://www.multiprecision.org/mpc/download + CT_Fetch MPC } # Extract MPC do_mpc_extract() { - CT_Extract "mpc-${CT_MPC_VERSION}" - CT_Patch "mpc" "${CT_MPC_VERSION}" + CT_ExtractPatch MPC } # Build MPC for running on build @@ -87,7 +84,7 @@ do_mpc_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \ + "${CT_SRC_DIR}/mpc/configure" \ --build=${CT_BUILD} \ --host=${host} \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/200-libelf.sh b/scripts/build/companion_libs/200-libelf.sh index 807ce7e..d1ac0b4 100644 --- a/scripts/build/companion_libs/200-libelf.sh +++ b/scripts/build/companion_libs/200-libelf.sh @@ -9,15 +9,11 @@ do_libelf_for_target() { :; } if [ "${CT_LIBELF}" = "y" -o "${CT_LIBELF_TARGET}" = "y" ]; then do_libelf_get() { - # The server hosting libelf will return an "HTTP 300 : Multiple Choices" - # error code if we try to download a file that does not exists there. - # So we have to request the file with an explicit extension. - CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/ + CT_Fetch LIBELF } do_libelf_extract() { - CT_Extract "libelf-${CT_LIBELF_VERSION}" - CT_Patch "libelf" "${CT_LIBELF_VERSION}" + CT_ExtractPatch LIBELF } if [ "${CT_LIBELF}" = "y" ]; then @@ -131,7 +127,7 @@ do_libelf_backend() { CFLAGS="${cflags} -fPIC" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \ + "${CT_SRC_DIR}/libelf/configure" \ --build=${CT_BUILD} \ --host=${host} \ --target=${CT_TARGET} \ diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh index 5aa8e31..dcb7208 100644 --- a/scripts/build/companion_libs/210-expat.sh +++ b/scripts/build/companion_libs/210-expat.sh @@ -9,13 +9,11 @@ do_expat_for_target() { :; } if [ "${CT_EXPAT_TARGET}" = "y" -o "${CT_EXPAT}" = "y" ]; then do_expat_get() { - CT_GetFile "expat-${CT_EXPAT_VERSION}" .tar.gz \ - http://downloads.sourceforge.net/project/expat/expat/${CT_EXPAT_VERSION} + CT_Fetch EXPAT } do_expat_extract() { - CT_Extract "expat-${CT_EXPAT_VERSION}" - CT_Patch "expat" "${CT_EXPAT_VERSION}" + CT_ExtractPatch EXPAT } if [ "${CT_EXPAT}" = "y" ]; then @@ -95,7 +93,7 @@ do_expat_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/expat-${CT_EXPAT_VERSION}/configure" \ + "${CT_SRC_DIR}/expat/configure" \ --build=${CT_BUILD} \ --host=${host} \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/220-ncurses.sh b/scripts/build/companion_libs/220-ncurses.sh index 7a1379d..815cf4b 100644 --- a/scripts/build/companion_libs/220-ncurses.sh +++ b/scripts/build/companion_libs/220-ncurses.sh @@ -9,15 +9,11 @@ do_ncurses_for_target() { :; } if [ "${CT_NCURSES_TARGET}" = "y" -o "${CT_NCURSES}" = "y" ]; then do_ncurses_get() { - CT_GetFile "ncurses-${CT_NCURSES_VERSION}" .tar.gz \ - {http,ftp,https}://ftp.gnu.org/pub/gnu/ncurses \ - ftp://invisible-island.net/ncurses + CT_Fetch NCURSES } do_ncurses_extract() { - CT_Extract "ncurses-${CT_NCURSES_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}" - CT_Patch "ncurses" "${CT_NCURSES_VERSION}" + CT_ExtractPatch NCURSES } # We need tic that runs on the build when building ncurses for host/target @@ -157,7 +153,7 @@ do_ncurses_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}/configure" \ + "${CT_SRC_DIR}/ncurses/configure" \ --build=${CT_BUILD} \ --host=${host} \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/320-libiconv.sh b/scripts/build/companion_libs/320-libiconv.sh index f2f0bef..ad571a9 100644 --- a/scripts/build/companion_libs/320-libiconv.sh +++ b/scripts/build/companion_libs/320-libiconv.sh @@ -9,13 +9,11 @@ do_libiconv_for_target() { :; } if [ "${CT_LIBICONV}" = "y" ]; then do_libiconv_get() { - CT_GetFile "libiconv-${CT_LIBICONV_VERSION}" \ - http://ftp.gnu.org/pub/gnu/libiconv/ + CT_Fetch LIBICONV } do_libiconv_extract() { - CT_Extract "libiconv-${CT_LIBICONV_VERSION}" - CT_Patch "libiconv" "${CT_LIBICONV_VERSION}" + CT_ExtractPatch LIBICONV } # Build libiconv for running on build @@ -93,7 +91,7 @@ do_libiconv_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/libiconv-${CT_LIBICONV_VERSION}/configure" \ + "${CT_SRC_DIR}/libiconv/configure" \ --build=${CT_BUILD} \ --host="${host}" \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_libs/330-gettext.sh b/scripts/build/companion_libs/330-gettext.sh index 8828e5d..f3f1497 100644 --- a/scripts/build/companion_libs/330-gettext.sh +++ b/scripts/build/companion_libs/330-gettext.sh @@ -9,13 +9,11 @@ do_gettext_for_target() { :; } if [ "${CT_GETTEXT}" = "y" ]; then do_gettext_get() { - CT_GetFile "gettext-${CT_GETTEXT_VERSION}" \ - http://ftp.gnu.org/pub/gnu/gettext/ + CT_Fetch GETTEXT } do_gettext_extract() { - CT_Extract "gettext-${CT_GETTEXT_VERSION}" - CT_Patch "gettext" "${CT_GETTEXT_VERSION}" + CT_ExtractPatch GETTEXT } # Build gettext for running on build @@ -112,7 +110,7 @@ do_gettext_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/gettext-${CT_GETTEXT_VERSION}/configure" \ + "${CT_SRC_DIR}/gettext/configure" \ --build=${CT_BUILD} \ --host="${host}" \ --prefix="${prefix}" \ diff --git a/scripts/build/companion_tools/050-make.sh b/scripts/build/companion_tools/050-make.sh index 76b24aa..3253f5b 100644 --- a/scripts/build/companion_tools/050-make.sh +++ b/scripts/build/companion_tools/050-make.sh @@ -1,14 +1,11 @@ # Build script for make do_companion_tools_make_get() { - CT_GetFile "make-${CT_MAKE_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/make + CT_Fetch MAKE } do_companion_tools_make_extract() { - CT_Extract "make-${CT_MAKE_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/make-${CT_MAKE_VERSION}" - CT_Patch "make" "${CT_MAKE_VERSION}" + CT_ExtractPatch MAKE } do_companion_tools_make_for_build() { @@ -61,7 +58,7 @@ do_make_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/make-${CT_MAKE_VERSION}/configure" \ + "${CT_SRC_DIR}/make/configure" \ --host="${host}" \ --prefix="${prefix}" \ "${extra_config[@]}" diff --git a/scripts/build/companion_tools/100-m4.sh b/scripts/build/companion_tools/100-m4.sh index e0fccd7..1707d64 100644 --- a/scripts/build/companion_tools/100-m4.sh +++ b/scripts/build/companion_tools/100-m4.sh @@ -1,13 +1,11 @@ # Build script for m4 do_companion_tools_m4_get() { - CT_GetFile "m4-${CT_M4_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/m4 + CT_Fetch M4 } do_companion_tools_m4_extract() { - CT_Extract "m4-${CT_M4_VERSION}" - CT_Patch "m4" "${CT_M4_VERSION}" + CT_ExtractPatch M4 } do_companion_tools_m4_for_build() { @@ -58,7 +56,7 @@ do_m4_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/m4-${CT_M4_VERSION}/configure" \ + "${CT_SRC_DIR}/m4/configure" \ --host="${host}" \ --prefix="${prefix}" diff --git a/scripts/build/companion_tools/200-autoconf.sh b/scripts/build/companion_tools/200-autoconf.sh index bccef75..52149ea 100644 --- a/scripts/build/companion_tools/200-autoconf.sh +++ b/scripts/build/companion_tools/200-autoconf.sh @@ -1,14 +1,11 @@ # Build script for autoconf do_companion_tools_autoconf_get() { - CT_GetFile "autoconf-${CT_AUTOCONF_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/autoconf + CT_Fetch AUTOCONF } do_companion_tools_autoconf_extract() { - CT_Extract "autoconf-${CT_AUTOCONF_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/autoconf-${CT_AUTOCONF_VERSION}" - CT_Patch "autoconf" "${CT_AUTOCONF_VERSION}" + CT_ExtractPatch AUTOCONF } do_companion_tools_autoconf_for_build() { @@ -42,7 +39,7 @@ do_autoconf_backend() { CT_DoLog EXTRA "Configuring autoconf" CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/autoconf-${CT_AUTOCONF_VERSION}/configure" \ + "${CT_SRC_DIR}/autoconf/configure" \ --host="${host}" \ --prefix="${prefix}" diff --git a/scripts/build/companion_tools/300-automake.sh b/scripts/build/companion_tools/300-automake.sh index ee76463..2d7eded 100644 --- a/scripts/build/companion_tools/300-automake.sh +++ b/scripts/build/companion_tools/300-automake.sh @@ -1,14 +1,11 @@ # Build script for automake do_companion_tools_automake_get() { - CT_GetFile "automake-${CT_AUTOMAKE_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/automake + CT_Fetch AUTOMAKE } do_companion_tools_automake_extract() { - CT_Extract "automake-${CT_AUTOMAKE_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/automake-${CT_AUTOMAKE_VERSION}" - CT_Patch "automake" "${CT_AUTOMAKE_VERSION}" + CT_ExtractPatch AUTOMAKE } do_companion_tools_automake_for_build() { @@ -38,7 +35,7 @@ do_automake_backend() { CT_DoLog EXTRA "Configuring automake" CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/automake-${CT_AUTOMAKE_VERSION}/configure" \ + "${CT_SRC_DIR}/automake/configure" \ --host="${host}" \ --prefix="${prefix}" diff --git a/scripts/build/companion_tools/400-libtool.sh b/scripts/build/companion_tools/400-libtool.sh index 4461207..3733072 100644 --- a/scripts/build/companion_tools/400-libtool.sh +++ b/scripts/build/companion_tools/400-libtool.sh @@ -1,14 +1,11 @@ # Build script for libtool do_companion_tools_libtool_get() { - CT_GetFile "libtool-${CT_LIBTOOL_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/libtool + CT_Fetch LIBTOOL } do_companion_tools_libtool_extract() { - CT_Extract "libtool-${CT_LIBTOOL_VERSION}" - CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/libtool-${CT_LIBTOOL_VERSION}" - CT_Patch "libtool" "${CT_LIBTOOL_VERSION}" + CT_ExtractPatch LIBTOOL } do_companion_tools_libtool_for_build() { @@ -38,7 +35,7 @@ do_libtool_backend() { CT_DoLog EXTRA "Configuring libtool" CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/libtool-${CT_LIBTOOL_VERSION}/configure" \ + "${CT_SRC_DIR}/libtool/configure" \ --host="${host}" \ --prefix="${prefix}" diff --git a/scripts/build/debug/200-duma.sh b/scripts/build/debug/200-duma.sh index 2a9b01f..afaeb02 100644 --- a/scripts/build/debug/200-duma.sh +++ b/scripts/build/debug/200-duma.sh @@ -1,24 +1,12 @@ # Build script for D.U.M.A. do_debug_duma_get() { - local dl_base - - dl_base="http://downloads.sourceforge.net/project/duma/duma" - dl_base+="/${CT_DUMA_VERSION//_/.}" - - # Downloading an non-existing file from sourceforge will give you an - # HTML file containing an error message, instead of returning a 404. - # Sigh... - CT_GetFile "duma_${CT_DUMA_VERSION}" .tar.gz "${dl_base}" - # Downloading from sourceforge may leave garbage, cleanup - CT_DoExecLog ALL rm -f "${CT_TARBALLS_DIR}/showfiles.php"* + # TBD need cleanup after sourceforge.net download? + CT_Fetch DUMA } do_debug_duma_extract() { - CT_Extract "duma_${CT_DUMA_VERSION}" - CT_Pushd "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" - CT_Patch nochdir "duma" "${CT_DUMA_VERSION}" - CT_Popd + CT_ExtractPatch DUMA } do_debug_duma_build() { @@ -26,7 +14,7 @@ do_debug_duma_build() { CT_DoStep INFO "Installing D.U.M.A." CT_DoLog EXTRA "Copying sources" - cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}/." "${CT_BUILD_DIR}/build-duma" + cp -a "${CT_SRC_DIR}/duma/." "${CT_BUILD_DIR}/build-duma" CT_Pushd "${CT_BUILD_DIR}/build-duma" make_args=( diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index e5276d0..cdc7047 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -1,40 +1,18 @@ # Build script for the gdb debug facility do_debug_gdb_get() { - local linaro_version="" - local linaro_series="" - - if [ "${CT_GDB_CUSTOM}" = "y" ]; then - CT_GetCustom "gdb" "${CT_GDB_CUSTOM_VERSION}" \ - "${CT_GDB_CUSTOM_LOCATION}" - else - case "${CT_GDB_VERSION}" in - linaro-*) - CT_GetLinaro "gdb" "${CT_GDB_VERSION}" - ;; - *) - CT_GetFile "gdb-${CT_GDB_VERSION}" \ - http://mirrors.kernel.org/sourceware/gdb \ - {http,ftp,https}://ftp.gnu.org/pub/gnu/gdb \ - ftp://{sourceware.org,gcc.gnu.org}/pub/gdb/releases - ;; - esac - fi + CT_Fetch GDB } do_debug_gdb_extract() { - CT_Extract "gdb-${CT_GDB_VERSION}" - CT_Patch "gdb" "${CT_GDB_VERSION}" - - if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then - CT_ConfigureXtensa "gdb" "${CT_GDB_VERSION}" - fi + # TBD xtensa overlays + CT_ExtractPatch GDB } do_debug_gdb_build() { local -a extra_config - gdb_src_dir="${CT_SRC_DIR}/gdb-${CT_GDB_VERSION}" + gdb_src_dir="${CT_SRC_DIR}/gdb" # Version 6.3 and below behave badly with gdbmi case "${CT_GDB_VERSION}" in @@ -174,11 +152,12 @@ do_debug_gdb_build() { if [ "${CT_GDB_INSTALL_GDBINIT}" = "y" ]; then CT_DoLog EXTRA "Installing '.gdbinit' template" # See in scripts/build/internals.sh for why we do this - if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then - gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ) + # TBD GCC 3.x and older not supported + if [ -f "${CT_SRC_DIR}/gcc/gcc/BASE-VER" ]; then + gcc_version=$( cat "${CT_SRC_DIR}/gcc/gcc/BASE-VER" ) else gcc_version=$(sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \ - "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/version.c" \ + "${CT_SRC_DIR}/gcc/gcc/version.c" \ ) fi sed -r \ diff --git a/scripts/build/debug/400-ltrace.sh b/scripts/build/debug/400-ltrace.sh index 6b860e9..ce299c2 100644 --- a/scripts/build/debug/400-ltrace.sh +++ b/scripts/build/debug/400-ltrace.sh @@ -1,19 +1,11 @@ # Build script for ltrace do_debug_ltrace_get() { - CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" .tar.gz \ - {http,ftp}://ftp.debian.org/debian/pool/main/l/ltrace/ - # Create a link so that the following steps are easier to do: - CT_Pushd "${CT_TARBALLS_DIR}" - ltrace_ext=$(CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig") - ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" \ - "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}" - CT_Popd + CT_Fetch LTRACE } do_debug_ltrace_extract() { - CT_Extract "ltrace-${CT_LTRACE_VERSION}" - CT_Patch "ltrace" "${CT_LTRACE_VERSION}" + CT_ExtractPatch LTRACE } do_debug_ltrace_build() { @@ -22,7 +14,7 @@ do_debug_ltrace_build() { CT_DoStep INFO "Installing ltrace" CT_DoLog EXTRA "Copying sources to build dir" - CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/." \ + CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ltrace/." \ "${CT_BUILD_DIR}/build-ltrace" CT_Pushd "${CT_BUILD_DIR}/build-ltrace" @@ -63,4 +55,3 @@ do_debug_ltrace_build() { CT_Popd CT_EndStep } - diff --git a/scripts/build/debug/500-strace.sh b/scripts/build/debug/500-strace.sh index 6eb2357..cb4643a 100644 --- a/scripts/build/debug/500-strace.sh +++ b/scripts/build/debug/500-strace.sh @@ -1,15 +1,11 @@ # Build script for strace do_debug_strace_get() { - local base_url="http://downloads.sourceforge.net/project/strace/strace" - CT_GetFile "strace-${CT_STRACE_VERSION}" "${base_url}/${CT_STRACE_VERSION}" - # Downloading from sourceforge leaves garbage, cleanup - CT_DoExecLog ALL rm -f "${CT_TARBALLS_DIR}/showfiles.php"* + CT_Fetch STRACE } do_debug_strace_extract() { - CT_Extract "strace-${CT_STRACE_VERSION}" - CT_Patch "strace" "${CT_STRACE_VERSION}" + CT_ExtractPatch STRACE } do_debug_strace_build() { @@ -23,7 +19,7 @@ do_debug_strace_build() { CPP="${CT_TARGET}-cpp" \ LD="${CT_TARGET}-ld" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/strace-${CT_STRACE_VERSION}/configure" \ + "${CT_SRC_DIR}/strace/configure" \ --build=${CT_BUILD} \ --host=${CT_TARGET} \ --prefix=/usr diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index db9b1fd..07029d0 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -70,17 +70,18 @@ do_finish() { "${CT_TARGET}/debug-root/usr/bin/gdbserver${exe_suffix}" fi if [ "${CT_CC_gcc}" = "y" ]; then - # We can not use the version in CT_CC_GCC_VERSION because + # TBD GCC 3.x/2.x is no longer supported by ctng + # We can not use the version in CT_GCC_VERSION because # of the Linaro stuff. So, harvest the version string # directly from the gcc sources... # All gcc 4.x seem to have the version in gcc/BASE-VER # while version prior to 4.x have the version in gcc/version.c # Of course, here is not the better place to do that... - if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then - gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ) + if [ -f "${CT_SRC_DIR}/gcc/gcc/BASE-VER" ]; then + gcc_version=$( cat "${CT_SRC_DIR}/gcc/gcc/BASE-VER" ) else gcc_version=$(sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \ - "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/version.c" \ + "${CT_SRC_DIR}/gcc/gcc/version.c" \ ) fi for _t in "bin/${CT_TARGET}-"* \ diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh index cd4a456..0f04d64 100644 --- a/scripts/build/kernel/linux.sh +++ b/scripts/build/kernel/linux.sh @@ -19,58 +19,12 @@ CT_DoKernelTupleValues() { # Download the kernel do_kernel_get() { - local k_ver - local custom_name - local rel_dir - local korg_base mirror_base - - if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then - CT_GetCustom "linux" "${CT_KERNEL_LINUX_CUSTOM_VERSION}" \ - "${CT_KERNEL_LINUX_CUSTOM_LOCATION}" - else # Not a custom tarball - case "${CT_KERNEL_VERSION}" in - 2.6.*.*|3.*.*|4.*.*) - # 4-part versions (for 2.6 stables and long-terms), and - # 3-part versions (for 3.x.y and 4.x.y stables and long-terms) - # we need to trash the last digit - k_ver="${CT_KERNEL_VERSION%.*}" - ;; - 2.6.*|3.*|4.*) - # 3-part version (for 2.6.x initial releases), and 2-part - # versions (for 3.x and 4.x initial releases), use all of it - k_ver="${CT_KERNEL_VERSION}" - ;; - esac - case "${CT_KERNEL_VERSION}" in - 2.6.*) rel_dir=v2.6;; - 3.*) rel_dir=v3.x;; - 4.*) rel_dir=v4.x;; - esac - korg_base="http://www.kernel.org/pub/linux/kernel/${rel_dir}" - CT_GetFile "linux-${CT_KERNEL_VERSION}" \ - "${korg_base}" \ - "${korg_base}/longterm/v${k_ver}" \ - "${korg_base}/longterm" - fi + CT_Fetch LINUX } # Extract kernel do_kernel_extract() { - # If using a custom directory location, nothing to do - if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" \ - -a -d "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" ]; then - return 0 - fi - - # Otherwise, we're using either a mainstream tarball, or a custom - # tarball; in either case, we need to extract - CT_Extract "linux-${CT_KERNEL_VERSION}" - - # If using a custom tarball, no need to patch - if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then - return 0 - fi - CT_Patch "linux" "${CT_KERNEL_VERSION}" + CT_ExtractPatch LINUX # Disable building relocs application - it needs <linux/types.h> # on the host, which may not be present on Cygwin or MacOS; it @@ -79,7 +33,8 @@ do_kernel_extract() { # This is not done as a patch, since it varies from Linux version # to version - patching each particular Linux version would be # too cumbersome. - CT_Pushd "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" + # TBD should happen before marking the sources as "patched"? + CT_Pushd "${CT_SRC_DIR}/linux" sed -i -r 's/(\$\(MAKE\) .* relocs)$/:/' arch/*/Makefile CT_Popd } @@ -93,7 +48,7 @@ do_kernel_headers() { mkdir -p "${CT_BUILD_DIR}/build-kernel-headers" - kernel_path="${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" + kernel_path="${CT_SRC_DIR}/linux" V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}" kernel_arch="${CT_ARCH}" diff --git a/scripts/build/libc/avr-libc.sh b/scripts/build/libc/avr-libc.sh index f94b601..7003f38 100644 --- a/scripts/build/libc/avr-libc.sh +++ b/scripts/build/libc/avr-libc.sh @@ -1,33 +1,11 @@ # This file adds functions to build the avr-libc C library do_libc_get() { - local libc_src - - libc_src="http://download.savannah.gnu.org/releases/avr-libc" - - if [ "${CT_LIBC_AVR_LIBC_CUSTOM}" = "y" ]; then - CT_GetCustom "avr-libc" "${CT_LIBC_AVR_LIBC_CUSTOM_VERSION}" \ - "${CT_LIBC_AVR_LIBC_CUSTOM_LOCATION}" - else # ! custom location - CT_GetFile "avr-libc-${CT_LIBC_VERSION}" "${libc_src}" - fi # ! custom location + CT_Fetch AVR_LIBC } do_libc_extract() { - CT_Extract "avr-libc-${CT_LIBC_VERSION}" - CT_Patch "avr-libc" "${CT_LIBC_VERSION}" -} - -do_libc_configure() { - CT_DoLog EXTRA "Configuring C library" - - CT_DoExecLog CFG \ - ${CONFIG_SHELL} \ - ./configure \ - --build=${CT_BUILD} \ - --host=${CT_TARGET} \ - --prefix=${CT_PREFIX_DIR} \ - "${CT_LIBC_AVR_LIBC_EXTRA_CONFIG_ARRAY[@]}" + CT_ExtractPatch AVR_LIBC } do_libc_start_files() { @@ -42,11 +20,19 @@ do_libc_post_cc() { CT_DoStep INFO "Installing C library" CT_DoLog EXTRA "Copying sources to build directory" - CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/avr-libc-${CT_LIBC_VERSION}/." \ + CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/avr-libc/." \ "${CT_BUILD_DIR}/build-libc-post-cc" cd "${CT_BUILD_DIR}/build-libc-post-cc" - do_libc_configure + CT_DoLog EXTRA "Configuring C library" + + CT_DoExecLog CFG \ + ${CONFIG_SHELL} \ + ./configure \ + --build=${CT_BUILD} \ + --host=${CT_TARGET} \ + --prefix=${CT_PREFIX_DIR} \ + "${CT_LIBC_AVR_LIBC_EXTRA_CONFIG_ARRAY[@]}" CT_DoLog EXTRA "Building C library" CT_DoExecLog ALL make ${JOBSFLAGS} diff --git a/scripts/build/libc/bionic.sh b/scripts/build/libc/bionic.sh index 4ce5d8f..a52078d 100644 --- a/scripts/build/libc/bionic.sh +++ b/scripts/build/libc/bionic.sh @@ -3,25 +3,17 @@ # Licensed under the GPL v2. See COPYING in the root of this package do_libc_get() { - if [ "${CT_LIBC_BIONIC_CUSTOM}" = "y" ]; then - CT_GetCustom "bionic" "${CT_LIBC_BIONIC_CUSTOM_VERSION}" \ - "${CT_LIBC_BIONIC_CUSTOM_LOCATION}" - else # ! custom location - CT_GetFile "android-ndk-${CT_LIBC_VERSION}-linux-x86_64.zip" https://dl.google.com/android/repository - fi # ! custom location + CT_Fetch BIONIC } do_libc_extract() { - CT_Extract "android-ndk-${CT_LIBC_VERSION}-linux-x86_64" - CT_Pushd "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/" - CT_Patch nochdir bionic "${CT_LIBC_VERSION}" - CT_Popd + CT_ExtractPatch BIONIC } # Install Unified headers do_libc_start_files() { CT_DoStep INFO "Installing C library headers" - CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/sysroot/usr" "${CT_SYSROOT_DIR}" + CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/bionic/sysroot/usr" "${CT_SYSROOT_DIR}" } do_libc() { @@ -33,7 +25,7 @@ do_libc() { arch="${arch}64" fi CT_DoStep INFO "Installing C library binaries" - CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/platforms/android-${CT_ANDROID_API}/arch-${arch}/usr" "${CT_SYSROOT_DIR}" + CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/bionic/platforms/android-${CT_ANDROID_API}/arch-${arch}/usr" "${CT_SYSROOT_DIR}" CT_EnvModify CT_TARGET_CFLAGS "${CT_TARGET_CFLAGS} -D__ANDROID_API__=${CT_ANDROID_API}" } diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index e8f0445..5862759 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -7,102 +7,22 @@ do_libc_get() { local version local -a addons_list - addons_list=($(do_libc_add_ons_list " ")) - - # Main source - if [ "${CT_GLIBC_CUSTOM}" = "y" ]; then - CT_GetCustom "glibc" "${CT_GLIBC_CUSTOM_VERSION}" \ - "${CT_GLIBC_CUSTOM_LOCATION}" - else - case "${CT_LIBC_VERSION}" in - linaro-*) - CT_GetLinaro "glibc" "${CT_LIBC_VERSION}" - ;; - *) - CT_GetFile "glibc-${CT_LIBC_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/glibc \ - ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots} - ;; - esac + CT_Fetch GLIBC + if [ "${CT_GLIBC_USE_PORTS_EXTERNAL}" = "y" ]; then + CT_Fetch GLIBC_PORTS fi - - # C library addons - for addon in "${addons_list[@]}"; do - # Never ever try to download these add-ons, - # they've always been internal - case "${addon}" in - nptl) continue;; - esac - - case "${addon}:${CT_GLIBC_PORTS_EXTERNAL}" in - ports:y) ;; - ports:*) continue;; - esac - - if ! CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \ - http://mirrors.kernel.org/sourceware/glibc \ - {http,ftp,https}://ftp.gnu.org/gnu/glibc \ - ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots} - then - # Some add-ons are bundled with glibc, others are - # bundled in their own tarball. Eg. NPTL is internal, - # while LinuxThreads was external. Also, for old - # versions of glibc, the libidn add-on was external, - # but with version >=2.10, it is internal. - CT_DoLog DEBUG "Addon '${addon}' could not be downloaded." - CT_DoLog DEBUG "We'll see later if we can find it in the source tree" - fi - done - return 0 } do_libc_extract() { local addon - CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}" - CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" - # Custom glibc won't get patched, because CT_GetCustom - # marks custom glibc as patched. - CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}" - - for addon in $(do_libc_add_ons_list " "); do - # If the addon was bundled with the main archive, we do not - # need to extract it. Worse, if we were to try to extract - # it, we'd get an error. - if [ -d "${addon}" ]; then - CT_DoLog DEBUG "Add-on '${addon}' already present, skipping extraction" - continue - fi - - CT_Extract nochdir "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" - - CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \ - -d "${addon}" -a -d "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" - - # Some addons have the 'long' name, while others have the - # 'short' name, but patches are non-uniformly built with - # either the 'long' or 'short' name, whatever the addons name - # but we prefer the 'short' name and avoid duplicates. - if [ -d "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" ]; then - CT_DoExecLog FILE mv "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" "${addon}" - fi - - CT_DoExecLog FILE ln -s "${addon}" "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" - - CT_Patch nochdir "${CT_LIBC}" "${addon}-${CT_LIBC_VERSION}" - - # Remove the long name since it can confuse configure scripts to run - # the same source twice. - rm "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" - done - - # The configure files may be older than the configure.in files - # if using a snapshot (or even some tarballs). Fake them being - # up to date. - find . -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL - - CT_Popd + CT_ExtrachPatch GLIBC + if [ "${CT_GLIBC_USE_PORTS_EXTERNAL}" = "y" ]; then + CT_Fetch GLIBC_PORTS + fi + # TBD make patches for addons (ports? anything else?) uniformly using short names + # TBD make the configure timestamp fix in all patched packages (e.g. part of CT_ExtractPatch) } # Build and install headers and start files @@ -161,7 +81,7 @@ do_libc_backend_once() { local multi_flags multi_dir multi_os_dir multi_root multi_index multi_count multi_target local build_cflags build_cppflags build_ldflags local startfiles_dir - local src_dir="${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" + local src_dir="${CT_SRC_DIR}/glibc" local -a extra_config local -a extra_make_args local glibc_cflags @@ -390,7 +310,7 @@ do_libc_backend_once() { # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html mkdir -p "${CT_HEADERS_DIR}/gnu" CT_DoExecLog ALL touch "${CT_HEADERS_DIR}/gnu/stubs.h" - CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/include/features.h" \ + CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc/include/features.h" \ "${CT_HEADERS_DIR}/features.h" # Building the bootstrap gcc requires either setting inhibit_libc, or @@ -486,18 +406,18 @@ do_libc_backend_once() { # Build up the addons list, separated with $1 do_libc_add_ons_list() { local sep="$1" - local addons_list="$( echo "${CT_GLIBC_ADDONS_LIST}" \ - |sed -r -e "s/[[:space:],]/${sep}/g;" \ - )" - if [ "${GLIBC_HAS_NPTL_ADDON}" = "y" ]; then - case "${CT_THREADS}" in - none) ;; - *) addons_list="${addons_list}${sep}${CT_THREADS}";; - esac + local addons_list + + if [ "${CT_GLIBC_USE_PORTS_ADDON}" = "y" ]; then + addons_list="${addons_list}${sep}ports" + fi + if [ "${CT_GLIBC_USE_NPTL_ADDON}" = "y" ]; then + addons_list="${addons_list}${sep}nptl" + fi + if [ "${CT_GLIBC_USE_LIBIDN_ADDON}" = "y" ]; then + addons_list="${addons_list}${sep}libidn" fi - [ "${CT_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list}${sep}ports" - # Remove duplicate, leading and trailing separators - echo "${addons_list}" |sed -r -e "s/${sep}+/${sep}/g; s/^${sep}//; s/${sep}\$//;" + echo "${addons_list#${sep}}" # Remove leading separator if any } # Compute up the minimum supported Linux kernel version @@ -507,6 +427,7 @@ do_libc_min_kernel_config() { case "${CT_GLIBC_EXTRA_CONFIG_ARRAY[*]}" in *--enable-kernel*) ;; *) if [ "${CT_GLIBC_KERNEL_VERSION_AS_HEADERS}" = "y" ]; then + # TBD do we support that currently? We always seem to install kernel headers # We can't rely on the kernel version from the configuration, # because it might not be available if the user uses pre-installed # headers. On the other hand, both method will have the kernel @@ -536,7 +457,7 @@ do_libc_min_kernel_config() { # Build and install the libc locales do_libc_locales() { - local src_dir="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}" + local src_dir="${CT_SRC_DIR}/glibc" local -a extra_config local glibc_cflags diff --git a/scripts/build/libc/mingw.sh b/scripts/build/libc/mingw.sh index 1471785..295b313 100644 --- a/scripts/build/libc/mingw.sh +++ b/scripts/build/libc/mingw.sh @@ -1,29 +1,17 @@ # Copyright 2012 Yann Diorcet # Licensed under the GPL v2. See COPYING in the root of this package -CT_WINAPI_VERSION_DOWNLOADED= - do_libc_get() { - if [ "${CT_WINAPI_VERSION}" = "devel" ]; then - CT_GetGit "mingw-w64" "ref=HEAD" "git://git.code.sf.net/p/mingw-w64/mingw-w64" CT_WINAPI_VERSION_DOWNLOADED - CT_DoLog DEBUG "Fetched mingw-w64 as ${CT_WINAPI_VERSION_DOWNLOADED}" - else - CT_GetFile "mingw-w64-v${CT_WINAPI_VERSION}" \ - http://downloads.sourceforge.net/sourceforge/mingw-w64 - CT_WINAPI_VERSION_DOWNLOADED=v${CT_WINAPI_VERSION} - fi + CT_Fetch MINGW_W64 } do_libc_extract() { - CT_Extract "mingw-w64-${CT_WINAPI_VERSION_DOWNLOADED}" - CT_Pushd "${CT_SRC_DIR}/mingw-w64-${CT_WINAPI_VERSION_DOWNLOADED}/" - CT_Patch nochdir mingw-w64 "${CT_WINAPI_VERSION_DOWNLOADED}" - CT_Popd + CT_ExtractPatch MINGW_W64 } do_set_mingw_install_prefix(){ MINGW_INSTALL_PREFIX=/usr/${CT_TARGET} - if [[ ${CT_WINAPI_VERSION} == 2* ]]; then + if [[ ${CT_MINGW_W64_VERSION} == 2* ]]; then MINGW_INSTALL_PREFIX=/usr fi } @@ -51,7 +39,7 @@ do_libc_start_files() { do_set_mingw_install_prefix CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/mingw-w64-${CT_WINAPI_VERSION_DOWNLOADED}/mingw-w64-headers/configure" \ + "${CT_SRC_DIR}/mingw-w64/mingw-w64-headers/configure" \ --build=${CT_BUILD} \ --host=${CT_TARGET} \ --prefix=${MINGW_INSTALL_PREFIX} \ @@ -75,9 +63,9 @@ do_libc_start_files() { do_check_mingw_vendor_tuple() { - if [[ ${CT_WINAPI_VERSION} == 4* ]]; then - CT_DoStep INFO "Checking vendor tuple configured in crosstool-ng .config" - if [[ ${CT_TARGET_VENDOR} == w64 ]]; then + if [ "${CT_MINGW_W64_VERSION%%.*}" -ge 4 ]; then + CT_DoStep INFO "Checking configured vendor tuple" + if [ ${CT_TARGET_VENDOR} == w64 ]; then CT_DoLog EXTRA "The tuple is set to '${CT_TARGET_VENDOR}', as recommended by mingw-64 developers." else CT_DoLog WARN "The tuple vendor is '${CT_TARGET_VENDOR}', not equal to 'w64' and might break the toolchain!" @@ -92,7 +80,7 @@ do_mingw_tools() for f in "${CT_MINGW_TOOL_LIST_ARRAY[@]}"; do CT_mkdir_pushd "${f}" - if [ ! -d "${CT_SRC_DIR}/mingw-w64-${CT_WINAPI_VERSION_DOWNLOADED}/mingw-w64-tools/${f}" ]; then + if [ ! -d "${CT_SRC_DIR}/mingw-w64/mingw-w64-tools/${f}" ]; then CT_DoLog WARN "Skipping ${f}: not found" CT_Popd continue @@ -101,7 +89,7 @@ do_mingw_tools() CT_DoLog EXTRA "Configuring ${f}" CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/mingw-w64-${CT_WINAPI_VERSION_DOWNLOADED}/mingw-w64-tools/${f}/configure" \ + "${CT_SRC_DIR}/mingw-w64/mingw-w64-tools/${f}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ --target=${CT_TARGET} \ @@ -159,7 +147,7 @@ do_mingw_pthreads() RCFLAGS="${rcflags}" \ DLLTOOLFLAGS="${dlltoolflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/mingw-w64-${CT_WINAPI_VERSION_DOWNLOADED}/mingw-w64-libraries/winpthreads/configure" \ + "${CT_SRC_DIR}/mingw-w64/mingw-w64-libraries/winpthreads/configure" \ --with-sysroot=${CT_SYSROOT_DIR} \ --prefix=${MINGW_INSTALL_PREFIX} \ --libdir=${libprefix} \ @@ -189,7 +177,7 @@ do_libc() do_set_mingw_install_prefix CT_DoExecLog CFG \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/mingw-w64-${CT_WINAPI_VERSION_DOWNLOADED}/mingw-w64-crt/configure" \ + "${CT_SRC_DIR}/mingw-w64/mingw-w64-crt/configure" \ --with-sysroot=${CT_SYSROOT_DIR} \ --prefix=${MINGW_INSTALL_PREFIX} \ --build=${CT_BUILD} \ diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh index 5a53fd0..430fb8d 100644 --- a/scripts/build/libc/musl.sh +++ b/scripts/build/libc/musl.sh @@ -3,17 +3,11 @@ # Licensed under the GPL v2. See COPYING in the root of this package do_libc_get() { - if [ "${CT_LIBC_MUSL_CUSTOM}" = "y" ]; then - CT_GetCustom "musl" "${CT_LIBC_MUSL_CUSTOM_VERSION}" \ - "${CT_LIBC_MUSL_CUSTOM_LOCATION}" - else # ! custom location - CT_GetFile "musl-${CT_LIBC_VERSION}" http://www.musl-libc.org/releases - fi # ! custom location + CT_Fetch MUSL } do_libc_extract() { - CT_Extract "musl-${CT_LIBC_VERSION}" - CT_Patch "musl" "${CT_LIBC_VERSION}" + CT_ExtractPatch MUSL } # Build and install headers and start files @@ -62,7 +56,7 @@ do_libc_backend_once() { local libc_mode local -a extra_cflags local -a extra_config - local src_dir="${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" + local src_dir="${CT_SRC_DIR}/musl" local multi_dir multi_os_dir multi_root multi_flags multi_index multi_count local multilib_dir local hdr_install_subdir @@ -83,7 +77,7 @@ do_libc_backend_once() { # From buildroot: # gcc constant folding bug with weak aliases workaround # See http://www.openwall.com/lists/musl/2014/05/15/1 - if [ "${CT_CC_GCC_4_9_or_later}" = "y" ]; then + if [ "${CT_GCC_BUG_61144}" = "y" ]; then extra_cflags+=("-fno-toplevel-reorder") fi diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh index 3b48507..ff0f45b 100644 --- a/scripts/build/libc/newlib.sh +++ b/scripts/build/libc/newlib.sh @@ -6,44 +6,21 @@ # do_libc_get() { - local libc_src="{http://mirrors.kernel.org/sourceware/newlib, - ftp://sourceware.org/pub/newlib}" - - if [ "${CT_LIBC_NEWLIB_CUSTOM}" = "y" ]; then - CT_GetCustom "newlib" "${CT_LIBC_NEWLIB_CUSTOM_VERSION}" \ - "${CT_LIBC_NEWLIB_CUSTOM_LOCATION}" - else # ! custom location - case "${CT_LIBC_VERSION}" in - linaro-*) - CT_GetLinaro "newlib" "${CT_LIBC_VERSION}" - ;; - *) - # kernel.org mirror is outdated, keep last as a fallback - CT_GetFile "newlib-${CT_LIBC_VERSION}" \ - ftp://sourceware.org/pub/newlib \ - http://mirrors.kernel.org/sourceware/newlib \ - http://mirrors.kernel.org/sources.redhat.com/newlib - ;; - esac - fi # ! custom location + CT_Fetch NEWLIB } do_libc_extract() { - CT_Extract "newlib-${CT_LIBC_VERSION}" - CT_Patch "newlib" "${CT_LIBC_VERSION}" - - if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then - CT_ConfigureXtensa "newlib" "${CT_LIBC_VERSION}" - fi + # TBD xtensa overlays + CT_ExtractPatch NEWLIB } do_libc_start_files() { CT_DoStep INFO "Installing C library headers & start files" - CT_DoExecLog ALL cp -a "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/newlib/libc/include/." \ + CT_DoExecLog ALL cp -a "${CT_SRC_DIR}/newlib/newlib/libc/include/." \ "${CT_HEADERS_DIR}" if [ "${CT_ARCH_xtensa}" = "y" ]; then CT_DoLog EXTRA "Installing Xtensa headers" - CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/newlib/libc/sys/xtensa/include/." \ + CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/newlib/newlib/libc/sys/xtensa/include/." \ "${CT_HEADERS_DIR}" fi CT_EndStep @@ -131,7 +108,7 @@ ENABLE_TARGET_OPTSPACE:target-optspace AR_FOR_TARGET="`which ${CT_TARGET}-gcc-ar`" \ RANLIB_FOR_TARGET="`which ${CT_TARGET}-gcc-ranlib`" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure" \ + "${CT_SRC_DIR}/newlib/configure" \ --host=${CT_BUILD} \ --target=${CT_TARGET} \ --prefix=${CT_PREFIX_DIR} \ diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index a730a1d..e428349 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -7,48 +7,24 @@ uclibc_locales_version=030818 uclibc_locale_tarball="uClibc-locale-${uclibc_locales_version}" -if [ "${CT_LIBC_UCLIBC_NG}" = "y" ]; then +if [ "${CT_UCLIBC_NG_USE_UCLIBC_NG_ORG}" = "y" ]; then + # TBD make the name come from config/versions/uclibc.in uclibc_name="uClibc-ng" - libc_src="http://downloads.uclibc-ng.org/releases/${CT_LIBC_VERSION}" -else +elif [ "${CT_UCLIBC_NG_USE_UCLIBC_ORG}" = "y" ]; then uclibc_name="uClibc" - libc_src="http://www.uclibc.org/downloads - http://www.uclibc.org/downloads/old-releases" fi # Download uClibc do_libc_get() { - if [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" ]; then - CT_GetCustom "${uclibc_name}" "${CT_LIBC_UCLIBC_CUSTOM_VERSION}" \ - "${CT_LIBC_UCLIBC_CUSTOM_LOCATION}" - else - CT_GetFile "${uclibc_name}-${CT_LIBC_VERSION}" ${libc_src} - fi - # uClibc locales - if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" ]; then - CT_GetFile "${uclibc_locale_tarball}" ${libc_src} - fi - - return 0 + # TBD allow for "default fork" selection in package.desc and select uClibc-NG (and then use just UCLIBC moniker) + CT_Fetch UCLIBC_NG + # TBD locales } # Extract uClibc do_libc_extract() { - CT_Extract "${uclibc_name}-${CT_LIBC_VERSION}" - CT_Patch "${uclibc_name}" "${CT_LIBC_VERSION}" - - # uClibc locales - # Extracting pregen locales ourselves is kinda - # broken, so just link it in place... - if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" \ - -a ! -f "${CT_SRC_DIR}/.${uclibc_locale_tarball}.extracted" ]; then - CT_Pushd "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}/extra/locale" - CT_DoExecLog ALL ln -s "${CT_TARBALLS_DIR}/${uclibc_locale_tarball}.tgz" . - CT_Popd - touch "${CT_SRC_DIR}/.${uclibc_locale_tarball}.extracted" - fi - - return 0 + CT_ExtractPatch UCLIBC_NG + # TBD locales } # Build and install headers and start files @@ -102,7 +78,7 @@ do_libc_backend_once() { # Simply copy files until uClibc has the ability to build out-of-tree CT_DoLog EXTRA "Copying sources to build dir" - CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}/." . + CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/${uclibc_name}/." . multilib_dir="lib/${multi_os_dir}" startfiles_dir="${multi_root}/usr/${multilib_dir}" diff --git a/scripts/build/test_suite/gcc.sh b/scripts/build/test_suite/gcc.sh index c829a43..6c6e5a7 100644 --- a/scripts/build/test_suite/gcc.sh +++ b/scripts/build/test_suite/gcc.sh @@ -18,7 +18,7 @@ do_test_suite_gcc_build() { CT_DoExecLog ALL cp -av "${CT_LIB_DIR}/contrib/gcc-test-suite/default.cfg" \ "${CT_LIB_DIR}/contrib/gcc-test-suite/Makefile" \ "${CT_LIB_DIR}/contrib/gcc-test-suite/README" \ - "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/testsuite" \ + "${CT_SRC_DIR}/gcc/gcc/testsuite" \ "${CT_TEST_SUITE_DIR}/gcc" CT_DoExecLog ALL sed -i -r -e "s/@@DG_TARGET@@/${CT_TARGET}/g;" \ diff --git a/scripts/functions b/scripts/functions index 972403f..50802dd 100644 --- a/scripts/functions +++ b/scripts/functions @@ -869,40 +869,6 @@ CT_GetFile() { return 1 } -# Get a component from Linaro archives. -# Usage: CT_GetLinaro <component> <version> -CT_GetLinaro() { - local comp="$1" - local version="$2" - local linaro_version - local yyyymm_p - local yymm - local base - - case "${version}" in - linaro-*) - linaro_version="${version#linaro-}" - ;; - *) - CT_Abort "Version ${version} is not a Linaro package" - ;; - esac - - # Recent releases reside in top of the directory tree; older releases - # are moved into the archive. Subdirectories are named differently - # in archive! - # In archive, some URLs also contain base component version - # (e.g. "gcc-linaro/4.9") while some do not (e.g. just "newlib-linaro"). - base="${linaro_version%%-*}" - # Strip base version, first two digits of the year and optional patchlevel - yymm="${linaro_version#*-??}" - yymm="${yymm%-*}" - CT_GetFile "${comp}-${version}" \ - "https://releases.linaro.org/components/toolchain/${comp}-linaro/${linaro_version}" \ - "https://releases.linaro.org/archive/${yymm}/components/toolchain/${comp}-linaro/${base}" \ - "https://releases.linaro.org/archive/${yymm}/components/toolchain/${comp}-linaro" -} - # Checkout from CVS, and build the associated tarball # The tarball will be called ${basename}.tar.bz2 # Prerequisite: either the server does not require password, @@ -1914,3 +1880,59 @@ CT_MultilibFixupLDSO() CT_Popd CT_EndStep } + +# List the download mirrors. Usage: +# CT_Mirrors ORGANIZATION PROJECT +CT_Mirrors() +{ + local org="${1}" + local project="${2}" + + case "${org}" in + GNU) + echo "https://ftpmirror.gnu.org/gnu/${project}" + echo "http://ftpmirror.gnu.org/gnu/${project}" + echo "https://ftp.gnu.org/gnu/${project}" + echo "http://ftp.gnu.org/gnu/${project}" + echo "ftp://ftp.gnu.org/gnu/${project}" + ;; + sourceware) + local subdir="${3:+/${3}}" + echo "ftp://sourceware.org/pub/${project}/releases${subdir}" + echo "http://mirrors.kernel.org/sourceware/${project}/releases${subdir}" + echo "http://gcc.gnu.org/pub/${project}/releases${subdir}" + ;; + Linaro) + local version="${3}" + base yymm + base="${version%%-*}" + yymm="${version##*-??}" + echo "https://releases.linaro.org/components/toolchain/${comp}-linaro/${version}" + echo "https://releases.linaro.org/archive/${yymm}/components/toolchain/${comp}-linaro/${base}" + echo "https://releases.linaro.org/archive/${yymm}/components/toolchain/${comp}-linaro" + ;; + linux) + local version="${3}" + case "${version}" in + [34].*) + echo "http://www.kernel.org/pub/linux/kernel/v${version%%.*}.x" + ;; + 2.6.*) + echo "http://www.kernel.org/pub/linux/kernel/v2.6" + case "${version}" in + 2.6.*.*) + echo "http://www.kernel.org/pub/linux/kernel/v2.6/longterm" + echo "http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v${version%.*}" + ;; + esac + ;; + *) + CT_Abort "Unsupported Linux kernel version" + ;; + esac + ;; + *) + CT_Abort "Unknown mirror '${org}'" + ;; + esac +} diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in index d9d999c..2c666db 100644 --- a/scripts/saveSample.sh.in +++ b/scripts/saveSample.sh.in @@ -72,8 +72,8 @@ fi # Save the uClibc .config file if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then # We save the file, and then point the saved sample to this file - CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config" - "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \ + CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${samp_dir}/${CT_LIBC}-${CT_UCLIBC_NG_VERSION}.config" + "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_UCLIBC_NG_VERSION}.config"|;' \ .defconfig else # remove any dangling files diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index 1e5d50b..b11a8d6 100644 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -20,16 +20,30 @@ dump_single_sample() { [ "$1" = "-v" ] && verbose=1 && shift [ "$1" = "-w" ] && wiki=1 && shift local sample="$1" + # TBD use CT_LoadConfig . $(pwd)/.config.sample # libc needs some love + # TBD after conversion of gen-kconfig to template, use CT_LIBC_USE as a selector for other variables + # (i.e. whether to use CT_GLIBC_VERSION or CT_MUSL_VERSION) local libc_name="${CT_LIBC}" - local libc_ver="${CT_LIBC_VERSION}" - if [ "${CT_LIBC}" = "uClibc" -a "${CT_LIBC_UCLIBC_NG}" = "y" ]; then - libc_name="uClibc-ng" - elif [ "${CT_LIBC}" = "mingw" ]; then - libc_ver="${CT_WINAPI_VERSION}" - fi + local libc_ver ksym + + ksym=${libc_name//[^0-9A-Za-z_]/_} + ksym=${ksym^^} + case ${ksym} in + GLIBC|NEWLIB) + if eval "[ \"\${CT_${ksym}_USE_LINARO}\" = y ]"; then + ksym="${ksym}_LINARO" + fi + ;; + UCLIBC) + if [ "${UCLIBC_NG_USE_UCLIBC_NG_ORG}" = y ]; then + ksym="${ksym}_NG" + fi + ;; + esac + eval "libc_ver=\"\${CT_${ksym}_VERSION}\"" case "${sample}" in current) @@ -63,7 +77,8 @@ dump_single_sample() { printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}" ;; esac - printf " %-*s : %s\n" ${width} "OS" "${CT_KERNEL}${CT_KERNEL_VERSION:+-}${CT_KERNEL_VERSION}" + # TBD currently only Linux is used. General handling for single-select (compiler/binutils/libc/os) and multi-select (debug/companions) components? + printf " %-*s : %s\n" ${width} "OS" "${CT_KERNEL}${CT_LINUX_VERSION:+-}${CT_LINUX_VERSION}" if [ -n "${CT_GMP}" \ -o -n "${CT_MPFR}" \ -o -n "${CT_ISL}" \ @@ -139,7 +154,7 @@ dump_single_sample() { if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then printf " //custom// " else - printf " ${CT_KERNEL_VERSION} " + printf " ${CT_LINUX_VERSION} " fi fi printf "| ${CT_BINUTILS_VERSION} " |