From 5a44c73989c0683f76f4651a5f007fc3accf8b99 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 27 Feb 2016 16:41:46 +0100 Subject: Fix compilation with EDI disabled --- configure.ac | 2 ++ src/ClockTAI.cpp | 6 +++++- src/DabMultiplexer.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index e7e169c..0e61cce 100644 --- a/configure.ac +++ b/configure.ac @@ -204,6 +204,8 @@ AS_IF([test "x$enable_output_edi" = "xyes"], AC_CHECK_LIB(curl, curl_easy_init, [true], [AC_MSG_ERROR([cURL is required for EDI output])])) AS_IF([test "x$enable_output_edi" = "xyes"], [AC_DEFINE(HAVE_OUTPUT_EDI, [1], [Define if EDI output is enabled])]) +AS_IF([test "x$enable_output_edi" = "xyes"], + [AC_DEFINE(HAVE_CURL, [1], [Define if cURL is available])]) # Link against lzmq AM_CONDITIONAL([HAVE_ZEROMQ_TEST], diff --git a/src/ClockTAI.cpp b/src/ClockTAI.cpp index 992390b..ea0e53c 100644 --- a/src/ClockTAI.cpp +++ b/src/ClockTAI.cpp @@ -35,7 +35,9 @@ #include #include #include -#include +#ifdef HAVE_CURL +# include +#endif #include #include #include @@ -156,6 +158,7 @@ int ClockTAI::download_tai_utc_bulletin(const char* url) { int r = 0; +#ifdef HAVE_CURL CURL *curl; CURLcode res; @@ -186,6 +189,7 @@ int ClockTAI::download_tai_utc_bulletin(const char* url) /* always cleanup */ curl_easy_cleanup(curl); } +#endif // HAVE_CURL return r; } diff --git a/src/DabMultiplexer.h b/src/DabMultiplexer.h index 529b9ca..a7f6962 100644 --- a/src/DabMultiplexer.h +++ b/src/DabMultiplexer.h @@ -137,9 +137,9 @@ class DabMultiplexer : public RemoteControllable { boost::property_tree::ptree m_pt_next; std::shared_ptr ensemble_next; -#if HAVE_OUTPUT_EDI ClockTAI m_clock_tai; +#if HAVE_OUTPUT_EDI std::ofstream edi_debug_file; // The TagPacket will then be placed into an AFPacket -- cgit v1.2.3