BuildSystem: Search for Python/C API when possibly needed only.

The Python/C API is used only if the Test Framework was enabled in Asterisk
'make menuselect'. The Test Framework is available only if the Developer Mode
was enabled in Asterisk './configure --enable-dev-mode'. And that Python/C API
is used only if the PJProject was found and not disabled in Asterisk; the user
did not go for './configure --without-pjproject'.

Furthermore, because version 2 of that Python/C API is required (currently) and
because some platforms do not offer a generic version 2, the script searches
for 2.7 explicitly as well.

To avoid version mismatch between the Python/C API and the Python environment,
the script searches for the latter in the same versions, in the same the order
as well. Because this Python/C API is just for (some) Asterisk contributors,
the script also goes for the Python 3 environment as a last resort for all
other Asterisk users. This allows 'make full' even on minimal installations of
Ubuntu 18.04 LTS and newer.

Because the Python/C API is Asterisk contributor specific, the Python packages
are removed from the script './contrib/scripts/install_prereq' as this script
is intended for Asterisk users. Asterisk contributors have to install much more
packages in any case, like:
sudo apt install autoconf automake git git-review python2.7-dev

ASTERISK-28824
ASTERISK-27717

Change-Id: Id46d357e18869f64dcc217b8fdba821b63eeb876
This commit is contained in:
Alexander Traud
2020-04-12 16:53:50 +02:00
committed by Friendly Automation
parent 2bcc3df533
commit 23211669a7
3 changed files with 222 additions and 17 deletions

View File

@@ -31,7 +31,7 @@ PACKAGES_DEBIAN="$PACKAGES_DEBIAN libresample1-dev libc-client2007e-dev binutils
# Asterisk: for the unpackaged below:
PACKAGES_DEBIAN="$PACKAGES_DEBIAN wget subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_DEBIAN="$PACKAGES_DEBIAN bzip2 patch python-dev"
PACKAGES_DEBIAN="$PACKAGES_DEBIAN bzip2 patch"
# Basic build system:
PACKAGES_RH="make gcc gcc-c++ pkgconfig"
@@ -46,7 +46,7 @@ PACKAGES_RH="$PACKAGES_RH libresample-devel uw-imap-devel binutils-devel libsrtp
# Asterisk: for the unpackaged below:
PACKAGES_RH="$PACKAGES_RH wget subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_RH="$PACKAGES_RH bzip2 patch python-devel"
PACKAGES_RH="$PACKAGES_RH bzip2 patch"
# Basic build system:
PACKAGES_SUSE="make gcc gcc-c++ pkg-config"
@@ -61,7 +61,7 @@ PACKAGES_SUSE="$PACKAGES_SUSE imap-devel libsrtp2-devel libgsm-devel doxygen gra
# Asterisk: for the unpackaged below:
PACKAGES_SUSE="$PACKAGES_SUSE wget subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_SUSE="$PACKAGES_SUSE bzip2 patch python-devel"
PACKAGES_SUSE="$PACKAGES_SUSE bzip2 patch"
# Basic build system:
PACKAGES_ARCH="make gcc pkg-config"
@@ -76,7 +76,7 @@ PACKAGES_ARCH="$PACKAGES_ARCH c-client binutils libsrtp gsm doxygen graphviz zli
# Asterisk: for the unpackaged below:
PACKAGES_ARCH="$PACKAGES_ARCH wget subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_ARCH="$PACKAGES_ARCH bzip2 patch python2"
PACKAGES_ARCH="$PACKAGES_ARCH bzip2 patch"
# Basic build system:
PACKAGES_GENTOO="sys-devel/make sys-devel/gcc dev-util/pkgconfig"
@@ -91,7 +91,7 @@ PACKAGES_GENTOO="$PACKAGES_GENTOO net-libs/c-client sys-devel/binutils net-libs/
# Asterisk: for the unpackaged below:
PACKAGES_GENTOO="$PACKAGES_GENTOO net-misc/wget dev-vcs/subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_GENTOO="$PACKAGES_GENTOO app-arch/bzip2 sys-devel/patch dev-lang/python:2.7"
PACKAGES_GENTOO="$PACKAGES_GENTOO app-arch/bzip2 sys-devel/patch"
# Basic build system:
PACKAGES_NBSD="gmake pkg-config"
@@ -106,7 +106,7 @@ PACKAGES_NBSD="$PACKAGES_NBSD imap-uw srtp gsm doxygen graphviz libzip openldap-
# Asterisk: for the unpackaged below:
PACKAGES_NBSD="$PACKAGES_NBSD wget subversion-base"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_NBSD="$PACKAGES_NBSD bzip2 patch python27"
PACKAGES_NBSD="$PACKAGES_NBSD bzip2 patch"
# Basic build system:
PACKAGES_OBSD="gmake"
@@ -121,7 +121,7 @@ PACKAGES_OBSD="$PACKAGES_OBSD c-client libsrtp gsm doxygen graphviz"
# Asterisk: for the unpackaged below:
PACKAGES_OBSD="$PACKAGES_OBSD wget subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_OBSD="$PACKAGES_OBSD bzip2 python%2"
PACKAGES_OBSD="$PACKAGES_OBSD bzip2"
# Basic build system:
PACKAGES_FBSD="gmake pkgconf"
@@ -136,7 +136,7 @@ PACKAGES_FBSD="$PACKAGES_FBSD cclient libbfd libsrtp gsm libilbc doxygen graphvi
# Asterisk: for the unpackaged below:
PACKAGES_FBSD="$PACKAGES_FBSD wget subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_FBSD="$PACKAGES_FBSD bzip2 patch python"
PACKAGES_FBSD="$PACKAGES_FBSD bzip2 patch"
# Basic build system:
PACKAGES_DBSD="gmake pkgconf"
@@ -151,7 +151,7 @@ PACKAGES_DBSD="$PACKAGES_DBSD cclient binutils libsrtp gsm libilbc doxygen graph
# Asterisk: for the unpackaged below:
PACKAGES_DBSD="$PACKAGES_DBSD wget subversion"
# Asterisk: for ./configure --with-pjproject-bundled:
PACKAGES_DBSD="$PACKAGES_DBSD bzip2 patch python"
PACKAGES_DBSD="$PACKAGES_DBSD bzip2 patch"
KVERS=`uname -r`