Add spinner for progress

This commit is contained in:
Felix Schulze 2015-12-07 18:51:50 +01:00
parent a8aeebfac5
commit ae252f2d30
1 changed files with 22 additions and 9 deletions

View File

@ -35,7 +35,20 @@ ENABLE_EC_NISTP_64_GCC_128=""
# Don't change anything under this line! #
# #
###########################################################################
spinner()
{
local pid=$!
local delay=0.75
local spinstr='|/-\'
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
printf "\b\b\b\b\b\b"
done
printf " \b\b\b\b"
}
CURRENTPATH=`pwd`
ARCHS="i386 x86_64 armv7 armv7s arm64 tv_x86_64 tv_arm64"
@ -135,12 +148,12 @@ do
export CC="${BUILD_TOOLS}/usr/bin/gcc -arch ${ARCH}"
fi
echo " Configure..."
echo " Configure...\c"
set +e
if [ "${ARCH}" == "x86_64" ]; then
./Configure no-asm darwin64-x86_64-cc --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" ${LOCAL_CONFIG_OPTIONS} > "${LOG}" 2>&1
else
./Configure iphoneos-cross --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" ${LOCAL_CONFIG_OPTIONS} > "${LOG}" 2>&1
(./Configure no-asm darwin64-x86_64-cc --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" ${LOCAL_CONFIG_OPTIONS} > "${LOG}" 2>&1) & spinner
else
(./Configure iphoneos-cross --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" ${LOCAL_CONFIG_OPTIONS} > "${LOG}" 2>&1) & spinner
fi
if [ $? != 0 ]; then
@ -148,7 +161,7 @@ do
exit 1
fi
echo " Patch..."
echo "\n Patch..."
# add -isysroot to CC=
if [[ "${PLATFORM}" == "AppleTVSimulator" || "${PLATFORM}" == "AppleTVOS" ]]; then
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -mtvos-version-min=${TVOS_MIN_SDK_VERSION} !" "Makefile"
@ -156,8 +169,7 @@ do
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -miphoneos-version-min=${MIN_SDK_VERSION} !" "Makefile"
fi
echo " Make..."
echo " Please stand by..."
echo " Make...\c"
if [ "$1" == "verbose" ]; then
if [[ ! -z $CONFIG_OPTIONS ]]; then
@ -168,8 +180,9 @@ do
if [[ ! -z $CONFIG_OPTIONS ]]; then
make depend >> "${LOG}" 2>&1
fi
make >> "${LOG}" 2>&1
(make >> "${LOG}" 2>&1) & spinner
fi
echo "\n"
if [ $? != 0 ]; then
echo "Problem while make - Please check ${LOG}"