-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfarm-config.in
78 lines (70 loc) · 1.57 KB
/
farm-config.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#! /bin/bash
# Configure source trees for compilation
set -e
if test -n "$1"; then
arch="$1"
else
arch=$(uname -i)
fi
case "$arch" in
i386)
ccflags=-m32 ;;
x86_64)
ccflags=-m64 ;;
*)
echo "Unsupported architecture $arch"
exit 1 ;;
esac
prefix=@prefix@
datarootdir=@datarootdir@
confdir=@datadir@/@PACKAGE_NAME@
. ${confdir}/farm-lib.sh
set_trap
error=
for srctree in $(ls -d $farmsrc/* | sort -V); do
test -d $srctree/Documentation || continue
bintree=$farmbin/$(basename $srctree)-$arch
gittree=$farmgit/$(basename $srctree)
echo -n "Configuring $bintree "
if test -e $gittree/index &&
test -e $bintree/configured-$arch &&
test $bintree/configured-$arch -nt $gittree/index; then
echo_cyan "Up to date"
continue
fi
rm -rf $bintree
rm -rf $bintree-bad
mkdir -p $bintree
cd $srctree
cvars=
for cvar in $config_enable; do
cvars="$cvars $cvar=y"
done
$make HOSTCC="$ucc $ucflags" KBUILD_OUTPUT=$bintree $cvars \
ARCH=$arch defconfig >$bintree/Log-config1-out \
2>$bintree/Log-config1-err
cd $bintree
for cvar in $config_enable; do
sed -i -e "s/# $cvar is not set/$cvar=y/" .config
done
yes "" | $make HOSTCC="$ucc $ucflags" ARCH=$arch oldconfig \
>Log-config2-out 2>Log-config2-err
if $make CC="$kcc $ccflags" HOSTCC="$ucc $ucflags" \
ARCH=$arch modules_prepare >Log-prepare-out 2>Log-prepare-err; then
date > $bintree/configured-$arch
echo_green "OK"
else
error=1
cd $srctree
mv $bintree $bintree-bad
echo_red "ERROR"
fi
done
unset_trap
if test -z "$error"; then
echo_green "All OK"
exit 0
else
echo_red "Errors found"
exit 1
fi