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: https://origsvn.digium.com/svn/asterisk/branches/v1-0@6707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
Russell Bryant 20 years ago
parent afdd1c5512
commit 6b36952664

@ -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 \ astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
utils.o utils.o
ifeq (${OSARCH},Darwin) ifeq (${OSARCH},Darwin)
OBJS+=poll.o dlfcn.o
ASTLINK=-Wl,-dynamic ASTLINK=-Wl,-dynamic
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
else else
@ -222,11 +221,19 @@ ASTLINK=-Wl,-E
SOLINK=-shared -Xlinker -x SOLINK=-shared -Xlinker -x
endif 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 CC=gcc
INSTALL=install INSTALL=install
CFLAGS+=$(shell if uname -r|grep -q 8.2.0 ; then echo " -DOSX10_4 " ; fi)
_all: all _all: all
@echo " +--------- Asterisk Build Complete ---------+" @echo " +--------- Asterisk Build Complete ---------+"
@echo " + Asterisk has successfully been built, but +" @echo " + Asterisk has successfully been built, but +"

@ -19,7 +19,7 @@
#include <asterisk/chanvars.h> #include <asterisk/chanvars.h>
#include <unistd.h> #include <unistd.h>
#include <setjmp.h> #include <setjmp.h>
#if !defined(OSX10_4) && defined(__APPLE__) #ifdef POLLCOMPAT
#include <asterisk/poll-compat.h> #include <asterisk/poll-compat.h>
#else #else
#include <sys/poll.h> #include <sys/poll.h>

@ -14,7 +14,7 @@
#ifndef _IO_H #ifndef _IO_H
#define _IO_H #define _IO_H
#if !defined(OSX10_4) && defined(__APPLE__) #ifdef POLLCOMPAT
#include <asterisk/poll-compat.h> #include <asterisk/poll-compat.h>
#else #else
#include <sys/poll.h> /* For POLL* constants */ #include <sys/poll.h> /* For POLL* constants */

@ -27,7 +27,7 @@
#include <asterisk/enum.h> #include <asterisk/enum.h>
#include <asterisk/rtp.h> #include <asterisk/rtp.h>
#include <asterisk/lock.h> #include <asterisk/lock.h>
#ifdef __APPLE__ #ifdef DLFCNCOMPAT
#include <asterisk/dlfcn-compat.h> #include <asterisk/dlfcn-compat.h>
#else #else
#include <dlfcn.h> #include <dlfcn.h>

Loading…
Cancel
Save