summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-03-05 17:32:33 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-03-05 17:32:33 +0100
commit8dad8afa09a3740dd90bd70917ff93a63098e576 (patch)
tree9b7917169e66fe6c43869f79ad4c3d8fbba56cde
parent19431ba192c3b95726c7297c96494ba6397879ef (diff)
downloaddabmux-8dad8afa09a3740dd90bd70917ff93a63098e576.tar.gz
dabmux-8dad8afa09a3740dd90bd70917ff93a63098e576.tar.bz2
dabmux-8dad8afa09a3740dd90bd70917ff93a63098e576.zip
Compile under OSX
-rw-r--r--INSTALL.md9
-rw-r--r--src/ClockTAI.cpp8
-rw-r--r--src/DabMultiplexer.cpp4
-rw-r--r--src/DabMux.cpp1
-rw-r--r--src/dabOutput/dabOutputRaw.cpp8
-rw-r--r--src/dabOutput/dabOutputUdp.cpp7
6 files changed, 34 insertions, 3 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 7d4bcba..d4cc548 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -49,6 +49,15 @@ that did not yet make its way into a release, you can clone the
* Bootstrap autotools: <pre>% ./bootstrap.sh</pre>
* Then use ./configure as above
+Develop on OSX
+==============
+
+If you want to develop on OSX platform install the necessary build tools
+with brew
+
+ brew install automake boost
+
+raw, edi and udp output are not available.
Advanced install procedure:
===========================
diff --git a/src/ClockTAI.cpp b/src/ClockTAI.cpp
index ea0e53c..c7b045b 100644
--- a/src/ClockTAI.cpp
+++ b/src/ClockTAI.cpp
@@ -34,7 +34,9 @@
#include <stdio.h>
#include <errno.h>
-#include <sys/timex.h>
+#if SUPPORT_SETTING_CLOCK_TAI
+# include <sys/timex.h>
+#endif
#ifdef HAVE_CURL
# include <curl/curl.h>
#endif
@@ -56,6 +58,7 @@ ClockTAI::ClockTAI()
int ClockTAI::get_offset()
{
+#if ENABLE_OUTPUT_EDI
struct timespec time_now;
int err = clock_gettime(CLOCK_REALTIME, &time_now);
@@ -81,6 +84,7 @@ int ClockTAI::get_offset()
etiLog.level(info) << "Updated TAI-UTC offset to " << m_offset << "s.";
}
+#endif // ENABLE_OUTPUT_EDI
return m_offset;
}
@@ -226,3 +230,5 @@ void debug_tai_clk()
}
#endif
+
+
diff --git a/src/DabMultiplexer.cpp b/src/DabMultiplexer.cpp
index 52bca1b..e60feaa 100644
--- a/src/DabMultiplexer.cpp
+++ b/src/DabMultiplexer.cpp
@@ -215,11 +215,11 @@ void DabMultiplexer::prepare()
*/
gettimeofday(&mnsc_time, NULL);
+#if HAVE_OUTPUT_EDI
if (clock_gettime(CLOCK_REALTIME, &edi_time)) {
throw std::runtime_error("Setting eti_time with clock_gettime failed");
}
-#if HAVE_OUTPUT_EDI
// Try to load offset once
bool tist_enabled = m_pt.get("general.tist", false);
@@ -1751,6 +1751,7 @@ void DabMultiplexer::mux_frame(std::vector<std::shared_ptr<DabOutput> >& outputs
edi_tagDETI.atstf = 1;
edi_tagDETI.utco = 0;
edi_tagDETI.seconds = 0;
+#if HAVE_OUTPUT_EDI
try {
bool tist_enabled = m_pt.get("general.tist", false);
@@ -1763,6 +1764,7 @@ void DabMultiplexer::mux_frame(std::vector<std::shared_ptr<DabOutput> >& outputs
catch (std::runtime_error& e) {
etiLog.level(error) << "Could not get UTC-TAI offset for EDI timestamp";
}
+#endif
/* Coding of the TIST, according to ETS 300 799 Annex C
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 19f11fe..0f66f71 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -82,7 +82,6 @@ typedef DWORD32 uint32_t;
# include <sys/times.h>
# include <sys/resource.h>
-# include <net/if_packet.h>
#endif
#include <time.h>
diff --git a/src/dabOutput/dabOutputRaw.cpp b/src/dabOutput/dabOutputRaw.cpp
index 346d34d..42d9238 100644
--- a/src/dabOutput/dabOutputRaw.cpp
+++ b/src/dabOutput/dabOutputRaw.cpp
@@ -23,6 +23,12 @@
You should have received a copy of the GNU General Public License
along with ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(HAVE_OUTPUT_RAW)
+
#include <cstdio>
#include <cstring>
#include "dabOutput.h"
@@ -390,3 +396,5 @@ int DabOutputRaw::Close()
return -1;
}
+#endif // defined(HAVE_OUTPUT_RAW)
+
diff --git a/src/dabOutput/dabOutputUdp.cpp b/src/dabOutput/dabOutputUdp.cpp
index 9664a2d..3338ea6 100644
--- a/src/dabOutput/dabOutputUdp.cpp
+++ b/src/dabOutput/dabOutputUdp.cpp
@@ -23,6 +23,11 @@
You should have received a copy of the GNU General Public License
along with ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(HAVE_OUTPUT_UDP)
#include <cstring>
#include <cstdio>
@@ -105,3 +110,5 @@ int DabOutputUdp::Write(void* buffer, int size)
this->packet_->addData(buffer, size);
return this->socket_->send(*this->packet_);
}
+#endif // defined(HAVE_OUTPUT_UDP)
+