2011-05-20 17:49:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Script to choose which langs you want to build
|
|
|
|
# author: pancake // nopcode
|
2012-06-13 15:34:07 +00:00
|
|
|
# update: 2012-07-13
|
2011-05-20 17:49:50 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
LANGS=""
|
|
|
|
help () {
|
|
|
|
echo "Usage: ./configure-langs [options]"
|
2011-10-25 23:52:05 +00:00
|
|
|
echo " --enable=python,perl,php5"
|
2011-05-20 17:49:50 +00:00
|
|
|
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
|
2012-06-13 15:34:07 +00:00
|
|
|
ENABLE="`echo $1 | sed -e 's/:/ /g'`"
|
2011-05-20 17:49:50 +00:00
|
|
|
DISABLE=""
|
|
|
|
}
|
|
|
|
|
|
|
|
disable() {
|
|
|
|
if [ -n "${ENABLE}" ]; then
|
|
|
|
echo "Cannot use --enable and --disable"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
ENABLE=""
|
2012-06-13 16:15:28 +00:00
|
|
|
DISABLE="`echo $1 | sed -e 's/:/ /g'`"
|
2011-05-20 17:49:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MODE=""
|
|
|
|
DONOTHING=0
|
|
|
|
while : ; do
|
|
|
|
[ -z "$1" ] && break
|
2012-06-13 15:34:07 +00:00
|
|
|
k=$(echo $1 | cut -d = -f 1)
|
|
|
|
v=$(echo $1 | cut -d = -f 2)
|
2011-05-20 17:49:50 +00:00
|
|
|
case "$k" in
|
|
|
|
"--enable") enable "$v" ; ;;
|
|
|
|
"--disable") disable "$v" ; ;;
|
|
|
|
"--list") cat supported.langs ; exit 0 ; ;;
|
|
|
|
"-h"|"--help") help ; exit 0 ; ;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2011-05-20 18:11:31 +00:00
|
|
|
root=`dirname -- $0`
|
|
|
|
sh $root/check-langs.sh
|
2011-05-20 17:49:50 +00:00
|
|
|
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
|
|
|
|
|
2012-06-13 16:15:28 +00:00
|
|
|
mv supported.langs .sl
|
|
|
|
cat .sl | sort | uniq > supported.langs
|
|
|
|
rm -f .sl
|
|
|
|
|
2011-05-20 17:49:50 +00:00
|
|
|
echo "Supported langs:"
|
|
|
|
cat supported.langs | sed -e 's,^, - ,'
|
|
|
|
|
|
|
|
# check for python
|
|
|
|
# check for perl
|
|
|
|
:> langs.cfg
|
|
|
|
|
|
|
|
exit 0
|