Add support for Solaris/x86 (bug #3064)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Mark Spencer 20 years ago
parent 4c4264a448
commit f9cfe60312

@ -1055,7 +1055,7 @@ static int str2r2prot(char *swtype)
}
#endif
static char *sig2str(int sig)
static char *zap_sig2str(int sig)
{
static char buf[256];
switch(sig) {
@ -1111,6 +1111,8 @@ static char *sig2str(int sig)
}
}
#define sig2str zap_sig2str
static int conf_add(struct zt_pvt *p, struct zt_subchannel *c, int index, int slavechannel)
{
/* If the conference already exists, and we're already in it

@ -30,7 +30,7 @@ static int frames = 0;
static int iframes = 0;
static int oframes = 0;
#ifdef SOLARIS
#if defined(SOLARIS) && defined(__sparc__)
static unsigned int get_uint32(unsigned char *p)
{
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];

@ -51,6 +51,10 @@ static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94";
#include <assert.h>
#endif
#ifdef SOLARIS
#include <solaris-compat/compat.h>
#endif
#include <db.h>
#include "hash.h"
#include "page.h"

@ -14,6 +14,9 @@
#ifndef _ASTERISK_CHANNEL_H
#define _ASTERISK_CHANNEL_H
#ifdef SOLARIS
#include <solaris-compat/compat.h>
#endif
#include <asterisk/frame.h>
#include <asterisk/sched.h>
#include <asterisk/chanvars.h>

@ -13,7 +13,9 @@
#ifndef _LOGGER_H
#define _LOGGER_H
#ifdef SOLARIS
#include <solaris-compat/compat.h>
#endif
#include <stdarg.h>
#if defined(__cplusplus) || defined(c_plusplus)

@ -12,6 +12,9 @@
#ifndef _ASTERISK_UTIL_H
#define _ASTERISK_UTIL_H
#ifdef SOLARIS
#include <solaris-compat/compat.h>
#endif
#include <netinet/in.h>
#include <netdb.h>
#include <pthread.h>

@ -8,18 +8,29 @@
#define __P(p) p
#endif
#define LITTLE_ENDIAN 1234
#define BIG_ENDIAN 4321
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#include <alloca.h>
#include <strings.h>
#include <string.h>
#include <pthread.h>
#include <sys/stat.h>
#include <signal.h>
#include <netinet/in.h>
#ifndef BYTE_ORDER
#define LITTLE_ENDIAN 1234
#define BIG_ENDIAN 4321
#ifdef __sparc__
#define BYTE_ORDER BIG_ENDIAN
#define __BYTE_ORDER BIG_ENDIAN
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#define ____BYTE_ORDER BIG_ENDIAN
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#endif
#ifndef __BYTE_ORDER
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#define __BIG_ENDIAN BIG_ENDIAN
#define __BYTE_ORDER BYTE_ORDER
#endif
#ifndef __BIT_TYPES_DEFINED__
@ -29,6 +40,9 @@ typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
#endif
char* strsep(char** str, const char* delims);
uint64_t
strtoq(const char *nptr, char **endptr, int base);
int setenv(const char *name, const char *value, int overwrite);
int unsetenv(const char *name);
#endif

@ -15,12 +15,12 @@ fi
## Clean out CFLAGS for the spec file.
LOCAL_CFLAGS=$(echo $CFLAGS | sed -e 's/\s*-pipe\s*//g' | sed -e 's/-[Wmp]\S*\s*//g' | \
sed -r -e 's/-I(include|\.\.\/include) //g' |
sed -e 's/-DINSTALL_PREFIX=\S* //g' |
sed -r -e 's/-DASTERISK_VERSION=\S* //g' |
sed -r -e 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g'
)
LOCAL_CFLAGS=`echo $CFLAGS | sed -e 's/\s*-pipe\s*//g' | sed -e 's/-[Wmp]\S*\s*//g' | \
sed -r -e 's/-I(include|\.\.\/include) //g' | \
sed -e 's/-DINSTALL_PREFIX=\S* //g' | \
sed -r -e 's/-DASTERISK_VERSION=\S* //g' | \
sed -r -e 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g'`
cat <<EOF > $PPATH/asterisk.pc
install_prefix=$INSTALL_PREFIX

@ -48,6 +48,9 @@
#include <asterisk/agi.h>
#include "../asterisk.h"
#include "../astconf.h"
#ifdef SOLARIS
#include <asterisk/astmm.h>
#endif
#define MAX_ARGS 128
#define MAX_COMMANDS 128

@ -1170,11 +1170,9 @@ int ast_rtp_sendcng(struct ast_rtp *rtp, int level)
return 0;
}
#ifdef SOLARIS
#if defined(SOLARIS) && defined(__sparc__)
static void put_uint32(unsigned char *buf, int i)
{
unsigned char *c = (unsigned char *)&i;
buf[0] = (i>>24) & 0xff;
buf[1] = (i>>16) & 0xff;
buf[2] = (i>>8) & 0xff;

@ -2,6 +2,9 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef SOLARIS
#include <solaris-compat/compat.h>
#endif
char* strsep(char** str, const char* delims)
{
@ -142,3 +145,9 @@ int setenv(const char *name, const char *value, int overwrite)
return ret;
}
int unsetenv(const char *name)
{
setenv(name,"",0);
}

@ -164,6 +164,7 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
integers, we break with tradition and refuse to look up a
pure integer */
s = host;
res = 0;
while(s && *s) {
if (!isdigit(*s))
break;

@ -12,6 +12,9 @@ TARGET=stereorize
TARGET+=$(shell if [ -f /usr/include/popt.h ]; then echo "smsq"; else if [ -f /usr/local/include/popt.h ]; then echo "smsq"; fi ; fi)
TARGET+=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; fi ; fi)
ifeq (${OSARCH},SunOS)
SOL=../strcompat.o
endif
all: depend $(TARGET)
@ -32,7 +35,7 @@ stereorize: stereorize.o frame.o
$(CC) $(CFLAGS) -o stereorize stereorize.o frame.o -lm
smsq: smsq.o
$(CC) $(CFLAGS) -o smsq smsq.o -lpopt
$(CC) $(CFLAGS) -o smsq ${SOL} smsq.o -lpopt
ifneq ($(wildcard .depend),)
include .depend

@ -9,6 +9,11 @@
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#ifdef SOLARIS
#include <solaris-compat/compat.h>
#define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000
#endif
/* SMS queuing application for use with asterisk app_sms */
/* by Adrian Kennard, 2004 - 2005 */

Loading…
Cancel
Save