diff options
Diffstat (limited to 'scripts/build/libc/uClibc.sh')
-rw-r--r-- | scripts/build/libc/uClibc.sh | 83 |
1 files changed, 19 insertions, 64 deletions
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index a730a1d..af07888 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -2,53 +2,14 @@ # Copyright 2007 Yann E. MORIN # Licensed under the GPL v2. See COPYING in the root of this package -# This is a constant because it does not change very often. -# We're in 2010, and are still using data from 7 years ago. -uclibc_locales_version=030818 -uclibc_locale_tarball="uClibc-locale-${uclibc_locales_version}" - -if [ "${CT_LIBC_UCLIBC_NG}" = "y" ]; then - uclibc_name="uClibc-ng" - libc_src="http://downloads.uclibc-ng.org/releases/${CT_LIBC_VERSION}" -else - 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 + CT_Fetch UCLIBC } # 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 } # Build and install headers and start files @@ -93,16 +54,19 @@ do_libc_backend_once() { local -a make_args local extra_cflags f cfg_cflags cf local hdr_install_subdir + local uclibc_name for arg in "$@"; do eval "${arg// /\\ }" done - CT_DoStep INFO "Building for multilib ${multi_index}/${multi_count}: '${multi_flags}'" + if [ "${CT_UCLIBC_USE_UCLIBC_NG_ORG}" = "y" ]; then + uclibc_name="uClibc-ng" + elif [ "${CT_UCLIBC_USE_UCLIBC_ORG}" = "y" ]; then + uclibc_name="uClibc" + fi - # 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_DoStep INFO "Building for multilib ${multi_index}/${multi_count}: '${multi_flags}'" multilib_dir="lib/${multi_os_dir}" startfiles_dir="${multi_root}/usr/${multilib_dir}" @@ -122,11 +86,14 @@ do_libc_backend_once() { HOSTCC="${CT_BUILD}-gcc" \ PREFIX="${multi_root}/" \ MULTILIB_DIR="${multilib_dir}" \ - LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \ STRIPTOOL=true \ ${CT_LIBC_UCLIBC_VERBOSITY} \ ) + # 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/." . + # Force the date of the pregen locale data, as the # newer ones that are referenced are not available CT_DoLog EXTRA "Applying configuration" @@ -323,27 +290,15 @@ manage_uClibc_config() { # entirely if LOCALE is not set. If LOCALE was already set, we'll # assume the user has already made all the appropriate generation # arrangements. Note that having the uClibc Makefile download the - # pregenerated locales is not compatible with crosstool; besides, - # crosstool downloads them as part of getandpatch.sh. - CT_KconfigDeleteOption "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE" "${dst}" - case "${CT_LIBC_UCLIBC_LOCALES}:${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" in - :*) - ;; - y:) + # pregenerated locales is not compatible with crosstool. + if [ -z "${CT_LIBC_UCLIBC_LOCALES}" ]; then + CT_KconfigDisableOption "UCLIBC_HAS_LOCALE" "${dst}" + else CT_KconfigEnableOption "UCLIBC_HAS_LOCALE" "${dst}" CT_KconfigDeleteOption "UCLIBC_PREGENERATED_LOCALE_DATA" "${dst}" - CT_KconfigDeleteOption "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA" \ - "${dst}" + CT_KconfigDeleteOption "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA" "${dst}" CT_KconfigDeleteOption "UCLIBC_HAS_XLOCALE" "${dst}" - ;; - y:y) - CT_KconfigEnableOption "UCLIBC_HAS_LOCALE" "${dst}" - CT_KconfigEnableOption "UCLIBC_PREGENERATED_LOCALE_DATA" "${dst}" - CT_KconfigDeleteOption "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA" \ - "${dst}" - CT_KconfigDeleteOption "UCLIBC_HAS_XLOCALE" "${dst}" - ;; - esac + fi # WCHAR support if [ "${CT_LIBC_UCLIBC_WCHAR}" = "y" ]; then |