From: Marcus Comstedt Date: Tue, 6 Dec 2016 20:01:23 +0000 (+0100) Subject: Bindings: Link C++ code with gnustl_shared if it exists (Android) X-Git-Tag: libsigrok-0.5.0~166 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9d8f363d35572c03f3f0d75d254f57d17dc51ed9;p=libsigrok.git Bindings: Link C++ code with gnustl_shared if it exists (Android) --- diff --git a/Makefile.am b/Makefile.am index 82a3eb7c..7d7d1f9e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index 94e54572..71b7b47c 100644 --- a/configure.ac +++ b/configure.ac @@ -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],