]> sigrok.org Git - libsigrok.git/commitdiff
Bindings: Link C++ code with gnustl_shared if it exists (Android)
authorMarcus Comstedt <redacted>
Tue, 6 Dec 2016 20:01:23 +0000 (21:01 +0100)
committerMarcus Comstedt <redacted>
Tue, 6 Dec 2016 20:05:15 +0000 (21:05 +0100)
Makefile.am
configure.ac

index 82a3eb7ccd752bc4eec4919e0acbe9780db1a124..7d7d1f9e4707006b1f0f8a60099bdd3bb8f2f1e9 100644 (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
index 94e545720ba07c80d9dce57411b149070aebbed3..71b7b47c9c30a2aa2d1be9a9279d794d7a21a105 100644 (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],