Merge branch 'master' into gsoc2009-matevz

Conflicts:
	Examples/Makefile.in
	Examples/guile/Makefile.in
	Lib/php/php.swg
	Makefile.in
	Source/CParse/parser.y
	configure.ac
This commit is contained in:
William S Fulton 2013-10-10 07:26:09 +01:00
commit bcb7aee022
585 changed files with 9528 additions and 12959 deletions

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,7 @@ TOP = ../..
SWIG = $(TOP)/../preinst-swig
TARGET = example
INTERFACE = example.i
INTERFACEDIR = jni/
PACKAGEDIR = src/org/swig
PACKAGENAME= org.swig.classexample
SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/classexample
@ -9,22 +10,17 @@ PROJECTNAME= SwigClass
TARGETID = 1
#INSTALLOPTIONS = -s # To install on SD Card
all:: android
check: build
android::
android update project --target $(TARGETID) --name $(PROJECTNAME) --path .
$(SWIG) -c++ -java $(SWIGOPT) -o jni/$(TARGET)_wrap.cpp jni/$(INTERFACE)
ndk-build
ant debug
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' INTERFACEDIR='$(INTERFACEDIR)' \
PROJECTNAME='$(PROJECTNAME)' TARGETID='$(TARGETID)' android_cpp
install::
-adb uninstall $(PACKAGENAME)
adb install $(INSTALLOPTIONS) bin/$(PROJECTNAME)-debug.apk
install:
$(MAKE) -f $(TOP)/Makefile INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \
PACKAGEDIR='$(PACKAGEDIR)' PACKAGENAME='$(PACKAGENAME)' android_install
clean::
ant clean
rm -f jni/$(TARGET)_wrap.cpp
rm -f `find $(PACKAGEDIR) -name \*.java | grep -v $(PROJECTNAME).java`
check: all
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \
PACKAGEDIR='$(PACKAGEDIR)' INTERFACEDIR='$(INTERFACEDIR)' android_clean

View file

@ -2,6 +2,7 @@ TOP = ../..
SWIG = $(TOP)/../preinst-swig
TARGET = example
INTERFACE = example.i
INTERFACEDIR = jni/
PACKAGEDIR = src/org/swig
PACKAGENAME= org.swig.extendexample
SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/extendexample
@ -9,22 +10,17 @@ PROJECTNAME= SwigExtend
TARGETID = 1
#INSTALLOPTIONS = -s # To install on SD Card
all:: android
check: build
android::
android update project --target $(TARGETID) --name $(PROJECTNAME) --path .
$(SWIG) -c++ -java $(SWIGOPT) -o jni/$(TARGET)_wrap.cpp jni/$(INTERFACE)
ndk-build
ant debug
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' INTERFACEDIR='$(INTERFACEDIR)' \
PROJECTNAME='$(PROJECTNAME)' TARGETID='$(TARGETID)' android_cpp
install::
-adb uninstall $(PACKAGENAME)
adb install $(INSTALLOPTIONS) bin/$(PROJECTNAME)-debug.apk
install:
$(MAKE) -f $(TOP)/Makefile INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \
PACKAGEDIR='$(PACKAGEDIR)' PACKAGENAME='$(PACKAGENAME)' android_install
clean::
ant clean
rm -f jni/$(TARGET)_wrap.cpp
rm -f `find $(PACKAGEDIR) -name \*.java | grep -v $(PROJECTNAME).java`
check: all
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \
PACKAGEDIR='$(PACKAGEDIR)' INTERFACEDIR='$(INTERFACEDIR)' android_clean

View file

@ -96,7 +96,7 @@ public class SwigExtend extends Activity
// methods of all these instances are treated the same. For items 0, 1, and
// 2, all methods resolve in C++. For item 3, our CEO, getTitle calls
// getPosition which resolves in Java. The call to getPosition is
// slightly different, however, because of the overidden getPosition() call, since
// slightly different, however, because of the overridden getPosition() call, since
// now the object reference has been "laundered" by passing through
// EmployeeList as an Employee*. Previously, Java resolved the call
// immediately in CEO, but now Java thinks the object is an instance of

View file

@ -2,6 +2,7 @@ TOP = ../..
SWIG = $(TOP)/../preinst-swig
TARGET = example
INTERFACE = example.i
INTERFACEDIR = jni/
PACKAGEDIR = src/org/swig
PACKAGENAME= org.swig.simple
SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/simple
@ -9,22 +10,17 @@ PROJECTNAME= SwigSimple
TARGETID = 1
#INSTALLOPTIONS = -s # To install on SD Card
all:: android
check: build
android::
android update project --target $(TARGETID) --name $(PROJECTNAME) --path .
$(SWIG) -java $(SWIGOPT) -o jni/$(TARGET)_wrap.c jni/$(INTERFACE)
ndk-build
ant debug
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' INTERFACEDIR='$(INTERFACEDIR)' \
PROJECTNAME='$(PROJECTNAME)' TARGETID='$(TARGETID)' android
install::
-adb uninstall $(PACKAGENAME)
adb install $(INSTALLOPTIONS) bin/$(PROJECTNAME)-debug.apk
install:
$(MAKE) -f $(TOP)/Makefile INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \
PACKAGEDIR='$(PACKAGEDIR)' PACKAGENAME='$(PACKAGENAME)' android_install
clean::
ant clean
rm -f jni/$(TARGET)_wrap.c
rm -f `find $(PACKAGEDIR) -name \*.java | grep -v $(PROJECTNAME).java`
check: all
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \
PACKAGEDIR='$(PACKAGEDIR)' INTERFACEDIR='$(INTERFACEDIR)' android_clean

View file

@ -10,29 +10,29 @@ CFLAGS =
VARIANT =
# uncomment the following lines to build a static exe (only pick one of the CHICKEN_MAIN lines)
#CHICKEN_MAIN = test-lowlevel-class.scm
#CHICKEN_MAIN = test-tinyclos-class.scm
#CHICKEN_MAIN = runme-lowlevel.scm
#CHICKEN_MAIN = runme-tinyclos.scm
#VARIANT = _static
all:: $(TARGET) $(TARGET)_proxy
check: build
$(MAKE) -f $(TOP)/Makefile CHICKEN_SCRIPT='runme-lowlevel.scm' chicken_run
$(MAKE) -f $(TOP)/Makefile CHICKEN_SCRIPT='runme-tinyclos.scm' chicken_run
build: $(TARGET) $(TARGET)_proxy
$(TARGET): $(INTERFACE) $(SRCS)
$(MAKE) -f $(TOP)/Makefile \
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp
$(TARGET)_proxy: $(INTERFACE) $(SRCS)
$(MAKE) -f $(TOP)/Makefile \
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT) -proxy' TARGET='$(TARGET)_proxy' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT) -proxy' TARGET='$(TARGET)_proxy' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp
clean::
clean:
$(MAKE) -f $(TOP)/Makefile chicken_clean
rm -f example.scm
rm -f $(TARGET)
check::
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH csi test-lowlevel-class.scm
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH csi test-tinyclos-class.scm

View file

@ -10,21 +10,21 @@ CFLAGS =
VARIANT =
# uncomment the following two lines to build a static exe
#CHICKEN_MAIN = test-constants.scm
#CHICKEN_MAIN = runme.scm
#VARIANT = _static
all:: $(TARGET)
check: build
$(MAKE) -f $(TOP)/Makefile chicken_run
build: $(TARGET)
$(TARGET): $(INTERFACE) $(SRCS)
$(MAKE) -f $(TOP)/Makefile \
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)
clean::
clean:
$(MAKE) -f $(TOP)/Makefile chicken_clean
rm -f example.scm
rm -f $(TARGET)
check::
csi test-constants.scm

View file

@ -1,6 +1,9 @@
SWIG = ../../../preinst-swig
all: single multi
check: build
cd eggs/install && csi ../../test.scm
build: single multi
# This creates an egg which contains only the single module. Any additional implementation files
# that implement the interface being wrapped should also be added to this egg
@ -9,7 +12,7 @@ single: single_wrap.cxx
tar czf eggs/single.egg single.setup single.scm single_wrap.cxx
rm -f single.scm single_wrap.cxx
# complie the single module with -nounit
# compile the single module with -nounit
single_wrap.cxx: single.i
$(SWIG) -chicken -c++ -proxy -nounit single.i
@ -34,6 +37,3 @@ setup:
mkdir -p install && \
chicken-setup -repository `pwd`/install single.egg && \
chicken-setup -repository `pwd`/install multi.egg
check:
cd eggs/install && csi ../../test.scm

View file

@ -10,21 +10,21 @@ CFLAGS =
VARIANT =
# uncomment the following two lines to build a static exe
#CHICKEN_MAIN = test-multimap.scm
#CHICKEN_MAIN = runme.scm
#VARIANT = _static
all:: $(TARGET)
check: build
$(MAKE) -f $(TOP)/Makefile chicken_run
build: $(TARGET)
$(TARGET): $(INTERFACE) $(SRCS)
$(MAKE) -f $(TOP)/Makefile \
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)
clean::
clean:
$(MAKE) -f $(TOP)/Makefile chicken_clean
rm -f example.scm
rm -f $(TARGET)
check::
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH csi test-multimap.scm

View file

@ -1,4 +1,3 @@
;; run with './multimap test-multimap.scm'
;; feel free to uncomment and comment sections
(load-library 'example "multimap.so")

View file

@ -10,21 +10,21 @@ CFLAGS =
VARIANT =
# uncomment the following lines to build a static exe
#CHICKEN_MAIN = test-overload.scm
#CHICKEN_MAIN = runme.scm
#VARIANT = _static
all:: $(TARGET)
check: build
$(MAKE) -f $(TOP)/Makefile chicken_run
build: $(TARGET)
$(TARGET): $(INTERFACE) $(SRCS)
$(MAKE) -f $(TOP)/Makefile \
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp
clean::
clean:
$(MAKE) -f $(TOP)/Makefile chicken_clean
rm -f example.scm
rm -f $(TARGET)
check::
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH csi test-overload.scm

View file

@ -10,21 +10,21 @@ CFLAGS =
VARIANT =
# uncomment the following two lines to build a static exe
#CHICKEN_MAIN = test-simple.scm
#CHICKEN_MAIN = runme.scm
#VARIANT = _static
all:: $(TARGET)
check: build
$(MAKE) -f $(TOP)/Makefile chicken_run
build: $(TARGET)
$(TARGET): $(INTERFACE) $(SRCS)
$(MAKE) -f $(TOP)/Makefile \
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)
SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \
INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \
SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)
clean::
clean:
$(MAKE) -f $(TOP)/Makefile chicken_clean
rm -f example.scm example-generic.scm example-clos.scm
rm -f $(TARGET)
check::
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH csi test-simple.scm

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -unsafe -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -debug -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -45,7 +45,7 @@ public class runme
// methods of all these instances are treated the same. For items 0, 1, and
// 2, all methods resolve in C++. For item 3, our CEO, getTitle calls
// getPosition which resolves in C#. The call to getPosition is
// slightly different, however, because of the overidden getPosition() call, since
// slightly different, however, because of the overridden getPosition() call, since
// now the object reference has been "laundered" by passing through
// EmployeeList as an Employee*. Previously, C# resolved the call
// immediately in CEO, but now C# thinks the object is an instance of

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -7,14 +7,13 @@ SWIGOPT =
CSHARPSRCS = *.cs
CSHARPFLAGS= -nologo -out:runme.exe
all:: csharp
check: build
$(MAKE) -f $(TOP)/Makefile csharp_run
csharp::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp
$(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile csharp_clean
check: all

View file

@ -13,18 +13,15 @@ SWIGOPT =
DSRCS = *.d
DFLAGS = -ofrunme
check: build
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run
all:: d
d::
build:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \
$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean::
clean:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_clean
check: all
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run

View file

@ -13,18 +13,15 @@ SWIGOPT =
DSRCS = *.d
DFLAGS = -ofrunme
check: build
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run
all:: d
d::
build:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \
$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean::
clean:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_clean
check: all
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run

View file

@ -13,18 +13,15 @@ SWIGOPT =
DSRCS = *.d
DFLAGS = -ofrunme
check: build
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run
all:: d
d::
build:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean::
clean:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_clean
check: all
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run

View file

@ -13,18 +13,15 @@ SWIGOPT =
DSRCS = *.d
DFLAGS = -ofrunme
check: build
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run
all:: d
d::
build:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \
$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean::
clean:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_clean
check: all
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run

View file

@ -13,18 +13,15 @@ SWIGOPT =
DSRCS = *.d
DFLAGS = -ofrunme
check: build
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run
all:: d
d::
build:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \
$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean::
clean:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_clean
check: all
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run

View file

@ -46,7 +46,7 @@ void main() {
// methods of all these instances are treated the same. For items 0, 1, and
// 2, all methods resolve in C++. For item 3, our CEO, getTitle calls
// getPosition which resolves in D. The call to getPosition is
// slightly different, however, because of the overidden getPosition() call, since
// slightly different, however, because of the overridden getPosition() call, since
// now the object reference has been "laundered" by passing through
// EmployeeList as an Employee*. Previously, D resolved the call
// immediately in CEO, but now D thinks the object is an instance of

View file

@ -46,7 +46,7 @@ void main() {
// methods of all these instances are treated the same. For items 0, 1, and
// 2, all methods resolve in C++. For item 3, our CEO, getTitle calls
// getPosition which resolves in D. The call to getPosition is
// slightly different, however, because of the overidden getPosition() call, since
// slightly different, however, because of the overridden getPosition() call, since
// now the object reference has been "laundered" by passing through
// EmployeeList as an Employee*. Previously, D resolved the call
// immediately in CEO, but now D thinks the object is an instance of

View file

@ -13,18 +13,15 @@ SWIGOPT =
DSRCS = *.d
DFLAGS = -ofrunme
check: build
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run
all:: d
d::
build:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean::
clean:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_clean
check: all
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run

View file

@ -13,18 +13,15 @@ SWIGOPT =
DSRCS = *.d
DFLAGS = -ofrunme
check: build
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run
all:: d
d::
build:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean::
clean:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_clean
check: all
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run

View file

@ -13,18 +13,15 @@ SWIGOPT =
DSRCS = *.d
DFLAGS = -ofrunme
check: build
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run
all:: d
d::
build:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean::
clean:
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_clean
check: all
cd $(WORKING_DIR); \
$(MAKE) -f $(TOP)/Makefile d_run

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -1,8 +1,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
func main() {

View file

@ -5,12 +5,12 @@ TARGET = example
INTERFACE = example.i
LIBS = -lm
all::
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -3,8 +3,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
func main() {

View file

@ -5,12 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -1,8 +1,8 @@
package main
import (
"fmt"
"./example"
"fmt"
)
func main() {

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -1,8 +1,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
func main() {

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -3,8 +3,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
type CEO struct{}
@ -42,7 +42,7 @@ func main() {
// treated the same. For items 0, 1, and 2, all methods
// resolve in C++. For item 3, our CEO, GetTitle calls
// GetPosition which resolves in Go. The call to GetPosition
// is slightly different, however, because of the overidden
// is slightly different, however, because of the overridden
// GetPosition() call, since now the object reference has been
// "laundered" by passing through EmployeeList as an
// Employee*. Previously, Go resolved the call immediately in

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -1,8 +1,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
func main() {

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -1,8 +1,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
func main() {

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -1,8 +1,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
func main() {

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -3,8 +3,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
func main() {

View file

@ -4,12 +4,12 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
all::
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -1,8 +1,8 @@
package main
import (
"fmt"
"./example"
"fmt"
)
func main() {

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -3,8 +3,8 @@
package main
import (
"fmt"
. "./example"
"fmt"
)
func main() {

View file

@ -5,14 +5,12 @@ TARGET = example
INTERFACE = example.i
SWIGOPT =
all:: go
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
go::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go
clean::
$(MAKE) -f $(TOP)/Makefile go_clean
check: all
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run
clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean

View file

@ -3,8 +3,8 @@
package main
import (
"fmt"
"./example"
"fmt"
)
func main() {

View file

@ -1,40 +0,0 @@
# Makefile for Guile. Used by all of the example programs.
subdirs = simple matrix port constants multimap multivalue
top_srcdir = @top_srcdir@
SWIG = ../$(top_srcdir)/preinst-swig
CC = @CC@
CXX = @CXX@
CFLAGS = @PLATCFLAGS@
GUILEINCLUDE = @GUILEINCLUDE@
GUILELINK = @GUILELINK@
SWIGOPT =
WRAP = $(IFILE:.i=_wrap.c)
CXXWRAP = $(IFILE:.i=_wrap.cxx)
SO = @SO@
all:
for d in $(subdirs) ; do (cd $$d ; $(MAKE)) ; done
clean::
for d in $(subdirs) ; do (cd $$d ; $(MAKE) clean) ; done
rm -f *~ .~*
guile_clean:
rm -f *.@OBJEXT@ *$(SO) *_wrap* *~ .~* core my-guile $(TARGET)
# This is meant to be used w/ "make -f ../Makefile" from subdirs.
# Doesn't make sense to use it from here.
sub-all::
$(SWIG) -guile $(SWIGOPT) $(IFILE)
$(CC) $(CFLAGS) -o $(TARGET) $(SRCS) $(WRAP) $(GUILEINCLUDE) $(GUILELINK)
sub-all-cxx::
$(SWIG) -c++ -guile $(SWIGOPT) $(IFILE)
$(CXX) $(CFLAGS) -o $(TARGET) $(SRCS) $(CXXWRAP) $(GUILEINCLUDE) $(GUILELINK)
# Makefile ends here

View file

@ -1,6 +1,7 @@
This directory contains examples for Guile.
constants -- handling #define and %constant literals
class -- classic c++ class example
matrix -- a very simple Matrix example
multimap -- typemaps with multiple sub-types
multivalue -- using the %values_as_list directive

View file

@ -1,6 +1,9 @@
# see top-level Makefile.in
constants
simple
class
port
simple
std_vector
matrix
multimap
multivalue

View file

@ -0,0 +1,19 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile guile_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_cpp
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static_cpp
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean

View file

@ -0,0 +1,28 @@
/* File : example.c */
#include "example.h"
#define M_PI 3.14159265358979323846
/* Move the shape to a new location */
void Shape::move(double dx, double dy) {
x += dx;
y += dy;
}
int Shape::nshapes = 0;
double Circle::area(void) {
return M_PI*radius*radius;
}
double Circle::perimeter(void) {
return 2*M_PI*radius;
}
double Square::area(void) {
return width*width;
}
double Square::perimeter(void) {
return 4*width;
}

View file

@ -0,0 +1,34 @@
/* File : example.h */
class Shape {
public:
Shape() {
nshapes++;
}
virtual ~Shape() {
nshapes--;
};
double x, y;
void move(double dx, double dy);
virtual double area(void) = 0;
virtual double perimeter(void) = 0;
static int nshapes;
};
class Circle : public Shape {
private:
double radius;
public:
Circle(double r) : radius(r) { };
virtual double area(void);
virtual double perimeter(void);
};
class Square : public Shape {
private:
double width;
public:
Square(double w) : width(w) { };
virtual double area(void);
virtual double perimeter(void);
};

View file

@ -0,0 +1,9 @@
/* File : example.i */
%module example
%{
#include "example.h"
%}
/* Let's just grab the original header file here */
%include "example.h"

View file

@ -0,0 +1,60 @@
; file: runme.scm
; This file illustrates the proxy class C++ interface generated
; by SWIG.
(load-extension "./libexample" "scm_init_example_module")
; Convenience wrapper around the display function
; (which only accepts one argument at the time)
(define (mdisplay-newline . args)
(for-each display args)
(newline))
; ----- Object creation -----
(mdisplay-newline "Creating some objects:")
(define c (new-Circle 10))
(mdisplay-newline " Created circle " c)
(define s (new-Square 10))
(mdisplay-newline " Created square " s)
; ----- Access a static member -----
(mdisplay-newline "\nA total of " (Shape-nshapes) " shapes were created")
; ----- Member data access -----
; Set the location of the object
(Shape-x-set c 20)
(Shape-y-set c 30)
(Shape-x-set s -10)
(Shape-y-set s 5)
(mdisplay-newline "\nHere is their current position:")
(mdisplay-newline " Circle = (" (Shape-x-get c) "," (Shape-y-get c) ")")
(mdisplay-newline " Square = (" (Shape-x-get s) "," (Shape-y-get s) ")")
; ----- Call some methods -----
(mdisplay-newline "\nHere are some properties of the shapes:")
(define (shape-props o)
(mdisplay-newline " " o)
(mdisplay-newline " area = " (Shape-area o))
(mdisplay-newline " perimeter = " (Shape-perimeter o)))
(for-each shape-props (list c s))
(mdisplay-newline "\nGuess I'll clean up now")
; Note: this invokes the virtual destructor
(delete-Shape c)
(delete-Shape s)
(define s 3)
(mdisplay-newline (Shape-nshapes) " shapes remain")
(mdisplay-newline "Goodbye")
(exit 0)

View file

@ -1,17 +1,15 @@
SRCS =
TARGET = my-guile
IFILE = example.i
MKDIR = ..
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS =
TARGET = my-guile
INTERFACE = example.i
all::
$(MAKE) -f $(MKDIR)/Makefile \
SRCS='$(SRCS)' \
TARGET=$(TARGET) \
IFILE=$(IFILE) \
sub-all
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_augmented_run
clean::
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_augmented
check: all
./my-guile -s constants.scm
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean

View file

@ -1,10 +0,0 @@
(or (= (ICONST) 42) (exit 1))
(or (< (abs (- (FCONST) 2.1828)) 0.00001) (exit 1))
(or (char=? (CCONST) #\x) (exit 1))
(or (char=? (CCONST2) #\newline) (exit 1))
(or (string=? (SCONST) "Hello World") (exit 1))
(or (string=? (SCONST2) "\"Hello World\"") (exit 1))
(or (< (abs (- (EXPR) (+ (ICONST) (* 3 (FCONST))))) 0.00001) (exit 1))
(or (= (iconst) 37) (exit 1))
(or (< (abs (- (fconst) 3.14)) 0.00001) (exit 1))
(exit 0)

View file

@ -0,0 +1,19 @@
(or (= (ICONST) 42) (exit 1))
(display "ICONST = ")(display (ICONST))(display " (should be 42)\n")
(or (< (abs (- (FCONST) 2.1828)) 0.00001) (exit 1))
(display "FCONST = ")(display (FCONST))(display " (should be 2.1828)\n")
(or (char=? (CCONST) #\x) (exit 1))
(display "CCONST = ")(display (CCONST))(display " (should be 'x')\n")
(or (char=? (CCONST2) #\newline) (exit 1))
(display "CCONST2 = ")(display (CCONST2))(display " (this should be on a new line)\n")
(or (string=? (SCONST) "Hello World") (exit 1))
(display "SCONST = ")(display (SCONST))(display " (should be 'Hello World')\n")
(or (string=? (SCONST2) "\"Hello World\"") (exit 1))
(display "SCONST2 = ")(display (SCONST2))(display " (should be \"Hello World\")\n")
(or (< (abs (- (EXPR) (+ (ICONST) (* 3 (FCONST))))) 0.00001) (exit 1))
(display "EXPR = ")(display (abs (- (EXPR) (+ (ICONST) (* 3 (FCONST))))))(display " (should round to 0.0)\n")
(or (= (iconst) 37) (exit 1))
(display "iconst = ")(display (iconst))(display " (should be 37)\n")
(or (< (abs (- (fconst) 3.14)) 0.00001) (exit 1))
(display "fconst = ")(display (fconst))(display " (should be 3.14)\n")
(exit 0)

View file

@ -1,18 +1,15 @@
SRCS = matrix.c vector.c
TARGET = matrix
IFILE = package.i
MKDIR = ..
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = matrix.c vector.c
TARGET = matrix
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' GUILE_RUNOPTIONS='-e do-test' guile_augmented_run
all::
$(MAKE) -f $(MKDIR)/Makefile \
SRCS='$(SRCS)' \
TARGET=$(TARGET) \
IFILE=$(IFILE) \
MODULE=$(MODULE) \
sub-all
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' LIBS='-lm' guile_augmented
clean::
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
check: all
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean

View file

@ -1,13 +1,13 @@
Matrix example. To run the example, execute the program 'matrix' and
type the following :
(load "matrix.scm")
(load "runme.scm")
(do-test 0)
Alternatively, use the command-line:
./matrix -e do-test -s matrix.scm
./matrix -e do-test -s runme.scm
Or, if your operating system is spiffy enough:
./matrix.scm
./runme.scm

View file

@ -1,7 +1,4 @@
// FILE : package.i
// See the SWIG users manual
/*** Matrix and vector package ***/
/*** Matrix and vector example ***/
%module Matrix
%{

View file

@ -1,24 +0,0 @@
#include <tcl.h>
extern int matrix_init(Tcl_Interp *); /* Init function from matrix.i */
int main() {
int code;
char input[1024];
Tcl_Interp *interp;
interp = Tcl_CreateInterp();
/* Initialize the wrappers */
if (matrix_init(interp) == TCL_ERROR)
exit(0);
fprintf(stdout,"matrix > ");
while(fgets(input, 1024, stdin) != NULL) {
code = Tcl_Eval(interp, input);
fprintf(stdout,"%s\n",interp->result);
fprintf(stdout,"matrix > ");
}
}

View file

@ -138,24 +138,28 @@
(set-m m1 i j (+ (get-m m1 i j) (get-m m2 i j)))
(add-two m1 m2 i (+ j 1)))
(add-two m1 m2 (+ i 1) 0))))
(if (null? ML) () (begin
(add-two M (car ML) 0 0)
(add-mat M (cdr ML)))))
(if (null? ML) *unspecified*
(begin
(add-two M (car ML) 0 0)
(add-mat M (cdr ML)))))
(define (cleanup ML)
(if (null? ML) () (begin
(destroy-matrix (car ML))
(cleanup (cdr ML)))))
(if (null? ML) *unspecified*
(begin
(destroy-matrix (car ML))
(cleanup (cdr ML)))))
(define (make-random ML) ; Put random values in them
(if (null? ML) () (begin
(randmat (car ML))
(make-random (cdr ML)))))
(if (null? ML) *unspecified*
(begin
(randmat (car ML))
(make-random (cdr ML)))))
(define (mul-mat m ML)
(if (null? ML) () (begin
(mat-mult m (car ML) m)
(mul-mat m (cdr ML)))))
(if (null? ML) *unspecified*
(begin
(mat-mult m (car ML) m)
(mul-mat m (cdr ML)))))
;;; Now we'll hammer on things a little bit just to make
;;; sure everything works.
@ -207,4 +211,3 @@
(cleanup M-list))
;;; matrix.scm ends here

View file

@ -4,15 +4,16 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
all::
check: build
$(MAKE) -f $(TOP)/Makefile guile_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean
check: all

View file

@ -15,43 +15,54 @@ extern int squareCubed (int n, int *OUTPUT);
extern int gcd(int x, int y);
%typemap(in) (int argc, char *argv[]) {
int i;
SCM *v;
if (!(SCM_NIMP($input) && SCM_VECTORP($input))) {
%typemap(in) (int argc, char *argv[]) %{
scm_t_array_handle handle;
size_t i;
size_t lenp;
ssize_t inc;
const SCM *v;
if (!(SCM_NIMP($input) && scm_is_vector($input))) {
SWIG_exception(SWIG_ValueError, "Expecting a vector");
return 0;
}
$1 = SCM_LENGTH($input);
v = scm_vector_elements($input, &handle, &lenp, &inc);
$1 = (int)lenp;
if ($1 == 0) {
SWIG_exception(SWIG_ValueError, "Vector must contain at least 1 element");
}
$2 = (char **) malloc(($1+1)*sizeof(char *));
v = SCM_VELTS($input);
for (i = 0; i < $1; i++) {
if (!(SCM_NIMP(v[i]) && SCM_STRINGP(v[i]))) {
free($2);
for (i = 0; i < $1; i++, v +=inc ) {
if (!(SCM_NIMP(*v) && scm_is_string(*v))) {
free($2);
SWIG_exception(SWIG_ValueError, "Vector items must be strings");
return 0;
}
$2[i] = SCM_CHARS(v[i]);
$2[i] = scm_to_locale_string(*v);
}
$2[i] = 0;
}
scm_array_handle_release (&handle);
%}
%typemap(freearg) (int argc, char *argv[]) {
free($2);
}
%typemap(freearg) (int argc, char *argv[]) %{
for (i = 0; i < $1; i++) {
free($2[i]);
}
free($2);
%}
extern int gcdmain(int argc, char *argv[]);
%typemap(in) (char *bytes, int len) {
if (!(SCM_NIMP($input) && SCM_STRINGP($input))) {
%typemap(in) (char *bytes, int len) %{
if (!(SCM_NIMP($input) && scm_is_string($input))) {
SWIG_exception(SWIG_ValueError, "Expecting a string");
}
$1 = SCM_CHARS($input);
$2 = SCM_LENGTH($input);
}
$1 = scm_to_locale_string($input);
$2 = scm_c_string_length($input);
%}
%typemap(freearg) (char *bytes, int len) %{
free($1);
%}
extern int count(char *bytes, int len, char c);
@ -59,15 +70,15 @@ extern int count(char *bytes, int len, char c);
%typemap(in) (char *str, int len) {
size_t temp;
$1 = gh_scm2newstr($input,&temp);
$1 = SWIG_Guile_scm2newstr($input,&temp);
$2 = temp;
}
/* Return the mutated string as a new object. */
%typemap(argout) (char *str, int len) {
SWIG_APPEND_VALUE(gh_str2scm($1,$2));
if ($1) scm_must_free($1);
SWIG_APPEND_VALUE(scm_from_locale_stringn($1,$2));
if ($1) SWIG_free($1);
}
extern void capitalize(char *str, int len);
@ -78,7 +89,7 @@ extern void capitalize(char *str, int len);
%typemap(check) (double cx, double cy) {
double a = $1*$1 + $2*$2;
if (a > 1.0) {
SWIG_exception(SWIG_ValueError,"$1_name and $2_name must be in unit circle");
SWIG_exception(SWIG_ValueError,"$1_name and $2_name must be in unit circle");
}
}

View file

@ -1,6 +1,6 @@
;;; Test out some multi-argument typemaps
(use-modules (example))
(load-extension "./libexample" "scm_init_example_module")
; Call the GCD function
@ -27,4 +27,4 @@
(display (capitalize "hello world"))
(newline)
(exit 0)

View file

@ -4,15 +4,16 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
all::
check: build
$(MAKE) -f $(TOP)/Makefile guile_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean
check: all

View file

@ -1,6 +1,6 @@
;;;; Show the three different ways to deal with multiple return values
(use-modules (example))
(load-extension "./libexample" "scm_init_example_module")
;;; Multiple values as lists. By default, if more than one value is to
;;; be returned, a list of the values is created and returned. The
@ -64,3 +64,4 @@
(display remainder)
(newline))
(exit 0)

View file

@ -1,18 +1,16 @@
SRCS = port.c
TARGET = port
IFILE = port.i
MKDIR = ..
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = port
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_augmented_run
all::
$(MAKE) -f $(MKDIR)/Makefile \
SRCS='$(SRCS)' \
TARGET=$(TARGET) \
IFILE=$(IFILE) \
MODULE=$(MODULE) \
sub-all
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_augmented
clean::
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
check: all
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean
rm -f test.out

View file

@ -1,2 +1,2 @@
This example illustrates the translation from Scheme file ports to
temporary FILE streams. Read the source and run ./port -s port.scm
temporary FILE streams. Read the source and run ./port -s runme.scm

View file

@ -21,12 +21,15 @@
(lambda ()
(print-int (current-output-port) 314159))))
(lambda args
(display "Below shows that attempting to write to a string or soft port will result in a wrong-type-error...")
(newline)
(write args) (newline)))
;; Read from a file port. Note that it is a bad idea to mix Scheme and
;; C input because of buffering.
;; C input because of buffering, hence the call to seek to rewind the file.
(with-input-from-file "test.out"
(lambda ()
(seek (current-input-port) 0 SEEK_SET)
(display (read-int (current-input-port)))
(newline)))

View file

@ -1,19 +1,15 @@
SRCS = example.c
TARGET = my-guile
IFILE = example.i
MKDIR = ..
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = my-guile
INTERFACE = example.i
all: $(TARGET)
check: build
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_augmented_run
$(TARGET):
$(MAKE) -f $(MKDIR)/Makefile \
SRCS='$(SRCS)' \
TARGET=$(TARGET) \
IFILE=$(IFILE) \
sub-all
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_augmented
clean::
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
check: $(TARGET)
./$(TARGET) -s example.scm > /dev/null
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean

View file

@ -2,8 +2,8 @@ A very simple example.
To run it, start the program 'my-guile' and type:
(load "example.scm")
(load "runme.scm")
Alternatively, you can use the shell command:
./my-guile -s example.scm
./my-guile -s runme.scm

View file

@ -1,4 +1,3 @@
;;; example.scm
(define (mdisplay-newline . args) ; does guile-1.3.4 have `format #t'?
(for-each display args)
@ -25,4 +24,3 @@
(exit (and (= 1932053504 (fact 13))
(= 745470.0 (My-variable))))
;;; example.scm ends here

View file

@ -1,18 +1,19 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS =
CXXSRCS =
TARGET = example
INTERFACE = example.i
all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
check: build
$(MAKE) -f $(TOP)/Makefile guile_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_cpp
static::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static_cpp
clean::
clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean
check: all

View file

@ -1,6 +1,5 @@
;; run with mzscheme -r example.scm
(use-modules (example))
(load-extension "./libexample" "scm_init_example_module")
; repeatedly invoke a procedure with v and an index as arguments
(define (with-vector v proc size-proc)
@ -52,3 +51,4 @@
(print-DoubleVector v)
(delete-DoubleVector v)
(exit 0)

View file

@ -4,15 +4,15 @@ CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
SWIGOPT =
JAVASRCS = *.java
all:: java
check: build
$(MAKE) -f $(TOP)/Makefile java_run
java::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp
javac *.java
$(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile java_clean
check: all

View file

@ -4,15 +4,15 @@ CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
SWIGOPT =
JAVASRCS = *.java
all:: java
check: build
$(MAKE) -f $(TOP)/Makefile java_run
java::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp
javac *.java
$(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile java_clean
check: all

View file

@ -4,15 +4,15 @@ CXXSRCS =
TARGET = example
INTERFACE = example.i
SWIGOPT =
JAVASRCS = *.java
all:: java
check: build
$(MAKE) -f $(TOP)/Makefile java_run
java::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp
javac *.java
$(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile java_clean
check: all

View file

@ -4,15 +4,15 @@ CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
SWIGOPT =
JAVASRCS = *.java
all:: java
check: build
$(MAKE) -f $(TOP)/Makefile java_run
java::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp
javac *.java
$(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile java_clean
check: all

View file

@ -4,15 +4,15 @@ CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
SWIGOPT =
JAVASRCS = *.java
all:: java
check: build
$(MAKE) -f $(TOP)/Makefile java_run
java::
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp
javac *.java
$(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile java_clean
check: all

View file

@ -55,7 +55,7 @@ public class runme {
// methods of all these instances are treated the same. For items 0, 1, and
// 2, all methods resolve in C++. For item 3, our CEO, getTitle calls
// getPosition which resolves in Java. The call to getPosition is
// slightly different, however, because of the overidden getPosition() call, since
// slightly different, however, because of the overridden getPosition() call, since
// now the object reference has been "laundered" by passing through
// EmployeeList as an Employee*. Previously, Java resolved the call
// immediately in CEO, but now Java thinks the object is an instance of

View file

@ -4,15 +4,15 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
SWIGOPT =
JAVASRCS = *.java
all:: java
check: build
$(MAKE) -f $(TOP)/Makefile java_run
java::
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java
javac *.java
$(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile
clean::
clean:
$(MAKE) -f $(TOP)/Makefile java_clean
check: all

Some files were not shown because too many files have changed in this diff Show more