bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
-bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS)
+bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS) $(SR_EXTRA_CXX_LIBS)
bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
$(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
$(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
@ORDER@ bindings/cxx/libsigrokcxx.la
- $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) -L.libs -Lbindings/cxx/.libs \
+ $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) $(LDFLAGS) -L.libs -Lbindings/cxx/.libs \
-fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
- -lsigrokcxx $(LIBSIGROKCXX_LIBS) -o $(JLIB)
+ -lsigrokcxx $(LIBSIGROKCXX_LIBS) $(SR_EXTRA_CXX_LIBS) -o $(JLIB)
java-install:
$(INSTALL) -d $(DESTDIR)$(libdir)/jni
SR_PKGLIBS_PYTHON=
SR_PKGLIBS_RUBY=
SR_EXTRA_LIBS=
+SR_EXTRA_CXX_LIBS=
SR_ARG_OPT_PKG([libserialport], [LIBSERIALPORT], [NEED_SERIAL],
[libserialport >= 0.1.1])
AS_IF([test "x$HAVE_DOXYGEN" != xyes],
[SR_APPEND([sr_cxx_missing], [', '], [Doxygen])])
+# Link C++ code with gnustl_shared if it exists (Android)
+SR_SEARCH_LIBS([SR_EXTRA_CXX_LIBS], [__cxa_throw], [gnustl_shared])
+
# Python is needed for the C++ bindings.
AM_PATH_PYTHON([2.7],
[HAVE_PYTHON=yes],