Complete port to solaris (bug #3062)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@168 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
38
Makefile
38
Makefile
@@ -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 @@ STATIC_OBJS=pri.o q921.o prisched.o q931.o pri_facility.o
|
||||
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 @@ LDCONFIG_FLAGS=-m
|
||||
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 @@ update:
|
||||
@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 @@ $(STATIC_LIBRARY): $(STATIC_OBJS)
|
||||
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:
|
||||
|
||||
10
compat.h
Executable file
10
compat.h
Executable file
@@ -0,0 +1,10 @@
|
||||
#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
|
||||
2
mkdep
2
mkdep
@@ -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 $
|
||||
|
||||
1
pri.c
1
pri.c
@@ -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"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
Copyright (C) 2004 Digium, Inc
|
||||
*/
|
||||
|
||||
#include "compat.h"
|
||||
#include "libpri.h"
|
||||
#include "pri_internal.h"
|
||||
#include "pri_q921.h"
|
||||
|
||||
1
q921.c
1
q921.c
@@ -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"
|
||||
|
||||
1
q931.c
1
q931.c
@@ -22,6 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "compat.h"
|
||||
#include "libpri.h"
|
||||
#include "pri_internal.h"
|
||||
#include "pri_q921.h"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user