0001-config-add-support-for-uClibc.patch 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. From eee83aa62993b15b7f460cca9583cd69a15b5357 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Thu, 15 Nov 2012 17:01:13 +0100
  4. Subject: [PATCH 1/2] config: add support for uClibc
  5. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  6. ---
  7. config.guess | 70 ++++++++++++++++++++++++++++++++++++----------------------
  8. 1 file changed, 43 insertions(+), 27 deletions(-)
  9. diff --git a/config.guess b/config.guess
  10. index 872b96a..9509179 100755
  11. --- a/config.guess
  12. +++ b/config.guess
  13. @@ -138,6 +138,23 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  14. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  15. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  16. +if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
  17. + eval $set_cc_for_build
  18. + cat << EOF > $dummy.c
  19. + #include <features.h>
  20. + #ifdef __UCLIBC__
  21. + # ifdef __UCLIBC_CONFIG_VERSION__
  22. + LIBC=uclibc __UCLIBC_CONFIG_VERSION__
  23. + # else
  24. + LIBC=uclibc
  25. + # endif
  26. + #else
  27. + LIBC=gnu
  28. + #endif
  29. +EOF
  30. + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
  31. +fi
  32. +
  33. # Note: order is significant - the case branches are not exclusive.
  34. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  35. @@ -869,11 +886,11 @@ EOF
  36. echo ${UNAME_MACHINE}-pc-minix
  37. exit ;;
  38. aarch64:Linux:*:*)
  39. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  40. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  41. exit ;;
  42. aarch64_be:Linux:*:*)
  43. UNAME_MACHINE=aarch64_be
  44. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  45. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  46. exit ;;
  47. alpha:Linux:*:*)
  48. case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
  49. @@ -886,15 +903,15 @@ EOF
  50. EV68*) UNAME_MACHINE=alphaev68 ;;
  51. esac
  52. objdump --private-headers /bin/sh | grep -q ld.so.1
  53. - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
  54. - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
  55. + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
  56. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  57. exit ;;
  58. arm*:Linux:*:*)
  59. eval $set_cc_for_build
  60. if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
  61. | grep -q __ARM_EABI__
  62. then
  63. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  64. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  65. else
  66. if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
  67. | grep -q __ARM_PCS_VFP
  68. @@ -906,22 +923,21 @@ EOF
  69. fi
  70. exit ;;
  71. avr32*:Linux:*:*)
  72. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  73. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  74. exit ;;
  75. cris:Linux:*:*)
  76. - echo ${UNAME_MACHINE}-axis-linux-gnu
  77. + echo ${UNAME_MACHINE}-axis-linux-${LIBC}
  78. exit ;;
  79. crisv32:Linux:*:*)
  80. - echo ${UNAME_MACHINE}-axis-linux-gnu
  81. + echo ${UNAME_MACHINE}-axis-linux-${LIBC}
  82. exit ;;
  83. frv:Linux:*:*)
  84. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  85. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  86. exit ;;
  87. hexagon:Linux:*:*)
  88. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  89. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  90. exit ;;
  91. i*86:Linux:*:*)
  92. - LIBC=gnu
  93. eval $set_cc_for_build
  94. sed 's/^ //' << EOF >$dummy.c
  95. #ifdef __dietlibc__
  96. @@ -932,13 +948,13 @@ EOF
  97. echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
  98. exit ;;
  99. ia64:Linux:*:*)
  100. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  101. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  102. exit ;;
  103. m32r*:Linux:*:*)
  104. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  105. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  106. exit ;;
  107. m68*:Linux:*:*)
  108. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  109. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  110. exit ;;
  111. mips:Linux:*:* | mips64:Linux:*:*)
  112. eval $set_cc_for_build
  113. @@ -957,10 +973,10 @@ EOF
  114. #endif
  115. EOF
  116. eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
  117. - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
  118. + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
  119. ;;
  120. or32:Linux:*:*)
  121. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  122. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  123. exit ;;
  124. padre:Linux:*:*)
  125. echo sparc-unknown-linux-gnu
  126. @@ -971,40 +987,40 @@ EOF
  127. parisc:Linux:*:* | hppa:Linux:*:*)
  128. # Look for CPU level
  129. case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  130. - PA7*) echo hppa1.1-unknown-linux-gnu ;;
  131. - PA8*) echo hppa2.0-unknown-linux-gnu ;;
  132. - *) echo hppa-unknown-linux-gnu ;;
  133. + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
  134. + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
  135. + *) echo hppa-unknown-linux-${LIBC} ;;
  136. esac
  137. exit ;;
  138. ppc64:Linux:*:*)
  139. - echo powerpc64-unknown-linux-gnu
  140. + echo powerpc64-unknown-linux-${LIBC}
  141. exit ;;
  142. ppc:Linux:*:*)
  143. - echo powerpc-unknown-linux-gnu
  144. + echo powerpc-unknown-linux-${LIBC}
  145. exit ;;
  146. s390:Linux:*:* | s390x:Linux:*:*)
  147. echo ${UNAME_MACHINE}-ibm-linux
  148. exit ;;
  149. sh64*:Linux:*:*)
  150. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  151. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  152. exit ;;
  153. sh*:Linux:*:*)
  154. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  155. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  156. exit ;;
  157. sparc:Linux:*:* | sparc64:Linux:*:*)
  158. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  159. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  160. exit ;;
  161. tile*:Linux:*:*)
  162. echo ${UNAME_MACHINE}-unknown-linux-gnu
  163. exit ;;
  164. vax:Linux:*:*)
  165. - echo ${UNAME_MACHINE}-dec-linux-gnu
  166. + echo ${UNAME_MACHINE}-dec-linux-${LIBC}
  167. exit ;;
  168. x86_64:Linux:*:*)
  169. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  170. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  171. exit ;;
  172. xtensa*:Linux:*:*)
  173. - echo ${UNAME_MACHINE}-unknown-linux-gnu
  174. + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
  175. exit ;;
  176. i*86:DYNIX/ptx:4*:*)
  177. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  178. --
  179. 1.7.9.5