More BSD enhancements

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
Mark Spencer 22 years ago
parent b9d6efa20e
commit 6eeee2496b

@ -13,13 +13,17 @@
.EXPORT_ALL_VARIABLES:
OSARCH=$(shell uname -s)
# Pentium Pro Optimize
#PROC=i686
PROC=i686
# Pentium Optimize
#PROC=i586
#PROC=k6
#PROC=ppc
ifeq (${OSARCH},Linux)
PROC=$(shell uname -m)
endif
######### More GSM codec optimization
######### Uncomment to enable MMXTM optimizations for x86 architecture CPU's
@ -63,6 +67,9 @@ CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarati
CFLAGS+=$(OPTIMIZE)
CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
ifeq (${OSARCH},OpenBSD)
CFLAGS+=-pthread
endif
LIBEDIT=editline/libedit.a
@ -85,7 +92,10 @@ CFLAGS+= $(DEBUG_THREADS)
CFLAGS+= $(TRACE_FRAMES)
CFLAGS+=# -fomit-frame-pointer
SUBDIRS=res channels pbx apps codecs formats agi cdr astman
LIBS=-ldl -lpthread -lncurses -lm #-lnjamd
ifeq (${OSARCH},Linux)
LIBS=-ldl
endif
LIBS+=-lpthread -lncurses -lm #-lnjamd
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 \
@ -147,7 +157,7 @@ build.h:
endif
asterisk: .version build.h editline/libedit.a db1-ast/libdb1.a $(OBJS)
gcc -o asterisk -rdynamic $(OBJS) $(LIBS) $(LIBEDIT) db1-ast/libdb1.a
gcc $(DEBUG) -o asterisk -rdynamic $(OBJS) $(LIBS) $(LIBEDIT) db1-ast/libdb1.a
subdirs:
for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done

@ -27,7 +27,7 @@ APPS=app_dial.so app_playback.so app_voicemail.so app_directory.so app_intercom.
APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so" ; fi)
#APPS+=$(shell if [ -f /usr/include/zap.h ]; then echo "app_rpt.so" ; fi)
CFLAGS+=
CFLAGS+=-fPIC
all: $(APPS)

@ -75,7 +75,7 @@ static int timed_read(int fd, void *data, int datalen)
struct timeval tv = { 2, 0 }; /* Wait no more than 2 seconds */
FD_ZERO(&fds);
FD_SET(fd, &fds);
res = select(fd + 1, &fds, NULL, NULL, &tv);
res = ast_select(fd + 1, &fds, NULL, NULL, &tv);
if (res < 1) {
ast_log(LOG_NOTICE, "Selected timed out/errored out with %d\n", res);
return -1;

@ -130,7 +130,7 @@ static void *netconsole(void *vconsole)
max = con->fd;
if (con->p[0] > max)
max = con->p[0];
res = select(max + 1, &rfds, NULL, NULL, NULL);
res = ast_select(max + 1, &rfds, NULL, NULL, NULL);
if (res < 0) {
ast_log(LOG_WARNING, "select returned < 0: %s\n", strerror(errno));
continue;
@ -672,7 +672,7 @@ static int ast_el_read_char(EditLine *el, char *cp)
max = ast_consock;
if (STDIN_FILENO > max)
max = STDIN_FILENO;
res = select(max+1, &rfds, NULL, NULL, NULL);
res = ast_select(max+1, &rfds, NULL, NULL, NULL);
if (res < 0) {
if (errno == EINTR)
continue;
@ -1369,7 +1369,7 @@ int main(int argc, char *argv[])
} else {
/* Do nothing */
select(0,NULL,NULL,NULL,NULL);
ast_select(0,NULL,NULL,NULL,NULL);
}
return 0;
}

@ -13,7 +13,7 @@
MODS=cdr_csv.so
CFLAGS+=
CFLAGS+=-fPIC
#
# MySQL stuff... Autoconf anyone??

@ -756,10 +756,10 @@ int ast_waitfor_n_fd(int *fds, int n, int *ms, int *exception)
max = fds[x];
}
}
if (*ms >= 0)
res = select(max + 1, &rfds, NULL, &efds, &tv);
if (*ms >= 0)
res = ast_select(max + 1, &rfds, NULL, &efds, &tv);
else
res = select(max + 1, &rfds, NULL, &efds, NULL);
res = ast_select(max + 1, &rfds, NULL, &efds, NULL);
if (res < 0) {
/* Simulate a timeout if we were interrupted */
@ -828,10 +828,10 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds,
if (fds[x] > max)
max = fds[x];
}
if (*ms >= 0)
res = select(max + 1, &rfds, NULL, &efds, &tv);
if (*ms >= 0)
res = ast_select(max + 1, &rfds, NULL, &efds, &tv);
else
res = select(max + 1, &rfds, NULL, &efds, NULL);
res = ast_select(max + 1, &rfds, NULL, &efds, NULL);
if (res < 0) {
for (x=0;x<n;x++)

@ -11,6 +11,8 @@
# the GNU General Public License
#
OSARCH=$(shell uname -s)
CHANNEL_LIBS=chan_modem.so chan_iax.so chan_sip.so \
chan_modem_aopen.so chan_oss.so \
chan_modem_bestdata.so chan_modem_i4l.so \
@ -41,6 +43,7 @@ ALSA_SRC=chan_alsa.c
ALSA_SRC+=$(shell [ -f alsa-monitor.h ] && echo "alsa-monitor.h")
CFLAGS+=-DCRYPTO
CFLAGS+=-fPIC
CFLAGS+=#-DVOFRDUMPER
@ -76,7 +79,11 @@ ringtone.h: gentone
chan_oss.o: chan_oss.c busy.h ringtone.h
chan_iax2.so: chan_iax2.o iax2-parser.o
ifeq (${OSARCH},Linux)
$(CC) -shared -Xlinker -x -o $@ chan_iax2.o iax2-parser.o
else
$(CC) -shared -Xlinker -x -o $@ chan_iax2.o iax2-parser.o -lossaudio
endif
chan_zap.o: $(CHANZAP)
$(CC) -c $(CFLAGS) -o chan_zap.o $(CHANZAP)

@ -262,7 +262,7 @@ static void *sound_thread(void *unused)
max = readdev;
}
#endif
res = select(max + 1, &rfds, &wfds, NULL, NULL);
res = ast_select(max + 1, &rfds, &wfds, NULL, NULL);
if (res < 1) {
ast_log(LOG_WARNING, "select failed: %s\n", strerror(errno));
continue;

@ -609,7 +609,7 @@ static void *do_monitor(void *data)
#endif
/* Wait indefinitely for something to happen */
pthread_testcancel();
res = select(n + 1, &rfds, NULL, &efds, NULL);
res = ast_select(n + 1, &rfds, NULL, &efds, NULL);
pthread_testcancel();
/* Okay, select has finished. Let's see what happened. */
if (res < 1) {

@ -245,7 +245,7 @@ static void *sound_thread(void *unused)
if (sounddev > max)
max = sounddev;
}
res = select(max + 1, &rfds, &wfds, NULL, NULL);
res = ast_select(max + 1, &rfds, &wfds, NULL, NULL);
if (res < 1) {
ast_log(LOG_WARNING, "select failed: %s\n", strerror(errno));
continue;

@ -848,9 +848,9 @@ static void *do_monitor(void *data)
tv.tv_usec = 30000;
tv.tv_sec = 0;
}
res = select(n + 1, &rfds, NULL, &efds, &tv);
res = ast_select(n + 1, &rfds, NULL, &efds, &tv);
} else {
res = select(n + 1, &rfds, NULL, &efds, NULL);
res = ast_select(n + 1, &rfds, NULL, &efds, NULL);
tv.tv_usec = 0;
tv.tv_sec = 0;
tonepos = 0;

@ -564,7 +564,7 @@ retry:
fd_set fds;
FD_ZERO(&fds);
FD_SET(p->s, &fds);
select(p->s + 1, &fds, NULL, NULL, NULL);
ast_select(p->s + 1, &fds, NULL, NULL, NULL);
goto retry;
}
ast->blocking = 0;
@ -953,7 +953,7 @@ static void *do_monitor(void *data)
ast_pthread_mutex_unlock(&monlock);
pthread_testcancel();
/* Wait indefinitely for something to happen */
res = select(n + 1, &rfds, NULL, NULL, NULL);
res = ast_select(n + 1, &rfds, NULL, NULL, NULL);
pthread_testcancel();
/* Okay, select has finished. Let's see what happened. */
if (res < 0) {

@ -1863,7 +1863,7 @@ int x;
FD_ZERO(&efds);
FD_SET(fd,&wfds);
FD_SET(fd,&efds);
res = select(fd + 1,NULL,&wfds,&efds,NULL);
res = ast_select(fd + 1,NULL,&wfds,&efds,NULL);
if (!res) {
ast_log(LOG_DEBUG, "select (for write) ret. 0 on channel %d\n", p->channel);
continue;
@ -4417,7 +4417,7 @@ static void *do_monitor(void *data)
/* Wait at least a second for something to happen */
tv.tv_sec = 1;
tv.tv_usec = 0;
res = select(n + 1, &rfds, NULL, &efds, &tv);
res = ast_select(n + 1, &rfds, NULL, &efds, &tv);
pthread_testcancel();
/* Okay, select has finished. Let's see what happened. */
if (res < 0) {
@ -5447,7 +5447,7 @@ static void *pri_dchannel(void *vpri)
pthread_mutex_unlock(&pri->lock);
e = NULL;
res = select(pri->fd + 1, &rfds, NULL, &efds, &tv);
res = ast_select(pri->fd + 1, &rfds, NULL, &efds, &tv);
ast_pthread_mutex_lock(&pri->lock);
if (!res) {
@ -6982,7 +6982,7 @@ static int zt_sendtext(struct ast_channel *c, char *text)
FD_ZERO(&efds);
FD_SET(fd,&wfds);
FD_SET(fd,&efds);
res = select(fd + 1,NULL,&wfds,&efds,NULL);
res = ast_select(fd + 1,NULL,&wfds,&efds,NULL);
if (!res) {
ast_log(LOG_DEBUG, "select (for write) ret. 0 on channel %d\n", p->channel);
continue;

@ -1673,7 +1673,7 @@ int x;
FD_ZERO(&efds);
FD_SET(fd,&wfds);
FD_SET(fd,&efds);
res = select(fd + 1,NULL,&wfds,&efds,NULL);
res = ast_select(fd + 1,NULL,&wfds,&efds,NULL);
if (!res) {
ast_log(LOG_DEBUG, "select (for write) ret. 0 on channel %d\n", p->channel);
continue;
@ -4055,7 +4055,7 @@ static void *do_monitor(void *data)
/* Wait at least a second for something to happen */
tv.tv_sec = 1;
tv.tv_usec = 0;
res = select(n + 1, &rfds, NULL, &efds, &tv);
res = ast_select(n + 1, &rfds, NULL, &efds, &tv);
pthread_testcancel();
/* Okay, select has finished. Let's see what happened. */
if (res < 0) {
@ -5114,7 +5114,7 @@ static void *pri_dchannel(void *vpri)
pthread_mutex_unlock(&pri->lock);
e = NULL;
res = select(pri->fd + 1, &rfds, NULL, &efds, &tv);
res = ast_select(pri->fd + 1, &rfds, NULL, &efds, &tv);
ast_pthread_mutex_lock(&pri->lock);
if (!res) {
@ -6550,7 +6550,7 @@ static int zt_sendtext(struct ast_channel *c, char *text)
FD_ZERO(&efds);
FD_SET(fd,&wfds);
FD_SET(fd,&efds);
res = select(fd + 1,NULL,&wfds,&efds,NULL);
res = ast_select(fd + 1,NULL,&wfds,&efds,NULL);
if (!res) {
ast_log(LOG_DEBUG, "select (for write) ret. 0 on channel %d\n", p->channel);
continue;

@ -21,7 +21,7 @@ MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/local/include/speex.h ] && echo "codec_speex.so")
MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
CFLAGS+=
CFLAGS+=-fPIC
LIBG723=g723.1/libg723.a
LIBG723B=g723.1b/libg723b.a

@ -55,7 +55,7 @@ PG =
# CCFLAGS = -c -O
CC = gcc -ansi -pedantic $(OPTIMIZE) -march=$(PROC) -fschedule-insns2 -fomit-frame-pointer
CCFLAGS += -c -DNeedFunctionPrototypes=1 -finline-functions -funroll-loops
CCFLAGS += -c -DNeedFunctionPrototypes=1 -finline-functions -funroll-loops -fPIC
LD = $(CC)
@ -175,7 +175,6 @@ GSM_SOURCES = $(SRC)/add.c \
$(SRC)/code.c \
$(SRC)/debug.c \
$(SRC)/decode.c \
$(SRC)/k6opt.s \
$(SRC)/long_term.c \
$(SRC)/lpc.c \
$(SRC)/preprocess.c \
@ -190,6 +189,9 @@ GSM_SOURCES = $(SRC)/add.c \
$(SRC)/gsm_option.c \
$(SRC)/short_term.c \
$(SRC)/table.c
ifneq (${OSARCH},OpenBSD)
GSM_SOURCES+= $(SRC)/k6opt.s
endif
TOAST_SOURCES = $(SRC)/toast.c \
$(SRC)/toast_lin.c \
@ -220,7 +222,6 @@ GSM_OBJECTS = $(SRC)/add.o \
$(SRC)/code.o \
$(SRC)/debug.o \
$(SRC)/decode.o \
$(SRC)/k6opt.o \
$(SRC)/long_term.o \
$(SRC)/lpc.o \
$(SRC)/preprocess.o \
@ -235,6 +236,9 @@ GSM_OBJECTS = $(SRC)/add.o \
$(SRC)/gsm_option.o \
$(SRC)/short_term.o \
$(SRC)/table.o
ifneq (${OSARCH},OpenBSD)
GSM_OBJECTS+= $(SRC)/k6opt.o
endif
TOAST_OBJECTS = $(SRC)/toast.o \
$(SRC)/toast_lin.o \

@ -1,3 +1,4 @@
CFLAGS+= -fPIC -O3
LIB=libilbc.a
OBJS= anaFilter.o iCBSearch.o packing.o \

@ -22,7 +22,7 @@ LIB_TARGET_DIR = .
#
WARNINGS = -Wall -Wno-comment -Wno-error
CFLAGS = $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS)
CFLAGS = $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS) -fPIC
#CFLAGS+= $(shell if uname -m | grep -q 86; then echo "-mpentium" ; fi)
#fix for PPC processors

@ -1,7 +1,7 @@
#
# LMC section
CFLAGS+= -I../include -Iinclude -O6 -funroll-loops -finline-functions -Wall -Wno-missing-prototypes -Wno-missing-declarations -g
CFLAGS+= -I../include -Iinclude -O6 -funroll-loops -finline-functions -Wall -Wno-missing-prototypes -Wno-missing-declarations -g -fPIC
RANLIB=ranlib
# the XING decoder objs and dependencies:

@ -117,14 +117,14 @@ typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
/* Access method description structure. */
typedef struct __db {
DBTYPE type; /* Underlying db type. */
int (*close) __PMT((struct __db *));
int (*del) __PMT((const struct __db *, const DBT *, u_int));
int (*get) __PMT((const struct __db *, const DBT *, DBT *, u_int));
int (*put) __PMT((const struct __db *, DBT *, const DBT *, u_int));
int (*seq) __PMT((const struct __db *, DBT *, DBT *, u_int));
int (*sync) __PMT((const struct __db *, u_int));
int (*close) __P((struct __db *));
int (*del) __P((const struct __db *, const DBT *, u_int));
int (*get) __P((const struct __db *, const DBT *, DBT *, u_int));
int (*put) __P((const struct __db *, DBT *, const DBT *, u_int));
int (*seq) __P((const struct __db *, DBT *, DBT *, u_int));
int (*sync) __P((const struct __db *, u_int));
void *internal; /* Access method private. */
int (*fd) __PMT((const struct __db *));
int (*fd) __P((const struct __db *));
} DB;
#define BTREEMAGIC 0x053162
@ -139,9 +139,9 @@ typedef struct {
int minkeypage; /* minimum keys per page */
u_int psize; /* page size */
int (*compare) /* comparison function */
__PMT((const DBT *, const DBT *));
__P((const DBT *, const DBT *));
size_t (*prefix) /* prefix function */
__PMT((const DBT *, const DBT *));
__P((const DBT *, const DBT *));
int lorder; /* byte order */
} BTREEINFO;
@ -155,7 +155,7 @@ typedef struct {
u_int nelem; /* number of elements */
u_int cachesize; /* bytes to cache */
u_int32_t /* hash function */
(*hash) __PMT((const void *, size_t));
(*hash) __P((const void *, size_t));
int lorder; /* byte order */
} HASHINFO;

@ -70,9 +70,9 @@ typedef struct MPOOL {
u_long pagesize; /* file page size */
int fd; /* file descriptor */
/* page in conversion routine */
void (*pgin) __PMT((void *, pgno_t, void *));
void (*pgin) __P((void *, pgno_t, void *));
/* page out conversion routine */
void (*pgout) __PMT((void *, pgno_t, void *));
void (*pgout) __P((void *, pgno_t, void *));
void *pgcookie; /* cookie for page in/out routines */
#ifdef STATISTICS
u_long cachehit;

190
editline/configure vendored

@ -841,7 +841,7 @@ echo "$ac_t""$CPP" 1>&6
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
for ac_dir in ${GNUSYSTEM_AUX_DIR} $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@ -1465,91 +1465,15 @@ fi
done
cat > conftest.$ac_ext <<EOF
#line 1470 "configure"
#include "confdefs.h"
#include <sys/cdefs.h>
#ifdef __RCSID
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "yes" >/dev/null 2>&1; then
:
else
rm -rf conftest*
CPPFLAGS="$CPPFLAGS '-D__RCSID(x)='"
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 1489 "configure"
#include "confdefs.h"
#include <sys/cdefs.h>
#ifdef __COPYRIGHT
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "yes" >/dev/null 2>&1; then
:
else
rm -rf conftest*
CPPFLAGS="$CPPFLAGS '-D__COPYRIGHT(x)='"
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 1508 "configure"
#include "confdefs.h"
#include <sys/cdefs.h>
#ifdef __RENAME
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "yes" >/dev/null 2>&1; then
:
else
rm -rf conftest*
CPPFLAGS="$CPPFLAGS '-D__RENAME(x)='"
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 1527 "configure"
#include "confdefs.h"
#include <sys/cdefs.h>
#ifdef _DIAGASSERT
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "yes" >/dev/null 2>&1; then
:
else
rm -rf conftest*
CPPFLAGS="$CPPFLAGS '-D_DIAGASSERT(x)='"
fi
rm -f conftest*
for ac_func in issetugid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1548: checking for $ac_func" >&5
echo "configure:1472: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1553 "configure"
#line 1477 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1572,7 +1496,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1599,12 +1523,12 @@ done
for ac_func in strlcat
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1603: checking for $ac_func" >&5
echo "configure:1527: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1608 "configure"
#line 1532 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1627,7 +1551,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1655,12 +1579,12 @@ done
for ac_func in strlcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1659: checking for $ac_func" >&5
echo "configure:1583: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1664 "configure"
#line 1588 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1683,7 +1607,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1711,12 +1635,12 @@ done
for ac_func in fgetln
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1715: checking for $ac_func" >&5
echo "configure:1639: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1720 "configure"
#line 1644 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1739,7 +1663,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1767,12 +1691,12 @@ done
for ac_func in strvis
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1771: checking for $ac_func" >&5
echo "configure:1695: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1776 "configure"
#line 1700 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1795,7 +1719,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1823,12 +1747,12 @@ done
for ac_func in strunvis
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1827: checking for $ac_func" >&5
echo "configure:1751: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1832 "configure"
#line 1756 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1851,7 +1775,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1877,6 +1801,82 @@ fi
done
cat > conftest.$ac_ext <<EOF
#line 1806 "configure"
#include "confdefs.h"
#include <sys/cdefs.h>
#ifdef __RCSID
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "yes" >/dev/null 2>&1; then
:
else
rm -rf conftest*
CPPFLAGS="$CPPFLAGS '-D__RCSID(x)='"
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 1825 "configure"
#include "confdefs.h"
#include <sys/cdefs.h>
#ifdef __COPYRIGHT
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "yes" >/dev/null 2>&1; then
:
else
rm -rf conftest*
CPPFLAGS="$CPPFLAGS '-D__COPYRIGHT(x)='"
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 1844 "configure"
#include "confdefs.h"
#include <sys/cdefs.h>
#ifdef __RENAME
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "yes" >/dev/null 2>&1; then
:
else
rm -rf conftest*
CPPFLAGS="$CPPFLAGS '-D__RENAME(x)='"
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 1863 "configure"
#include "confdefs.h"
#include <sys/cdefs.h>
#ifdef _DIAGASSERT
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "yes" >/dev/null 2>&1; then
:
else
rm -rf conftest*
CPPFLAGS="$CPPFLAGS '-D_DIAGASSERT(x)='"
fi
rm -f conftest*
# Check whether --enable-readline or --disable-readline was given.
if test "${enable_readline+set}" = set; then
enableval="$enable_readline"

@ -76,6 +76,13 @@ AC_CHECK_HEADERS(termcap.h, , \
AC_CHECK_HEADERS(sys/cdefs.h vis.h)
AC_CHECK_FUNCS(issetugid)
AC_CHECK_FUNCS(strlcat, , CCSRCS="$CCSRCS np/strlcat.c")
AC_CHECK_FUNCS(strlcpy, , CCSRCS="$CCSRCS np/strlcpy.c")
AC_CHECK_FUNCS(fgetln, , CCSRCS="$CCSRCS np/fgetln.c")
AC_CHECK_FUNCS(strvis, , CCSRCS="$CCSRCS np/vis.c")
AC_CHECK_FUNCS(strunvis, , CCSRCS="$CCSRCS np/unvis.c")
AC_EGREP_CPP(yes,
[#include <sys/cdefs.h>
#ifdef __RCSID
@ -104,13 +111,6 @@ AC_EGREP_CPP(yes,
#endif
], , [CPPFLAGS="$CPPFLAGS '-D_DIAGASSERT(x)='"])
AC_CHECK_FUNCS(issetugid)
AC_CHECK_FUNCS(strlcat, , CCSRCS="$CCSRCS np/strlcat.c")
AC_CHECK_FUNCS(strlcpy, , CCSRCS="$CCSRCS np/strlcpy.c")
AC_CHECK_FUNCS(fgetln, , CCSRCS="$CCSRCS np/fgetln.c")
AC_CHECK_FUNCS(strvis, , CCSRCS="$CCSRCS np/vis.c")
AC_CHECK_FUNCS(strunvis, , CCSRCS="$CCSRCS np/unvis.c")
dnl Enable readline compatibility by default.
AC_ARG_ENABLE(readline, [ --disable-readline Disable readline compatibility],
if test "x$enable_readline" != "xyes" ; then

@ -17,7 +17,7 @@ FORMAT_LIBS+=format_jpeg.so
GSMLIB=../codecs/gsm/lib/libgsm.a
CFLAGS+=
CFLAGS+=-fPIC
all: $(FORMAT_LIBS)

@ -669,6 +669,45 @@ int ast_autoservice_start(struct ast_channel *chan);
/*! Stop servicing a channel for us... Returns -1 on error or if channel has been hungup */
int ast_autoservice_stop(struct ast_channel *chan);
/* Misc. functions below */
//! Waits for activity on a group of channels
/*!
* \param nfds the maximum number of file descriptors in the sets
* \param rfds file descriptors to check for read availability
* \param wfds file descriptors to check for write availability
* \param efds file descriptors to check for exceptions (OOB data)
* \param tvp timeout while waiting for events
* This is the same as a standard select(), except it guarantees the
* behaviour where the passed struct timeval is updated with how much
* time was not slept while waiting for the specified events
*/
static inline int ast_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tvp)
{
#ifdef __linux__
return select(nfds, rfds, wfds, efds, tvp);
#else
if (tvp) {
struct timeval tv, tvstart, tvend, tvlen;
int res;
tv = *tvp;
gettimeofday(&tvstart, NULL);
res = select(nfds, rfds, wfds, efds, tvp);
gettimeofday(&tvend, NULL);
timersub(&tvend, &tvstart, &tvlen);
timersub(&tv, &tvlen, tvp);
if (tvp->tv_sec < 0 || (tvp->tv_sec == 0 && tvp->tv_usec < 0)) {
tvp->tv_sec = 0;
tvp->tv_usec = 0;
}
return res;
}
else
return(nfds, rfds, wfds, efds, NULL);
#endif
}
#ifdef DO_CRASH
#define CRASH do { fprintf(stderr, "!! Forcing immediate crash a-la abort !!\n"); *((int *)0) = 0; } while(0)
#else

@ -539,7 +539,7 @@ static int get_input(struct mansession *s, char *output)
}
FD_ZERO(&fds);
FD_SET(s->fd, &fds);
res = select(s->fd + 1, &fds, NULL, NULL, NULL);
res = ast_select(s->fd + 1, &fds, NULL, NULL, NULL);
if (res < 0) {
ast_log(LOG_WARNING, "Select returned error: %s\n", strerror(errno));
} else if (res > 0) {

@ -27,7 +27,7 @@ GTK_LIBS=`gtk-config --libs gthread`
MOC=$(QTDIR)/bin/moc
KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui
CFLAGS+=
CFLAGS+=-fPIC
KDE_CONSOLE_OBJS=pbx_kdeconsole_main.o pbx_kdeconsole.o

@ -20,7 +20,7 @@ CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
#
# Work around buggy RedHat 9.0
#
CFLAGS+=-DOPENSSL_NO_KRB5
CFLAGS+=-DOPENSSL_NO_KRB5 -fPIC
all: $(MODS)

@ -443,7 +443,7 @@ std: for (x=0;x<AST_MAX_FDS;x++) {
tv.tv_sec = ms / 1000;
tv.tv_usec = (ms % 1000) * 1000;
/* Wait for something to happen */
select(max + 1, &rfds, NULL, &efds, (ms > -1) ? &tv : NULL);
ast_select(max + 1, &rfds, NULL, &efds, (ms > -1) ? &tv : NULL);
pthread_testcancel();
}
return NULL; /* Never reached */

Loading…
Cancel
Save