diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-09-26 17:17:56 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-09-26 17:17:56 +0000 |
commit | acf412a38709fae4ef744dc3f1f767f9ef398cab (patch) | |
tree | a0a2ade13aca9537da0534216037aca04bc1a3ff | |
parent | 036dea1feb21a191642da5df61ec4e8eca7a3ed7 (diff) |
use a more generic means to decide whether we need to provide poll/dlfcn functionality (issue #5297)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6664 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | Makefile | 11 | ||||
-rwxr-xr-x | include/asterisk/channel.h | 2 | ||||
-rwxr-xr-x | include/asterisk/io.h | 2 | ||||
-rwxr-xr-x | loader.c | 2 |
4 files changed, 13 insertions, 4 deletions
@@ -301,6 +301,16 @@ OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \ utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \ netsock.o slinfactory.o ast_expr2.o ast_expr2f.o +ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),) + OBJS+= poll.o + ASTCFLAGS+=-DPOLLCOMPAT +endif + +ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),) + OBJS+= dhfcn.o + ASTCFLAGS+=-DDLFCNCOMPAT +endif + ifeq (${OSARCH},Linux) LIBS=-ldl -lpthread -lncurses -lm -lresolv #-lnjamd else @@ -311,7 +321,6 @@ ifeq (${OSARCH},Darwin) LIBS+=-lresolv ASTCFLAGS+=-D__Darwin__ AUDIO_LIBS=-framework CoreAudio - OBJS+=poll.o dlfcn.o ASTLINK=-Wl,-dynamic SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace else diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 4e9d2b39a..67b32b1b8 100755 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -31,7 +31,7 @@ #include <unistd.h> #include <setjmp.h> -#if defined(__APPLE__) +#ifdef POLLCOMPAT #include "asterisk/poll-compat.h" #else #include <sys/poll.h> diff --git a/include/asterisk/io.h b/include/asterisk/io.h index a9be35703..8bda98a2b 100755 --- a/include/asterisk/io.h +++ b/include/asterisk/io.h @@ -23,7 +23,7 @@ #ifndef _ASTERISK_IO_H #define _ASTERISK_IO_H -#ifdef __APPLE__ +#ifdef POLLCOMPAT #include "asterisk/poll-compat.h" #else #include <sys/poll.h> /* For POLL* constants */ @@ -43,7 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/enum.h" #include "asterisk/rtp.h" #include "asterisk/lock.h" -#ifdef __APPLE__ +#ifdef DLFCNCOMPAT #include "asterisk/dlfcn-compat.h" #else #include <dlfcn.h> |