3 # helper script to quick build testing with cross-compilers
8 : ${BUILD_NCPUS:=$(getconf _NPROCESSORS_ONLN)}
9 if [ "$BUILD_NCPUS" -gt 1 ] ; then
10 JOBS
=-j$
((BUILD_NCPUS
+ 1))
14 MAKE
="${MAKE} ${JOBS}"
16 : ${CROSS_COMPILE:=${CROSS_COMPILER_PREFIX}}
28 -e "/${opt}=/s:=.*:=$*:" \
30 echo " ## setconfig ${opt} $*"
36 hppa
) echo hppa hppa2.0 hppa1.1 hppa1.0
;;
37 i386
) echo i386 i486 i586 i686
;;
38 sh
) echo sh4 sh2 sh3 sh1 sh
;;
39 sparc
) echo sparc sparc64
;;
47 for a
in $
(get_arches
$1) ; do
48 for l
in uclibc gnu gnueabi
"" ; do
49 for v
in unknown pc gentoo
"" ; do
50 for o
in linux uclinux
"" ; do
51 t
="${a}${v:+-${v}}${o:+-${o}}${l:+-${l}}"
52 if ${t}-gcc --help > /dev
/null
2>&1 ; then
64 echo " ## ${MAKE} -s $*"
76 '$0 ~ /^config TARGET_/ { sub("TARGET_",""); print $NF }' \
77 extra
/Configs
/Config.
in |
grep -v SUBARCH
)
83 if [ -z "${CROSS_COMPILE}" ] ; then
84 CROSS_COMPILE
=$
(find_compiler
${a})
87 if [ -z "${CROSS_COMPILE}" ] ; then
89 echo " ### SKIP: ${a}: could not find compiler"
93 rm -f ${a}.log
${a}.fail
97 echo " ### Building target ${a} (${CROSS_COMPILE})"
100 do_make ARCH
=$a defconfig
103 setconfig CROSS_COMPILER_PREFIX
${CROSS_COMPILE}
105 header_path
=${KERNEL_HEADERS:-$(echo '#include <linux/version.h>' | ${CROSS_COMPILE}cpp 2>/dev/null | grep -o '[^"]*linux/version.h')} ||
:
106 if [ -z "${header_path}" ] ; then
107 for p
in /usr
/${CROSS_COMPILE%-}/usr
/include
; do
108 if [ -e ${p}/linux
/version.h
] ; then
113 if [ -z "${header_path}" ] ; then
114 echo " ## unable to locate KERNEL_HEADERS"
117 setconfig KERNEL_HEADERS
${header_path%/linux/version.h}
125 ) 2>&1 |
tee ${a}.log
127 if [ -e ${a}.fail
] ; then
137 if [ -n "${skip}" ] ; then
138 printf '\nSKIPPED: %s\n' "${skip}"
140 if [ -n "${fail}" ] ; then
141 printf '\nPASSED: %s\nFAILED: %s\n\n' "${pass}" "${fail}"
144 printf '\nAll arches passed!\n\n'