From 4ae8cc7bcfcbca2632ce829fedd962c7e579b540 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Sat, 22 May 2004 04:25:53 +0000 Subject: [PATCH] Make build on FreeBSD git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@99 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- Makefile | 12 +++++++++++- pri_q921.h | 4 ++++ pridump.c | 5 +++++ pritest.c | 4 ++++ testprilib.c | 4 ++++ 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d211bf2..a82d6ad 100755 --- a/Makefile +++ b/Makefile @@ -27,6 +27,8 @@ # Uncomment if you want libpri to count number of Q921/Q931 sent/received #LIBPRI_COUNTERS=-DLIBPRI_COUNTERS +OSARCH=$(shell uname -s) + TOBJS=testpri.o T2OBJS=testprilib.o STATIC_LIBRARY=libpri.a @@ -35,6 +37,14 @@ STATIC_OBJS=pri.o q921.o prisched.o q931.o DYNAMIC_OBJS=pri.lo q921.lo prisched.lo q931.lo CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS) INSTALL_PREFIX= +ifeq (${OSARCH},Linux) +LDCONFIG_FLAGS=-n +else +ifeq (${OSARCH},FreeBSD) +LDCONFIG_FLAGS=-m +CFLAGS += -I../zaptel -I../zapata +endif +endif all: depend $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY) @@ -81,7 +91,7 @@ $(STATIC_LIBRARY): $(STATIC_OBJS) $(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS) $(CC) -shared -Wl,-soname,libpri.so.1 -o $@ $(DYNAMIC_OBJS) - /sbin/ldconfig -n . + /sbin/ldconfig $(LDCONFIG_FLAGS) . ln -sf libpri.so.1 libpri.so clean: diff --git a/pri_q921.h b/pri_q921.h index c4217f9..0cd3409 100755 --- a/pri_q921.h +++ b/pri_q921.h @@ -26,7 +26,11 @@ #define _PRI_Q921_H #include +#if defined(__linux__) #include +#elif defined(__FreeBSD__) +#include +#endif /* Timer values */ diff --git a/pridump.c b/pridump.c index f5b452f..c9076f0 100755 --- a/pridump.c +++ b/pridump.c @@ -36,7 +36,12 @@ #include #include #include +#include +#if defined(__linux__) #include +#elif defined(__FreeBSD__) +#include +#endif #include "libpri.h" #include "pri_q921.h" #include "pri_q931.h" diff --git a/pritest.c b/pritest.c index 44b3b75..b67aedc 100755 --- a/pritest.c +++ b/pritest.c @@ -40,7 +40,11 @@ #include #include #include +#if defined(__linux__) #include +#elif defined(__FreeBSD__) +#include +#endif #include #include "libpri.h" diff --git a/testprilib.c b/testprilib.c index e0fda9d..847e790 100755 --- a/testprilib.c +++ b/testprilib.c @@ -42,7 +42,11 @@ #include #include #include +#if defined(__linux__) #include +#elif defined(__FreeBSD__) +#include +#endif #include #include #include