# We require at least 0.22, as "Requires.private" behaviour changed there.
PKG_PROG_PKG_CONFIG([0.22])
+# Keep track of all checked modules so we can list them at the end.
+SR_PKG_CHECK_SUMMARY([srf_pkglibs_summary])
+
+# Collect the pkg-config module names of all dependencies in SRF_PKGLIBS.
+# These are used to derive the compiler flags and for the "Requires.private"
+# field in the generated libsigrokflow.pc file.
+SR_VAR_OPT_PKG([SRF_PKGLIBS], [srf_deps_avail])
+
+SR_ARG_OPT_PKG([libsigrokcxx], [LIBSIGROKCXX], , [libsigrokcxx >= 0.5.1])
+
AC_LANG([C++])
SR_ARG_ENABLE_WARNINGS([SRF_WXXFLAGS], [-Wall], [-Wall -Wextra])
Detected libraries (required):
- gstreamermm >= 1.8.0 ........... $srf_gstreamermm_version
+Detected libraries (optional):
+$srf_pkglibs_summary
+
_EOF
#include <gstreamermm.h>
#include <gstreamermm/private/element_p.h>
#include <gstreamermm/private/basesink_p.h>
+#ifdef HAVE_LIBSIGROKCXX
#include <libsigrokcxx/libsigrokcxx.hpp>
+#endif
#include <libsigrokdecode/libsigrokdecode.h>
namespace Srf
explicit CaptureDevice(GstElement *gobj);
};
+#ifdef HAVE_LIBSIGROKCXX
class LegacyCaptureDevice :
public CaptureDevice
{
shared_ptr<sigrok::Output> _libsigrok_output;
map<string, Glib::VariantBase> _options;
};
+#endif
class LegacyDecoder :
public Sink
Description: sigrok flow graph library
URL: http://www.sigrok.org
Requires: gstreamermm-1.0 >= 1.8.0
+Requires.private: @SRF_PKGLIBS@
Version: @SRF_PACKAGE_VERSION@
Libs: -L${libdir} -lsigrokflow
Cflags: -I${includedir}
void init()
{
+#ifdef HAVE_LIBSIGROKCXX
Gst::Plugin::register_static(GST_VERSION_MAJOR, GST_VERSION_MINOR,
"sigrok_legacy_capture_device",
"Wrapper for capture devices using legacy libsigrok APIs",
"Wrapper for outputs using legacy libsigrok APIs",
sigc::ptr_fun(&LegacyOutput::register_element),
"0.01", "GPL", "sigrok", "libsigrokflow", "http://sigrok.org");
+#endif
Gst::Plugin::register_static(GST_VERSION_MAJOR, GST_VERSION_MINOR,
"sigrok_legacy_decoder",
"Wrapper for protocol decoders using legacy libsigrokdecode APIs",
{
}
+#ifdef HAVE_LIBSIGROKCXX
void LegacyCaptureDevice::class_init(Gst::ElementClass<LegacyCaptureDevice> *klass)
{
klass->set_metadata("sigrok legacy capture device",
cout << result;
return true;
}
+#endif
void LegacyDecoder::class_init(Gst::ElementClass<LegacyDecoder> *klass)
{