File: update_lua_bindings.sh

package info (click to toggle)
ember 0.6.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 21,372 kB
  • sloc: cpp: 106,397; sh: 10,156; xml: 1,473; makefile: 915; ansic: 530; objc: 245
file content (20 lines) | stat: -rw-r--r-- 971 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
#! /bin/sh
# tolua++ will for some reason translate "const std::string" into
# "const,std::string", so we need to remove these incorrect commas from the
# final code some versions will also for some unexplainable reason not
# correctly remove the tolua specific directive tolua_outside, so we need to 
# clean that out also.  We'll also replace the inclusion of "tolua++.h" with
# our own version which has better support for building on win32.  
echo "Updating lua bindings."

#If the TOLUAXX environment variable isn't set default to using the command "tolua++".
if [ x${TOLUAXX} = x ]; then
  TOLUAXX=tolua++
fi
${TOLUAXX} -n $1 $2 > $3
grep -q '** tolua internal error' $3 && cat $3 && exit 1
if [ "`echo $OSTYPE | grep darwin`" != "" ] ; then
  sed -i "" -e 's/const,/const /g' -e 's/tolua_outside//g' -e 's/tolua++\.h/components\/lua\/tolua++\.h/' $3
else
  sed -i -e 's/const,/const /g' -e 's/tolua_outside//g' -e 's/tolua++\.h/components\/lua\/tolua++\.h/' $3
fi