mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
More cleanups and OSX fixes for 10.3
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
5
Makefile
5
Makefile
@@ -151,6 +151,11 @@ LIBS+=-lncurses -lm
|
|||||||
ifeq (${OSARCH},Linux)
|
ifeq (${OSARCH},Linux)
|
||||||
LIBS+=-lresolv #-lnjamd
|
LIBS+=-lresolv #-lnjamd
|
||||||
endif
|
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 \
|
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 \
|
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 \
|
ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
|
||||||
|
@@ -27,8 +27,7 @@ CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include"
|
|||||||
LIBG723=g723.1/libg723.a
|
LIBG723=g723.1/libg723.a
|
||||||
LIBG723B=g723.1b/libg723b.a
|
LIBG723B=g723.1b/libg723b.a
|
||||||
LIBGSM=gsm/lib/libgsm.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=gsm/lib/libgsm.a
|
||||||
LIBGSMT=$(shell if uname -m | grep -q 86; then echo gsm/lib/libgsm.a; fi)
|
|
||||||
LIBMP3=mp3/libmp3.a
|
LIBMP3=mp3/libmp3.a
|
||||||
LIBLPC10=lpc10/liblpc10.a
|
LIBLPC10=lpc10/liblpc10.a
|
||||||
LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
|
LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
|
||||||
|
@@ -37,6 +37,10 @@ WAV49 = -DWAV49
|
|||||||
######### ppro's, etc, as well as the AMD K6 and K7. The compile will
|
######### ppro's, etc, as well as the AMD K6 and K7. The compile will
|
||||||
######### probably require gcc.
|
######### probably require gcc.
|
||||||
|
|
||||||
|
ifneq (${OSARCH},Darwin)
|
||||||
|
OPTIMIZE+=-march=$(PROC)
|
||||||
|
endif
|
||||||
|
|
||||||
PG =
|
PG =
|
||||||
#PG = -g -pg
|
#PG = -g -pg
|
||||||
######### Profiling flags. If you don't know what that means, leave it blank.
|
######### Profiling flags. If you don't know what that means, leave it blank.
|
||||||
@@ -54,7 +58,7 @@ PG =
|
|||||||
# CC = /usr/lang/acc
|
# CC = /usr/lang/acc
|
||||||
# CCFLAGS = -c -O
|
# CCFLAGS = -c -O
|
||||||
|
|
||||||
CC = gcc $(OPTIMIZE) -march=$(PROC) -fomit-frame-pointer
|
CC = gcc $(OPTIMIZE) -fomit-frame-pointer
|
||||||
CCFLAGS += -c -DNeedFunctionPrototypes=1 -funroll-loops -fPIC
|
CCFLAGS += -c -DNeedFunctionPrototypes=1 -funroll-loops -fPIC
|
||||||
|
|
||||||
LD = $(CC)
|
LD = $(CC)
|
||||||
@@ -189,7 +193,7 @@ GSM_SOURCES = $(SRC)/add.c \
|
|||||||
$(SRC)/gsm_option.c \
|
$(SRC)/gsm_option.c \
|
||||||
$(SRC)/short_term.c \
|
$(SRC)/short_term.c \
|
||||||
$(SRC)/table.c
|
$(SRC)/table.c
|
||||||
ifneq (${OSARCH},OpenBSD)
|
ifeq (${OSARCH},Linux)
|
||||||
GSM_SOURCES+= $(SRC)/k6opt.s
|
GSM_SOURCES+= $(SRC)/k6opt.s
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -236,7 +240,7 @@ GSM_OBJECTS = $(SRC)/add.o \
|
|||||||
$(SRC)/gsm_option.o \
|
$(SRC)/gsm_option.o \
|
||||||
$(SRC)/short_term.o \
|
$(SRC)/short_term.o \
|
||||||
$(SRC)/table.o
|
$(SRC)/table.o
|
||||||
ifneq (${OSARCH},OpenBSD)
|
ifeq (${OSARCH},Linux)
|
||||||
GSM_OBJECTS+= $(SRC)/k6opt.o
|
GSM_OBJECTS+= $(SRC)/k6opt.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -62,6 +62,10 @@ void Gsm_Coder P8((S,s,LARc,Nc,bc,Mc,xmaxc,xMc),
|
|||||||
|
|
||||||
word so[160];
|
word so[160];
|
||||||
|
|
||||||
|
#if !(defined(__GNUC__) && defined(__i386__))
|
||||||
|
longword ltmp;
|
||||||
|
#endif
|
||||||
|
|
||||||
Gsm_Preprocess (S, s, so);
|
Gsm_Preprocess (S, s, so);
|
||||||
Gsm_LPC_Analysis (S, so, LARc);
|
Gsm_LPC_Analysis (S, so, LARc);
|
||||||
Gsm_Short_Term_Analysis_Filter (S, LARc, so);
|
Gsm_Short_Term_Analysis_Filter (S, LARc, so);
|
||||||
|
@@ -37,42 +37,17 @@ LIB = $(LIB_TARGET_DIR)/liblpc10.a
|
|||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
all: $(LIB)
|
all: $(LIB)
|
||||||
ranlib $(LIB)
|
|
||||||
|
|
||||||
$(LIB): $(LIB)(f2clib.o) \
|
OBJ= f2clib.o analys.o bsynz.o chanwr.o dcbias.o decode.o \
|
||||||
$(LIB)(analys.o) \
|
deemp.o difmag.o dyptrk.o encode.o energy.o ham84.o \
|
||||||
$(LIB)(bsynz.o) \
|
hp100.o invert.o irc2pc.o ivfilt.o lpcdec.o lpcenc.o \
|
||||||
$(LIB)(chanwr.o) \
|
lpcini.o lpfilt.o median.o mload.o onset.o pitsyn.o \
|
||||||
$(LIB)(dcbias.o) \
|
placea.o placev.o preemp.o prepro.o random.o rcchk.o \
|
||||||
$(LIB)(decode.o) \
|
synths.o tbdm.o voicin.o vparms.o
|
||||||
$(LIB)(deemp.o) \
|
|
||||||
$(LIB)(difmag.o) \
|
$(LIB): $(OBJ)
|
||||||
$(LIB)(dyptrk.o) \
|
$(AR) cr $@ $(OBJ)
|
||||||
$(LIB)(encode.o) \
|
ranlib $@
|
||||||
$(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)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f *.o $(LIB)
|
-rm -f *.o $(LIB)
|
||||||
|
@@ -44,7 +44,9 @@ static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94";
|
|||||||
|
|
||||||
#include <db.h>
|
#include <db.h>
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
#define dbopen __dbopen
|
#define dbopen __dbopen
|
||||||
|
#endif
|
||||||
|
|
||||||
DB *
|
DB *
|
||||||
dbopen(fname, flags, mode, type, openinfo)
|
dbopen(fname, flags, mode, type, openinfo)
|
||||||
@@ -74,8 +76,8 @@ dbopen(fname, flags, mode, type, openinfo)
|
|||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
#undef dbopen
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
|
#undef dbopen
|
||||||
#define weak_alias(original, alias) \
|
#define weak_alias(original, alias) \
|
||||||
asm (".weak " #alias "\n" #alias " = " #original);
|
asm (".weak " #alias "\n" #alias " = " #original);
|
||||||
weak_alias (__dbopen, dbopen)
|
weak_alias (__dbopen, dbopen)
|
||||||
|
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
|
|||||||
#define __MPOOLINTERFACE_PRIVATE
|
#define __MPOOLINTERFACE_PRIVATE
|
||||||
#include <mpool.h>
|
#include <mpool.h>
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
#define mpool_open __mpool_open
|
#define mpool_open __mpool_open
|
||||||
#define mpool_filter __mpool_filter
|
#define mpool_filter __mpool_filter
|
||||||
#define mpool_new __mpool_new
|
#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_put __mpool_put
|
||||||
#define mpool_sync __mpool_sync
|
#define mpool_sync __mpool_sync
|
||||||
#define mpool_close __mpool_close
|
#define mpool_close __mpool_close
|
||||||
|
#endif
|
||||||
|
|
||||||
static BKT *mpool_bkt __P((MPOOL *));
|
static BKT *mpool_bkt __P((MPOOL *));
|
||||||
static BKT *mpool_look __P((MPOOL *, pgno_t));
|
static BKT *mpool_look __P((MPOOL *, pgno_t));
|
||||||
@@ -309,6 +311,7 @@ mpool_sync(mp)
|
|||||||
return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
|
return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
#undef mpool_open
|
#undef mpool_open
|
||||||
#undef mpool_filter
|
#undef mpool_filter
|
||||||
#undef mpool_new
|
#undef mpool_new
|
||||||
@@ -317,7 +320,6 @@ mpool_sync(mp)
|
|||||||
#undef mpool_close
|
#undef mpool_close
|
||||||
#undef mpool_sync
|
#undef mpool_sync
|
||||||
|
|
||||||
#ifndef __APPLE__
|
|
||||||
#define weak_alias(original, alias) \
|
#define weak_alias(original, alias) \
|
||||||
asm (".weak " #alias "\n" #alias " = " #original);
|
asm (".weak " #alias "\n" #alias " = " #original);
|
||||||
weak_alias (__mpool_open, mpool_open)
|
weak_alias (__mpool_open, mpool_open)
|
||||||
|
3
enum.c
3
enum.c
@@ -15,6 +15,9 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
|
#if __APPLE_CC__ >= 1495
|
||||||
|
#include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
#include <resolv.h>
|
#include <resolv.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@@ -26,7 +26,7 @@ extern "C" {
|
|||||||
#ifndef __BYTE_ORDER
|
#ifndef __BYTE_ORDER
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#elif (defined(__OpenBSD__) || defined(__APPLE__))
|
#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
||||||
#include <machine/endian.h>
|
#include <machine/endian.h>
|
||||||
#define __BYTE_ORDER BYTE_ORDER
|
#define __BYTE_ORDER BYTE_ORDER
|
||||||
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
||||||
@@ -36,11 +36,11 @@ extern "C" {
|
|||||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
#define __BYTE_ORDER __LITTLE_ENDIAN
|
||||||
#endif /* __LITTLE_ENDIAN */
|
#endif /* __LITTLE_ENDIAN */
|
||||||
|
|
||||||
#if (defined(i386))
|
#if defined(i386) || defined(__i386__)
|
||||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
#define __BYTE_ORDER __LITTLE_ENDIAN
|
||||||
#endif /* defined i386 */
|
#endif /* defined i386 */
|
||||||
|
|
||||||
#if (defined(sun) && defined(unix) && defined(sparc))
|
#if defined(sun) && defined(unix) && defined(sparc)
|
||||||
#define __BYTE_ORDER __BIG_ENDIAN
|
#define __BYTE_ORDER __BIG_ENDIAN
|
||||||
#endif /* sun unix sparc */
|
#endif /* sun unix sparc */
|
||||||
|
|
||||||
|
@@ -18,5 +18,7 @@ extern int ast_tzsetwall(void);
|
|||||||
extern void ast_tzset(const char *name);
|
extern void ast_tzset(const char *name);
|
||||||
extern struct tm *ast_localtime(const time_t *timep, struct tm *p_tm, const char *zone);
|
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 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
|
#endif
|
||||||
|
19
srv.c
19
srv.c
@@ -14,6 +14,9 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
|
#if __APPLE_CC__ >= 1495
|
||||||
|
#include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
#include <resolv.h>
|
#include <resolv.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -36,22 +39,6 @@ struct srv {
|
|||||||
unsigned short portnum;
|
unsigned short portnum;
|
||||||
} __attribute__ ((__packed__));
|
} __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)
|
static int parse_srv(unsigned char *host, int hostlen, int *portno, unsigned char *answer, int len, unsigned char *msg)
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
@@ -1187,8 +1187,8 @@ register struct tm * const tmp;
|
|||||||
#endif /* defined TM_GMTOFF */
|
#endif /* defined TM_GMTOFF */
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
char *
|
||||||
ctime(timep)
|
ast_ctime(timep)
|
||||||
const time_t * const timep;
|
const time_t * const timep;
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -1200,8 +1200,8 @@ const time_t * const timep;
|
|||||||
return asctime(localtime(timep));
|
return asctime(localtime(timep));
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
char *
|
||||||
ctime_r(timep, buf)
|
ast_ctime_r(timep, buf)
|
||||||
const time_t * const timep;
|
const time_t * const timep;
|
||||||
char *buf;
|
char *buf;
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user