--- ./dabc/base/src/threads.cxx 2009-08-31 12:34:08.000000000 +0200 +++ ../roc_new/./dabc/base/src/threads.cxx 2013-10-24 09:49:03.000000000 +0200 @@ -11,6 +11,12 @@ * This software can be used under the GPL license agreements as stated * in LICENSE.txt file which is part of the distribution. ********************************************************************/ +#ifdef __APPLE__ +# ifndef PTHREAD_MUTEX_RECURSIVE_NP +# define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE +# endif +#endif + #include "dabc/threads.h" #include --- ./dabc/base/src/timing.cxx 2010-05-14 14:49:58.000000000 +0200 +++ ../roc_new/./dabc/base/src/timing.cxx 2013-10-24 09:50:14.000000000 +0200 @@ -11,6 +11,20 @@ * This software can be used under the GPL license agreements as stated * in LICENSE.txt file which is part of the distribution. ********************************************************************/ +#ifdef __APPLE__ +#include +//clock_gettime is not implemented on OSX +int clock_gettime(int /*clk_id*/, struct timespec* t) { + struct timeval now; + int rv = gettimeofday(&now, NULL); + if (rv) return rv; + t->tv_sec = now.tv_sec; + t->tv_nsec = now.tv_usec * 1000; + return 0; +} +#define CLOCK_MONOTONIC 0 +#endif + #include "dabc/timing.h" // #include --- ./dabc/plugins/mbs/mbs/LmdTypeDefs.h 2009-08-31 12:34:01.000000000 +0200 +++ ../roc_new/./dabc/plugins/mbs/mbs/LmdTypeDefs.h 2013-10-24 09:52:51.000000000 +0200 @@ -15,7 +15,13 @@ #define MBS_LmdTypeDefs #include + +#ifdef __APPLE__ +//on MacOS endian.h is in a differnt directory +#include +#else #include +#endif namespace mbs { --- ./dabc/plugins/mbs/src/LmdOutput.cxx 2010-06-04 16:22:30.000000000 +0200 +++ ../roc_new/./dabc/plugins/mbs/src/LmdOutput.cxx 2013-10-24 09:55:20.000000000 +0200 @@ -17,7 +17,13 @@ #include #include #include -#include + +#ifdef __APPLE__ +//on MacOS endian.h is in a differnt directory +#include +#else +#include +#endif #include "dabc/logging.h" #include "dabc/Buffer.h" --- ./dabc/plugins/mbs/src/MbsTypeDefs.cxx 2009-08-31 12:34:01.000000000 +0200 +++ ../roc_new/./dabc/plugins/mbs/src/MbsTypeDefs.cxx 2013-10-23 16:54:16.000000000 +0200 @@ -11,10 +11,19 @@ * This software can be used under the GPL license agreements as stated * in LICENSE.txt file which is part of the distribution. ********************************************************************/ +#if defined(__APPLE__) +// Mac OS X / Darwin features +#include +#define bswap_16(x) OSSwapInt16(x) +#define bswap_32(x) OSSwapInt32(x) +#define bswap_64(x) OSSwapInt64(x) +#else +#include +#endif + #include "MbsTypeDefs.h" #include -#include const char* mbs::typeLmdInput = "mbs::LmdInput"; --- ./dabc/base/src/SocketThread.cxx 2010-05-14 14:46:48.000000000 +0200 +++ ../roc_new/./dabc/base/src/SocketThread.cxx 2013-10-24 10:08:44.000000000 +0200 @@ -11,6 +11,12 @@ * This software can be used under the GPL license agreements as stated * in LICENSE.txt file which is part of the distribution. ********************************************************************/ +#ifdef __APPLE__ +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL SO_NOSIGPIPE +#endif +#endif + #include "dabc/SocketThread.h" #include --- dabc/plugins/mbs/fileapi/fLmd.c~ 2010-02-26 17:10:00.000000000 +0100 +++ dabc/plugins/mbs/fileapi/fLmd.c 2013-10-24 10:14:48.000000000 +0200 @@ -25,6 +25,25 @@ #include #endif +#ifdef __APPLE__ /* Max OS X */ +#include +#include +#include +#define fgetpos64 fgetpos +#define fopen64 fopen +#define fseeko64 fseek +#define fpos64_t fpos_t + +// just some dummies for compilation, we will never write lmd with time header +#define CLOCK_REALTIME 1 +int clock_gettime(int clockid, struct timespec* tp) +{ + return 0; +} + +#endif + + #ifdef WIN32 #include #include --- Makefile 2013-10-24 10:21:54.000000000 +0200 +++ ../roc_new/Makefile 2013-10-23 16:25:38.000000000 +0200 @@ -144,9 +144,9 @@ ## from here is configuration part, not required in other tools ifdef debug -CXXOPT = -g -O2 -Wall -fPIC +CXXOPT = -g -O2 -Wall -fPIC -I$(SIMPATH)/include else -CXXOPT = -O2 -fPIC +CXXOPT = -O2 -fPIC -I$(SIMPATH)/include endif ifeq ($(shell uname -m),x86_64) --- ./dabc/base/Makefile.mk 2010-05-14 14:46:48.000000000 +0200 +++ ./dabc_new/base/Makefile.mk 2013-10-24 10:54:30.000000000 +0200 @@ -48,7 +48,7 @@ @cp -f $< $@ $(DABCBASE_LIB): $(BASE_O) - @$(MakeLib) $(DABCBASE_LIBNAME) "$(BASE_O)" $(DABCDLLPATH) "-lpthread -ldl -lrt" + @$(MakeLib) $(DABCBASE_LIBNAME) "$(BASE_O)" $(DABCDLLPATH) "-lpthread -ldl" #$(DABCBASE_SLIB): $(BASE_O) # $(AR) $(ARFLAGS) $(DABCBASE_SLIB) $(BASE_O) @@ -57,7 +57,7 @@ $(LD) $(LDFLAGS) $(BASERUN_O) $(LIBS_CORESET) $(OutPutOpt) $(DABC_BASEEXE) $(DABC_XMLEXE) : $(DABC_XMLEXEO) $(DABC_BASESUB_O) - $(LD) $(LDFLAGS) $(DABC_XMLEXEO) $(DABC_BASESUB_O) -lpthread -lrt $(OutPutOpt) $(DABC_XMLEXE) + $(LD) $(LDFLAGS) $(DABC_XMLEXEO) $(DABC_BASESUB_O) -lpthread $(OutPutOpt) $(DABC_XMLEXE) $(DABC_BASESH): $(BASERUN_SH) @cp -f $< $@ --- ./dabc/config/Makefile.config 2009-08-31 12:34:08.000000000 +0200 +++ ./dabc_new/config/Makefile.config 2013-10-24 10:51:21.000000000 +0200 @@ -61,7 +61,8 @@ #### Linker definitions: ### LD = g++ LDFLAGS = -O -SOFLAGS = -shared -Wl,-soname, +SOFLAGS = -shared -flat_namespace -single_module -undefined dynamic_lookup -Wl,-install_name, +#SOFLAGS = -shared -Wl,-soname, AR = ar ARFLAGS = cr --- ./dabc/plugins/mbs/Makefile 2009-08-31 12:34:01.000000000 +0200 +++ ./dabc_new/plugins/mbs/Makefile 2013-10-24 10:53:29.000000000 +0200 @@ -75,7 +75,7 @@ @cp -f $< $@ $(DABCMBS_LIB): $(DABCMBS_O) - @$(MakeLib) $(DABCMBS_LIBNAME) "$(DABCMBS_O)" $(TGTDLLPATH) "-lrt" + @$(MakeLib) $(DABCMBS_LIBNAME) "$(DABCMBS_O)" $(TGTDLLPATH) "" $(MBSFAPI_PACKAGE) : $(MBSFAPI_H) $(MBSFAPI_S) $(MBSFAPI_DISTR) @rm -f $(MBSFAPI_PACKAGE) --- ./dabc/plugins/mbs/fileapi/Makefile 2009-08-31 12:34:01.000000000 +0200 +++ ./dabc_new/plugins/mbs/fileapi/Makefile 2013-10-24 10:52:47.000000000 +0200 @@ -67,7 +67,7 @@ rm -f $(TEST_O) $(TEST_EXE) $(MBSFAPI_O) $(MBSFAPI_LIB) $(MBSFAPI_RMAP) $(MBSFAPI_DICT).* $(MBSFAPI_LIB): $(MBSFAPI_O) - $(LD) -shared -O $(MBSFAPI_O) -lrt -o $(MBSFAPI_LIB) + $(LD) -shared -O $(MBSFAPI_O) -o $(MBSFAPI_LIB) $(MBSFAPI_DS): $(MBSFAPI_H) $(MBSFAPI_LINKDEF) echo "Generating root dictionary $(MBSFAPI_DS) ..." --- roclib/Makefile~ 2013-10-24 14:16:13.000000000 +0200 +++ roclib/Makefile 2013-10-24 14:21:11.000000000 +0200 @@ -41,7 +41,7 @@ $(ROCDICT_LIB): $(ROCDICT_OBJ) @echo 'Building: $@' - @$(LD) -o $@ -shared -O $(ROCDICT_OBJ) + @$(LD) -o $@ -shared -flat_namespace -single_module -undefined dynamic_lookup -O $(ROCDICT_OBJ) dict: $(ROCDICT_LIB) $(ROCDICT_MAP)