diff --git a/Makefile.defs b/Makefile.defs index fc4aa19a..11218de5 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -82,6 +82,8 @@ CPPFLAGS += -DDEBUG_PLAYOUTBUF endif TARGET = +LIB_LDFLAGS = -shared + ifeq ($(OS), linux) LDFLAGS += -ldl -rdynamic -lpthread else @@ -93,6 +95,19 @@ ifeq ($(OS), openbsd) else ifeq ($(OS), netbsd) LDFLAGS += -rdynamic -pthread +else +ifeq ($(OS), darwin) + LDFLAGS += -rdynamic -pthread + LIB_LDFLAGS = -flat_namespace -undefined suppress -bundle + CXXFLAGS += -fno-common + CFLAGS += -fno-common + + # add the DarwinPorts directory + CPPFLAGS += -I /opt/local/include + LDFLAGS += -L/opt/local/lib + + # those modules do not compile by now + exclude_modules += binrpcctrl ilbc else LDFLAGS+= -fPIC -ldl -lsocket -lnsl -lpthread TARGET=solaris @@ -100,8 +115,9 @@ endif endif endif endif +endif -LIB_LDFLAGS = $(LDFLAGS) -shared +LIB_LDFLAGS += $(LDFLAGS) # install path is $(basedir) $(prefix) # example: diff --git a/apps/Makefile b/apps/Makefile index 198d2e0c..d567a2d6 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -3,7 +3,7 @@ COREPATH ?= ../core include $(COREPATH)/../Makefile.defs -exclude_modules ?= mp3 examples +exclude_modules = mp3 examples py_sems modules ?= $(filter-out $(exclude_modules) \ $(wildcard Makefile*) CVS, \ $(wildcard *) ) examples/tutorial/cc_acc diff --git a/core/plug-in/Makefile.audio_module b/core/plug-in/Makefile.audio_module index 09f46ff2..018968e6 100644 --- a/core/plug-in/Makefile.audio_module +++ b/core/plug-in/Makefile.audio_module @@ -1,7 +1,7 @@ COREPATH ?=../.. include $(COREPATH)/../Makefile.defs -LDFLAGS += -shared $(module_ldflags) +LDFLAGS += $(module_ldflags) CPPFLAGS += -I $(COREPATH) -I $(COREPATH)/amci CFLAGS += -Wall $(module_cflags) @@ -47,7 +47,7 @@ $(lib_full_name): $(lib_name) cp $(lib_name) $(lib_full_name) $(lib_name): $(objs) Makefile - $(LD) -o $(lib_name) $(objs) $(LDFLAGS) + $(LD) -o $(lib_name) $(objs) $(LIB_LDFLAGS) ifeq ($(lib_full_name),$(MAKECMDGOALS)) include $(depends) diff --git a/core/plug-in/sipctrl/udp_trsp.cpp b/core/plug-in/sipctrl/udp_trsp.cpp index 29986680..a043188b 100644 --- a/core/plug-in/sipctrl/udp_trsp.cpp +++ b/core/plug-in/sipctrl/udp_trsp.cpp @@ -25,11 +25,10 @@ # error "can't determine socket option (IP_RECVDSTADDR or IP_PKTINFO)" #endif -union control_data { - struct cmsghdr cmsg; - u_char data[DSTADDR_DATASIZE]; - -}; +// union control_data { +// struct cmsghdr cmsg; +// u_char data[DSTADDR_DATASIZE]; +// }; udp_trsp::udp_trsp(trans_layer* tl) @@ -65,7 +64,7 @@ void udp_trsp::run() int buf_len; msghdr msg; - control_data cmsg; + //control_data cmsg; cmsghdr* cmsgptr; sockaddr_storage from_addr; iovec iov[1]; @@ -78,8 +77,8 @@ void udp_trsp::run() msg.msg_namelen = sizeof(sockaddr_storage); msg.msg_iov = iov; msg.msg_iovlen = 1; - msg.msg_control = &cmsg; - msg.msg_controllen = sizeof(cmsg); + msg.msg_control = new u_char[DSTADDR_DATASIZE]; + msg.msg_controllen = DSTADDR_DATASIZE; if(sd<=0){ ERROR("Transport instance not bound\n"); diff --git a/core/plug-in/speex/Makefile b/core/plug-in/speex/Makefile index 0a311f32..2b76b4fe 100644 --- a/core/plug-in/speex/Makefile +++ b/core/plug-in/speex/Makefile @@ -1,18 +1,19 @@ plug_in_name = speex -SPEEX_INC=/usr/include/ -SPEEX_LIB=-lspeex +SPEEX_INC= +#/usr/include/ +SPEEX_LIB = -lspeex # or: -# SPEEXDIR?=speex_src -# SPEEX_INC?=$(SPEEXDIR) -# SPEEX_LIB?=$(SPEEXDIR)/libspeex/.libs/libspeex.a +# SPEEXDIR ?= speex_src +# SPEEX_INC ?= -I $(SPEEXDIR) +# SPEEX_LIB ?= $(SPEEXDIR)/libspeex/.libs/libspeex.a # # CONFIGURE_FLAG=--with-pic module_ldflags = $(SPEEX_LIB) -module_cflags = -I $(SPEEX_INC) -ansi # -DNOFPU +module_cflags = -ansi # -DNOFPU ifdef NOFPU module_cflags += -DNOFPU diff --git a/core/plug-in/wav/wav_hdr.c b/core/plug-in/wav/wav_hdr.c index c34789a2..0fadc5ab 100644 --- a/core/plug-in/wav/wav_hdr.c +++ b/core/plug-in/wav/wav_hdr.c @@ -32,7 +32,7 @@ #include #include -#if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) +#if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || (defined(BYTE_ORDER) && (BYTE_ORDER == BIG_ENDIAN)) #define bswap_16(A) ((((u_int16_t)(A) & 0xff00) >> 8) | \ (((u_int16_t)(A) & 0x00ff) << 8)) #define bswap_32(A) ((((u_int32_t)(A) & 0xff000000) >> 24) | \ @@ -43,7 +43,7 @@ #define le_to_cpu16(x) bswap_16(x) #define cpu_to_le32(x) bswap_32(x) #define le_to_cpu32(x) bswap_32(x) -#elif (defined(__BYTE_ORDER) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN) +#elif (defined(__BYTE_ORDER) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN) || (defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)) #define cpu_to_le16(x) (x) #define cpu_to_le32(x) (x) #define le_to_cpu16(x) (x)