diff options
author | Morgan Deters <mdeters@gmail.com> | 2011-09-20 14:58:30 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2011-09-20 14:58:30 +0000 |
commit | c241cf3bef737a58162868d51a2c773c5af5abbf (patch) | |
tree | 741fac2402e78a85bdc42e3b47ee23d7c10db9f8 /src/bindings | |
parent | f1c1cc7c3de0d4a5f310357a249cef82f73c588c (diff) |
Merge from "swig" branch: language binding for Java is compiling and linking. Enable with --enable-language-bindings=java
Diffstat (limited to 'src/bindings')
-rw-r--r-- | src/bindings/Makefile.am | 47 | ||||
-rw-r--r-- | src/bindings/swig.h | 38 |
2 files changed, 66 insertions, 19 deletions
diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am index cd314f957..7c4d7c5a3 100644 --- a/src/bindings/Makefile.am +++ b/src/bindings/Makefile.am @@ -4,8 +4,10 @@ AM_CPPFLAGS = \ AM_CXXFLAGS = -Wall $(FLAG_VISIBILITY_HIDDEN) lib_LTLIBRARIES = +data_DATA = if CVC4_LANGUAGE_BINDING_JAVA lib_LTLIBRARIES += libcvc4bindings_java.la +data_DATA += cvc4.jar endif # cvc4bindings_csharp.so \ # cvc4bindings_perl.so \ @@ -36,23 +38,30 @@ BUILT_SOURCES = \ CLEANFILES = \ $(BUILT_SOURCES) \ - cvc4.java \ - cvc4.cs \ - cvc4JNI.java \ - cvc4.php \ - cvc4PINVOKE.cs \ - cvc4.pm \ - cvc4.py \ - php_cvc4.h + .swig_deps \ + $(patsubst %,%.d,$(filter-out c c++,$(CVC4_LANGUAGE_BINDINGS))) \ + cvc4.jar -java.lo: java.cpp; $(LTCXXCOMPILE) $(JAVA_INCLUDES) -o $@ $< -java.cpp:: -csharp.cpp:: -perl.cpp:: -php.cpp:: -python.cpp:: -ocaml.cpp:: -ruby.cpp:: -tcl.cpp:: -$(patsubst %,%.cpp,$(filter-out c c++,$(CVC4_LANGUAGE_BINDINGS))):: %.cpp: @srcdir@/../smt/smt_engine.h - $(AM_V_GEN)$(SWIG) -w503 -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/.. -module cvc4 -c++ -$(patsubst %.cpp,%,$@) -o $@ $< +java.lo: java.cpp; $(AM_V_CXX)$(LTCXXCOMPILE) -c $(JAVA_INCLUDES) -o $@ $< +cvc4.jar: java.cpp; $(AM_V_GEN)jar cf $@ -C java . +java.cpp: +csharp.cpp: +perl.cpp: +php.cpp: +python.cpp: +ocaml.cpp: +ruby.cpp: +tcl.cpp: +$(patsubst %,%.cpp,$(filter-out c c++,$(CVC4_LANGUAGE_BINDINGS))): %.cpp: @srcdir@/../cvc4.i + $(AM_V_at)mkdir -p $(patsubst %.cpp,%,$@) + $(AM_V_GEN)$(SWIG) -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/.. -module cvc4 -c++ -$(patsubst %.cpp,%,$@) -outdir $(patsubst %.cpp,%,$@) -package edu.nyu.acsys -o $@ $< + +$(patsubst %,%.d,$(filter-out c c++,$(CVC4_LANGUAGE_BINDINGS))): %.d: @srcdir@/../cvc4.i + $(AM_V_GEN)$(SWIG) -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/.. -module cvc4 -c++ -MM -o $(patsubst %.d,%.cpp,$@) $< +# .PHONY so they get rebuilt each time +.PHONY: .swig_deps $(patsubst %,%.d,$(filter-out c c++,$(CVC4_LANGUAGE_BINDINGS))) +.swig_deps: $(patsubst %,%.d,$(filter-out c c++,$(CVC4_LANGUAGE_BINDINGS))) + $(AM_V_GEN)cat $+ >$@ +@mk_include@ .swig_deps + +clean-local:; rm -fr $(patsubst %.cpp,%,$(filter-out c c++,$(CVC4_LANGUAGE_BINDINGS))) diff --git a/src/bindings/swig.h b/src/bindings/swig.h new file mode 100644 index 000000000..7dec263f6 --- /dev/null +++ b/src/bindings/swig.h @@ -0,0 +1,38 @@ +/********************* */ +/*! \file swig.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) + ** Courant Institute of Mathematical Sciences + ** New York University + ** See the file COPYING in the top-level source directory for licensing + ** information.\endverbatim + ** + ** \brief Common swig checks and definitions + ** + ** Common swig checks and definitions, when generating swig interfaces. + **/ + +#ifndef __CVC4__BINDINGS__SWIG_H +#define __CVC4__BINDINGS__SWIG_H + +#ifndef SWIG +# error This file should only be included when generating swig interfaces. +#endif /* SWIG */ + +#if !defined(SWIG_VERSION) || SWIG_VERSION < 0x020000 +# error CVC4 bindings require swig version 2.0.0 or later, sorry. +#endif /* SWIG_VERSION */ + +%import "cvc4_public.h" +%import "util/tls.h" + +// swig doesn't like the __thread storage class... +#define __thread +// ...or GCC attributes +#define __attribute__(x) + +#endif /* __CVC4__BINDINGS__SWIG_H */ |