Fix {python|perl5|ruby|tcl}/java examples

- in Lib/gcj/cni.i: remove JvAllocObject(), change
  JvCreateJavaVM() argument from void* to JvVMInitArgs*
- in Examples/{python|perl5|ruby|tcl}/java/Makefile:
  pass full class name to gcjh, add Example.h as dependency,
  do not override CXX for compiling C++ sources
- in Examples/python/java/example.i:
  add destructor to class to prevent memory loss complaint
This commit is contained in:
Karl Wette 2014-04-24 21:25:40 +02:00
commit b6c1889c08
9 changed files with 43 additions and 26 deletions

View file

@ -8,6 +8,24 @@ Version 3.0.1 (in progress)
2014-05-01: olly
[PHP] The generated __isset() method now returns true for read-only properties.
2014-04-24: kwwette
Fix {python|perl5|ruby|tcl}/java examples
In Lib/gcj/cni.i, for compatibility with newer gcj versions:
- remove JvAllocObject() which gcj no longer defines, from gcj Changelog:
2004-04-16 Bryce McKinlay <mckinlay@redhat.com>
* gcj/cni.h (JvAllocObject): Remove these obsolete,
undocumented CNI calls.
- change JvCreateJavaVM() argument from void* to JvVMInitArgs*, from gcj Changelog:
2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com>
PR libgcj/16923
...
(JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than void*.
*** POTENTIAL INCOMPATIBILITY ***
2014-04-08: wsfulton
SF Bug #1366 - Remove duplicate declarations of strtoimax and strtoumax in inttypes.i

View file

@ -6,6 +6,7 @@ constants2
extend
funcptr
import
java
multimap
multiple_inheritance
pointer

View file

@ -8,15 +8,15 @@ LIBS = -lm
check: build
$(MAKE) -f $(TOP)/Makefile perl5_run
build: Example.class
build: Example.class Example.h
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' CXX="gcj" \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
CXXSHARED="gcj -fpic -shared Example.class" PERL5_CCFLAGS='' PERL5_EXP='' LIBS="-lstdc++" perl5_cpp
clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
rm -f *.class Example.h
Example.class: Example.java
Example.class Example.h: Example.java
gcj -fPIC -C -c -g Example.java
gcjh Example
gcjh Example.class

View file

@ -6,10 +6,11 @@ INTERFACE = example.i
LIBS = -lm
check: build
$(MAKE) -f $(TOP)/Makefile python_run
build: Example.class
build: Example.class Example.h
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' CXX="gcj" \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
CXXSHARED="gcj -fpic -shared Example.class" DEFS='' LIBS="-lstdc++" python_cpp
clean:
@ -17,6 +18,6 @@ clean:
rm -f $(TARGET).py
rm -f *.class Example.h
Example.class: Example.java
Example.class Example.h: Example.java
gcj -fPIC -C -c -g Example.java
gcjh Example
gcjh Example.class

View file

@ -7,3 +7,7 @@
%include Example.h
%extend Example {
~Example() {}
}

View file

@ -8,15 +8,15 @@ LIBS = -lm
check: build
$(MAKE) -f $(TOP)/Makefile ruby_run
build: Example.class
build: Example.class Example.h
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' CXX="gcj" \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
CXXSHARED="gcj -fpic -shared Example.class" LIBS="-lstdc++" DEFS='' ruby_cpp
clean:
$(MAKE) -f $(TOP)/Makefile ruby_clean
rm -f *.class Example.h
Example.class: Example.java
Example.class Example.h: Example.java
gcj -fPIC -C -c -g Example.java
gcjh Example
gcjh Example.class

View file

@ -8,18 +8,15 @@ LIBS = -lm
check: build
$(MAKE) -f $(TOP)/Makefile tcl_run
build: Example.class
build: Example.class Example.h
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' CXX="gcj" \
TCL_CXXSHARED="gcj -fpic -shared Example.class " LIBS="-lstdc++" DEFS='' tcl_cpp
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
TCLCXXSHARED="gcj -fpic -shared Example.class " LIBS="-lstdc++" DEFS='' tcl_cpp
clean:
$(MAKE) -f $(TOP)/Makefile tcl_clean
rm -f *.class Example.h
run:
tclsh runme.tcl
Example.class: Example.java
Example.class Example.h: Example.java
gcj -fPIC -C -c -g Example.java
gcjh Example
gcjh Example.class

View file

@ -4,10 +4,6 @@
%include <gcj/javaprims.i>
extern jobject JvAllocObject (jclass cls);
extern jobject JvAllocObject (jclass cls, jsize sz);
extern void JvInitClass (jclass cls);
extern jstring JvAllocString (jsize sz);
@ -30,7 +26,7 @@ extern void *JvMalloc (jsize size);
extern void JvFree (void *ptr);
extern jint JvCreateJavaVM (void* vm_args);
extern jint JvCreateJavaVM (JvVMInitArgs* vm_args);
extern java::lang::Thread* JvAttachCurrentThread (jstring name, java::lang::ThreadGroup* group);

View file

@ -252,7 +252,7 @@ java.actionexample:
echo "skipping Examples/$(LANGUAGE)/java $(ACTION) (gcj test)"; \
else \
echo $(ACTION)ing Examples/$(LANGUAGE)/java; \
(cd Examples/$(LANGUAGE)/java && $(MAKE) $(FLAGS) $(chk-set-env) $(ACTION)) \
(cd Examples/$(LANGUAGE)/java && $(MAKE) $(FLAGS) $(chk-set-env) $(ACTION) RUNPIPE=$(RUNPIPE)) \
fi
# Checks testcases in the test-suite excluding those which are known to be broken