From: William F. <wsf...@us...> - 2004-07-10 16:37:46
|
Update of /cvsroot/swig/SWIG/Examples/python/import_template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21139/Examples/python/import_template Modified Files: .cvsignore Makefile README Added Files: runtime.i Log Message: import and import_template examples that used the prebuilt runtime library generate their own runtime library DLL/so and use that instead now Index: README =================================================================== RCS file: /cvsroot/swig/SWIG/Examples/python/import_template/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README 30 Nov 2002 21:59:11 -0000 1.2 --- README 10 Jul 2004 16:37:37 -0000 1.3 *************** *** 1,6 **** ! This example tests the SWIG run-time libraries and use of the ! %import directive to work with multiple modules. However, ! unlike the import example, this uses templates to really ! stress test the type-system. Use 'python runme.py' to run a test. --- 1,3 ---- ! This example tests the %import directive and working with multiple modules. Use 'python runme.py' to run a test. *************** *** 19,30 **** Each module used %import to refer to another module. For example, the 'foo.i' module uses '%import base.i' to get ! definitions for its base class. ! ! If everything is working correctly, all of the modules will load ! correctly and type checking will work correctly. The ! example requires the use of the SWIG run-time libraries ! which must be built and properly installed. --- 16,34 ---- Each module used %import to refer to another module. For example, the 'foo.i' module uses '%import base.i' to get ! definitions for its base class. These modules do not generate ! any runtime code (-noruntime commandline option). + The runtime.i file is an empty SWIG module which will generate + the runtime library code for sharing amongst the other modules + (uses -runtime commandline option). + If everything is okay, all of the modules will load correctly and + type checking will work correctly. + Unix: + ----- + - Run make + - Make sure your LD_LIBRARY_PATH includes the current directory so that + lib_runtime.so can be loaded. + - Run the test as described above Index: .cvsignore =================================================================== RCS file: /cvsroot/swig/SWIG/Examples/python/import_template/.cvsignore,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .cvsignore 8 May 2003 15:32:27 -0000 1.4 --- .cvsignore 10 Jul 2004 16:37:37 -0000 1.5 *************** *** 3,16 **** foo.py spam.py bar.pyc base.pyc foo.pyc spam.pyc *_wrap.c *_wrap.cxx *.dll example.dsw ! example.exp ! example.lib example.ncb example.opt --- 3,18 ---- foo.py spam.py + runtime.py bar.pyc base.pyc foo.pyc spam.pyc + runtime.pyc *_wrap.c *_wrap.cxx *.dll example.dsw ! *.exp ! *.lib example.ncb example.opt Index: Makefile =================================================================== RCS file: /cvsroot/swig/SWIG/Examples/python/import_template/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 20 Nov 2003 21:14:54 -0000 1.4 --- Makefile 10 Jul 2004 16:37:37 -0000 1.5 *************** *** 2,21 **** SWIG = $(TOP)/../swig SWIGOPT = -noruntime ! RUNTIMEDIR = $(TOP)/../Runtime/.libs all:: $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ ! RUNTIMEDIR='$(RUNTIMEDIR)' TARGET='base' INTERFACE='base.i' python_multi_cpp $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ ! RUNTIMEDIR='$(RUNTIMEDIR)' TARGET='foo' INTERFACE='foo.i' python_multi_cpp $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ ! RUNTIMEDIR='$(RUNTIMEDIR)' TARGET='bar' INTERFACE='bar.i' python_multi_cpp $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ ! RUNTIMEDIR='$(RUNTIMEDIR)' TARGET='spam' INTERFACE='spam.i' python_multi_cpp clean:: $(MAKE) -f $(TOP)/Makefile python_clean ! @rm -f foo.py bar.py spam.py base.py check: all --- 2,23 ---- SWIG = $(TOP)/../swig SWIGOPT = -noruntime ! LIBS = -L. -l_runtime all:: + $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='-runtime' \ + LIBPREFIX='lib' TARGET='runtime' INTERFACE='runtime.i' python_cpp $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ ! LIBS='$(LIBS)' TARGET='base' INTERFACE='base.i' python_cpp $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ ! LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ ! LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ ! LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' python_cpp clean:: $(MAKE) -f $(TOP)/Makefile python_clean ! @rm -f foo.py bar.py spam.py base.py runtime.py check: all --- NEW FILE: runtime.i --- // Empty module for building the runtime library %module runtime |