2008-09-28 22:49:02 +05:30
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Select which libc to build against
|
|
|
|
libc="glibc" # assumed native
|
2008-11-09 21:38:31 +05:30
|
|
|
# static, cross-compilation
|
2008-09-28 22:49:02 +05:30
|
|
|
libc="uclibc"
|
2008-11-09 21:38:31 +05:30
|
|
|
# x86 32-bit:
|
|
|
|
uclibc_cross="i486-linux-uclibc-"
|
|
|
|
# My system has strange prefix for x86 64-bit uclibc:
|
|
|
|
#uclibc_cross="x86_64-pc-linux-gnu-"
|
2008-09-28 22:49:02 +05:30
|
|
|
|
|
|
|
test -d tree || exit 1
|
|
|
|
|
|
|
|
dir=test.$$
|
|
|
|
while test -e "$dir" -o -e failed."$dir"; do
|
|
|
|
dir=test."$RANDOM"
|
|
|
|
done
|
|
|
|
|
|
|
|
cp -dpr tree "$dir" || exit 1
|
|
|
|
cd "$dir" || exit 1
|
|
|
|
|
|
|
|
echo "Running randconfig test in $dir..." >&2
|
|
|
|
|
|
|
|
make randconfig >/dev/null || exit 1
|
|
|
|
|
|
|
|
cat .config \
|
|
|
|
| grep -v ^CONFIG_DEBUG_PESSIMIZE= \
|
|
|
|
| grep -v CONFIG_WERROR \
|
|
|
|
| cat >.config.new
|
|
|
|
mv .config.new .config
|
2010-01-25 04:03:06 +05:30
|
|
|
#echo CONFIG_WERROR=y >>.config
|
|
|
|
echo '# CONFIG_WERROR is not set' >>.config
|
2008-09-28 22:49:02 +05:30
|
|
|
|
|
|
|
test "$libc" = glibc && {
|
|
|
|
cat .config \
|
2010-01-25 04:03:06 +05:30
|
|
|
| grep -v CONFIG_STATIC \
|
|
|
|
| grep -v CONFIG_SELINUX \
|
|
|
|
| grep -v CONFIG_EFENCE \
|
|
|
|
| grep -v CONFIG_DMALLOC \
|
2008-09-28 22:49:02 +05:30
|
|
|
| cat >.config.new
|
|
|
|
mv .config.new .config
|
2010-01-25 04:03:06 +05:30
|
|
|
echo '# CONFIG_STATIC is not set' >>.config
|
2008-09-28 22:49:02 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
test "$libc" = uclibc && {
|
|
|
|
cat .config \
|
|
|
|
| grep -v ^CONFIG_SELINUX= \
|
|
|
|
| grep -v ^CONFIG_EFENCE= \
|
|
|
|
| grep -v ^CONFIG_DMALLOC= \
|
|
|
|
| grep -v ^CONFIG_BUILD_LIBBUSYBOX= \
|
|
|
|
| grep -v ^CONFIG_PAM= \
|
|
|
|
| grep -v ^CONFIG_TASKSET= \
|
2010-03-26 18:36:56 +05:30
|
|
|
| grep -v ^CONFIG_UNICODE_SUPPORT= \
|
2008-09-28 22:49:02 +05:30
|
|
|
| grep -v ^CONFIG_PIE= \
|
|
|
|
| grep -v CONFIG_STATIC \
|
|
|
|
| grep -v CONFIG_CROSS_COMPILER_PREFIX \
|
|
|
|
| cat >.config.new
|
|
|
|
mv .config.new .config
|
2008-11-09 21:38:31 +05:30
|
|
|
echo 'CONFIG_CROSS_COMPILER_PREFIX="'"$uclibc_cross"'"' >>.config
|
2008-09-28 22:49:02 +05:30
|
|
|
echo 'CONFIG_STATIC=y' >>.config
|
|
|
|
}
|
|
|
|
|
|
|
|
# If STATIC, remove some things
|
|
|
|
# PAM with static linking is probably pointless
|
|
|
|
# (but I need to try - now I don't have libpam.a on my system, only libpam.so)
|
|
|
|
grep -q ^CONFIG_STATIC= .config && {
|
|
|
|
cat .config \
|
|
|
|
| grep -v ^CONFIG_PAM= \
|
|
|
|
| cat >.config.new
|
|
|
|
mv .config.new .config
|
|
|
|
}
|
|
|
|
|
|
|
|
# Regenerate .config with default answers for yanked-off options
|
|
|
|
{ yes "" | make oldconfig >/dev/null; } || exit 1
|
|
|
|
|
2009-12-12 07:12:35 +05:30
|
|
|
nice -n 10 make $MAKEOPTS 2>&1 | tee -a make.log
|
2008-09-28 22:49:02 +05:30
|
|
|
|
|
|
|
test -x busybox && {
|
|
|
|
cd ..
|
|
|
|
rm -rf "$dir"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
cd ..
|
2009-03-29 00:38:23 +05:30
|
|
|
mv "$dir" "failed.$dir"
|
2008-09-28 22:49:02 +05:30
|
|
|
exit 1
|