From 4ec547ed04a8abb12306d3c20ef809cbf379e9e7 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 23 Mar 2011 14:22:21 +0100 Subject: [PATCH] * r2-swig fixes reported by @hteso --- swig/check-langs.sh | 4 +++- swig/python-config-wrapper | 4 ++++ swig/rules.mk | 12 +++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/swig/check-langs.sh b/swig/check-langs.sh index 9b939fc2cb..21e2661527 100755 --- a/swig/check-langs.sh +++ b/swig/check-langs.sh @@ -4,6 +4,8 @@ SUP_LANGS="" LANGS="python perl ruby lua go java" +[ -z "${CC}" ] && CC=gcc +[ -z "${CXX}" ] && CXX=g++ if [ "$1" = "force-all" ]; then :> supported.langs @@ -13,7 +15,7 @@ if [ "$1" = "force-all" ]; then echo python >> supported.langs fi echo "#include " > .test.c - ${CC} -c .test.c + ${CC} -I/usr/include/lua5.1 ${CFLAGS} -c .test.c if [ -f .test.o ]; then echo "check-langs.sh: Detected lua" echo lua >> supported.langs diff --git a/swig/python-config-wrapper b/swig/python-config-wrapper index 0187b4b911..01ab1e8f98 100755 --- a/swig/python-config-wrapper +++ b/swig/python-config-wrapper @@ -5,9 +5,13 @@ # order matters here PCS=" python2-config python25-config + python2.5-config python26-config + python2.6-config python27-config + python2.7-config python28-config + python2.8-config python-config" PYTHONCONFIG="" diff --git a/swig/rules.mk b/swig/rules.mk index d9d2b653c9..86de54e633 100644 --- a/swig/rules.mk +++ b/swig/rules.mk @@ -41,9 +41,15 @@ else test ../vapi/$${VAPI} -nt ${LIBS_PFX}$@ -o ! -e ${LIBS_PFX}$@ ; \ if [ $$? = 0 ]; then echo " - ${LANG} $@" ; \ LIB=`echo $@ | sed -e s,.${SOEXT},,` ; \ - ${CXX} -fPIC -shared $${LIB}_wrap.cxx `../python-config-wrapper --cflags --libs` \ - `pkg-config --cflags --libs $${LIB}` ${CFLAGS} ${LDFLAGS} -o ${LIBS_PFX}$@ ; \ - fi ; true + case "${LANG}" in \ + "python") \ + ${CXX} -fPIC -shared $${LIB}_wrap.cxx `../python-config-wrapper --cflags --libs` \ + `pkg-config --cflags --libs $${LIB}` ${CFLAGS} ${LDFLAGS} -o ${LIBS_PFX}$@ ; \ + ;; \ + "lua") \ + ${CXX} -fPIC -shared $${LIB}_wrap.cxx -I/usr/include/lua5.1 ${CFLAGS} ${LDFLAGS} -o ${LIBS_PFX}$@ ; \ + ;; \ + esac ; fi ; true clean: rm -f *.${SOEXT}