Bindings: Link C++ code with gnustl_shared if it exists (Android)

This commit is contained in:
Marcus Comstedt 2016-12-06 21:01:23 +01:00
parent e83a8f4958
commit 9d8f363d35
2 changed files with 7 additions and 3 deletions

View File

@ -594,7 +594,7 @@ lib_LTLIBRARIES += bindings/cxx/libsigrokcxx.la
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
@ -782,9 +782,9 @@ $(JLIB): $(JCXX) \
$(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

View File

@ -94,6 +94,7 @@ SR_PKGLIBS_CXX=
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])
@ -321,6 +322,9 @@ AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
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],