summaryrefslogtreecommitdiff
path: root/scripts/build/libc
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-05-30 05:32:38 (GMT)
committerAlexey Neyman <stilor@att.net>2017-07-08 17:57:56 (GMT)
commit567277099a487508fd228a4c56f3583db3fa96c9 (patch)
tree19b7f40c0f6e4e6284e799dbac1098bd8805dc2d /scripts/build/libc
parent57426168ad2c7e8367786ed466c86f6aeb49b3c3 (diff)
Fix the references to old config variables
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/libc')
-rw-r--r--scripts/build/libc/avr-libc.sh38
-rw-r--r--scripts/build/libc/bionic.sh16
-rw-r--r--scripts/build/libc/glibc.sh127
-rw-r--r--scripts/build/libc/mingw.sh34
-rw-r--r--scripts/build/libc/musl.sh14
-rw-r--r--scripts/build/libc/newlib.sh35
-rw-r--r--scripts/build/libc/uClibc.sh42
7 files changed, 70 insertions, 236 deletions
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}"