I am trying to write an SCons script to build lua/embed3 example distributed with swig. Build instructions by makefile as follows:
swig -c++ -lua -external-runtime swigluarun.h
swig -c++ -lua -module example -o example_wrap.cpp example.i
g++ -o embed3 embed3.cpp example_wrap.cpp example.cpp \
-llua5.1 -I/usr/include/lua5.1
In Scons wiki, it's said that Scons has builtin swig support. Adding '.i' file among sources should do the job, however i am unable to find any detailed description about how can this script can be implemented.
Following script builds lua/simple project under swig examples. However, i am unable to find how to execute first swig directive given in my question. Thanks for reply.
env = Environment()
env.Append( SWIGFLAGS = '-lua' )
env.Append( CPPPATH = '/usr/include/lua5.1' )
env.Append( LIBS = 'lua5.1' )
env.SharedLibrary( target = 'example.so',
source = ['example.c', 'example.i' ], SHLIBPREFIX='' )
Thanks in advance.