mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
'--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
60 lines
1.8 KiB
Bash
Executable File
60 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
if [[ ( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} > 1 ) || ${BASH_VERSINFO[0]} > 4 ]] ; then
|
|
shopt -s compat41
|
|
fi
|
|
set -e
|
|
|
|
ASTTOPDIR=${ASTTOPDIR:-.}
|
|
|
|
tmpdir=$(mktemp -d)
|
|
if [[ -z "${tmpdir}" ]] ; then
|
|
echo "${module_name}: Unable to create temporary directory."
|
|
exit 1
|
|
fi
|
|
trap "rm -rf ${tmpdir}" EXIT
|
|
|
|
# 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."
|
|
exit 1
|
|
fi
|
|
|
|
XMLSTARLET=${XMLSTARLET:-xmlstarlet}
|
|
if [[ "${XMLSTARLET}" = ":" ]] ; then
|
|
echo "${module_name}: The externals downloader requires xmlstarlet to be installed."
|
|
exit 1
|
|
fi
|
|
|
|
version=$(${ASTTOPDIR}/build_tools/make_version ${ASTTOPDIR})
|
|
if [[ ! ${version} =~ ^(GIT-)?([^.-]+)[.-].* ]] ; then
|
|
echo "${module_name}: Couldn't parse version ${version}"
|
|
exit 1
|
|
fi
|
|
major_version=${BASH_REMATCH[2]}.0
|
|
|
|
if [[ "${HOST_CPU}" = "x86_64" ]] ; then
|
|
host_bits=64
|
|
else
|
|
host_bits=32
|
|
fi
|
|
|
|
names=""
|
|
for manifest in ${DESTDIR}${ASTMODDIR}/*.manifest.xml ; do
|
|
if [ ! -f "$manifest" ] ; then
|
|
break
|
|
fi
|
|
package_version=$(${XMLSTARLET} sel -t -v "/package/@version" ${manifest})
|
|
package_major_version=${package_version%_*}
|
|
package_arch=$(${XMLSTARLET} sel -t -v "/package/@arch" ${manifest})
|
|
if [[ "$package_major_version" = "$major_version" && "${package_arch}" = "x86_${host_bits}" ]] ; then
|
|
names+=$(${XMLSTARLET} sel -t -m "//file[@executable = 'yes']" -v "concat(@name, ' ')" ${manifest})
|
|
fi
|
|
done
|
|
echo $names
|