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