summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-07-03 21:49:54 (GMT)
committerAlexey Neyman <stilor@att.net>2017-07-08 17:57:56 (GMT)
commit16a56ed75b489186ae49a8c62945ca914e263477 (patch)
tree1908a6f9cbc0902c4b34e784a5860bcd9caa4626
parentf63fbd356f4e80b2f597796039eb79a69121fb4d (diff)
uClibc locale "package"
Does not build, though. Signed-off-by: Alexey Neyman <stilor@att.net>
-rw-r--r--TODO8
-rw-r--r--config/arch/xtensa.in1
-rw-r--r--config/libc/uClibc.in.24
-rw-r--r--packages/uClibc-locale/030818/version.desc0
-rw-r--r--packages/uClibc-locale/package.desc3
-rw-r--r--scripts/build/libc/uClibc.sh58
-rw-r--r--scripts/functions39
7 files changed, 64 insertions, 49 deletions
diff --git a/TODO b/TODO
index 386ad14..47c3059 100644
--- a/TODO
+++ b/TODO
@@ -1,19 +1,19 @@
TBD
packages todo
-[ ] mention custom glibc addons are no longer handled (even though they never fully were, ct-ng would be unable to fetch them unless they were secretly placed into the download area)
-[ ] mention incompatibility of sample options
+[X] mention custom glibc addons are no longer handled (even though they never fully were, ct-ng would be unable to fetch them unless they were secretly placed into the download area)
+[x] mention incompatibility of sample options
[X] version-locked packages
[X] make glibc-ports package for glibc <2.17 (it has its own repo)
[ ] convert gen-kconfig to use templates
-[ ] switch to checked in generated files (config/versions, config/gen) - take too long to generate
[ ] new packages
[ ] config.guess
[ ] gnulib
[ ] use gnulib in m4, gettext, libiconv, libtool
[ ] autoconf-archive
[ ] use to retrieve ax_pthread.m4 (gettext?)
+ [ ] uclibc-locales
[ ] some way of patching development sources - version based? or just directory with "apply-to-any-revision" patches.
-[ ] dependencies like cloog
+[x] dependencies like cloog
A (slightly) ordered set of tasks for crosstool-NG. Written in a cryptic language; contact me if you want to help with any of these :)
diff --git a/config/arch/xtensa.in b/config/arch/xtensa.in
index c247f62..3ffa4e8 100644
--- a/config/arch/xtensa.in
+++ b/config/arch/xtensa.in
@@ -5,7 +5,6 @@
## select ARCH_DEFAULT_LE
## select ARCH_SUPPORTS_BOTH_MMU
## select ARCH_DEFAULT_HAS_MMU
-## select USE_OVERLAY
##
## help The xtensa architecture
## help
diff --git a/config/libc/uClibc.in.2 b/config/libc/uClibc.in.2
index 7bf8f2a..0883959 100644
--- a/config/libc/uClibc.in.2
+++ b/config/libc/uClibc.in.2
@@ -60,6 +60,10 @@ config LIBC_UCLIBC_LOCALES_PREGEN_DATA
If so, please report the issue, so we can default this
to off if too many people complain.
+if LIBC_UCLIBC_LOCALES_PREGEN_DATA
+source "config/versions/uClibc-locale.in"
+endif
+
config LIBC_UCLIBC_IPV6
bool
prompt "Add support for IPv6"
diff --git a/packages/uClibc-locale/030818/version.desc b/packages/uClibc-locale/030818/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/uClibc-locale/030818/version.desc
diff --git a/packages/uClibc-locale/package.desc b/packages/uClibc-locale/package.desc
new file mode 100644
index 0000000..a14de38
--- /dev/null
+++ b/packages/uClibc-locale/package.desc
@@ -0,0 +1,3 @@
+# TBD repository='git git://git.busybox.net/uClibc'
+mirrors='http://www.uclibc.org/downloads'
+archive_dirname='.'
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh
index 1e6db21..fdaded8 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc.sh
@@ -2,28 +2,20 @@
# 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_UCLIBC_USE_UCLIBC_NG_ORG}" = "y" ]; then
- # TBD make the name come from config/versions/uclibc.in
- uclibc_name="uClibc-ng"
-elif [ "${CT_UCLIBC_USE_UCLIBC_ORG}" = "y" ]; then
- uclibc_name="uClibc"
-fi
-
# Download uClibc
do_libc_get() {
- CT_Fetch UCLIBC_NG
- # TBD locales
+ CT_Fetch UCLIBC
+ if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" ]; then
+ CT_Fetch UCLIBC_LOCALE
+ fi
}
# Extract uClibc
do_libc_extract() {
- CT_ExtractPatch UCLIBC_NG
- # TBD locales
+ CT_ExtractPatch UCLIBC
+ if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" ]; then
+ CT_ExtractPatch UCLIBC_LOCALE
+ fi
}
# Build and install headers and start files
@@ -68,16 +60,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_DoStep INFO "Building for multilib ${multi_index}/${multi_count}: '${multi_flags}'"
multilib_dir="lib/${multi_os_dir}"
startfiles_dir="${multi_root}/usr/${multilib_dir}"
@@ -97,11 +92,22 @@ 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/." .
+ if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" ]; then
+ # uClibc's makefile insists on unpacking, but that would screw fetching from
+ # non-tarball locations.
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-locale/." extra/locale
+ CT_DoExecLog ALL touch extra/locale/dummy-file
+ CT_DoExecLog ALL tar czf extra/locale/dummy.tar.gz -C extra/locale dummy-file
+ make_args+=( LOCALE_DATA_FILENAME=dummy.tar.gz )
+ fi
+
# Force the date of the pregen locale data, as the
# newer ones that are referenced are not available
CT_DoLog EXTRA "Applying configuration"
@@ -298,24 +304,20 @@ 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}"
+ # pregenerated locales is not compatible with crosstool.
case "${CT_LIBC_UCLIBC_LOCALES}:${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" in
:*)
;;
y:)
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_DOWNLOAD_PREGENERATED_LOCALE_DATA" "${dst}"
CT_KconfigDeleteOption "UCLIBC_HAS_XLOCALE" "${dst}"
;;
esac
diff --git a/scripts/functions b/scripts/functions
index 4588315..cea001f 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -537,18 +537,14 @@ CT_Pushd() {
pushd "$1" >/dev/null 2>&1
}
CT_Popd() {
+ local dir=`dirs +0`
+
+ CT_DoLog DEBUG "Leaving '${dir}'"
popd >/dev/null 2>&1
}
-# Create a dir and cd or pushd into it
-# Usage: CT_mkdir_cd <dir/to/create>
-# CT_mkdir_pushd <dir/to/create>
-CT_mkdir_cd() {
- local dir="${1}"
-
- mkdir -p "${dir}"
- cd "${dir}"
-}
+# Create a dir and pushd into it
+# Usage: CT_mkdir_pushd <dir/to/create>
CT_mkdir_pushd() {
local dir="${1}"
@@ -1718,7 +1714,12 @@ CT_DoFetch()
local tmp_dir
if [ "${src_release}" = "y" ]; then
- basename="${archive_dirname}"
+ # Some packages do not contain any directory level at all
+ if [ "${archive_dirname}" != "." ]; then
+ basename="${archive_dirname}"
+ else
+ basename="${pkg_name}-${version}"
+ fi
if ! CT_GetFile "${archive_filename}" ${mirrors}; then
CT_Abort "${pkg_name}: download failed"
fi
@@ -1869,7 +1870,13 @@ CT_DoExtractPatch()
fi
# TBD save/discover the extension while fetching
ext=`CT_GetFileExtension "${archive}"`
- CT_Extract "${CT_TARBALLS_DIR}/${archive}${ext}" "${CT_COMMON_SRC_DIR}"
+ if [ "${archive_dirname}" = "." ]; then
+ CT_mkdir_pushd "${CT_COMMON_SRC_DIR}/${basename}"
+ CT_Extract "${CT_TARBALLS_DIR}/${archive}${ext}" "${CT_COMMON_SRC_DIR}/${basename}"
+ CT_Popd
+ else
+ CT_Extract "${CT_TARBALLS_DIR}/${archive}${ext}" "${CT_COMMON_SRC_DIR}"
+ fi
CT_DoExecLog ALL touch "${CT_COMMON_SRC_DIR}/.${basename}.extracted"
CT_DoExecLog ALL rm -f "${CT_COMMON_SRC_DIR}/.${basename}.extracting"
fi
@@ -1937,7 +1944,7 @@ CT_DoExtractPatch()
CT_DoLog WARN "${pkg_name}: using custom location, no overlays applied"
fi
if [ -d "${custom_location}" ]; then
- CT_DoExecLog ALL cp -av "${custom_location}" "${CT_SRC_DIR}/${pkg_name}"
+ CT_DoExecLog ALL cp -av "${custom_location}" "${CT_SRC_DIR}/${dir_name}"
elif [ -f "${custom_location}" ]; then
# Assume "foo.tar.gz" (or likes) contain the "foo" directory
local bn
@@ -1945,7 +1952,7 @@ CT_DoExtractPatch()
CT_Extract "${custom_location}" "${CT_SRC_DIR}"
bn=`CT_GetFileBasename "${custom_location##*/}"`
CT_TestOrAbort "Unknown file extension: ${custom_location}" -n "${bn}"
- CT_DoExecLog ALL mv -v "${CT_SRC_DIR}/${bn%${ext}}" "${CT_SRC_DIR}/${pkg_name}"
+ CT_DoExecLog ALL mv -v "${CT_SRC_DIR}/${bn%${ext}}" "${CT_SRC_DIR}/${dir_name}"
else
CT_Abort "Neither file nor directory: ${custom_location}"
fi
@@ -1953,13 +1960,13 @@ CT_DoExtractPatch()
# Possibly has overlays; copy from common source and apply overlays if any
local overlay
- CT_DoExecLog ALL cp -av "${CT_COMMON_SRC_DIR}/${basename}" "${CT_SRC_DIR}/${pkg_name}"
+ CT_DoExecLog ALL cp -av "${CT_COMMON_SRC_DIR}/${basename}" "${CT_SRC_DIR}/${dir_name}"
overlay="${CT_OVERLAY_LOCATION}/${CT_ARCH}-${CT_OVERLAY_NAME:-overlay}"
ext=`CT_GetFileExtension "${overlay}"`
- CT_Extract "${overlay}${ext}" "${CT_SRC_DIR}" "${pkg_name}"
+ CT_Extract "${overlay}${ext}" "${CT_SRC_DIR}" "${dir_name}"
else
# Common source, just symlink
- CT_DoExecLog ALL ln -s "${CT_COMMON_SRC_DIR}/${basename}" "${CT_SRC_DIR}/${pkg_name}"
+ CT_DoExecLog ALL ln -s "${CT_COMMON_SRC_DIR}/${basename}" "${CT_SRC_DIR}/${dir_name}"
fi
}