summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/binutils.in2
-rw-r--r--config/debug/gdb.in7
-rw-r--r--patches/newlib/1.18.0/100-fix-unaligned-access-memcpy-m68k.patch23
-rw-r--r--scripts/build/binutils/binutils.sh2
-rw-r--r--scripts/build/binutils/elf2flt.sh2
-rw-r--r--scripts/build/cc/gcc.sh6
-rw-r--r--scripts/build/companion_libs/cloog.sh2
-rw-r--r--scripts/build/companion_libs/gmp.sh2
-rw-r--r--scripts/build/companion_libs/libelf.sh2
-rw-r--r--scripts/build/companion_libs/mpc.sh2
-rw-r--r--scripts/build/companion_libs/mpfr.sh2
-rw-r--r--scripts/build/companion_libs/ppl.sh2
-rw-r--r--scripts/build/companion_tools/100-m4.sh2
-rw-r--r--scripts/build/companion_tools/200-autoconf.sh2
-rw-r--r--scripts/build/companion_tools/300-automake.sh2
-rw-r--r--scripts/build/companion_tools/400-libtool.sh2
-rw-r--r--scripts/build/debug/000-template.sh2
-rw-r--r--scripts/build/debug/100-dmalloc.sh2
-rw-r--r--scripts/build/debug/200-duma.sh6
-rw-r--r--scripts/build/debug/300-gdb.sh23
-rw-r--r--scripts/build/debug/400-ltrace.sh2
-rw-r--r--scripts/build/debug/500-strace.sh2
-rw-r--r--scripts/build/kernel/linux.sh2
-rw-r--r--scripts/build/libc/eglibc.sh4
-rw-r--r--scripts/build/libc/glibc.sh4
-rw-r--r--scripts/build/libc/newlib.sh16
-rw-r--r--scripts/build/libc/uClibc.sh4
-rw-r--r--scripts/functions53
28 files changed, 98 insertions, 84 deletions
diff --git a/config/binutils.in b/config/binutils.in
index d524065..4779708 100644
--- a/config/binutils.in
+++ b/config/binutils.in
@@ -6,7 +6,7 @@ choice
bool
prompt "Binary format:"
-if ARCH_USE_MMU
+if ARCH_USE_MMU || BARE_METAL
config ARCH_BINFMT_ELF
bool
diff --git a/config/debug/gdb.in b/config/debug/gdb.in
index 108044b..a41953c 100644
--- a/config/debug/gdb.in
+++ b/config/debug/gdb.in
@@ -37,12 +37,6 @@ config GDB_V_6_8
bool
prompt "6.8"
-config GDB_V_snapshot
- bool
- prompt "snapshot (EXPERIMENTAL)"
- depends on EXPERIMENTAL
- depends on ! GDB_CROSS_INSIGHT
-
endchoice
config GDB_7_0_or_later
@@ -56,4 +50,3 @@ config GDB_VERSION
default "7.0.1" if GDB_V_7_0_1
default "7.0" if GDB_V_7_0
default "6.8" if GDB_V_6_8
- default "snapshot" if GDB_V_snapshot
diff --git a/patches/newlib/1.18.0/100-fix-unaligned-access-memcpy-m68k.patch b/patches/newlib/1.18.0/100-fix-unaligned-access-memcpy-m68k.patch
new file mode 100644
index 0000000..6214ee5
--- /dev/null
+++ b/patches/newlib/1.18.0/100-fix-unaligned-access-memcpy-m68k.patch
@@ -0,0 +1,23 @@
+The m68k mcpu processor does not like unaligned access
+
+Disable at least mcpu32, m68010 and m68020. These processors certainly
+do not like unaligned accesses.
+
+Signed-off-by: Remy Bohmer <linux@bohmer.net>
+---
+ newlib/libc/machine/m68k/memcpy.S | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: newlib-1.18.0/newlib/libc/machine/m68k/memcpy.S
+===================================================================
+--- newlib-1.18.0.orig/newlib/libc/machine/m68k/memcpy.S
++++ newlib-1.18.0/newlib/libc/machine/m68k/memcpy.S
+@@ -15,7 +15,7 @@
+
+ #include "m68kasm.h"
+
+-#if defined (__mcoldfire__) || defined (__mcpu32__) || defined (__mc68010__) || defined (__mc68020__) || defined (__mc68030__) || defined (__mc68040__) || defined (__mc68060__)
++#if defined (__mcoldfire__) || defined (__mc68030__) || defined (__mc68040__) || defined (__mc68060__)
+ # define MISALIGNED_OK 1
+ #else
+ # define MISALIGNED_OK 0
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh
index 2f4bbbd..0ef5861 100644
--- a/scripts/build/binutils/binutils.sh
+++ b/scripts/build/binutils/binutils.sh
@@ -12,7 +12,7 @@ do_binutils_get() {
# Extract binutils
do_binutils_extract() {
CT_Extract "binutils-${CT_BINUTILS_VERSION}"
- CT_Patch "binutils-${CT_BINUTILS_VERSION}"
+ CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
}
# Build binutils
diff --git a/scripts/build/binutils/elf2flt.sh b/scripts/build/binutils/elf2flt.sh
index aa7f0e0..76d8b45 100644
--- a/scripts/build/binutils/elf2flt.sh
+++ b/scripts/build/binutils/elf2flt.sh
@@ -22,7 +22,7 @@ do_elf2flt_get() {
# Extract elf2flt
do_elf2flt_extract() {
CT_Extract "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
- CT_Patch "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
+ CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
}
# Build elf2flt
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index 0f90284..ed80463 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -28,7 +28,7 @@ do_cc_get() {
# Extract gcc
do_cc_extract() {
CT_Extract "gcc-${CT_CC_VERSION}"
- CT_Patch "gcc-${CT_CC_VERSION}"
+ CT_Patch "gcc" "${CT_CC_VERSION}"
# Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \
@@ -132,6 +132,10 @@ do_cc_core() {
;;
esac
+ # Bare metal delivers the core compiler as final compiler, so add version info and bugurl
+ [ -n "${CT_CC_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_CC_BUGURL}")
+ [ -n "${CT_CC_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_CC_PKGVERSION}")
+
if [ "${copy_headers}" = "y" ]; then
CT_DoLog DEBUG "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
CT_DoExecLog ALL mkdir -p "${core_prefix_dir}/${CT_TARGET}/include"
diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh
index e858931..73844ef 100644
--- a/scripts/build/companion_libs/cloog.sh
+++ b/scripts/build/companion_libs/cloog.sh
@@ -29,7 +29,7 @@ do_cloog_extract() {
*) _t="-${CT_CLOOG_VERSION}";;
esac
CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}"
- CT_Patch nochdir "cloog-ppl-${CT_CLOOG_VERSION}"
+ CT_Patch nochdir "cloog-ppl" "${CT_CLOOG_VERSION}"
CT_Popd
}
diff --git a/scripts/build/companion_libs/gmp.sh b/scripts/build/companion_libs/gmp.sh
index 5bcc39a..11da8f7 100644
--- a/scripts/build/companion_libs/gmp.sh
+++ b/scripts/build/companion_libs/gmp.sh
@@ -18,7 +18,7 @@ do_gmp_get() {
# Extract GMP
do_gmp_extract() {
CT_Extract "gmp-${CT_GMP_VERSION}"
- CT_Patch "gmp-${CT_GMP_VERSION}"
+ CT_Patch "gmp" "${CT_GMP_VERSION}"
}
if [ "${CT_GMP}" = "y" ]; then
diff --git a/scripts/build/companion_libs/libelf.sh b/scripts/build/companion_libs/libelf.sh
index 67e85b4..59dea27 100644
--- a/scripts/build/companion_libs/libelf.sh
+++ b/scripts/build/companion_libs/libelf.sh
@@ -16,7 +16,7 @@ do_libelf_get() {
do_libelf_extract() {
CT_Extract "libelf-${CT_LIBELF_VERSION}"
- CT_Patch "libelf-${CT_LIBELF_VERSION}"
+ CT_Patch "libelf" "${CT_LIBELF_VERSION}"
}
if [ "${CT_LIBELF}" = "y" ]; then
diff --git a/scripts/build/companion_libs/mpc.sh b/scripts/build/companion_libs/mpc.sh
index 9631b52..652931f 100644
--- a/scripts/build/companion_libs/mpc.sh
+++ b/scripts/build/companion_libs/mpc.sh
@@ -19,7 +19,7 @@ do_mpc_get() {
# Extract MPC
do_mpc_extract() {
CT_Extract "mpc-${CT_MPC_VERSION}"
- CT_Patch "mpc-${CT_MPC_VERSION}"
+ CT_Patch "mpc" "${CT_MPC_VERSION}"
}
do_mpc() {
diff --git a/scripts/build/companion_libs/mpfr.sh b/scripts/build/companion_libs/mpfr.sh
index 7787d8c..97e00b8 100644
--- a/scripts/build/companion_libs/mpfr.sh
+++ b/scripts/build/companion_libs/mpfr.sh
@@ -19,7 +19,7 @@ do_mpfr_get() {
# Extract MPFR
do_mpfr_extract() {
CT_Extract "mpfr-${CT_MPFR_VERSION}"
- CT_Patch "mpfr-${CT_MPFR_VERSION}"
+ CT_Patch "mpfr" "${CT_MPFR_VERSION}"
# OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
# same version number. Unfortunately, some tarballs of MPFR are not
diff --git a/scripts/build/companion_libs/ppl.sh b/scripts/build/companion_libs/ppl.sh
index a2c9a0e..7746af1 100644
--- a/scripts/build/companion_libs/ppl.sh
+++ b/scripts/build/companion_libs/ppl.sh
@@ -21,7 +21,7 @@ do_ppl_get() {
# Extract PPL
do_ppl_extract() {
CT_Extract "ppl-${CT_PPL_VERSION}"
- CT_Patch "ppl-${CT_PPL_VERSION}"
+ CT_Patch "ppl" "${CT_PPL_VERSION}"
}
do_ppl() {
diff --git a/scripts/build/companion_tools/100-m4.sh b/scripts/build/companion_tools/100-m4.sh
index bc40dbf..6a16a1e 100644
--- a/scripts/build/companion_tools/100-m4.sh
+++ b/scripts/build/companion_tools/100-m4.sh
@@ -9,7 +9,7 @@ do_companion_tools_m4_get() {
do_companion_tools_m4_extract() {
CT_Extract "m4-${CT_M4_VERSION}"
- CT_Patch "m4-${CT_M4_VERSION}"
+ CT_Patch "m4" "${CT_M4_VERSION}"
}
do_companion_tools_m4_build() {
diff --git a/scripts/build/companion_tools/200-autoconf.sh b/scripts/build/companion_tools/200-autoconf.sh
index 6b404c4..9ed66b5 100644
--- a/scripts/build/companion_tools/200-autoconf.sh
+++ b/scripts/build/companion_tools/200-autoconf.sh
@@ -9,7 +9,7 @@ do_companion_tools_autoconf_get() {
do_companion_tools_autoconf_extract() {
CT_Extract "autoconf-${CT_AUTOCONF_VERSION}"
- CT_Patch "autoconf-${CT_AUTOCONF_VERSION}"
+ CT_Patch "autoconf" "${CT_AUTOCONF_VERSION}"
}
do_companion_tools_autoconf_build() {
diff --git a/scripts/build/companion_tools/300-automake.sh b/scripts/build/companion_tools/300-automake.sh
index f58d938..174b2a7 100644
--- a/scripts/build/companion_tools/300-automake.sh
+++ b/scripts/build/companion_tools/300-automake.sh
@@ -9,7 +9,7 @@ do_companion_tools_automake_get() {
do_companion_tools_automake_extract() {
CT_Extract "automake-${CT_AUTOMAKE_VERSION}"
- CT_Patch "automake-${CT_AUTOMAKE_VERSION}"
+ CT_Patch "automake" "${CT_AUTOMAKE_VERSION}"
}
do_companion_tools_automake_build() {
diff --git a/scripts/build/companion_tools/400-libtool.sh b/scripts/build/companion_tools/400-libtool.sh
index 56a6bc8..eb9f82e 100644
--- a/scripts/build/companion_tools/400-libtool.sh
+++ b/scripts/build/companion_tools/400-libtool.sh
@@ -9,7 +9,7 @@ do_companion_tools_libtool_get() {
do_companion_tools_libtool_extract() {
CT_Extract "libtool-${CT_LIBTOOL_VERSION}"
- CT_Patch "libtool-${CT_LIBTOOL_VERSION}"
+ CT_Patch "libtool" "${CT_LIBTOOL_VERSION}"
}
do_companion_tools_libtool_build() {
diff --git a/scripts/build/debug/000-template.sh b/scripts/build/debug/000-template.sh
index 793d786..c76c972 100644
--- a/scripts/build/debug/000-template.sh
+++ b/scripts/build/debug/000-template.sh
@@ -11,7 +11,7 @@ do_debug_foobar_get() {
do_debug_foobar_extract() {
# For example:
# CT_Extract "foobar-${CT_FOOBAR_VERSION}"
- # CT_Patch "foobar-${CT_FOOBAR_VERSION}"
+ # CT_Patch "foobar" "${CT_FOOBAR_VERSION}"
:
}
diff --git a/scripts/build/debug/100-dmalloc.sh b/scripts/build/debug/100-dmalloc.sh
index e8965e9..c567c40 100644
--- a/scripts/build/debug/100-dmalloc.sh
+++ b/scripts/build/debug/100-dmalloc.sh
@@ -6,7 +6,7 @@ do_debug_dmalloc_get() {
do_debug_dmalloc_extract() {
CT_Extract "dmalloc-${CT_DMALLOC_VERSION}"
- CT_Patch "dmalloc-${CT_DMALLOC_VERSION}"
+ CT_Patch "dmalloc" "${CT_DMALLOC_VERSION}"
}
do_debug_dmalloc_build() {
diff --git a/scripts/build/debug/200-duma.sh b/scripts/build/debug/200-duma.sh
index de0c5c1..fe47b5e 100644
--- a/scripts/build/debug/200-duma.sh
+++ b/scripts/build/debug/200-duma.sh
@@ -12,11 +12,7 @@ do_debug_duma_get() {
do_debug_duma_extract() {
CT_Extract "duma_${CT_DUMA_VERSION}"
CT_Pushd "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}"
- # Even if DUMA uses _ and not -, crosstool-NG uses the dash to split the
- # name from the version in order to find the appropriate patches
- # YEM: FIXME: make CT_Patch more intelligent, Eg.: CT_Patch duma _ "${CT_DUMA_VERSION}"
- CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.duma-${CT_DUMA_VERSION}.extracted"
- CT_Patch nochdir "duma-${CT_DUMA_VERSION}"
+ CT_Patch nochdir "duma" "${CT_DUMA_VERSION}"
CT_Popd
}
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index afa783a..49810c6 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -6,13 +6,6 @@
# config options for this.
CT_DEBUG_GDB_NCURSES_VERSION="5.7"
-do_debug_gdb_suffix() {
- case "${CT_GDB_VERSION}" in
- snapshot) ;;
- *) echo "-${CT_GDB_VERSION}";;
- esac
-}
-
do_debug_gdb_parts() {
do_gdb=
do_insight=
@@ -40,9 +33,9 @@ do_debug_gdb_get() {
do_debug_gdb_parts
if [ "${do_gdb}" = "y" ]; then
- CT_GetFile "gdb$(do_debug_gdb_suffix)" \
- {ftp,http}://ftp.gnu.org/pub/gnu/gdb \
- ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
+ CT_GetFile "gdb-${CT_GDB_VERSION}" \
+ {ftp,http}://ftp.gnu.org/pub/gnu/gdb \
+ ftp://sources.redhat.com/pub/gdb/{,old-}releases
fi
if [ "${do_insight}" = "y" ]; then
@@ -63,25 +56,25 @@ do_debug_gdb_extract() {
do_debug_gdb_parts
if [ "${do_gdb}" = "y" ]; then
- CT_Extract "gdb$(do_debug_gdb_suffix)"
- CT_Patch "gdb$(do_debug_gdb_suffix)"
+ CT_Extract "gdb-${CT_GDB_VERSION}"
+ CT_Patch "gdb" "${CT_GDB_VERSION}"
fi
if [ "${do_insight}" = "y" ]; then
CT_Extract "insight-${CT_GDB_VERSION}"
- CT_Patch "insight-${CT_GDB_VERSION}"
+ CT_Patch "insight" "${CT_GDB_VERSION}"
fi
if [ "${do_ncurses}" = "y" ]; then
CT_Extract "ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}"
- CT_Patch "ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}"
+ CT_Patch "ncurses" "${CT_DEBUG_GDB_NCURSES_VERSION}"
fi
}
do_debug_gdb_build() {
local -a extra_config
- gdb_src_dir="${CT_SRC_DIR}/gdb$(do_debug_gdb_suffix)"
+ gdb_src_dir="${CT_SRC_DIR}/gdb-${CT_GDB_VERSION}"
insight_src_dir="${CT_SRC_DIR}/insight-${CT_GDB_VERSION}"
# Version 6.3 and below behave badly with gdbmi
diff --git a/scripts/build/debug/400-ltrace.sh b/scripts/build/debug/400-ltrace.sh
index f09277d..dd0fe4a 100644
--- a/scripts/build/debug/400-ltrace.sh
+++ b/scripts/build/debug/400-ltrace.sh
@@ -13,7 +13,7 @@ do_debug_ltrace_get() {
do_debug_ltrace_extract() {
CT_Extract "ltrace-${CT_LTRACE_VERSION}"
- CT_Patch "ltrace-${CT_LTRACE_VERSION}"
+ CT_Patch "ltrace" "${CT_LTRACE_VERSION}"
}
do_debug_ltrace_build() {
diff --git a/scripts/build/debug/500-strace.sh b/scripts/build/debug/500-strace.sh
index 174c8dc..3713da5 100644
--- a/scripts/build/debug/500-strace.sh
+++ b/scripts/build/debug/500-strace.sh
@@ -8,7 +8,7 @@ do_debug_strace_get() {
do_debug_strace_extract() {
CT_Extract "strace-${CT_STRACE_VERSION}"
- CT_Patch "strace-${CT_STRACE_VERSION}"
+ CT_Patch "strace" "${CT_STRACE_VERSION}"
}
do_debug_strace_build() {
diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh
index 777c104..8a568ed 100644
--- a/scripts/build/kernel/linux.sh
+++ b/scripts/build/kernel/linux.sh
@@ -23,7 +23,7 @@ do_kernel_get() {
do_kernel_extract() {
if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" != "y" ]; then
CT_Extract "linux-${CT_KERNEL_VERSION}"
- CT_Patch "linux-${CT_KERNEL_VERSION}"
+ CT_Patch "linux" "${CT_KERNEL_VERSION}"
fi
return 0
}
diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh
index 1875a23..c8f34c0 100644
--- a/scripts/build/libc/eglibc.sh
+++ b/scripts/build/libc/eglibc.sh
@@ -94,7 +94,7 @@ do_libc_get() {
# Extract eglibc
do_libc_extract() {
CT_Extract "eglibc-${CT_LIBC_VERSION}"
- CT_Patch "eglibc-${CT_LIBC_VERSION}"
+ CT_Patch "eglibc" "${CT_LIBC_VERSION}"
# C library addons
for addon in $(do_libc_add_ons_list " "); do
@@ -110,7 +110,7 @@ do_libc_extract() {
# directory, returns true!
[ -d "${addon}" ] || ln -s "eglibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
[ -d "eglibc-${addon}-${CT_LIBC_VERSION}" ] || ln -s "${addon}" "eglibc-${addon}-${CT_LIBC_VERSION}"
- CT_Patch nochdir "eglibc-${addon}-${CT_LIBC_VERSION}"
+ CT_Patch nochdir "eglibc" "${addon}-${CT_LIBC_VERSION}"
CT_Popd
done
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 233cd3b..a45aef9 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -38,7 +38,7 @@ do_libc_extract() {
CT_Extract "glibc-${CT_LIBC_VERSION}"
CT_Pushd "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
- CT_Patch nochdir "glibc-${CT_LIBC_VERSION}"
+ CT_Patch nochdir "glibc" "${CT_LIBC_VERSION}"
# C library addons
for addon in "${addons_list[@]}"; do
@@ -54,7 +54,7 @@ do_libc_extract() {
# directory, returns true!
[ -d "${addon}" ] || CT_DoExecLog ALL ln -s "glibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
[ -d "glibc-${addon}-${CT_LIBC_VERSION}" ] || CT_DoExecLog ALL ln -s "${addon}" "glibc-${addon}-${CT_LIBC_VERSION}"
- CT_Patch nochdir "glibc-${addon}-${CT_LIBC_VERSION}"
+ CT_Patch nochdir "glibc" "${addon}-${CT_LIBC_VERSION}"
done
# The configure files may be older than the configure.in files
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index c4cf654..23c6d84 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -5,11 +5,11 @@
# Edited by Martin Lund <mgl@doredevelopment.dk>
#
-libc_newlib_basename() {
+libc_newlib_version() {
if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
- echo "newlib-${CT_LIBC_VERSION}"
+ echo "${CT_LIBC_VERSION}"
else
- echo "newlib-cvs${CT_LIBC_VERSION:+-${CT_LIBC_VERSION}}"
+ echo "cvs${CT_LIBC_VERSION:+-${CT_LIBC_VERSION}}"
fi
}
@@ -20,11 +20,11 @@ do_libc_get() {
if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
else
- CT_GetCVS "$(libc_newlib_basename)" \
+ CT_GetCVS "newlib-$(libc_newlib_version)" \
":pserver:anoncvs@sources.redhat.com:/cvs/src" \
"newlib" \
"${CT_LIBC_VERSION}" \
- "$(libc_newlib_basename)=src"
+ "newlib-$(libc_newlib_version)=src"
fi
if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
@@ -33,8 +33,8 @@ do_libc_get() {
}
do_libc_extract() {
- CT_Extract "$(libc_newlib_basename)"
- CT_Patch "$(libc_newlib_basename)"
+ CT_Extract "newlib-$(libc_newlib_version)"
+ CT_Patch "newlib" "$(libc_newlib_version)"
if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
CT_Extract "avr32headers"
@@ -71,7 +71,7 @@ do_libc() {
AR=${CT_TARGET}-ar \
RANLIB=${CT_TARGET}-ranlib \
CT_DoExecLog ALL \
- "${CT_SRC_DIR}/$(libc_newlib_basename)/configure" \
+ "${CT_SRC_DIR}/newlib-$(libc_newlib_version)/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 009fd14..f4aa43d 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc.sh
@@ -22,13 +22,13 @@ do_libc_get() {
# Extract uClibc
do_libc_extract() {
CT_Extract "uClibc-${CT_LIBC_VERSION}"
- CT_Patch "uClibc-${CT_LIBC_VERSION}"
+ CT_Patch "uClibc" "${CT_LIBC_VERSION}"
# uClibc locales
if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ]; then
CT_Pushd "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}/extra/locale"
CT_Extract nochdir "uClibc-locale-030818"
- CT_Patch nochdir "uClibc-locale-030818"
+ CT_Patch nochdir "uClibc" "locale-030818"
CT_Popd
fi
diff --git a/scripts/functions b/scripts/functions
index f39eeaf..00d7214 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -708,10 +708,15 @@ CT_ExtractGit() {
# Patches the specified component
# See CT_Extract, above, for explanations on 'nochdir'
-# Usage: CT_Patch [nochdir] <basename>
+# Usage: CT_Patch [nochdir] <packagename> <packageversion>
+# If the package directory is *not* packagename-packageversion, then
+# the caller must cd into the proper directory first, and call us
+# with nochdir
CT_Patch() {
local nochdir="$1"
- local basename
+ local pkgname
+ local version
+ local pkgdir
local base_file
local ver_file
local d
@@ -719,40 +724,40 @@ CT_Patch() {
local bundled_patch_dir
local local_patch_dir
+ pkgname="$1"
+ version="$2"
+ pkgdir="${pkgname}-${version}"
+
if [ "${nochdir}" = "nochdir" ]; then
shift
nochdir="$(pwd)"
else
- nochdir="${CT_SRC_DIR}/${1}"
+ nochdir="${CT_SRC_DIR}/${pkgdir}"
fi
- basename="$1"
- base_file="${basename%%-*}"
- ver_file="${basename#*-}"
-
# Check if already patched
- if [ -e "${CT_SRC_DIR}/.${basename}.patched" ]; then
- CT_DoLog DEBUG "Already patched '${basename}'"
+ if [ -e "${CT_SRC_DIR}/.${pkgdir}.patched" ]; then
+ CT_DoLog DEBUG "Already patched '${pkgdir}'"
return 0
fi
# Check if already partially patched
- if [ -e "${CT_SRC_DIR}/.${basename}.patching" ]; then
- CT_DoLog ERROR "The '${basename}' sources were partially patched."
+ if [ -e "${CT_SRC_DIR}/.${pkgdir}.patching" ]; then
+ CT_DoLog ERROR "The '${pkgdir}' sources were partially patched."
CT_DoLog ERROR "Please remove first:"
- CT_DoLog ERROR " - the source dir for '${basename}', in '${CT_SRC_DIR}'"
- CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${basename}.extracted'"
- CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${basename}.patching'"
+ CT_DoLog ERROR " - the source dir for '${pkgdir}', in '${CT_SRC_DIR}'"
+ CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${pkgdir}.extracted'"
+ CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${pkgdir}.patching'"
CT_Abort "I'll stop now to avoid any carnage..."
fi
- touch "${CT_SRC_DIR}/.${basename}.patching"
+ touch "${CT_SRC_DIR}/.${pkgdir}.patching"
CT_Pushd "${nochdir}"
- CT_DoLog EXTRA "Patching '${basename}'"
+ CT_DoLog EXTRA "Patching '${pkgdir}'"
- bundled_patch_dir="${CT_LIB_DIR}/patches/${base_file}/${ver_file}"
- local_patch_dir="${CT_LOCAL_PATCH_DIR}/${base_file}/${ver_file}"
+ bundled_patch_dir="${CT_LIB_DIR}/patches/${pkgname}/${version}"
+ local_patch_dir="${CT_LOCAL_PATCH_DIR}/${pkgname}/${version}"
case "${CT_PATCH_ORDER}" in
bundled) patch_dirs=("${bundled_patch_dir}");;
@@ -787,8 +792,8 @@ CT_Patch() {
done
fi
- CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.patched"
- CT_DoExecLog DEBUG rm -f "${CT_SRC_DIR}/.${basename}.patching"
+ CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${pkgdir}.patched"
+ CT_DoExecLog DEBUG rm -f "${CT_SRC_DIR}/.${pkgdir}.patching"
CT_Popd
}
@@ -860,10 +865,10 @@ CT_DoBuildTargetTuple() {
CT_DoKernelTupleValues
# Finish the target tuple construction
- CT_TARGET="${CT_TARGET_ARCH}-"
- CT_TARGET="${CT_TARGET}${CT_TARGET_VENDOR:+${CT_TARGET_VENDOR}-}"
- CT_TARGET="${CT_TARGET}${CT_TARGET_KERNEL:+${CT_TARGET_KERNEL}-}"
- CT_TARGET="${CT_TARGET}${CT_TARGET_SYS}"
+ CT_TARGET="${CT_TARGET_ARCH}"
+ CT_TARGET="${CT_TARGET}${CT_TARGET_VENDOR:+-${CT_TARGET_VENDOR}}"
+ CT_TARGET="${CT_TARGET}${CT_TARGET_KERNEL:+-${CT_TARGET_KERNEL}}"
+ CT_TARGET="${CT_TARGET}${CT_TARGET_SYS:+-${CT_TARGET_SYS}}"
# Sanity checks
__sed_alias=""