2003-03-31 07:13:36 +00:00
|
|
|
# include the Makefile of OpenH323
|
|
|
|
|
|
|
|
ifndef OPENH323DIR
|
|
|
|
OPENH323DIR=$(HOME)/openh323
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef PWLIBDIR
|
|
|
|
PWLIBDIR=$(HOME)/pwlib
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef ASTERISKDIR
|
|
|
|
ASTERISKDIR= /usr/lib/asterisk/modules
|
|
|
|
endif
|
|
|
|
|
2003-04-02 18:58:47 +00:00
|
|
|
ifndef ASTETCDIR
|
|
|
|
ASTETCDIR=/etc/asterisk
|
|
|
|
endif
|
2003-03-31 07:13:36 +00:00
|
|
|
|
2005-01-28 16:45:06 +00:00
|
|
|
PWLIB_MAJOR_VERSION=$(shell cat ${PWLIBDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' ')
|
|
|
|
PWLIB_MINOR_VERSION=$(shell cat ${PWLIBDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' ')
|
|
|
|
PWLIB_BUILD_NUMBER=$(shell cat ${PWLIBDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' ')
|
|
|
|
PWLIB_VERSION="${PWLIB_MAJOR_VERSION}.${PWLIB_MINOR_VERSION}.${PWLIB_BUILD_NUMBER}"
|
|
|
|
|
|
|
|
OPENH323_MAJOR_VERSION=$(shell cat ${OPENH323DIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' ')
|
|
|
|
OPENH323_MINOR_VERSION=$(shell cat ${OPENH323DIR}/version.h | grep MINOR_VERSION | cut -f3 -d' ')
|
|
|
|
OPENH323_BUILD_NUMBER=$(shell cat ${OPENH323DIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' ')
|
|
|
|
OPENH323_VERSION="${OPENH323_MAJOR_VERSION}.${OPENH323_MINOR_VERSION}.${OPENH323_BUILD_NUMBER}"
|
|
|
|
|
2003-06-25 06:48:08 +00:00
|
|
|
#
|
2003-03-31 07:13:36 +00:00
|
|
|
# This needs to be updated to deal with more than just little endian machines
|
2003-06-25 06:48:08 +00:00
|
|
|
#
|
2004-06-22 17:42:14 +00:00
|
|
|
OSARCH=$(shell uname -s)
|
2005-01-15 19:04:45 +00:00
|
|
|
PROC=$(shell uname -m)
|
2004-06-22 17:42:14 +00:00
|
|
|
ifneq (${OSARCH},FreeBSD)
|
2004-08-31 13:32:11 +00:00
|
|
|
ifneq (${OSARCH},NetBSD)
|
2005-01-15 19:04:45 +00:00
|
|
|
ifneq (${PROC},ppc)
|
2005-01-18 16:21:54 +00:00
|
|
|
CFLAGS += -march=$(PROC)
|
2005-01-15 19:04:45 +00:00
|
|
|
endif
|
2004-06-22 17:42:14 +00:00
|
|
|
endif
|
2004-08-31 13:32:11 +00:00
|
|
|
endif
|
2004-06-22 17:42:14 +00:00
|
|
|
CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN
|
2003-06-25 06:48:08 +00:00
|
|
|
|
2004-06-22 17:42:14 +00:00
|
|
|
ifeq (${OSARCH},Linux)
|
|
|
|
LDLIBS+=-ldl
|
|
|
|
endif
|
2003-08-10 18:12:48 +00:00
|
|
|
|
|
|
|
#############################################
|
|
|
|
#
|
2003-06-25 06:48:08 +00:00
|
|
|
# Only change below if you know WTF your doing
|
|
|
|
#
|
2004-09-30 19:30:49 +00:00
|
|
|
OSARCH=$(shell uname -s)
|
2003-06-25 06:48:08 +00:00
|
|
|
CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
|
2004-12-16 02:03:19 +00:00
|
|
|
CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes
|
2004-04-28 21:06:29 +00:00
|
|
|
CFLAGS += -D_REENTRANT -D_GNU_SOURCE
|
2003-08-16 16:55:19 +00:00
|
|
|
CFLAGS += -I../../include
|
2004-09-30 19:30:49 +00:00
|
|
|
CFLAGS += -I$(PWLIBDIR)/include
|
2004-12-16 02:03:19 +00:00
|
|
|
CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes
|
2004-09-30 19:30:49 +00:00
|
|
|
|
2005-01-28 16:45:06 +00:00
|
|
|
all: checkversion depend libchanh323.a
|
2003-03-31 07:13:36 +00:00
|
|
|
|
2003-04-02 18:58:47 +00:00
|
|
|
samples:
|
|
|
|
if [ -f $(ASTETCDIR)/h323.conf ]; then \
|
|
|
|
mv -f $(ASTETCDIR)/h323.conf $(ASTETCDIR)/h323.conf.old ; \
|
|
|
|
fi ;
|
|
|
|
install h323.conf.sample $(ASTETCDIR)/h323.conf
|
|
|
|
|
2003-03-31 07:13:36 +00:00
|
|
|
|
2004-11-15 00:41:25 +00:00
|
|
|
libchanh323.a: ast_h323.o
|
|
|
|
ar cr libchanh323.a ast_h323.o
|
2004-12-16 02:03:19 +00:00
|
|
|
touch ../chan_h323.c
|
2004-11-15 00:41:25 +00:00
|
|
|
|
2003-03-31 07:13:36 +00:00
|
|
|
ast_h323.o: ast_h323.cpp
|
2004-09-30 19:30:49 +00:00
|
|
|
$(CXX) -g -c -o $@ $(CFLAGS) $<
|
|
|
|
|
2004-11-15 00:41:25 +00:00
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|
2003-08-16 16:55:19 +00:00
|
|
|
|
|
|
|
chan_h323.so:
|
2004-06-22 17:42:14 +00:00
|
|
|
$(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
|
2003-03-31 07:13:36 +00:00
|
|
|
|
|
|
|
chan_h323_d.so: chan_h323.o ast_h323.o
|
2004-06-22 17:42:14 +00:00
|
|
|
$(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
|
2003-03-31 07:13:36 +00:00
|
|
|
|
|
|
|
chan_h323_s.so: chan_h323.o ast_h323.o
|
2004-06-22 17:42:14 +00:00
|
|
|
$(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
|
2003-03-31 07:13:36 +00:00
|
|
|
clean:
|
2004-11-15 00:41:25 +00:00
|
|
|
rm -f *.o *.so core.* libchanh323.a .depend
|
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
.depend:
|
|
|
|
../../mkdep $(CFLAGS) `ls *.cpp`
|
2003-03-31 07:13:36 +00:00
|
|
|
|
2005-01-28 16:45:06 +00:00
|
|
|
checkversion:
|
|
|
|
@echo -n "PWLib version is ${PWLIB_VERSION}... "
|
|
|
|
@if [ ${PWLIB_VERSION} == "1.8.1" ]; then \
|
|
|
|
echo "ok" ; \
|
|
|
|
else \
|
|
|
|
echo "BAD" ; \
|
|
|
|
echo ; \
|
|
|
|
echo "Please read README for further details!" ; \
|
|
|
|
echo ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi
|
|
|
|
@echo -n "OpenH323 version is ${OPENH323_VERSION}... "
|
|
|
|
@if [ ${OPENH323_VERSION} == "1.15.1" ]; then \
|
|
|
|
echo "ok" ; \
|
|
|
|
else \
|
|
|
|
echo "BAD" ; \
|
|
|
|
echo ; \
|
|
|
|
echo "Please read README for further details!" ; \
|
|
|
|
echo ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi
|