mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
Rework astersk make process to be compatable with the Open H.323 build process. Bug #3981
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1 +1,6 @@
|
|||||||
.depend
|
.depend
|
||||||
|
Makefile.ast
|
||||||
|
ast_h323.dep
|
||||||
|
ast_h323.cxx
|
||||||
|
ast_h323.o
|
||||||
|
libchanh323.a
|
||||||
|
@@ -1,117 +1,41 @@
|
|||||||
# include the Makefile of OpenH323
|
#
|
||||||
|
# Makefile
|
||||||
|
#
|
||||||
|
# Make file for OpenH323 support layer
|
||||||
|
#
|
||||||
|
|
||||||
|
# Verify those options with main Makefile
|
||||||
|
STDCCFLAGS += -DNDEBUG
|
||||||
|
STDCCFLAGS += $(shell grep ^DEBUG_THREADS ../../Makefile | sed -e "s/^DEBUG_THREADS[ ]*=//" -e "s/\([^\#]*\)\#.*/\1/")
|
||||||
|
STDCCFLAGS += -I../../include
|
||||||
|
STDCCFLAGS += -Wmissing-prototypes
|
||||||
|
STDCCFLAGS += -fPIC
|
||||||
|
#OPTCCFLAGS +=
|
||||||
|
CFLAGS += -pipe
|
||||||
|
TARGET += libchanh323.a
|
||||||
|
TARGET += Makefile.ast
|
||||||
|
SOURCES = ast_h323.cxx
|
||||||
|
OBJDIR = .
|
||||||
|
|
||||||
ifndef OPENH323DIR
|
ifndef OPENH323DIR
|
||||||
OPENH323DIR=$(HOME)/openh323
|
OPENH323DIR=$(HOME)/openh323
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef PWLIBDIR
|
include $(OPENH323DIR)/openh323u.mak
|
||||||
PWLIBDIR=$(HOME)/pwlib
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef ASTERISKDIR
|
$(SOURCES):: $(SOURCES:.cxx=.cpp)
|
||||||
ASTERISKDIR= /usr/lib/asterisk/modules
|
ln -f $< $@
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef ASTETCDIR
|
$(SOURCES):: Makefile ../../Makefile
|
||||||
ASTETCDIR=/etc/asterisk
|
touch $(SOURCES)
|
||||||
endif
|
|
||||||
|
|
||||||
PWLIBVERSIONFILE=$(PWLIBDIR)/version.h
|
libchanh323.a: $(OBJS)
|
||||||
OPENH323VERSIONFILE=$(OPENH323DIR)/version.h
|
ar crv $@ $(OBJS)
|
||||||
|
|
||||||
PWLIB_MAJOR_VERSION=$(shell test -e ${PWLIBVERSIONFILE} && cat ${PWLIBVERSIONFILE} | grep MAJOR_VERSION | cut -f3 -d' ')
|
Makefile.ast: FORCE
|
||||||
PWLIB_MINOR_VERSION=$(shell test -e ${PWLIBVERSIONFILE} && cat ${PWLIBVERSIONFILE} | grep MINOR_VERSION | cut -f3 -d' ')
|
@echo H323CFLAGS = $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) >$@.tmp
|
||||||
PWLIB_BUILD_NUMBER=$(shell test -e ${PWLIBVERSIONFILE} && cat ${PWLIBVERSIONFILE} | grep BUILD_NUMBER | cut -f3 -d' ')
|
@echo H323LDFLAGS = $(CFLAGS) $(LDFLAGS) >>$@.tmp
|
||||||
PWLIB_VERSION="${PWLIB_MAJOR_VERSION}.${PWLIB_MINOR_VERSION}.${PWLIB_BUILD_NUMBER}"
|
@echo H323LDLIBS = $(LDLIBS) $(ENDLDLIBS) $(ENDLDFLAGS) >>$@.tmp
|
||||||
|
@if [ -r $@ ] && cmp -s $@ $@.tmp; then rm -f $@.tmp; else mv -f $@.tmp $@; fi
|
||||||
|
|
||||||
OPENH323_MAJOR_VERSION=$(shell test -e ${OPENH323VERSIONFILE} && cat ${OPENH323VERSIONFILE} | grep MAJOR_VERSION | cut -f3 -d' ')
|
FORCE:
|
||||||
OPENH323_MINOR_VERSION=$(shell test -e ${OPENH323VERSIONFILE} && cat ${OPENH323VERSIONFILE} | grep MINOR_VERSION | cut -f3 -d' ')
|
|
||||||
OPENH323_BUILD_NUMBER=$(shell test -e ${OPENH323VERSIONFILE} && cat ${OPENH323VERSIONFILE} | grep BUILD_NUMBER | cut -f3 -d' ')
|
|
||||||
OPENH323_VERSION="${OPENH323_MAJOR_VERSION}.${OPENH323_MINOR_VERSION}.${OPENH323_BUILD_NUMBER}"
|
|
||||||
|
|
||||||
#
|
|
||||||
# This needs to be updated to deal with more than just little endian machines
|
|
||||||
#
|
|
||||||
OSARCH=$(shell uname -s)
|
|
||||||
PROC=$(shell uname -m)
|
|
||||||
ifneq (${OSARCH},FreeBSD)
|
|
||||||
ifneq (${OSARCH},NetBSD)
|
|
||||||
ifneq (${PROC},ppc)
|
|
||||||
CFLAGS += -march=$(PROC)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN
|
|
||||||
|
|
||||||
ifeq (${OSARCH},Linux)
|
|
||||||
LDLIBS+=-ldl
|
|
||||||
endif
|
|
||||||
|
|
||||||
#############################################
|
|
||||||
#
|
|
||||||
# Only change below if you know WTF your doing
|
|
||||||
#
|
|
||||||
OSARCH=$(shell uname -s)
|
|
||||||
CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
|
|
||||||
CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes
|
|
||||||
CFLAGS += -D_REENTRANT -D_GNU_SOURCE
|
|
||||||
CFLAGS += -I../../include
|
|
||||||
CFLAGS += -I$(PWLIBDIR)/include
|
|
||||||
CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes
|
|
||||||
|
|
||||||
all: checkversion depend libchanh323.a
|
|
||||||
|
|
||||||
samples:
|
|
||||||
if [ -f $(ASTETCDIR)/h323.conf ]; then \
|
|
||||||
mv -f $(ASTETCDIR)/h323.conf $(ASTETCDIR)/h323.conf.old ; \
|
|
||||||
fi ;
|
|
||||||
install h323.conf.sample $(ASTETCDIR)/h323.conf
|
|
||||||
|
|
||||||
|
|
||||||
libchanh323.a: ast_h323.o
|
|
||||||
ar cr $@ $<
|
|
||||||
|
|
||||||
ast_h323.o: ast_h323.cpp
|
|
||||||
$(CXX) -g -c -o $@ $(CFLAGS) $<
|
|
||||||
|
|
||||||
ifneq ($(wildcard .depend),)
|
|
||||||
include .depend
|
|
||||||
endif
|
|
||||||
|
|
||||||
chan_h323.so:
|
|
||||||
$(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)
|
|
||||||
|
|
||||||
chan_h323_d.so: chan_h323.o ast_h323.o
|
|
||||||
$(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)
|
|
||||||
|
|
||||||
chan_h323_s.so: chan_h323.o ast_h323.o
|
|
||||||
$(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)
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.so core.* libchanh323.a .depend
|
|
||||||
|
|
||||||
depend: .depend
|
|
||||||
|
|
||||||
.depend:
|
|
||||||
../../mkdep $(CFLAGS) `ls *.cpp`
|
|
||||||
|
|
||||||
checkversion:
|
|
||||||
@echo -n "PWLib version is ${PWLIB_VERSION}... "
|
|
||||||
@if [ ${PWLIB_MAJOR_VERSION} -gt 1 -o ${PWLIB_MAJOR_VERSION} -eq 1 -a ${PWLIB_MINOR_VERSION} -gt 8 -o ${PWLIB_MAJOR_VERSION} -eq 1 -a ${PWLIB_MINOR_VERSION} -eq 8 -a ${PWLIB_BUILD_NUMBER} -ge 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_MAJOR_VERSION} -gt 1 -o ${OPENH323_MAJOR_VERSION} -eq 1 -a ${OPENH323_MINOR_VERSION} -gt 15 -o ${OPENH323_MAJOR_VERSION} -eq 1 -a ${OPENH323_MINOR_VERSION} -eq 15 -a ${OPENH323_BUILD_NUMBER} -ge 1 ]; then \
|
|
||||||
echo "ok" ; \
|
|
||||||
else \
|
|
||||||
echo "BAD" ; \
|
|
||||||
echo ; \
|
|
||||||
echo "Please read README for further details!" ; \
|
|
||||||
echo ; \
|
|
||||||
exit 1 ; \
|
|
||||||
fi
|
|
||||||
|
@@ -19,10 +19,10 @@ your distro did not install them for you without your knowledge.
|
|||||||
|
|
||||||
To compile this code
|
To compile this code
|
||||||
--------------------
|
--------------------
|
||||||
Once PWLib and Open H.323 have been compiled per their specific build
|
Once PWLib and Open H.323 have been compiled per their specific build
|
||||||
instructions, issue a make in the asterisk/channels/h323 directory,
|
instructions, issue a make in the asterisk/channels/h323 directory with
|
||||||
then go back to the Asterisk source top level directory and issue a make
|
argument used to build PWLib and OpenH323 (for example, make opt), then go
|
||||||
install.
|
back to the Asterisk source top level directory and issue a make install.
|
||||||
|
|
||||||
|
|
||||||
The most common compile error
|
The most common compile error
|
||||||
@@ -45,7 +45,7 @@ cd /path/to/openh323
|
|||||||
./configure
|
./configure
|
||||||
make clean opt
|
make clean opt
|
||||||
cd /path/to/asterisk/channels/h323
|
cd /path/to/asterisk/channels/h323
|
||||||
make
|
make opt
|
||||||
cd /path/to/asterisk
|
cd /path/to/asterisk
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user