dect
/
asterisk
Archived
13
0
Fork 0

More cleanups and OSX fixes for 10.3

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1678 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2003-10-27 20:00:41 +00:00
parent 73f4bc8c25
commit 854adbe3bd
12 changed files with 48 additions and 65 deletions

View File

@ -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 \

View File

@ -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")

View File

@ -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

View File

@ -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);

View File

@ -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)

View File

@ -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)

View File

@ -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)

3
enum.c
View File

@ -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>

View File

@ -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 */

View File

@ -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

19
srv.c
View File

@ -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;

View File

@ -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;
{