summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/binutils.sh13
-rw-r--r--scripts/build/cc_core_gcc.sh20
-rw-r--r--scripts/build/cc_gcc.sh20
-rw-r--r--scripts/build/kernel_linux.sh21
-rw-r--r--scripts/build/libc_glibc.sh32
-rw-r--r--scripts/build/libc_libfloat.sh42
-rw-r--r--scripts/build/libc_uClibc.sh19
7 files changed, 165 insertions, 2 deletions
diff --git a/scripts/build/binutils.sh b/scripts/build/binutils.sh
index 26493c4..7a3497d 100644
--- a/scripts/build/binutils.sh
+++ b/scripts/build/binutils.sh
@@ -2,6 +2,19 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
+# Download binutils
+do_binutils_get() {
+ CT_GetFile "${CT_BINUTILS_FILE}" \
+ ftp://ftp.gnu.org/gnu/binutils \
+ ftp://ftp.kernel.org/pub/linux/devel/binutils
+}
+
+# Extract binutils
+do_binutils_extract() {
+ CT_ExtractAndPatch "${CT_BINUTILS_FILE}"
+}
+
+# Build binutils
do_binutils() {
mkdir -p "${CT_BUILD_DIR}/build-binutils"
cd "${CT_BUILD_DIR}/build-binutils"
diff --git a/scripts/build/cc_core_gcc.sh b/scripts/build/cc_core_gcc.sh
index bcfd2dc..a21777c 100644
--- a/scripts/build/cc_core_gcc.sh
+++ b/scripts/build/cc_core_gcc.sh
@@ -2,6 +2,26 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
+# Download core gcc
+do_cc_core_get() {
+ # Ah! gcc folks are kind of 'different': they store the tarballs in
+ # subdirectories of the same name! That's because gcc is such /crap/ that
+ # it is such /big/ that it needs being splitted for distribution! Sad. :-(
+ # Arrgghh! Some of those versions does not follow this convention:
+ # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a
+ # subdirectory! You bastard!
+ CT_GetFile "${CT_CC_CORE_FILE}" \
+ ftp://ftp.gnu.org/gnu/gcc/${CT_CC_CORE_FILE} \
+ ftp://ftp.gnu.org/gnu/gcc/releases/${CT_CC_CORE_FILE} \
+ ftp://ftp.gnu.org/gnu/gcc
+}
+
+# Extract core gcc
+do_cc_core_extract() {
+ CT_ExtractAndPatch "${CT_CC_CORE_FILE}"
+}
+
+# Build core gcc
do_cc_core() {
mkdir -p "${CT_BUILD_DIR}/build-cc-core"
cd "${CT_BUILD_DIR}/build-cc-core"
diff --git a/scripts/build/cc_gcc.sh b/scripts/build/cc_gcc.sh
index 2479e5e..b7d36ee 100644
--- a/scripts/build/cc_gcc.sh
+++ b/scripts/build/cc_gcc.sh
@@ -2,6 +2,26 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
+# Download final gcc
+do_cc_get() {
+ # Ah! gcc folks are kind of 'different': they store the tarballs in
+ # subdirectories of the same name! That's because gcc is such /crap/ that
+ # it is such /big/ that it needs being splitted for distribution! Sad. :-(
+ # Arrgghh! Some of those versions does not follow this convention:
+ # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a
+ # subdirectory! You bastard!
+ CT_GetFile "${CT_CC_FILE}" \
+ ftp://ftp.gnu.org/gnu/gcc/${CT_CC_FILE} \
+ ftp://ftp.gnu.org/gnu/gcc/releases/${CT_CC_FILE} \
+ ftp://ftp.gnu.org/gnu/gcc
+}
+
+# Extract final gcc
+do_cc_extract() {
+ CT_ExtractAndPatch "${CT_CC_FILE}"
+}
+
+# Build final gcc
do_cc() {
CT_DoStep INFO "Installing final compiler"
diff --git a/scripts/build/kernel_linux.sh b/scripts/build/kernel_linux.sh
index c6ff608..985cd86 100644
--- a/scripts/build/kernel_linux.sh
+++ b/scripts/build/kernel_linux.sh
@@ -2,6 +2,27 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
+# Download the kernel
+do_kernel_get() {
+ if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" != "y" ]; then
+ CT_GetFile "${CT_KERNEL_FILE}" \
+ ftp://ftp.kernel.org/pub/linux/kernel/v2.6 \
+ ftp://ftp.kernel.org/pub/linux/kernel/v2.4 \
+ ftp://ftp.kernel.org/pub/linux/kernel/v2.2 \
+ ftp://ftp.kernel.org/pub/linux/kernel/v2.6/testing \
+ http://ep09.pld-linux.org/~mmazur/linux-libc-headers
+ fi
+ return 0
+}
+
+# Extract kernel
+do_kernel_extract() {
+ if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" != "y" ]; then
+ CT_ExtractAndPatch "${CT_KERNEL_FILE}"
+ fi
+ return 0
+}
+
# Check kernel configuration
do_kernel_check_config() {
CT_DoStep INFO "Checking kernel configuration"
diff --git a/scripts/build/libc_glibc.sh b/scripts/build/libc_glibc.sh
index 2fa9ac7..8b3a6d0 100644
--- a/scripts/build/libc_glibc.sh
+++ b/scripts/build/libc_glibc.sh
@@ -2,6 +2,33 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
+# Download glibc
+do_libc_download() {
+ # Ah! Not all GNU folks seem stupid. All glibc releases are in the same
+ # directory. Good. Alas, there is no snapshot there. I'll deal with them
+ # later on... :-/
+ CT_GetFile "${CT_LIBC_FILE}" ftp://ftp.gnu.org/gnu/glibc
+
+ # C library addons
+ addons_list=`echo "${CT_LIBC_ADDONS}" |sed -r -e 's/,/ /g; s/ $//g;'`
+ for addon in ${addons_list}; do
+ CT_GetFile "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" ftp://ftp.gnu.org/gnu/glibc
+ done
+ [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && CT_GetFile "${CT_LIBC}-ports-${CT_LIBC_VERSION}" ftp://ftp.gnu.org/gnu/glibc
+}
+
+# Extract glibc
+do_libc_extract() {
+ CT_ExtractAndPatch "${CT_LIBC_FILE}"
+
+ # C library addons
+ addons_list=`echo "${CT_LIBC_ADDONS}" |sed -r -e 's/,/ /g; s/ $//g;'`
+ for addon in ${addons_list}; do
+ CT_ExtractAndPatch "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
+ done
+ [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && CT_ExtractAndPatch "${CT_LIBC}-ports-${CT_LIBC_VERSION}"
+}
+
# There is nothing to do for glibc check config
do_libc_check_config() {
CT_DoStep INFO "Checking C library configuration"
@@ -44,7 +71,8 @@ do_libc_headers() {
--host="${CT_TARGET}" \
--prefix=/usr \
--with-headers="${CT_HEADERS_DIR}" \
- --without-cvs --disable-sanity-checks \
+ --without-cvs \
+ --disable-sanity-checks \
--enable-hacker-mode \
--enable-add-ons="" \
--without-nptl 2>&1 |CT_DoLog DEBUG
@@ -142,7 +170,7 @@ do_libc() {
CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
# Add some default CC args
- extra_cc_args=
+ extra_cc_args="${CT_CFLAGS_FOR_HOST}"
case "${CT_LIBC_EXTRA_CC_ARGS}" in
*-mbig-endian*) ;;
*-mlittle-endian*) ;;
diff --git a/scripts/build/libc_libfloat.sh b/scripts/build/libc_libfloat.sh
index 3828a3f..d40070f 100644
--- a/scripts/build/libc_libfloat.sh
+++ b/scripts/build/libc_libfloat.sh
@@ -2,6 +2,34 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
+# Define libfloat functions depending on wether it is selected or not
+if [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ]; then
+
+# Download libfloat
+do_libfloat_get() {
+ # Please note: because the file we download, and the file we store on the
+ # file system don't have the same name, CT_GetFile will always try to
+ # download the file over and over.
+ # To avoid this, we check that the file we want already exists in the
+ # tarball directory first. This is an ugly hack that overrides the standard
+ # CT_GetFile behavior... Sight...
+ lib_float_url="ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/"
+ ext=`CT_GetFileExtension "${CT_LIBFLOAT_FILE}"`
+ if [ -z "${ext}" ]; then
+ CT_GetFile libfloat_990616.orig "${lib_float_url}"
+ ext=`CT_GetFileExtension "libfloat_990616.orig"`
+ # Hack: remove the .orig extension, and change _ to -
+ mv -v "${CT_TARBALLS_DIR}/libfloat_990616.orig${ext}" \
+ "${CT_TARBALLS_DIR}/libfloat-990616${ext}" 2>&1 |CT_DoLog DEBUG
+ fi
+}
+
+# Extract libfloat
+do_libfloat_extract() {
+ [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
+}
+
+# Build libfloat
do_libfloat() {
# Here we build and install libfloat for the target, so that the C library
# builds OK with those versions of gcc that have severed softfloat support
@@ -29,3 +57,17 @@ do_libfloat() {
CT_EndStep
}
+
+else # "${CT_ARCH_FLOAT_SW_LIBFLOAT}" != "y"
+
+do_libfloat_get() {
+ true
+}
+do_libfloat_extract() {
+ true
+}
+do_libfloat() {
+ true
+}
+
+fi
diff --git a/scripts/build/libc_uClibc.sh b/scripts/build/libc_uClibc.sh
index 171736d..5b1504c 100644
--- a/scripts/build/libc_uClibc.sh
+++ b/scripts/build/libc_uClibc.sh
@@ -2,6 +2,25 @@
# Copyright 2007 Yann E. MORIN
# Licensed under the GPL v2. See COPYING in the root of this package
+# Download uClibc
+do_libc_get() {
+ libc_src="http://www.uclibc.org/downloads
+ http://www.uclibc.org/downloads/snapshots
+ http://www.uclibc.org/downloads/old-releases"
+ # For uClibc, we have almost every thing: releases, and snapshots
+ # for the last month or so. We'll have to deal with svn revisions
+ # later...
+ CT_GetFile "${CT_LIBC_FILE}" ${libc_src}
+ # uClibc locales
+ [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ] && CT_GetFile "uClibc-locale-030818" ${libc_src}
+}
+
+# Extract uClibc
+do_libc_extract() {
+ CT_ExtractAndPatch "${CT_LIBC_FILE}"
+ # uClibc locales
+ [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ] && CT_ExtractAndPatch "uClibc-locale-030818"
+}
# Check that uClibc has been previously configured
do_libc_check_config() {