aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-01 01:58:20 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-01 01:58:20 +0000
commit4ec708d94989039ec736b39246082336700c065c (patch)
tree02f5a1eb88ae0b8e02c199343641d696809d68b6
parent5370637c14a428d0046fe0158dd773ccd69e6f6b (diff)
correctly fix build issues on Mac OSX Tiger by using a more generic means
for determining wheter poll and dlfcn functionality needs to be provided git-svn-id: http://svn.digium.com/svn/asterisk/branches/v1-0@6707 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xMakefile13
-rwxr-xr-xinclude/asterisk/channel.h2
-rwxr-xr-xinclude/asterisk/io.h2
-rwxr-xr-xloader.c2
4 files changed, 13 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index f704a6bd3..059b499a1 100755
--- a/Makefile
+++ b/Makefile
@@ -214,7 +214,6 @@ OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
utils.o
ifeq (${OSARCH},Darwin)
-OBJS+=poll.o dlfcn.o
ASTLINK=-Wl,-dynamic
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
else
@@ -222,11 +221,19 @@ ASTLINK=-Wl,-E
SOLINK=-shared -Xlinker -x
endif
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
+ OBJS+= poll.o
+ CFLAGS+=-DPOLLCOMPAT
+endif
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),)
+ OBJS+= dhfcn.o
+ CFLAGS+=-DDLFCNCOMPAT
+endif
+
CC=gcc
INSTALL=install
-CFLAGS+=$(shell if uname -r|grep -q 8.2.0 ; then echo " -DOSX10_4 " ; fi)
-
_all: all
@echo " +--------- Asterisk Build Complete ---------+"
@echo " + Asterisk has successfully been built, but +"
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index bd1674f08..6dbc70a65 100755
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -19,7 +19,7 @@
#include <asterisk/chanvars.h>
#include <unistd.h>
#include <setjmp.h>
-#if !defined(OSX10_4) && 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 f775418a5..62e1f458f 100755
--- a/include/asterisk/io.h
+++ b/include/asterisk/io.h
@@ -14,7 +14,7 @@
#ifndef _IO_H
#define _IO_H
-#if !defined(OSX10_4) && defined(__APPLE__)
+#ifdef POLLCOMPAT
#include <asterisk/poll-compat.h>
#else
#include <sys/poll.h> /* For POLL* constants */
diff --git a/loader.c b/loader.c
index 0720d0670..91c9cf0c6 100755
--- a/loader.c
+++ b/loader.c
@@ -27,7 +27,7 @@
#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>