[Asterisk-cvs]
libpri compat.h, NONE, 1.1 Makefile, 1.12, 1.13 mkdep,
1.2, 1.3 pri.c, 1.30, 1.31 pri_facility.c, 1.1, 1.2 q921.c,
1.18, 1.19 q931.c, 1.100, 1.101 testprilib.c, 1.2, 1.3
markster at lists.digium.com
markster at lists.digium.com
Wed Dec 15 15:18:48 CST 2004
Update of /usr/cvsroot/libpri
In directory mongoose.digium.com:/tmp/cvs-serv31697
Modified Files:
Makefile mkdep pri.c pri_facility.c q921.c q931.c testprilib.c
Added Files:
compat.h
Log Message:
Complete port to solaris (bug #3062)
--- NEW FILE: compat.h ---
#ifndef __COMPAT_H
#define __COMPAT_H
#ifdef SOLARIS
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
#endif
#endif
Index: Makefile
===================================================================
RCS file: /usr/cvsroot/libpri/Makefile,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Makefile 27 Oct 2004 20:43:23 -0000 1.12
+++ Makefile 15 Dec 2004 20:15:28 -0000 1.13
@@ -27,6 +27,8 @@
# Uncomment if you want libpri to count number of Q921/Q931 sent/received
#LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
+CC=gcc
+
OSARCH=$(shell uname -s)
PROC=$(shell uname -m)
@@ -38,6 +40,7 @@
DYNAMIC_OBJS=pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
INSTALL_PREFIX=
+INSTALL_BASE=/usr
ifeq (${OSARCH},Linux)
LDCONFIG_FLAGS=-n
else
@@ -46,6 +49,15 @@
CFLAGS += -I../zaptel -I../zapata
endif
endif
+ifeq (${OSARCH},SunOS)
+CFLAGS += -DSOLARIS -I../zaptel-solaris -lsocket -lnsl
+SOFLAGS =
+LDCONFIG = echo
+INSTALL_BASE = /usr/local
+else
+SOFLAGS = -Wl,-soname,libpri.so.1
+LDCONFIG = /sbin/ldconfig
+endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
#This works for even old (2.96) versions of gcc and provides a small boost either way.
@@ -62,20 +74,20 @@
@cvs update -d
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
- mkdir -p $(INSTALL_PREFIX)/usr/lib
- mkdir -p $(INSTALL_PREFIX)/usr/include
- install -m 644 libpri.h $(INSTALL_PREFIX)/usr/include
- install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/usr/lib
- ( cd $(INSTALL_PREFIX)/usr/lib ; ln -sf libpri.so.1 libpri.so )
- install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/usr/lib
- /sbin/ldconfig
+ mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
+ mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/include
+ install -m 644 libpri.h $(INSTALL_PREFIX)/$(INSTALL_BASE)/include
+ install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
+ ( cd $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
+ install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
+ $(LDCONFIG)
uninstall:
@echo "Removing Libpri"
- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.so.1.0
- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.so
- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.a
- rm -f $(INSTALL_PREFIX)/usr/include/libpri.h
+ rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.so.1.0
+ rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.so
+ rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.a
+ rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/include/libpri.h
pritest: pritest.o
$(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
@@ -99,8 +111,8 @@
ranlib $(STATIC_LIBRARY)
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
- $(CC) -shared -Wl,-soname,libpri.so.1 -o $@ $(DYNAMIC_OBJS)
- /sbin/ldconfig $(LDCONFIG_FLAGS) .
+ $(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
+ $(LDCONFIG) $(LDCONFIG_FLAGS) .
ln -sf libpri.so.1 libpri.so
clean:
Index: mkdep
===================================================================
RCS file: /usr/cvsroot/libpri/mkdep,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mkdep 29 Jun 2004 15:19:15 -0000 1.2
+++ mkdep 15 Dec 2004 20:15:28 -0000 1.3
@@ -1,4 +1,4 @@
-#!/bin/sh -
+#!/bin/bash -
#
# $OpenBSD: mkdep.gcc.sh,v 1.8 1998/09/02 06:40:07 deraadt Exp $
# $NetBSD: mkdep.gcc.sh,v 1.9 1994/12/23 07:34:59 jtc Exp $
Index: pri.c
===================================================================
RCS file: /usr/cvsroot/libpri/pri.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- pri.c 15 Dec 2004 15:44:22 -0000 1.30
+++ pri.c 15 Dec 2004 20:15:28 -0000 1.31
@@ -19,6 +19,7 @@
#include <stdlib.h>
#include <sys/select.h>
#include <stdarg.h>
+#include "compat.h"
#include "libpri.h"
#include "pri_internal.h"
#include "pri_q921.h"
Index: pri_facility.c
===================================================================
RCS file: /usr/cvsroot/libpri/pri_facility.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pri_facility.c 27 Oct 2004 20:44:39 -0000 1.1
+++ pri_facility.c 15 Dec 2004 20:15:28 -0000 1.2
@@ -6,6 +6,7 @@
Copyright (C) 2004 Digium, Inc
*/
+#include "compat.h"
#include "libpri.h"
#include "pri_internal.h"
#include "pri_q921.h"
Index: q921.c
===================================================================
RCS file: /usr/cvsroot/libpri/q921.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- q921.c 2 Oct 2004 14:55:20 -0000 1.18
+++ q921.c 15 Dec 2004 20:15:28 -0000 1.19
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
+#include "compat.h"
#include "libpri.h"
#include "pri_internal.h"
#include "pri_q921.h"
Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- q931.c 15 Dec 2004 19:48:15 -0000 1.100
+++ q931.c 15 Dec 2004 20:15:28 -0000 1.101
@@ -22,6 +22,7 @@
*
*/
+#include "compat.h"
#include "libpri.h"
#include "pri_internal.h"
#include "pri_q921.h"
Index: testprilib.c
===================================================================
RCS file: /usr/cvsroot/libpri/testprilib.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- testprilib.c 22 May 2004 04:25:53 -0000 1.2
+++ testprilib.c 15 Dec 2004 20:15:28 -0000 1.3
@@ -44,14 +44,20 @@
#include <sys/socket.h>
#if defined(__linux__)
#include <linux/zaptel.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(SOLARIS)
#include <zaptel.h>
#endif
+#ifndef SOLARIS
#include <zap.h>
+#endif
#include <pthread.h>
#include <sys/select.h>
#include "libpri.h"
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
+
#define DEBUG_LEVEL PRI_DEBUG_ALL
#define PRI_DEF_NODETYPE PRI_CPE
More information about the svn-commits
mailing list