Merge "Allow the build-toolchain.sh script to apply source packages."
This commit is contained in:
committed by
Android (Google) Code Review
commit
1f13f4084d
@@ -389,14 +389,13 @@ download_package ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Unpack a given package in a target location
|
# Unpack a given package in a target location
|
||||||
# $1: package name
|
# $1: package name (e.g. toolchain)
|
||||||
# $2: target directory
|
# $2: target directory (e.g. /tmp/foo)
|
||||||
#
|
#
|
||||||
unpack_package ()
|
unpack_package ()
|
||||||
{
|
{
|
||||||
WORKSPACE=$ANDROID_NDK_ARCHIVE/$1
|
|
||||||
SRCDIR=$2
|
|
||||||
SRCPKG=`var_value PKG_$1`
|
SRCPKG=`var_value PKG_$1`
|
||||||
|
SRCDIR=$2
|
||||||
if ! timestamp_check $1 unpack; then
|
if ! timestamp_check $1 unpack; then
|
||||||
echo "Unpack : $1 sources"
|
echo "Unpack : $1 sources"
|
||||||
echo " from $SRCPKG"
|
echo " from $SRCPKG"
|
||||||
@@ -413,6 +412,45 @@ unpack_package ()
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
timestamp_set $1 unpack
|
timestamp_set $1 unpack
|
||||||
|
timestamp_force $1 patch
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Patch a given package at a target location
|
||||||
|
# $1: package name (e.g. toolchain)
|
||||||
|
# $2: target directory (e.g. /tmp/foo)
|
||||||
|
# $3: patch directory (e.g. build/tools/toolchain-patches)
|
||||||
|
#
|
||||||
|
# The rationale here is that anything named like $3/<subpath>/<foo>.patch
|
||||||
|
# will be applied with "patch -p1" under $2/<subpath>
|
||||||
|
#
|
||||||
|
# Patches are listed and applied in alphanumerical order of their names
|
||||||
|
# as returned by 'find'. Consider using numbered prefixes like the patch
|
||||||
|
# files generated by "git format-patch" are named.
|
||||||
|
#
|
||||||
|
patch_package ()
|
||||||
|
{
|
||||||
|
SRCPKG=`var_value PKG_$1`
|
||||||
|
SRCDIR=$2
|
||||||
|
if ! timestamp_check $1 patch; then
|
||||||
|
PATCH_FILES=`(cd $3 && find . -name "*.patch") 2> /dev/null`
|
||||||
|
if [ -z "$PATCH_FILES" ] ; then
|
||||||
|
echo "Patch : none provided"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
for PATCH in $PATCH_FILES; do
|
||||||
|
echo "Patch : $1 sources"
|
||||||
|
echo " from $PATCH"
|
||||||
|
echo " into $SRCDIR"
|
||||||
|
PATCHDIR=`dirname $PATCH`
|
||||||
|
PATCHNAME=`basename $PATCH`
|
||||||
|
cd $SRCDIR/$PATCHDIR && patch -p1 < $3/$PATCH
|
||||||
|
if [ $? != 0 ] ; then
|
||||||
|
echo "Patch failure !! Please check toolchain package !"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
timestamp_set $1 patch
|
||||||
timestamp_force $1 configure
|
timestamp_force $1 configure
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -443,6 +481,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
unpack_package toolchain $ANDROID_TOOLCHAIN_SRC
|
unpack_package toolchain $ANDROID_TOOLCHAIN_SRC
|
||||||
|
patch_package toolchain $ANDROID_TOOLCHAIN_SRC $ANDROID_NDK_ROOT/build/tools/toolchain-patches
|
||||||
|
|
||||||
# remove all info files from the unpacked toolchain sources
|
# remove all info files from the unpacked toolchain sources
|
||||||
# they create countless little problems during the build
|
# they create countless little problems during the build
|
||||||
|
|||||||
Reference in New Issue
Block a user