facelift step number two

This commit is contained in:
Eric Andersen
2004-10-09 02:49:33 +00:00
parent 73f7be8290
commit 44eedc5c44
144 changed files with 182 additions and 1089 deletions

View File

@@ -33,7 +33,7 @@ $(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
# Apply appropriate binutils patches.
$(SOURCE_DIR)/patch-kernel.sh $(BINUTILS_DIR) toolchain/binutils/$(BINUTILS_VERSION) \*.patch
toolchain/patch-kernel.sh $(BINUTILS_DIR) toolchain/binutils/$(BINUTILS_VERSION) \*.patch
touch $(BINUTILS_DIR)/.patched
$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched

View File

@@ -62,7 +62,7 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
#
# We do not wish to build the libstdc++ library provided with gcc,
# since it doesn't seem to work at all with uClibc plus gcc 2.95...

View File

@@ -67,7 +67,7 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
# Note: The soft float situation has improved considerably with gcc 3.4.x.
# We can dispense with the custom spec files, as well as libfloat for the arm case.
# However, we still need a patch for arm. There's a similar patch for gcc 3.3.x
@@ -75,14 +75,14 @@ $(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# anyone (?) who might still be using gcc 2.95. mjn3
ifeq ($(SOFT_FLOAT),true)
ifeq ("$(strip $(ARCH))","arm")
$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
endif
ifeq ("$(strip $(ARCH))","armeb")
$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
endif
# Not yet updated to 3.4.1.
#ifeq ("$(strip $(ARCH))","i386")
#$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) toolchain/gcc i386-gcc-soft-float.patch
#toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc i386-gcc-soft-float.patch
#endif
endif
touch $(GCC_DIR)/.patched

View File

@@ -22,7 +22,7 @@ $(DL_DIR)/$(GDB_SOURCE):
$(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
$(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
$(SOURCE_DIR)/patch-kernel.sh $(GDB_DIR) $(SOURCE_DIR)/gdb/$(GDB_VERSION) \*.patch
toolchain/patch-kernel.sh $(GDB_DIR) $(SOURCE_DIR)/gdb/$(GDB_VERSION) \*.patch
# Copy a config.sub from gcc. This is only necessary until
# gdb's config.sub supports <arch>-linux-uclibc tuples.
# Should probably integrate this into the patch.

View File

@@ -65,7 +65,7 @@ endif
touch $(LINUX_HEADERS_DIR)/.unpacked
$(LINUX_HEADERS_DIR)/.patched: $(LINUX_HEADERS_DIR)/.unpacked
$(SOURCE_DIR)/patch-kernel.sh $(LINUX_HEADERS_DIR) toolchain/kernel-headers linux-libc-headers-$(LINUX_VERSION)-\*.patch
toolchain/patch-kernel.sh $(LINUX_HEADERS_DIR) toolchain/kernel-headers linux-libc-headers-$(LINUX_VERSION)-\*.patch
touch $(LINUX_HEADERS_DIR)/.patched
$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_DIR)/.patched

File diff suppressed because it is too large Load Diff

53
toolchain/patch-kernel.sh Executable file
View File

@@ -0,0 +1,53 @@
#! /bin/sh
# A little script I whipped up to make it easy to
# patch source trees and have sane error handling
# -Erik
#
# (c) 2002 Erik Andersen <andersen@codepoet.org>
# Set directories from arguments, or use defaults.
targetdir=${1-.}
patchdir=${2-../kernel-patches}
patchpattern=${3-*}
if [ ! -d "${targetdir}" ] ; then
echo "Aborting. '${targetdir}' is not a directory."
exit 1
fi
if [ ! -d "${patchdir}" ] ; then
echo "Aborting. '${patchdir}' is not a directory."
exit 1
fi
for i in ${patchdir}/${patchpattern} ; do
case "$i" in
*.gz)
type="gzip"; uncomp="gunzip -dc"; ;;
*.bz)
type="bzip"; uncomp="bunzip -dc"; ;;
*.bz2)
type="bzip2"; uncomp="bunzip2 -dc"; ;;
*.zip)
type="zip"; uncomp="unzip -d"; ;;
*.Z)
type="compress"; uncomp="uncompress -c"; ;;
*)
type="plaintext"; uncomp="cat"; ;;
esac
echo ""
echo "Applying ${i} using ${type}: "
${uncomp} ${i} | patch -p1 -E -d ${targetdir}
if [ $? != 0 ] ; then
echo "Patch failed! Please fix $i!"
exit 1
fi
done
# Check for rejects...
if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
echo "Aborting. Reject files found."
exit 1
fi
# Remove backup files
find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;