summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-08-09 07:01:33 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-08-09 08:05:42 -0500
commitd91c93c2264d96c0bb6bb6fd60a35d97ef9bebcc (patch)
treeca289dac565a7f3abac804deba511ed09bc287de /build_tools
parent2c23f8719e5a0b5d0fd5a7fd22e9b613a5bcb98a (diff)
configure: Add --with-download-cache option
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'. Change-Id: I5c3cf15ee61e8fe191b52732303e969854f8d861
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/download_externals6
-rwxr-xr-xbuild_tools/list_valid_installed_externals6
2 files changed, 10 insertions, 2 deletions
diff --git a/build_tools/download_externals b/build_tools/download_externals
index b0a414ed1..f6cc52390 100755
--- a/build_tools/download_externals
+++ b/build_tools/download_externals
@@ -26,7 +26,11 @@ if [[ -z "${tmpdir}" ]] ; then
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 12aff3f95..194801c94 100755
--- a/build_tools/list_valid_installed_externals
+++ b/build_tools/list_valid_installed_externals
@@ -14,7 +14,11 @@ if [[ -z "${tmpdir}" ]] ; then
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."