File: configure-langs

package info (click to toggle)
radare2 0.9.6-3.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 17,496 kB
  • ctags: 45,959
  • sloc: ansic: 240,999; sh: 3,645; makefile: 2,520; python: 1,212; asm: 312; ruby: 214; awk: 209; perl: 188; lisp: 169; java: 23; xml: 17; php: 6
file content (77 lines) | stat: -rwxr-xr-x 1,471 bytes parent folder | download | duplicates (2)
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
#!/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
	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
cat .sl | sort | uniq > supported.langs
rm -f .sl

echo "Supported langs:"
cat supported.langs | sed -e 's,^, - ,'

# check for python
# check for perl
:> langs.cfg

exit 0