[Asterisk-code-review] Make --with-pjproject-bundled the default for Asterisk 15 (asterisk[15.0])
Joshua Colp
asteriskteam at digium.com
Thu Aug 10 07:21:41 CDT 2017
Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/6176 )
Change subject: Make --with-pjproject-bundled the default for Asterisk 15
......................................................................
Make --with-pjproject-bundled the default for Asterisk 15
'--with-pjproject-bundled' is now the default when running
./configure. It can be disabled with '--without-pjproject-bundled'.
To make building without an internet connection easier, a new
./configure option '--with-download-cache' was added that sets
the cache for externals (like pjproject, the codecs and the DPMA),
AND the sounds files. It can also be specified as an environment
variable named "AST_DOWNLOAD_CACHE". The existing
'--with-sounds-cache' option / SOUNDS_CACHE_DIR env variable and
'--with-externals-cache' option / EXTERNALS_CACHE_DIR env variable
remain and if specified, will override '--with-downloads-cache'.
ASTERISK-27189
Change-Id: Ifa9783fddf44aafadb060c9feba713dfa81d38ce
---
M CHANGES
M UPGRADE-15.txt
M build_tools/download_externals
M build_tools/list_valid_installed_externals
M configure
M configure.ac
M makeopts.in
M third-party/pjproject/configure.m4
8 files changed, 67 insertions(+), 14 deletions(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
diff --git a/CHANGES b/CHANGES
index 71166ef..37d78e1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -22,6 +22,16 @@
queue position has improved since the last time that we annouced their
position. This default is no.
+Build System
+------------------
+ * '--with-pjproject-bundled' is now the default when running ./configure
+ It can be disabled with '--without-pjproject-bundled'.
+
+ * A '--with-download-cache' option is now available which is equivalent to
+ setting '--with-sounds-cache' and '--with-externals-cache' to the same
+ value. The download cache can also be set via the AST_DOWNLOAD_CACHE
+ environment variable.
+
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 14.6.0 to Asterisk 14.7.0 ------------
------------------------------------------------------------------------------
diff --git a/UPGRADE-15.txt b/UPGRADE-15.txt
index 4ebe400..2e5eb1c 100644
--- a/UPGRADE-15.txt
+++ b/UPGRADE-15.txt
@@ -33,6 +33,10 @@
ARI. As a result, the 'DataGet' AMI action as well as the 'data get'
CLI command have been removed.
+Build System:
+ - '--with-pjproject-bundled' is now the default when running ./configure
+ It can be disabled with '--without-pjproject-bundled'.
+
From 14.6.0 to 14.7.0:
Core:
diff --git a/build_tools/download_externals b/build_tools/download_externals
index b0a414e..f6cc523 100755
--- a/build_tools/download_externals
+++ b/build_tools/download_externals
@@ -26,7 +26,11 @@
fi
trap "rm -rf ${tmpdir}" EXIT
-sed -r -e "s/^([^ =]+)\s*=\s*(.*)$/\1=\"\2\"/g" ${ASTTOPDIR}/makeopts >${tmpdir}/makeopts
+# We have to pre-process the makeopts file so it will be parsable by bash
+# Surround values with double quotes
+# Convert make $(or) functions to bash ${name:-value}
+sed -r -e "s/^([^ =]+)\s*=\s*(.*)$/\1=\"\2\"/g" \
+ -e 's/^([^ =]+)="\$\(or ([^,]*),([^)]+)\)"/_tmp="\2"\n\1="${_tmp:-\3}"/g' ${ASTTOPDIR}/makeopts >${tmpdir}/makeopts
source ${tmpdir}/makeopts
if [[ -z "${ASTMODDIR}" ]] ; then
echo "${module_name}: Unable to parse ${ASTTOPDIR}/makeopts."
diff --git a/build_tools/list_valid_installed_externals b/build_tools/list_valid_installed_externals
index 12aff3f..194801c 100755
--- a/build_tools/list_valid_installed_externals
+++ b/build_tools/list_valid_installed_externals
@@ -14,7 +14,11 @@
fi
trap "rm -rf ${tmpdir}" EXIT
-sed -r -e "s/^([^ =]+)\s*=\s*(.*)$/\1=\"\2\"/g" ${ASTTOPDIR}/makeopts >${tmpdir}/makeopts
+# We have to pre-process the makeopts file so it will be parsable by bash
+# Surround values with double quotes
+# Convert make $(or) functions to bash ${name:-value}
+sed -r -e "s/^([^ =]+)\s*=\s*(.*)$/\1=\"\2\"/g" \
+ -e 's/^([^ =]+)="\$\(or ([^,]*),([^)]+)\)"/_tmp="\2"\n\1="${_tmp:-\3}"/g' ${ASTTOPDIR}/makeopts >${tmpdir}/makeopts
source ${tmpdir}/makeopts
if [[ -z "${ASTMODDIR}" ]] ; then
echo "${module_name}: Unable to parse ${ASTTOPDIR}/makeopts."
diff --git a/configure b/configure
index 5bb7523..4c66c69 100755
--- a/configure
+++ b/configure
@@ -1227,6 +1227,7 @@
AST_CODE_COVERAGE
EXTERNALS_CACHE_DIR
SOUNDS_CACHE_DIR
+AST_DOWNLOAD_CACHE
AST_DEVMODE_STRICT
AST_DEVMODE
NOISY_BUILD
@@ -1381,6 +1382,7 @@
enable_option_checking
with_gnu_ld
enable_dev_mode
+with_download_cache
with_sounds_cache
with_externals_cache
enable_coverage
@@ -2139,12 +2141,15 @@
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-download-cache=PATH
+ use cached sound AND external module tarfiles in
+ PATH
--with-sounds-cache=PATH
use cached sound tarfiles in PATH
--with-externals-cache=PATH
use cached external module tarfiles in PATH
--with-pjproject-bundled
- Use bundled pjproject libraries
+ Use bundled pjproject libraries (default)
--with-asound=PATH use Advanced Linux Sound Architecture files in PATH
--with-bfd=PATH use Debug symbol decoding files in PATH
--with-execinfo=PATH use Stack Backtrace files in PATH
@@ -9066,6 +9071,30 @@
+# Check whether --with-download-cache was given.
+if test "${with_download_cache+set}" = set; then :
+ withval=$with_download_cache;
+ case ${withval} in
+ n|no)
+ unset AST_DOWNLOAD_CACHE
+ ;;
+ *)
+ if test "x${withval}" = "x"; then
+ :
+ else
+ AST_DOWNLOAD_CACHE="${withval}"
+ fi
+ ;;
+ esac
+
+else
+ :
+fi
+
+
+
+
+
# Check whether --with-sounds-cache was given.
if test "${with_sounds_cache+set}" = set; then :
withval=$with_sounds_cache;
@@ -9265,7 +9294,7 @@
CFLAGS="$save_CFLAGS"
-PJPROJECT_BUNDLED=no
+PJPROJECT_BUNDLED=yes
@@ -9328,11 +9357,11 @@
PJPROJECT_CONFIGURE_OPTS+=" --host=$host"
fi
- export TAR PATCH SED NM EXTERNALS_CACHE_DIR DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT
+ export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT
export NOISY_BUILD
${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \
PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \
- EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR}" \
+ EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" \
configure
if test $? -ne 0 ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
@@ -9345,7 +9374,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bundled pjproject" >&5
$as_echo_n "checking for bundled pjproject... " >&6; }
- PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR}" echo_cflags)
+ PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" echo_cflags)
PJPROJECT_CFLAGS="$PJPROJECT_INCLUDE"
PBX_PJPROJECT=1
diff --git a/configure.ac b/configure.ac
index a2eaab4..24aa922 100644
--- a/configure.ac
+++ b/configure.ac
@@ -407,6 +407,7 @@
AC_SUBST(AST_DEVMODE)
AC_SUBST(AST_DEVMODE_STRICT)
+AST_OPTION_ONLY([download-cache], [AST_DOWNLOAD_CACHE], [cached sound AND external module tarfiles], [])
AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [])
AST_OPTION_ONLY([externals-cache], [EXTERNALS_CACHE_DIR], [cached external module tarfiles], [])
@@ -424,12 +425,12 @@
AST_CHECK_RAII()
AST_CHECK_STRSEP_ARRAY_BOUNDS()
-PJPROJECT_BUNDLED=no
+PJPROJECT_BUNDLED=yes
AH_TEMPLATE(m4_bpatsubst([[HAVE_PJPROJECT_BUNDLED]], [(.*)]), [Define to 1 when using the bundled pjproject.])
AC_ARG_WITH([pjproject-bundled],
[AS_HELP_STRING([--with-pjproject-bundled],
- [Use bundled pjproject libraries])],
+ [Use bundled pjproject libraries (default)])],
[case "${withval}" in
n|no) PJPROJECT_BUNDLED=no ;;
*) PJPROJECT_BUNDLED=yes ;;
diff --git a/makeopts.in b/makeopts.in
index 07360a7..b852856 100644
--- a/makeopts.in
+++ b/makeopts.in
@@ -29,8 +29,9 @@
DOWNLOAD=@DOWNLOAD@
DOWNLOAD_TO_STDOUT=@DOWNLOAD_TO_STDOUT@
DOWNLOAD_TIMEOUT=@DOWNLOAD_TIMEOUT@
-SOUNDS_CACHE_DIR=@SOUNDS_CACHE_DIR@
-EXTERNALS_CACHE_DIR=@EXTERNALS_CACHE_DIR@
+AST_DOWNLOAD_CACHE=@AST_DOWNLOAD_CACHE@
+SOUNDS_CACHE_DIR=$(or @SOUNDS_CACHE_DIR@,${AST_DOWNLOAD_CACHE})
+EXTERNALS_CACHE_DIR=$(or @EXTERNALS_CACHE_DIR@,${AST_DOWNLOAD_CACHE})
RUBBER=@RUBBER@
CATDVI=@CATDVI@
KPATHSEA=@KPATHSEA@
diff --git a/third-party/pjproject/configure.m4 b/third-party/pjproject/configure.m4
index 709a706..2d33534 100644
--- a/third-party/pjproject/configure.m4
+++ b/third-party/pjproject/configure.m4
@@ -49,11 +49,11 @@
PJPROJECT_CONFIGURE_OPTS+=" --host=$host"
fi
- export TAR PATCH SED NM EXTERNALS_CACHE_DIR DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT
+ export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT
export NOISY_BUILD
${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \
PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \
- EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR}" \
+ EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" \
configure
if test $? -ne 0 ; then
AC_MSG_RESULT(failed)
@@ -63,7 +63,7 @@
AC_MSG_CHECKING(for bundled pjproject)
- PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR}" echo_cflags)
+ PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" echo_cflags)
PJPROJECT_CFLAGS="$PJPROJECT_INCLUDE"
PBX_PJPROJECT=1
--
To view, visit https://gerrit.asterisk.org/6176
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15.0
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa9783fddf44aafadb060c9feba713dfa81d38ce
Gerrit-Change-Number: 6176
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170810/53291b55/attachment-0001.html>
More information about the asterisk-code-review
mailing list