3 # Select which libc to build against
4 libc="glibc" # assumed native
5 # static cross-compiled (i486-linux-uclibc-XXX)
11 while test -e "$dir" -o -e failed."$dir"; do
15 cp -dpr tree "$dir" || exit 1
18 echo "Running randconfig test in $dir..." >&2
20 make randconfig >/dev/null || exit 1
23 | grep -v ^CONFIG_DEBUG_PESSIMIZE= \
24 | grep -v CONFIG_WERROR \
26 mv .config.new .config
27 echo CONFIG_WERROR=y >>.config
29 test "$libc" = glibc && {
31 | grep -v ^CONFIG_SELINUX= \
32 | grep -v ^CONFIG_EFENCE= \
33 | grep -v ^CONFIG_DMALLOC= \
35 mv .config.new .config
38 test "$libc" = uclibc && {
40 | grep -v ^CONFIG_SELINUX= \
41 | grep -v ^CONFIG_EFENCE= \
42 | grep -v ^CONFIG_DMALLOC= \
43 | grep -v ^CONFIG_BUILD_LIBBUSYBOX= \
44 | grep -v ^CONFIG_PAM= \
45 | grep -v ^CONFIG_TASKSET= \
46 | grep -v ^CONFIG_FEATURE_ASSUME_UNICODE= \
47 | grep -v ^CONFIG_PIE= \
48 | grep -v CONFIG_STATIC \
49 | grep -v CONFIG_CROSS_COMPILER_PREFIX \
51 mv .config.new .config
52 echo 'CONFIG_CROSS_COMPILER_PREFIX="i486-linux-uclibc-"' >>.config
53 echo 'CONFIG_STATIC=y' >>.config
56 # If NOMMU, remove some things
57 grep -q ^CONFIG_NOMMU= .config && {
59 | grep -v ^CONFIG_ASH= \
60 | grep -v ^CONFIG_FEATURE_SH_IS_ASH= \
62 mv .config.new .config
65 # If STATIC, remove some things
66 # PAM with static linking is probably pointless
67 # (but I need to try - now I don't have libpam.a on my system, only libpam.so)
68 grep -q ^CONFIG_STATIC= .config && {
70 | grep -v ^CONFIG_PAM= \
72 mv .config.new .config
75 # CONFIG_NOMMU + CONFIG_HUSH + CONFIG_WERROR don't mix
77 grep -q ^CONFIG_NOMMU= .config && \
78 grep -q ^CONFIG_HUSH= .config && \
81 | grep -v ^CONFIG_WERROR= \
83 mv .config.new .config
86 # Regenerate .config with default answers for yanked-off options
87 { yes "" | make oldconfig >/dev/null; } || exit 1
98 mv "$dir" failed."$dir"