]> sigrok.org Git - libsigrokflow.git/commitdiff
Check for the (optional) libsigrokdecode dependency.
authorUwe Hermann <redacted>
Tue, 8 Jan 2019 21:32:35 +0000 (22:32 +0100)
committerUwe Hermann <redacted>
Tue, 8 Jan 2019 23:09:36 +0000 (00:09 +0100)
configure.ac
include/libsigrokflow/libsigrokflow.hpp
src/main.cpp

index bafb3ba34eea764351b265b4e3112dec17d4864f..687e1441fc3788146d04bf1da05acb730666dc39 100644 (file)
@@ -71,6 +71,7 @@ SR_PKG_CHECK_SUMMARY([srf_pkglibs_summary])
 SR_VAR_OPT_PKG([SRF_PKGLIBS], [srf_deps_avail])
 
 SR_ARG_OPT_PKG([libsigrokcxx], [LIBSIGROKCXX], , [libsigrokcxx >= 0.5.1])
+SR_ARG_OPT_PKG([libsigrokdecode], [LIBSIGROKDECODE], , [libsigrokdecode >= 0.5.1])
 
 AC_LANG([C++])
 SR_ARG_ENABLE_WARNINGS([SRF_WXXFLAGS], [-Wall], [-Wall -Wextra])
index ee71487cf3d1c638b7e9d4b4a64a95bc7921336d..31cbd0126aa51ab7211a31709d2ccc2c4b7739eb 100644 (file)
@@ -27,7 +27,9 @@
 #ifdef HAVE_LIBSIGROKCXX
 #include <libsigrokcxx/libsigrokcxx.hpp>
 #endif
+#ifdef HAVE_LIBSIGROKDECODE
 #include <libsigrokdecode/libsigrokdecode.h>
+#endif
 
 namespace Srf
 {
@@ -173,6 +175,7 @@ private:
 };
 #endif
 
+#ifdef HAVE_LIBSIGROKDECODE
 class LegacyDecoder :
         public Sink
 {
@@ -205,6 +208,7 @@ private:
         uint64_t _abs_ss;
         uint64_t _unitsize;
 };
+#endif
 
 }
 #endif
index 080ef64376e5fe69d66dcbfc5402f909cb6debc1..ab9435b129bbdad2dbb258a84423af71e3bdce11 100644 (file)
  */
 
 #include <config.h>
-#include <libsigrokflow/libsigrokflow.hpp>
-
-#include <libsigrokdecode/libsigrokdecode.h>
-
 #include <iostream>
+#include <libsigrokflow/libsigrokflow.hpp>
 
 namespace Srf
 {
@@ -50,11 +47,13 @@ void init()
                        sigc::ptr_fun(&LegacyOutput::register_element),
                        "0.01", "GPL", "sigrok", "libsigrokflow", "http://sigrok.org");
 #endif
+#ifdef HAVE_LIBSIGROKDECODE
        Gst::Plugin::register_static(GST_VERSION_MAJOR, GST_VERSION_MINOR,
                        "sigrok_legacy_decoder",
                        "Wrapper for protocol decoders using legacy libsigrokdecode APIs",
                        sigc::ptr_fun(&LegacyDecoder::register_element),
                        "0.01", "GPL", "sigrok", "libsigrokflow", "http://sigrok.org");
+#endif
 }
 
 Sink::Sink(GstBaseSink *gobj) :
@@ -350,6 +349,7 @@ bool LegacyOutput::stop_vfunc()
 }
 #endif
 
+#ifdef HAVE_LIBSIGROKDECODE
 void LegacyDecoder::class_init(Gst::ElementClass<LegacyDecoder> *klass)
 {
        klass->set_metadata("sigrok legacy decoder",
@@ -418,5 +418,6 @@ bool LegacyDecoder::stop_vfunc()
        srd_session_terminate_reset(_session);
        return true;
 }
+#endif
 
 }