uClibc-0.9.28-fix_includes.patch 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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
  3. @@ -158,7 +158,7 @@
  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'*'" ; \
  10. else \
  11. extra_exclude="" ; \
  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
  14. @@ -1,183 +1,155 @@
  15. #!/bin/sh
  16. -# Copyright (C) 2003 Erik Andersen <andersen@uclibc.org>
  17. #
  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
  22. -# version.
  23. -#
  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.
  28. -#
  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
  33. -
  34. -usage () {
  35. - echo ""
  36. - echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
  37. - echo ""
  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"
  41. - echo "uClibc."
  42. - echo ""
  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."
  46. - echo ""
  47. - echo "If the specified kernel headers are missing entirely, this"
  48. - echo "script will return an error."
  49. - echo ""
  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."
  57. - echo ""
  58. - echo "Most Linux distributions provide 'kernel-headers' packages"
  59. - echo "that are suitable for use by uClibc."
  60. - echo ""
  61. - echo ""
  62. - exit 1;
  63. +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  64. +#
  65. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  66. +#
  67. +
  68. +usage() {
  69. + echo ""
  70. + echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
  71. + echo ""
  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"
  75. + echo "uClibc."
  76. + echo ""
  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."
  80. + echo ""
  81. + echo "If the specified kernel headers are missing entirely, this"
  82. + echo "script will return an error."
  83. + echo ""
  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."
  91. + echo ""
  92. + echo "Most Linux distributions provide 'kernel-headers' packages"
  93. + echo "that are suitable for use by uClibc."
  94. + echo ""
  95. + echo ""
  96. + exit 1
  97. }
  98. -HAS_MMU="y";
  99. +
  100. +#
  101. +# Parse our arguments
  102. +#
  103. +HAS_MMU="y"
  104. while [ -n "$1" ]; do
  105. - case $1 in
  106. - -k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
  107. - -t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
  108. - -n ) shift; HAS_MMU="n"; ;;
  109. - -* ) usage; ;;
  110. - * ) usage; ;;
  111. - esac;
  112. -done;
  113. + case $1 in
  114. + -k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
  115. + -t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
  116. + -n ) shift; HAS_MMU="n"; ;;
  117. + -* ) usage; ;;
  118. + * ) usage; ;;
  119. + esac
  120. +done
  121. -if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
  122. - echo "";
  123. - echo "";
  124. - echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!";
  125. - echo "Perhaps your kernel source is broken?"
  126. - echo "";
  127. - echo "";
  128. - exit 1;
  129. -fi;
  130. -if [ ! -d "$KERNEL_SOURCE" ]; then
  131. - echo "";
  132. - echo "";
  133. - echo "$KERNEL_SOURCE is not a directory";
  134. - echo "";
  135. - echo "";
  136. - exit 1;
  137. -fi;
  138. -
  139. -if [ -f "$KERNEL_SOURCE/Makefile" ] ; then
  140. -# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION
  141. -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`
  142. -else
  143. -ver=`grep UTS_RELEASE $KERNEL_SOURCE/include/linux/version.h | cut -d '"' -f 2`
  144. -VERSION=`echo "$ver" | cut -d '.' -f 1`
  145. -PATCHLEVEL=`echo "$ver" | cut -d '.' -f 2`
  146. -if echo "$ver" | grep -q '-' ; then
  147. -SUBLEVEL=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.//" | cut -d '-' -f 1`
  148. -EXTRAVERSION=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-//"`
  149. -else
  150. -SUBLEVEL=`echo "$ver" | cut -d '.' -f 3`
  151. -#EXTRAVERSION=
  152. -fi
  153. +#
  154. +# Perform some sanity checks on our kernel sources
  155. +#
  156. +if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
  157. + echo ""
  158. + echo ""
  159. + echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!"
  160. + echo "Perhaps your kernel source is broken?"
  161. + echo ""
  162. + echo ""
  163. + exit 1
  164. fi
  165. -if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
  166. -then
  167. - echo "Unable to determine version for kernel headers"
  168. - echo -e "\tprovided in directory $KERNEL_SOURCE"
  169. - exit 1
  170. +if [ ! -d "$KERNEL_SOURCE" ]; then
  171. + echo ""
  172. + echo ""
  173. + echo "$KERNEL_SOURCE is not a directory"
  174. + echo ""
  175. + echo ""
  176. + exit 1
  177. fi
  178. -if [ "$MAKE_IS_SILENT" != "y" ]; then
  179. -echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION}"
  180. -echo -e "\n"
  181. -echo "Using kernel headers from $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION} for architecture '$TARGET_ARCH'"
  182. -echo -e "\tprovided in directory $KERNEL_SOURCE"
  183. -echo -e "\n"
  184. -fi
  185. +#
  186. # Create a symlink to include/asm
  187. -
  188. +#
  189. rm -f include/asm*
  190. if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
  191. - echo "";
  192. - echo "";
  193. - echo "The symlink $KERNEL_SOURCE/include/asm is missing\!";
  194. - echo "Perhaps you forgot to configure your kernel source?";
  195. - echo "You really should configure your kernel source tree so I";
  196. - echo "do not have to try and guess about this sort of thing.";
  197. - echo ""
  198. - echo "Attempting to guess a usable value....";
  199. - echo ""
  200. - echo "";
  201. - sleep 1;
  202. -
  203. - if [ "$TARGET_ARCH" = "powerpc" ];then
  204. - set -x;
  205. - ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm;
  206. - set +x;
  207. - elif [ "$TARGET_ARCH" = "mips" ];then
  208. - set -x;
  209. - ln -fs $KERNEL_SOURCE/include/asm-mips include/asm;
  210. - set +x;
  211. - elif [ "$TARGET_ARCH" = "arm" ];then
  212. - set -x;
  213. - ln -fs $KERNEL_SOURCE/include/asm-arm include/asm;
  214. - set +x;
  215. - if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ] ; then
  216. - if [ ! -L proc ] ; then
  217. - (cd include/asm;
  218. - ln -fs proc-armv proc;
  219. - ln -fs arch-ebsa285 arch);
  220. - fi
  221. + echo ""
  222. + echo ""
  223. + echo "The symlink $KERNEL_SOURCE/include/asm is missing\!"
  224. + echo "Perhaps you forgot to configure your kernel source?"
  225. + echo "You really should configure your kernel source tree so I"
  226. + echo "do not have to try and guess about this sort of thing."
  227. + echo ""
  228. + echo "Attempting to guess a usable value...."
  229. + echo ""
  230. + echo ""
  231. + sleep 1
  232. +
  233. + if [ "$TARGET_ARCH" = "powerpc" ]; then
  234. + set -x
  235. + ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm
  236. + set +x
  237. + elif [ "$TARGET_ARCH" = "mips" ]; then
  238. + set -x
  239. + ln -fs $KERNEL_SOURCE/include/asm-mips include/asm
  240. + set +x
  241. + elif [ "$TARGET_ARCH" = "arm" ]; then
  242. + set -x
  243. + ln -fs $KERNEL_SOURCE/include/asm-arm include/asm
  244. + set +x
  245. + if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ]; then
  246. + if [ ! -L proc ]; then
  247. + (
  248. + cd include/asm
  249. + ln -fs proc-armv proc
  250. + ln -fs arch-ebsa285 arch
  251. + )
  252. + fi
  253. + fi
  254. + elif [ "$TARGET_ARCH" = "cris" ]; then
  255. + set -x
  256. + ln -fs $KERNEL_SOURCE/include/asm-cris include/asm
  257. + set +x
  258. + elif [ "$HAS_MMU" != "y" ]; then
  259. + if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ]; then
  260. + set -x
  261. + ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm
  262. + set +x
  263. + else
  264. + set -x
  265. + ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
  266. + set +x
  267. + fi
  268. + else
  269. + set -x
  270. + ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
  271. + set +x
  272. fi;
  273. - elif [ "$TARGET_ARCH" = "cris" ]; then
  274. - set -x;
  275. - ln -fs $KERNEL_SOURCE/include/asm-cris include/asm;
  276. - set +x;
  277. - elif [ "$HAS_MMU" != "y" ]; then
  278. - if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ] ; then
  279. - set -x;
  280. - ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm;
  281. - set +x;
  282. - else
  283. - set -x;
  284. - ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
  285. - set +x;
  286. - fi;
  287. - else
  288. - set -x;
  289. - ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
  290. - set +x;
  291. - fi;
  292. else
  293. -# No guessing required.....
  294. -ln -fs $KERNEL_SOURCE/include/asm include/asm
  295. -if [ -e $KERNEL_SOURCE/include/asm-$TARGET_ARCH ] ; then
  296. -ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm-$TARGET_ARCH
  297. + # No guessing required.....
  298. + for x in $KERNEL_SOURCE/include/asm* ; do
  299. + ln -fs ${x} include/
  300. + done
  301. fi
  302. -fi;
  303. +#
  304. # Annoyingly, 2.6.x kernel headers also need an include/asm-generic/ directory
  305. -if [ $VERSION -eq 2 ] && [ $PATCHLEVEL -ge 6 ] ; then
  306. - ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
  307. -fi;
  308. +#
  309. +if [ -e $KERNEL_SOURCE/include/asm-generic ]; then
  310. + rm -f include/asm-generic
  311. + ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
  312. +fi
  313. +#
  314. # Create the include/linux symlink.
  315. +#
  316. rm -f include/linux
  317. ln -fs $KERNEL_SOURCE/include/linux include/linux
  318. -