]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
correctly fix build issues on Mac OSX Tiger by using a more generic means
authorRussell Bryant <russell@russellbryant.com>
Sat, 1 Oct 2005 01:58:20 +0000 (01:58 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 1 Oct 2005 01:58:20 +0000 (01:58 +0000)
for determining wheter poll and dlfcn functionality needs to be provided

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@6707 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
include/asterisk/channel.h
include/asterisk/io.h
loader.c

index f704a6bd39515de07af59ee5e912f4d24b481655..059b499a1411a24b79c631ad69f608fa0a971b8f 100755 (executable)
--- 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 +"  
index bd1674f080383a8776f334f35406b78577061c8e..6dbc70a651b1873368129fa2fd68342e92aee750 100755 (executable)
@@ -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>
index f775418a558e331ec16b367067af09fbb597707d..62e1f458f1d7b917466667dc4cada1e24b22b785 100755 (executable)
@@ -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 */
index 0720d0670cf95f9b8b1c46a5552e40b4a68e98ae..91c9cf0c678273e837adaaf6e0601a7121cfa5e6 100755 (executable)
--- 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>