* Use configure-langs from root configure.hook

- r_lang now obeys the rules specified in configure
    ./configure --enable=python,perl
This commit is contained in:
pancake 2011-05-20 20:11:31 +02:00
parent a4b57487bf
commit b499275e36
4 changed files with 25 additions and 5 deletions

View File

@ -1,3 +1,4 @@
#!/bin/sh
[ plugins.def.cfg -nt ./plugins.cfg ] && rm -f plugins.cfg
[ ! -e plugins.cfg ] && ./configure-plugins
[ ! -e plugins.cfg ] && ./configure-plugins $@
r2-bindings/configure-langs $@

View File

@ -9,18 +9,19 @@ endif
BINDEPS=
LANGS=lang_python.${EXT_SO} lang_perl.${EXT_SO}
LANGS=$(shell ./getlangs.sh ${EXT_SO})
#LANGS=lang_python.${EXT_SO} lang_perl.${EXT_SO}
#LANGS+=lang_ruby.so
ifeq ($(HAVE_LIB_TCC),1)
LANGS+=lang_tcc.${EXT_SO}
endif
ifeq ($(HAVE_LIB_LUA5_1),1)
LANGS+=lang_lua.${EXT_SO}
endif
all: ${LANGS}
@true
@echo r_lang_plugins: ${LANGS}
ifeq ($(OSTYPE),windows)
lang_python.${EXT_SO}:
@ -58,3 +59,4 @@ lang_perl.${EXT_SO}:
clean:
-rm -f *.${EXT_SO} *.${EXT_AR} *.o
-rm -rf *.dSYM

16
libr/lang/p/getlangs.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
e=$1
#LANGS="python perl tcc lua ruby vala"
LANGS=$(cat ../../../supported.langs | grep -e perl -e ruby -e python -e lua)
# check tcc
echo "main(){}" > a.c
gcc a.c -ltcc >/dev/null 2>&1
if [ $? = 0 ]; then
LANGS="tcc ${LANGS}"
fi
rm -f a.c
for a in ${LANGS} ; do
printf "lang_$a.$e "
done

View File

@ -50,7 +50,8 @@ while : ; do
shift
done
sh check-langs.sh
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