-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·51 lines (50 loc) · 1.09 KB
/
build.sh
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
#!/bin/sh
args="-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++"
use_auth=""
rootcmd () {
if [ "$use_auth" = "su" ]; then
su root -c "`echo $@`"
else
$use_auth $@
fi
}
for auth in doas sudo su; do
which $auth >/dev/null 2>&1
if [ "$?" = "0" ]; then
echo "$auth would work (probably)"
use_auth="$auth"
break
fi
done
for i in $@; do
case "$i" in
--prefix=*)
args="$args -DCMAKE_INSTALL_PREFIX=`echo $i | sed "s/--prefix=//g"`"
rootcmd ln -fs `echo $i | sed "s/--prefix=//g"`/bin/moc-qt1 /usr/bin/moc-qt1
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`echo $i | sed "s/--prefix=//g"`/lib"
export LD_LIBRARY_PATH
;;
esac
done
count=`grep processor /proc/cpuinfo | wc -l | sed "s/ //g"`
if [ "$count" = "0" ]; then
count=4
fi
for i in qt1 kdelibs kdebase kdegames kdeutils kdenetwork kdetoys; do
echo "--- $i"
mkdir -p $i/build
cd $i/build
if [ ! -e "configured" ]; then
cmake .. $args || exit 1
touch configured
fi
if [ ! -e "built" ]; then
make -j$count || exit 1
touch built
fi
if [ ! -e "installed" ]; then
rootcmd make install || exit 1
touch installed
fi
cd ../..
done