Browse Source

TT#28163 add support for properly packaged libbcg729

also eliminate `` in makefiles

document external bcg729 requirement for Debian building

closes #460

Change-Id: Iadecbc6df81c2fe876acc20c25c8be0e85391779
changes/05/19105/2
Richard Fuchs 8 years ago
parent
commit
4d859bfd6b
4 changed files with 93 additions and 82 deletions
  1. +20
    -11
      README.md
  2. +52
    -50
      daemon/Makefile
  3. +3
    -3
      lib/lib.Makefile
  4. +18
    -18
      recording-daemon/Makefile

+ 20
- 11
README.md View File

@ -66,41 +66,49 @@ Before that, run `./debian/flavors/no_ngcp` in order to remove any NGCP dependen
This will produce a number of `.deb` files, which can then be installed using the This will produce a number of `.deb` files, which can then be installed using the
`dpkg -i` command. `dpkg -i` command.
The generated files are (with version 2.3.0 being built on an amd64 system):
The generated files are (with version 6.2.0.0 being built on an amd64 system):
* `ngcp-rtpengine_2.3.0_all.deb`
* `ngcp-rtpengine_6.2.0.0+0~mr6.2.0.0_all.deb`
This is a meta-package, which doesn't contain or install anything on its own, but rather This is a meta-package, which doesn't contain or install anything on its own, but rather
only depends on the other packages to be installed. Not strictly necessary to be installed. only depends on the other packages to be installed. Not strictly necessary to be installed.
* `ngcp-rtpengine-daemon_2.3.0_amd64.deb`
* `ngcp-rtpengine-daemon_6.2.0.0+0~mr6.2.0.0_amd64.deb`
This installed the userspace daemon, which is the main workhorse of rtpengine. This is This installed the userspace daemon, which is the main workhorse of rtpengine. This is
the minimum requirement for anything to work. the minimum requirement for anything to work.
* `ngcp-rtpengine-dbg_2.3.0_amd64.deb`
Debugging symbols for the daemon. Optional.
* `ngcp-rtpengine-iptables_2.3.0_amd64.deb`
* `ngcp-rtpengine-iptables_6.2.0.0+0~mr6.2.0.0_amd64.deb`
Installs the plugin for `iptables` and `ip6tables`. Necessary for in-kernel operation. Installs the plugin for `iptables` and `ip6tables`. Necessary for in-kernel operation.
* `ngcp-rtpengine-kernel-dkms_2.3.0_all.deb`
* `ngcp-rtpengine-kernel-dkms_6.2.0.0+0~mr6.2.0.0_all.deb`
Kernel module, DKMS version of the package. Recommended for in-kernel operation. The kernel Kernel module, DKMS version of the package. Recommended for in-kernel operation. The kernel
module will be compiled against the currently running kernel using DKMS. module will be compiled against the currently running kernel using DKMS.
* `ngcp-rtpengine-kernel-source_2.3.0_all.deb`
* `ngcp-rtpengine-kernel-source_6.2.0.0+0~mr6.2.0.0_all.deb`
If DKMS is unavailable or not desired, then this package will install the sources for the kernel If DKMS is unavailable or not desired, then this package will install the sources for the kernel
module for manual compilation. Required for in-kernel operation, but only if the DKMS package module for manual compilation. Required for in-kernel operation, but only if the DKMS package
can't be used. can't be used.
* `ngcp-rtpengine-recording-daemon_6.2.0.0+0~mr6.2.0.0_amd64.deb`
Optional separate userspace daemon used for call recording features.
* `-dbg...` or `-dbgsym...` packages
Debugging symbols for the various components. Optional.
For transcoding purposes, Debian provides an additional package `libavcodec-extra` to replace For transcoding purposes, Debian provides an additional package `libavcodec-extra` to replace
the regular `libavcodec` package. It is recommended to install this extra package to offer support the regular `libavcodec` package. It is recommended to install this extra package to offer support
for additional codecs. for additional codecs.
To support the G.729 codec for transcoding purposes, the external library *bcg729* is required. To
include this in a Debian build environment, a Debian-packaged version is required, which is available
from [GitHub](https://github.com/ossobv/bcg729-deb).
Manual Compilation Manual Compilation
------------------ ------------------
@ -120,7 +128,8 @@ There's 3 parts to *rtpengine*, which can be found in the respective subdirector
- *XMLRPC-C* version 1.16.08 or higher - *XMLRPC-C* version 1.16.08 or higher
- *hiredis* library - *hiredis* library
- *libiptc* library for iptables management (optional) - *libiptc* library for iptables management (optional)
- *ffmpeg* codec libraries for transcoding (options) such as *libavcodec*, *libavfilter*, *libavresample*
- *ffmpeg* codec libraries for transcoding (optional) such as *libavcodec*, *libavfilter*, *libavresample*
- *bcg729* for full G.729 transcoding support (optional)
The `Makefile` contains a few Debian-specific flags, which may have to removed for compilation to The `Makefile` contains a few Debian-specific flags, which may have to removed for compilation to
be successful. This will not affect operation in any way. be successful. This will not affect operation in any way.


+ 52
- 50
daemon/Makefile View File

@ -4,33 +4,40 @@ with_iptables_option ?= yes
with_transcoding ?= yes with_transcoding ?= yes
# look for bcg729 # look for bcg729
# system
# system pkg-config
ifeq ($(shell pkg-config --exists libbcg729 && echo yes),yes)
have_bcg729 := yes
bcg729_inc := $(shell pkg-config --cflags libbcg729)
bcg729_lib := $(shell pkg-config --libs libbcg729)
else
# system generic
ifneq (,$(wildcard /usr/include/bcg729/decoder.h)) ifneq (,$(wildcard /usr/include/bcg729/decoder.h))
have_bcg729 := yes have_bcg729 := yes
else else
# /usr/src # /usr/src
ifneq (,$(wildcard /usr/src/bcg729/include/bcg729/decoder.h)) ifneq (,$(wildcard /usr/src/bcg729/include/bcg729/decoder.h))
have_bcg729 := yes have_bcg729 := yes
bcg729_inc := /usr/src/bcg729/include/
bcg729_lib := /usr/src/bcg729/src/
bcg729_inc := -I/usr/src/bcg729/include/
bcg729_lib := -L/usr/src/bcg729/src/ -lbcg729
else else
# rfuchs dev # rfuchs dev
ifneq (,$(wildcard $(HOME)/src/bcg729/include/bcg729/decoder.h)) ifneq (,$(wildcard $(HOME)/src/bcg729/include/bcg729/decoder.h))
have_bcg729 := yes have_bcg729 := yes
bcg729_inc := $(HOME)/src/bcg729/include/
bcg729_lib := $(HOME)/src/bcg729/src/
bcg729_inc := -I$(HOME)/src/bcg729/include/
bcg729_lib := -L$(HOME)/src/bcg729/src/ -lbcg729
else else
# home directory # home directory
ifneq (,$(wildcard $(HOME)/bcg729/include/bcg729/decoder.h)) ifneq (,$(wildcard $(HOME)/bcg729/include/bcg729/decoder.h))
have_bcg729 := yes have_bcg729 := yes
bcg729_inc := $(HOME)/bcg729/include/
bcg729_lib := $(HOME)/bcg729/src/
bcg729_inc := -I$(HOME)/bcg729/include/
bcg729_lib := -L$(HOME)/bcg729/src/ -lbcg729
else else
# included toplevel # included toplevel
ifneq (,$(wildcard ../bcg729/include/bcg729/decoder.h)) ifneq (,$(wildcard ../bcg729/include/bcg729/decoder.h))
have_bcg729 := yes have_bcg729 := yes
bcg729_inc := ../bcg729/include/
bcg729_lib := ../bcg729/src/
bcg729_inc := -I../bcg729/include/
bcg729_lib := -L../bcg729/src/ -lbcg729
endif
endif endif
endif endif
endif endif
@ -39,37 +46,35 @@ endif
CFLAGS= -g -Wall -pthread -fno-strict-aliasing CFLAGS= -g -Wall -pthread -fno-strict-aliasing
CFLAGS+= -std=c99 CFLAGS+= -std=c99
CFLAGS+= `pkg-config --cflags glib-2.0`
CFLAGS+= `pkg-config --cflags gthread-2.0`
CFLAGS+= `pkg-config --cflags zlib`
CFLAGS+= `pkg-config --cflags openssl`
CFLAGS+= `pkg-config --cflags libevent_pthreads`
CFLAGS+= `pcre-config --cflags`
CFLAGS+= `pkg-config xmlrpc_client --cflags 2> /dev/null || xmlrpc-c-config client --cflags`
CFLAGS+= `pkg-config xmlrpc --cflags 2> /dev/null`
CFLAGS+= `pkg-config xmlrpc_util --cflags 2> /dev/null`
CFLAGS+= `pkg-config --cflags json-glib-1.0`
CFLAGS+= $(shell pkg-config --cflags glib-2.0)
CFLAGS+= $(shell pkg-config --cflags gthread-2.0)
CFLAGS+= $(shell pkg-config --cflags zlib)
CFLAGS+= $(shell pkg-config --cflags openssl)
CFLAGS+= $(shell pkg-config --cflags libevent_pthreads)
CFLAGS+= $(shell pcre-config --cflags)
CFLAGS+= $(shell pkg-config xmlrpc_client --cflags 2> /dev/null || xmlrpc-c-config client --cflags)
CFLAGS+= $(shell pkg-config xmlrpc --cflags 2> /dev/null)
CFLAGS+= $(shell pkg-config xmlrpc_util --cflags 2> /dev/null)
CFLAGS+= $(shell pkg-config --cflags json-glib-1.0)
ifeq ($(with_iptables_option),yes) ifeq ($(with_iptables_option),yes)
CFLAGS+= `pkg-config --cflags libiptc`
CFLAGS+= $(shell pkg-config --cflags libiptc)
CFLAGS+= -DWITH_IPTABLES_OPTION CFLAGS+= -DWITH_IPTABLES_OPTION
endif endif
CFLAGS+= -I. -I../kernel-module/ -I../lib/ CFLAGS+= -I. -I../kernel-module/ -I../lib/
CFLAGS+= -D_GNU_SOURCE CFLAGS+= -D_GNU_SOURCE
ifeq ($(with_transcoding),yes) ifeq ($(with_transcoding),yes)
CFLAGS+= `pkg-config --cflags libavcodec`
CFLAGS+= `pkg-config --cflags libavformat`
CFLAGS+= `pkg-config --cflags libavutil`
CFLAGS+= `pkg-config --cflags libavresample`
CFLAGS+= `pkg-config --cflags libavfilter`
CFLAGS+= $(shell pkg-config --cflags libavcodec)
CFLAGS+= $(shell pkg-config --cflags libavformat)
CFLAGS+= $(shell pkg-config --cflags libavutil)
CFLAGS+= $(shell pkg-config --cflags libavresample)
CFLAGS+= $(shell pkg-config --cflags libavfilter)
CFLAGS+= -DWITH_TRANSCODING CFLAGS+= -DWITH_TRANSCODING
else else
CFLAGS+= -DWITHOUT_CODECLIB CFLAGS+= -DWITHOUT_CODECLIB
endif endif
ifeq ($(have_bcg729),yes) ifeq ($(have_bcg729),yes)
CFLAGS+= -DHAVE_BCG729 CFLAGS+= -DHAVE_BCG729
ifneq ($(bcg729_inc),)
CFLAGS+= -I$(bcg729_inc)
endif
CFLAGS+= $(bcg729_inc)
endif endif
CFLAGS+= -DRE_PLUGIN_DIR="\"/usr/lib/rtpengine\"" CFLAGS+= -DRE_PLUGIN_DIR="\"/usr/lib/rtpengine\""
@ -80,35 +85,32 @@ CFLAGS+= -DRE_PLUGIN_DIR="\"/usr/lib/rtpengine\""
#CFLAGS+= -DSTRICT_SDES_KEY_LIFETIME #CFLAGS+= -DSTRICT_SDES_KEY_LIFETIME
LDFLAGS= -lm LDFLAGS= -lm
LDFLAGS+= `pkg-config --libs glib-2.0`
LDFLAGS+= `pkg-config --libs gthread-2.0`
LDFLAGS+= `pkg-config --libs zlib`
LDFLAGS+= `pkg-config --libs libpcre`
LDFLAGS+= `pkg-config --libs libcrypto`
LDFLAGS+= `pkg-config --libs openssl`
LDFLAGS+= `pkg-config --libs libevent_pthreads`
LDFLAGS+= $(shell pkg-config --libs glib-2.0)
LDFLAGS+= $(shell pkg-config --libs gthread-2.0)
LDFLAGS+= $(shell pkg-config --libs zlib)
LDFLAGS+= $(shell pkg-config --libs libpcre)
LDFLAGS+= $(shell pkg-config --libs libcrypto)
LDFLAGS+= $(shell pkg-config --libs openssl)
LDFLAGS+= $(shell pkg-config --libs libevent_pthreads)
LDFLAGS+= -lpcap LDFLAGS+= -lpcap
LDFLAGS+= `pcre-config --libs`
LDFLAGS+= `pkg-config xmlrpc_client --libs 2> /dev/null || xmlrpc-c-config client --libs`
LDFLAGS+= `pkg-config xmlrpc --libs 2> /dev/null`
LDFLAGS+= `pkg-config xmlrpc_util --libs 2> /dev/null`
LDFLAGS+= $(shell pcre-config --libs)
LDFLAGS+= $(shell pkg-config xmlrpc_client --libs 2> /dev/null || xmlrpc-c-config client --libs)
LDFLAGS+= $(shell pkg-config xmlrpc --libs 2> /dev/null)
LDFLAGS+= $(shell pkg-config xmlrpc_util --libs 2> /dev/null)
LDFLAGS+= -lhiredis LDFLAGS+= -lhiredis
LDFLAGS+= `pkg-config --libs json-glib-1.0`
LDFLAGS+= $(shell pkg-config --libs json-glib-1.0)
ifeq ($(with_iptables_option),yes) ifeq ($(with_iptables_option),yes)
LDFLAGS+= `pkg-config --libs libiptc`
LDFLAGS+= $(shell pkg-config --libs libiptc)
endif endif
ifeq ($(with_transcoding),yes) ifeq ($(with_transcoding),yes)
LDFLAGS+= `pkg-config --libs libavcodec`
LDFLAGS+= `pkg-config --libs libavformat`
LDFLAGS+= `pkg-config --libs libavutil`
LDFLAGS+= `pkg-config --libs libavresample`
LDFLAGS+= `pkg-config --libs libavfilter`
LDFLAGS+= $(shell pkg-config --libs libavcodec)
LDFLAGS+= $(shell pkg-config --libs libavformat)
LDFLAGS+= $(shell pkg-config --libs libavutil)
LDFLAGS+= $(shell pkg-config --libs libavresample)
LDFLAGS+= $(shell pkg-config --libs libavfilter)
endif endif
ifeq ($(have_bcg729),yes) ifeq ($(have_bcg729),yes)
ifneq ($(bcg729_lib),)
LDFLAGS+= -L$(bcg729_lib)
endif
LDFLAGS+= -lbcg729
LDFLAGS+= $(bcg729_lib)
endif endif
include ../lib/lib.Makefile include ../lib/lib.Makefile


+ 3
- 3
lib/lib.Makefile View File

@ -37,8 +37,8 @@ ifneq ($(DBG),yes)
DPKG_BLDFLGS= $(shell which dpkg-buildflags 2>/dev/null) DPKG_BLDFLGS= $(shell which dpkg-buildflags 2>/dev/null)
ifneq ($(DPKG_BLDFLGS),) ifneq ($(DPKG_BLDFLGS),)
# support http://wiki.debian.org/Hardening for >=wheezy # support http://wiki.debian.org/Hardening for >=wheezy
CFLAGS+= `dpkg-buildflags --get CFLAGS`
CPPFLAGS+= `dpkg-buildflags --get CPPFLAGS`
LDFLAGS+= `dpkg-buildflags --get LDFLAGS`
CFLAGS+= $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS+= $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS+= $(shell dpkg-buildflags --get LDFLAGS)
endif endif
endif endif

+ 18
- 18
recording-daemon/Makefile View File

@ -3,26 +3,26 @@ TARGET= rtpengine-recording
CFLAGS= -g -Wall -pthread -I. -I../lib/ CFLAGS= -g -Wall -pthread -I. -I../lib/
CFLAGS+= -std=c99 CFLAGS+= -std=c99
CFLAGS+= -D_GNU_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE CFLAGS+= -D_GNU_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE
CFLAGS+= `pkg-config --cflags glib-2.0`
CFLAGS+= `pkg-config --cflags gthread-2.0`
CFLAGS+= `pkg-config --cflags libavcodec`
CFLAGS+= `pkg-config --cflags libavformat`
CFLAGS+= `pkg-config --cflags libavutil`
CFLAGS+= `pkg-config --cflags libavresample`
CFLAGS+= `pkg-config --cflags libavfilter`
CFLAGS+= `mysql_config --cflags`
CFLAGS+= `pkg-config --cflags openssl`
CFLAGS+= $(shell pkg-config --cflags glib-2.0)
CFLAGS+= $(shell pkg-config --cflags gthread-2.0)
CFLAGS+= $(shell pkg-config --cflags libavcodec)
CFLAGS+= $(shell pkg-config --cflags libavformat)
CFLAGS+= $(shell pkg-config --cflags libavutil)
CFLAGS+= $(shell pkg-config --cflags libavresample)
CFLAGS+= $(shell pkg-config --cflags libavfilter)
CFLAGS+= $(shell mysql_config --cflags)
CFLAGS+= $(shell pkg-config --cflags openssl)
LDFLAGS= -lm LDFLAGS= -lm
LDFLAGS+= `pkg-config --libs glib-2.0`
LDFLAGS+= `pkg-config --libs gthread-2.0`
LDFLAGS+= `pkg-config --libs libavcodec`
LDFLAGS+= `pkg-config --libs libavformat`
LDFLAGS+= `pkg-config --libs libavutil`
LDFLAGS+= `pkg-config --libs libavresample`
LDFLAGS+= `pkg-config --libs libavfilter`
LDFLAGS+= `mysql_config --libs`
LDFLAGS+= `pkg-config --libs openssl`
LDFLAGS+= $(shell pkg-config --libs glib-2.0)
LDFLAGS+= $(shell pkg-config --libs gthread-2.0)
LDFLAGS+= $(shell pkg-config --libs libavcodec)
LDFLAGS+= $(shell pkg-config --libs libavformat)
LDFLAGS+= $(shell pkg-config --libs libavutil)
LDFLAGS+= $(shell pkg-config --libs libavresample)
LDFLAGS+= $(shell pkg-config --libs libavfilter)
LDFLAGS+= $(shell mysql_config --libs)
LDFLAGS+= $(shell pkg-config --libs openssl)
include ../lib/lib.Makefile include ../lib/lib.Makefile


Loading…
Cancel
Save