aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-10-27 20:00:41 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-10-27 20:00:41 +0000
commit854adbe3bd6fcd137e2d78dac42c2c535bf3a945 (patch)
treec8ce701bc8a19fff64bf153bba8347c57ac0e658
parent73f4bc8c25d00d2d942b3580abc779f9382ab446 (diff)
More cleanups and OSX fixes for 10.3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1678 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xMakefile5
-rwxr-xr-xcodecs/Makefile3
-rwxr-xr-xcodecs/gsm/Makefile10
-rwxr-xr-xcodecs/gsm/src/code.c4
-rwxr-xr-xcodecs/lpc10/Makefile45
-rwxr-xr-xdb1-ast/db/db.c4
-rwxr-xr-xdb1-ast/mpool/mpool.c4
-rwxr-xr-xenum.c3
-rwxr-xr-xinclude/asterisk/frame.h6
-rwxr-xr-xinclude/asterisk/localtime.h2
-rwxr-xr-xsrv.c19
-rwxr-xr-xstdtime/localtime.c8
12 files changed, 48 insertions, 65 deletions
diff --git a/Makefile b/Makefile
index 881d1fa1d..65df33e80 100755
--- a/Makefile
+++ b/Makefile
@@ -151,6 +151,11 @@ LIBS+=-lncurses -lm
ifeq (${OSARCH},Linux)
LIBS+=-lresolv #-lnjamd
endif
+ifeq (${OSARCH},Darwin)
+ifeq ($(shell uname -r),7.0.0)
+LIBS+=-lresolv
+endif
+endif
OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
translate.o file.o say.o pbx.o cli.o md5.o term.o \
ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
diff --git a/codecs/Makefile b/codecs/Makefile
index a86709da8..f7a69fd1a 100755
--- a/codecs/Makefile
+++ b/codecs/Makefile
@@ -27,8 +27,7 @@ CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include"
LIBG723=g723.1/libg723.a
LIBG723B=g723.1b/libg723b.a
LIBGSM=gsm/lib/libgsm.a
-LIBGSM=$(shell if uname -m | grep -q 86; then echo gsm/lib/libgsm.a; else echo "-lgsm" ; fi)
-LIBGSMT=$(shell if uname -m | grep -q 86; then echo gsm/lib/libgsm.a; fi)
+LIBGSMT=gsm/lib/libgsm.a
LIBMP3=mp3/libmp3.a
LIBLPC10=lpc10/liblpc10.a
LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
diff --git a/codecs/gsm/Makefile b/codecs/gsm/Makefile
index 5e2ccd180..490f3938c 100755
--- a/codecs/gsm/Makefile
+++ b/codecs/gsm/Makefile
@@ -37,6 +37,10 @@ WAV49 = -DWAV49
######### ppro's, etc, as well as the AMD K6 and K7. The compile will
######### probably require gcc.
+ifneq (${OSARCH},Darwin)
+OPTIMIZE+=-march=$(PROC)
+endif
+
PG =
#PG = -g -pg
######### Profiling flags. If you don't know what that means, leave it blank.
@@ -54,7 +58,7 @@ PG =
# CC = /usr/lang/acc
# CCFLAGS = -c -O
-CC = gcc $(OPTIMIZE) -march=$(PROC) -fomit-frame-pointer
+CC = gcc $(OPTIMIZE) -fomit-frame-pointer
CCFLAGS += -c -DNeedFunctionPrototypes=1 -funroll-loops -fPIC
LD = $(CC)
@@ -189,7 +193,7 @@ GSM_SOURCES = $(SRC)/add.c \
$(SRC)/gsm_option.c \
$(SRC)/short_term.c \
$(SRC)/table.c
-ifneq (${OSARCH},OpenBSD)
+ifeq (${OSARCH},Linux)
GSM_SOURCES+= $(SRC)/k6opt.s
endif
@@ -236,7 +240,7 @@ GSM_OBJECTS = $(SRC)/add.o \
$(SRC)/gsm_option.o \
$(SRC)/short_term.o \
$(SRC)/table.o
-ifneq (${OSARCH},OpenBSD)
+ifeq (${OSARCH},Linux)
GSM_OBJECTS+= $(SRC)/k6opt.o
endif
diff --git a/codecs/gsm/src/code.c b/codecs/gsm/src/code.c
index 4d195dfbd..6358330e5 100755
--- a/codecs/gsm/src/code.c
+++ b/codecs/gsm/src/code.c
@@ -62,6 +62,10 @@ void Gsm_Coder P8((S,s,LARc,Nc,bc,Mc,xmaxc,xMc),
word so[160];
+#if !(defined(__GNUC__) && defined(__i386__))
+ longword ltmp;
+#endif
+
Gsm_Preprocess (S, s, so);
Gsm_LPC_Analysis (S, so, LARc);
Gsm_Short_Term_Analysis_Filter (S, LARc, so);
diff --git a/codecs/lpc10/Makefile b/codecs/lpc10/Makefile
index 5e04d5f73..42ff10638 100755
--- a/codecs/lpc10/Makefile
+++ b/codecs/lpc10/Makefile
@@ -37,42 +37,17 @@ LIB = $(LIB_TARGET_DIR)/liblpc10.a
.PHONY: all clean
all: $(LIB)
- ranlib $(LIB)
-$(LIB): $(LIB)(f2clib.o) \
- $(LIB)(analys.o) \
- $(LIB)(bsynz.o) \
- $(LIB)(chanwr.o) \
- $(LIB)(dcbias.o) \
- $(LIB)(decode.o) \
- $(LIB)(deemp.o) \
- $(LIB)(difmag.o) \
- $(LIB)(dyptrk.o) \
- $(LIB)(encode.o) \
- $(LIB)(energy.o) \
- $(LIB)(ham84.o) \
- $(LIB)(hp100.o) \
- $(LIB)(invert.o) \
- $(LIB)(irc2pc.o) \
- $(LIB)(ivfilt.o) \
- $(LIB)(lpcdec.o) \
- $(LIB)(lpcenc.o) \
- $(LIB)(lpcini.o) \
- $(LIB)(lpfilt.o) \
- $(LIB)(median.o) \
- $(LIB)(mload.o) \
- $(LIB)(onset.o) \
- $(LIB)(pitsyn.o) \
- $(LIB)(placea.o) \
- $(LIB)(placev.o) \
- $(LIB)(preemp.o) \
- $(LIB)(prepro.o) \
- $(LIB)(random.o) \
- $(LIB)(rcchk.o) \
- $(LIB)(synths.o) \
- $(LIB)(tbdm.o) \
- $(LIB)(voicin.o) \
- $(LIB)(vparms.o)
+OBJ= f2clib.o analys.o bsynz.o chanwr.o dcbias.o decode.o \
+ deemp.o difmag.o dyptrk.o encode.o energy.o ham84.o \
+ hp100.o invert.o irc2pc.o ivfilt.o lpcdec.o lpcenc.o \
+ lpcini.o lpfilt.o median.o mload.o onset.o pitsyn.o \
+ placea.o placev.o preemp.o prepro.o random.o rcchk.o \
+ synths.o tbdm.o voicin.o vparms.o
+
+$(LIB): $(OBJ)
+ $(AR) cr $@ $(OBJ)
+ ranlib $@
clean:
-rm -f *.o $(LIB)
diff --git a/db1-ast/db/db.c b/db1-ast/db/db.c
index ab739ed78..5a74061e0 100755
--- a/db1-ast/db/db.c
+++ b/db1-ast/db/db.c
@@ -44,7 +44,9 @@ static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94";
#include <db.h>
+#ifndef __APPLE__
#define dbopen __dbopen
+#endif
DB *
dbopen(fname, flags, mode, type, openinfo)
@@ -74,8 +76,8 @@ dbopen(fname, flags, mode, type, openinfo)
errno = EINVAL;
return (NULL);
}
-#undef dbopen
#ifndef __APPLE__
+#undef dbopen
#define weak_alias(original, alias) \
asm (".weak " #alias "\n" #alias " = " #original);
weak_alias (__dbopen, dbopen)
diff --git a/db1-ast/mpool/mpool.c b/db1-ast/mpool/mpool.c
index b09f801f5..6773e4e23 100755
--- a/db1-ast/mpool/mpool.c
+++ b/db1-ast/mpool/mpool.c
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
#define __MPOOLINTERFACE_PRIVATE
#include <mpool.h>
+#ifndef __APPLE__
#define mpool_open __mpool_open
#define mpool_filter __mpool_filter
#define mpool_new __mpool_new
@@ -57,6 +58,7 @@ static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
#define mpool_put __mpool_put
#define mpool_sync __mpool_sync
#define mpool_close __mpool_close
+#endif
static BKT *mpool_bkt __P((MPOOL *));
static BKT *mpool_look __P((MPOOL *, pgno_t));
@@ -309,6 +311,7 @@ mpool_sync(mp)
return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
}
+#ifndef __APPLE__
#undef mpool_open
#undef mpool_filter
#undef mpool_new
@@ -317,7 +320,6 @@ mpool_sync(mp)
#undef mpool_close
#undef mpool_sync
-#ifndef __APPLE__
#define weak_alias(original, alias) \
asm (".weak " #alias "\n" #alias " = " #original);
weak_alias (__mpool_open, mpool_open)
diff --git a/enum.c b/enum.c
index 2fac1bd47..143b22281 100755
--- a/enum.c
+++ b/enum.c
@@ -15,6 +15,9 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
+#if __APPLE_CC__ >= 1495
+#include <arpa/nameser_compat.h>
+#endif
#include <resolv.h>
#include <stdlib.h>
#include <string.h>
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index d477f0528..9c5ba203e 100755
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -26,7 +26,7 @@ extern "C" {
#ifndef __BYTE_ORDER
#ifdef __linux__
#include <endian.h>
-#elif (defined(__OpenBSD__) || defined(__APPLE__))
+#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
#include <machine/endian.h>
#define __BYTE_ORDER BYTE_ORDER
#define __LITTLE_ENDIAN LITTLE_ENDIAN
@@ -36,11 +36,11 @@ extern "C" {
#define __BYTE_ORDER __LITTLE_ENDIAN
#endif /* __LITTLE_ENDIAN */
-#if (defined(i386))
+#if defined(i386) || defined(__i386__)
#define __BYTE_ORDER __LITTLE_ENDIAN
#endif /* defined i386 */
-#if (defined(sun) && defined(unix) && defined(sparc))
+#if defined(sun) && defined(unix) && defined(sparc)
#define __BYTE_ORDER __BIG_ENDIAN
#endif /* sun unix sparc */
diff --git a/include/asterisk/localtime.h b/include/asterisk/localtime.h
index 320c293d7..d7d6bbe22 100755
--- a/include/asterisk/localtime.h
+++ b/include/asterisk/localtime.h
@@ -18,5 +18,7 @@ extern int ast_tzsetwall(void);
extern void ast_tzset(const char *name);
extern struct tm *ast_localtime(const time_t *timep, struct tm *p_tm, const char *zone);
extern time_t ast_mktime(struct tm * const tmp, const char *zone);
+extern char *ast_ctime(const time_t * const timep);
+extern char *ast_ctime_r(const time_t * const timep, char *buf);
#endif
diff --git a/srv.c b/srv.c
index 19f62851f..c49abbf14 100755
--- a/srv.c
+++ b/srv.c
@@ -14,6 +14,9 @@
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
+#if __APPLE_CC__ >= 1495
+#include <arpa/nameser_compat.h>
+#endif
#include <resolv.h>
#include <stdio.h>
#include <string.h>
@@ -36,22 +39,6 @@ struct srv {
unsigned short portnum;
} __attribute__ ((__packed__));
-static int parse_ie(unsigned char *data, int maxdatalen, unsigned char *src, int srclen)
-{
- int len, olen;
- len = olen = (int)src[0];
- src++;
- srclen--;
- if (len > srclen) {
- ast_log(LOG_WARNING, "Want %d, got %d\n", len, srclen);
- return -1;
- }
- if (len > maxdatalen)
- len = maxdatalen;
- memcpy(data, src, len);
- return olen + 1;
-}
-
static int parse_srv(unsigned char *host, int hostlen, int *portno, unsigned char *answer, int len, unsigned char *msg)
{
int res = 0;
diff --git a/stdtime/localtime.c b/stdtime/localtime.c
index 1ad9bf6c9..f0b67e67e 100755
--- a/stdtime/localtime.c
+++ b/stdtime/localtime.c
@@ -1187,8 +1187,8 @@ register struct tm * const tmp;
#endif /* defined TM_GMTOFF */
}
-static char *
-ctime(timep)
+char *
+ast_ctime(timep)
const time_t * const timep;
{
/*
@@ -1200,8 +1200,8 @@ const time_t * const timep;
return asctime(localtime(timep));
}
-static char *
-ctime_r(timep, buf)
+char *
+ast_ctime_r(timep, buf)
const time_t * const timep;
char *buf;
{