forked from radareorg/radare2-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure-langs
executable file
·74 lines (65 loc) · 1.43 KB
/
configure-langs
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
#!/bin/sh
#
# Script to choose which langs you want to build
# author: pancake // nopcode
# update: 2012-07-13
#
LANGS=""
help () {
echo "Usage: ./configure-langs [options]"
echo " --enable=python,perl,php5"
echo " --disable=java,ruby"
echo " --list"
echo "Filter out supported.langs"
}
ENABLE=""
DISABLE=""
enable() {
if [ -n "${DISABLE}" ]; then
echo "Cannot use --enable and --disable"
exit 1
fi
ENABLE="`echo $1 | sed -e 's/:/ /g'`"
DISABLE=""
}
disable() {
if [ -n "${ENABLE}" ]; then
echo "Cannot use --enable and --disable"
exit 1
fi
ENABLE=""
DISABLE="`echo $1 | sed -e 's/:/ /g'`"
}
MODE=""
DONOTHING=0
while : ; do
[ -z "$1" ] && break
k=$(echo $1 | cut -d = -f 1)
v=$(echo $1 | cut -d = -f 2)
case "$k" in
"--enable") enable "$v" ; ;;
"--disable") disable "$v" ; ;;
"--list") cat supported.langs ; exit 0 ; ;;
"-h"|"--help") help ; exit 0 ; ;;
esac
shift
done
root=`dirname -- $0`
sh $root/check-langs.sh
if [ -n "${ENABLE}" ]; then
echo ${ENABLE} | sed -e 's/,/\n/g' > supported.langs
#mv supported.langs .sl
#cat .sl | grep -e `echo ${ENABLE} | sed -e 's/,/ -e/g'` > supported.langs
#rm -f .sl
fi
if [ -n "${DISABLE}" ]; then
mv supported.langs .sl
cat .sl | grep -v -e `echo ${DISABLE} | sed -e 's/,/ -e/g'` > supported.langs
rm -f .sl
fi
mv supported.langs .sl
sort -u .sl > supported.langs
rm -f .sl
echo "Supported langs:"
cat supported.langs | sed -e 's,^, - ,'
exit 0