1 --- uClibc-0.9.28/Makefile.orig 2006-12-11 21:06:42.000000000 -0700
2 +++ uClibc-0.9.28/Makefile 2006-12-11 21:06:53.000000000 -0700
4 $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
5 $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
6 -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
7 - if [ "$(KERNEL_SOURCE)" == "$(DEVEL_PREFIX)" ] ; then \
8 + if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
9 extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
12 --- uClibc-0.9.28/extra/scripts/fix_includes.sh.orig 2006-12-13 05:44:21.000000000 -0700
13 +++ uClibc-0.9.28/extra/scripts/fix_includes.sh 2006-12-13 05:44:35.000000000 -0700
16 -# Copyright (C) 2003 Erik Andersen <andersen@uclibc.org>
18 -# This program is free software; you can redistribute it and/or
19 -# modify it under the terms of the GNU Library General Public
20 -# License as published by the Free Software Foundation; either
21 -# version 2 of the License, or (at your option) any later
24 -# This program is distributed in the hope that it will be useful,
25 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
26 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 -# GNU Library General Public License for more details.
29 -# You should have received a copy of the GNU Library General
30 -# Public License along with this program; if not, write to the
31 -# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
32 -# Boston, MA 02111-1307 USA
36 - echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
38 - echo "This utility scans the KERNEL_SOURCE_DIRECTORY directory and"
39 - echo "checks that it contains well formed kernel headers suitable"
40 - echo "for inclusion as the include/linux/ directory provided by"
43 - echo "If the specified kernel headers are present and already"
44 - echo "configured for the architecture specified by TARGET_ARCH,"
45 - echo "they will be used as-is."
47 - echo "If the specified kernel headers are missing entirely, this"
48 - echo "script will return an error."
50 - echo "If the specified kernel headers are present, but are either"
51 - echo "not yet configured or are configured for an architecture"
52 - echo "different than that specified by TARGET_ARCH, this script"
53 - echo "will attempt to 'fix' the kernel headers and make them"
54 - echo "suitable for use by uClibc. This fixing process may fail."
55 - echo "It is therefore best to always provide kernel headers that"
56 - echo "are already configured for the selected architecture."
58 - echo "Most Linux distributions provide 'kernel-headers' packages"
59 - echo "that are suitable for use by uClibc."
63 +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
65 +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
70 + echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
72 + echo "This utility scans the KERNEL_SOURCE_DIRECTORY directory and"
73 + echo "checks that it contains well formed kernel headers suitable"
74 + echo "for inclusion as the include/linux/ directory provided by"
77 + echo "If the specified kernel headers are present and already"
78 + echo "configured for the architecture specified by TARGET_ARCH,"
79 + echo "they will be used as-is."
81 + echo "If the specified kernel headers are missing entirely, this"
82 + echo "script will return an error."
84 + echo "If the specified kernel headers are present, but are either"
85 + echo "not yet configured or are configured for an architecture"
86 + echo "different than that specified by TARGET_ARCH, this script"
87 + echo "will attempt to 'fix' the kernel headers and make them"
88 + echo "suitable for use by uClibc. This fixing process may fail."
89 + echo "It is therefore best to always provide kernel headers that"
90 + echo "are already configured for the selected architecture."
92 + echo "Most Linux distributions provide 'kernel-headers' packages"
93 + echo "that are suitable for use by uClibc."
102 +# Parse our arguments
105 while [ -n "$1" ]; do
107 - -k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
108 - -t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
109 - -n ) shift; HAS_MMU="n"; ;;
115 + -k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
116 + -t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
117 + -n ) shift; HAS_MMU="n"; ;;
123 -if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
126 - echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!";
127 - echo "Perhaps your kernel source is broken?"
133 -if [ ! -d "$KERNEL_SOURCE" ]; then
136 - echo "$KERNEL_SOURCE is not a directory";
142 -if [ -f "$KERNEL_SOURCE/Makefile" ] ; then
143 -# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION
144 -eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $KERNEL_SOURCE/Makefile`
146 -ver=`grep UTS_RELEASE $KERNEL_SOURCE/include/linux/version.h | cut -d '"' -f 2`
147 -VERSION=`echo "$ver" | cut -d '.' -f 1`
148 -PATCHLEVEL=`echo "$ver" | cut -d '.' -f 2`
149 -if echo "$ver" | grep -q '-' ; then
150 -SUBLEVEL=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.//" | cut -d '-' -f 1`
151 -EXTRAVERSION=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-//"`
153 -SUBLEVEL=`echo "$ver" | cut -d '.' -f 3`
157 +# Perform some sanity checks on our kernel sources
159 +if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
162 + echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!"
163 + echo "Perhaps your kernel source is broken?"
168 -if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
170 - echo "Unable to determine version for kernel headers"
171 - echo -e "\tprovided in directory $KERNEL_SOURCE"
173 +if [ ! -d "$KERNEL_SOURCE" ]; then
176 + echo "$KERNEL_SOURCE is not a directory"
182 -if [ "$MAKE_IS_SILENT" != "y" ]; then
183 -echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION}"
185 -echo "Using kernel headers from $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION} for architecture '$TARGET_ARCH'"
186 -echo -e "\tprovided in directory $KERNEL_SOURCE"
191 # Create a symlink to include/asm
195 if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
198 - echo "The symlink $KERNEL_SOURCE/include/asm is missing\!";
199 - echo "Perhaps you forgot to configure your kernel source?";
200 - echo "You really should configure your kernel source tree so I";
201 - echo "do not have to try and guess about this sort of thing.";
203 - echo "Attempting to guess a usable value....";
208 - if [ "$TARGET_ARCH" = "powerpc" ];then
210 - ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm;
212 - elif [ "$TARGET_ARCH" = "mips" ];then
214 - ln -fs $KERNEL_SOURCE/include/asm-mips include/asm;
216 - elif [ "$TARGET_ARCH" = "arm" ];then
218 - ln -fs $KERNEL_SOURCE/include/asm-arm include/asm;
220 - if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ] ; then
221 - if [ ! -L proc ] ; then
223 - ln -fs proc-armv proc;
224 - ln -fs arch-ebsa285 arch);
228 + echo "The symlink $KERNEL_SOURCE/include/asm is missing\!"
229 + echo "Perhaps you forgot to configure your kernel source?"
230 + echo "You really should configure your kernel source tree so I"
231 + echo "do not have to try and guess about this sort of thing."
233 + echo "Attempting to guess a usable value...."
238 + if [ "$TARGET_ARCH" = "powerpc" ]; then
240 + ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm
242 + elif [ "$TARGET_ARCH" = "mips" ]; then
244 + ln -fs $KERNEL_SOURCE/include/asm-mips include/asm
246 + elif [ "$TARGET_ARCH" = "arm" ]; then
248 + ln -fs $KERNEL_SOURCE/include/asm-arm include/asm
250 + if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ]; then
251 + if [ ! -L proc ]; then
254 + ln -fs proc-armv proc
255 + ln -fs arch-ebsa285 arch
259 + elif [ "$TARGET_ARCH" = "cris" ]; then
261 + ln -fs $KERNEL_SOURCE/include/asm-cris include/asm
263 + elif [ "$HAS_MMU" != "y" ]; then
264 + if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ]; then
266 + ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm
270 + ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
275 + ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
278 - elif [ "$TARGET_ARCH" = "cris" ]; then
280 - ln -fs $KERNEL_SOURCE/include/asm-cris include/asm;
282 - elif [ "$HAS_MMU" != "y" ]; then
283 - if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ] ; then
285 - ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm;
289 - ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
294 - ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
298 -# No guessing required.....
299 -ln -fs $KERNEL_SOURCE/include/asm include/asm
300 -if [ -e $KERNEL_SOURCE/include/asm-$TARGET_ARCH ] ; then
301 -ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm-$TARGET_ARCH
302 + # No guessing required.....
303 + for x in $KERNEL_SOURCE/include/asm* ; do
304 + ln -fs ${x} include/
311 # Annoyingly, 2.6.x kernel headers also need an include/asm-generic/ directory
312 -if [ $VERSION -eq 2 ] && [ $PATCHLEVEL -ge 6 ] ; then
313 - ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
316 +if [ -e $KERNEL_SOURCE/include/asm-generic ]; then
317 + rm -f include/asm-generic
318 + ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
323 # Create the include/linux symlink.
326 ln -fs $KERNEL_SOURCE/include/linux include/linux