Build Mac: add --quiet option to dependency build scripts

By default stdout is printed on screen. For CI builds this is cluttering the log.

Note: /dev/stdout is not POSIX but is available on MacOS and popular Linux distributions.
This commit is contained in:
Christian Beer 2017-08-10 10:18:06 +02:00
parent a54b1d531e
commit aaec0f9490
8 changed files with 57 additions and 18 deletions

View File

@ -61,6 +61,7 @@ fi
ROOTDIR=$(pwd) ROOTDIR=$(pwd)
cache_dir="" cache_dir=""
doclean="" doclean=""
extra_options=""
wxoption="--nodebug" wxoption="--nodebug"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
key="$1" key="$1"
@ -75,6 +76,9 @@ while [[ $# -gt 0 ]]; do
--debug) --debug)
wxoption="" wxoption=""
;; ;;
-q|--quiet)
extra_options="${extra_options} --quiet"
;;
*) *)
echo "unrecognized option $key" echo "unrecognized option $key"
;; ;;
@ -111,7 +115,7 @@ download_and_build() {
tar -xf ${FILENAME} tar -xf ${FILENAME}
fi fi
cd ${DIRNAME} || exit 1 cd ${DIRNAME} || exit 1
source ${BUILDSCRIPT} --prefix ${PREFIX} source ${BUILDSCRIPT} --prefix ${PREFIX} ${extra_options}
if [ $? -ne 0 ]; then exit 1; fi if [ $? -ne 0 ]; then exit 1; fi
cd ../.. || exit 1 cd ../.. || exit 1
touch ${FLAGFILE} touch ${FLAGFILE}

View File

@ -39,9 +39,11 @@
## ##
## the -clean argument will force a full rebuild. ## the -clean argument will force a full rebuild.
## if --prefix is given as absolute path the library is installed into there ## if --prefix is given as absolute path the library is installed into there
## use -q or --quiet to redirect build output to /dev/null instead of /dev/stdout
## ##
doclean="" doclean=""
stdout_target="/dev/stdout"
lprefix="" lprefix=""
libPath="src/.libs" libPath="src/.libs"
libftpath="`pwd`/../freetype_install/" libftpath="`pwd`/../freetype_install/"
@ -57,6 +59,9 @@ while [[ $# -gt 0 ]]; do
libftpath="${lprefix}" libftpath="${lprefix}"
shift shift
;; ;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac esac
shift # past argument or value shift # past argument or value
done done
@ -120,11 +125,11 @@ else
fi fi
if [ "${doclean}" = "yes" ]; then if [ "${doclean}" = "yes" ]; then
make clean 1>/dev/null make clean 1>$stdout_target
fi fi
cd src || return 1 cd src || return 1
make 1>/dev/null make 1>$stdout_target
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
cd "${SRCDIR}" || return 1 cd "${SRCDIR}" || return 1
return 1; return 1;
@ -135,7 +140,7 @@ mv -f .libs/libftgl.a libftgl_i386.a
cd "${SRCDIR}" || return 1 cd "${SRCDIR}" || return 1
# Build for x86_64 architecture # Build for x86_64 architecture
make clean 1>/dev/null make clean 1>$stdout_target
export CC="${GCCPATH}";export CXX="${GPPPATH}" export CC="${GCCPATH}";export CXX="${GPPPATH}"
export LDFLAGS="-Wl,-syslibroot,${SDKPATH},-arch,x86_64" export LDFLAGS="-Wl,-syslibroot,${SDKPATH},-arch,x86_64"
@ -157,7 +162,7 @@ if [ $retval -ne 0 ]; then
fi fi
cd src || return 1 cd src || return 1
make 1>/dev/null make 1>$stdout_target
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
rm -f libftgl_i386.a rm -f libftgl_i386.a
cd "${SRCDIR}" || return 1 cd "${SRCDIR}" || return 1
@ -178,7 +183,7 @@ rm -f .libs/libftgl_x86_64.a
if [ "x${lprefix}" != "x" ]; then if [ "x${lprefix}" != "x" ]; then
# this installs the modified library # this installs the modified library
make install 1>/dev/null make install 1>$stdout_target
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
cd "${SRCDIR}" || return 1 cd "${SRCDIR}" || return 1
return 1; return 1;

View File

@ -43,6 +43,7 @@
## the -clean argument will force a full rebuild. ## the -clean argument will force a full rebuild.
## the -nodebug argument will ommit building the debug version of the library ## the -nodebug argument will ommit building the debug version of the library
## if --prefix is given as absolute path the library is installed into there ## if --prefix is given as absolute path the library is installed into there
## use -q or --quiet to redirect build output to /dev/null instead of /dev/stdout
# #
SRCDIR=$PWD SRCDIR=$PWD
@ -144,6 +145,7 @@ fi
echo "" echo ""
doclean="" doclean=""
stdout_target="/dev/stdout"
lprefix="" lprefix=""
libPathRel="build/osx/build/Release" libPathRel="build/osx/build/Release"
libPathDbg="build/osx/build/Debug" libPathDbg="build/osx/build/Debug"
@ -164,6 +166,9 @@ while [[ $# -gt 0 ]]; do
libPathDbg="${lprefix}/lib/debug" libPathDbg="${lprefix}/lib/debug"
shift shift
;; ;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac esac
shift # past argument or value shift # past argument or value
done done

View File

@ -42,9 +42,11 @@
## ##
## the -clean argument will force a full rebuild. ## the -clean argument will force a full rebuild.
## if --prefix is given as absolute path the library is installed into there ## if --prefix is given as absolute path the library is installed into there
## use -q or --quiet to redirect build output to /dev/null instead of /dev/stdout
## ##
doclean="" doclean=""
stdout_target="/dev/stdout"
lprefix="/tmp/installed-c-ares" lprefix="/tmp/installed-c-ares"
libPath=".libs" libPath=".libs"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -58,6 +60,9 @@ while [[ $# -gt 0 ]]; do
libPath="${lprefix}/lib" libPath="${lprefix}/lib"
shift shift
;; ;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac esac
shift # past argument or value shift # past argument or value
done done
@ -124,9 +129,9 @@ if [ "${doclean}" = "yes" ]; then
make clean make clean
fi fi
make 1>/dev/null make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
make install 1>/dev/null make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
lprefix="" lprefix=""

View File

@ -46,6 +46,7 @@
## ##
## the -clean argument will force a full rebuild. ## the -clean argument will force a full rebuild.
## if --prefix is given as absolute path the library is installed into there ## if --prefix is given as absolute path the library is installed into there
## use -q or --quiet to redirect build output to /dev/null instead of /dev/stdout
## ##
CURL_DIR=`pwd` CURL_DIR=`pwd`
@ -82,6 +83,7 @@ fi
doclean="" doclean=""
lprefix="" lprefix=""
stdout_target="/dev/stdout"
libPath="lib/.libs" libPath="lib/.libs"
libcares="/tmp/installed-c-ares" libcares="/tmp/installed-c-ares"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -96,6 +98,9 @@ while [[ $# -gt 0 ]]; do
libcares="$libPath" libcares="$libPath"
shift shift
;; ;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac esac
shift # past argument or value shift # past argument or value
done done
@ -184,11 +189,11 @@ if [ "${doclean}" = "yes" ]; then
make clean make clean
fi fi
make 1>/dev/null make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
if [ "x${lprefix}" != "x" ]; then if [ "x${lprefix}" != "x" ]; then
make install 1>/dev/null make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
else else
# Delete temporarily installed c-ares. # Delete temporarily installed c-ares.

View File

@ -41,6 +41,7 @@
## ##
## the -clean argument will force a full rebuild. ## the -clean argument will force a full rebuild.
## if --prefix is given as absolute path the library is installed into there ## if --prefix is given as absolute path the library is installed into there
## use -q or --quiet to redirect build output to /dev/null instead of /dev/stdout
## ##
@ -60,6 +61,7 @@ if [ "$?" -eq "0" ]; then
fi fi
doclean="" doclean=""
stdout_target="/dev/stdout"
lprefix="`pwd`/../freetype_install/" lprefix="`pwd`/../freetype_install/"
libPath="objs/.libs" libPath="objs/.libs"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -73,6 +75,9 @@ while [[ $# -gt 0 ]]; do
libPath="${lprefix}/lib" libPath="${lprefix}/lib"
shift shift
;; ;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac esac
shift # past argument or value shift # past argument or value
done done
@ -141,14 +146,14 @@ if [ "${doclean}" = "yes" ]; then
make clean make clean
fi fi
make 1>/dev/null make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
# save i386 lib for later use # save i386 lib for later use
mv -f objs/.libs/libfreetype.a objs/.libs/libfreetype_i386.a mv -f objs/.libs/libfreetype.a objs/.libs/libfreetype_i386.a
# Build for x86_64 architecture # Build for x86_64 architecture
make clean 1>/dev/null make clean 1>$stdout_target
export CC="${GCCPATH}";export CXX="${GPPPATH}" export CC="${GCCPATH}";export CXX="${GPPPATH}"
export LDFLAGS="-Wl,-syslibroot,${SDKPATH},-arch,x86_64" export LDFLAGS="-Wl,-syslibroot,${SDKPATH},-arch,x86_64"
@ -159,7 +164,7 @@ export MACOSX_DEPLOYMENT_TARGET=10.6
./configure --enable-shared=NO --prefix=${lprefix} --host=x86_64 ./configure --enable-shared=NO --prefix=${lprefix} --host=x86_64
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
make 1>/dev/null make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
mv -f objs/.libs/libfreetype.a objs/.libs/libfreetype_x86_64.a mv -f objs/.libs/libfreetype.a objs/.libs/libfreetype_x86_64.a
@ -172,7 +177,7 @@ rm -f objs/.libs/libfreetype_x86_64.a
# Building ftgl requires [install-path]/bin/freetype-config # Building ftgl requires [install-path]/bin/freetype-config
# this installs the modified library # this installs the modified library
make install 1>/dev/null make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
# remove installed items not needed by ftgl build # remove installed items not needed by ftgl build

View File

@ -46,9 +46,11 @@
## ##
## the -clean argument will force a full rebuild. ## the -clean argument will force a full rebuild.
## if --prefix is given as absolute path the library is installed into there ## if --prefix is given as absolute path the library is installed into there
## use -q or --quiet to redirect build output to /dev/null instead of /dev/stdout
## ##
doclean="" doclean=""
stdout_target="/dev/stdout"
lprefix="" lprefix=""
libPath="." libPath="."
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -62,6 +64,9 @@ while [[ $# -gt 0 ]]; do
libPath="${lprefix}/lib" libPath="${lprefix}/lib"
shift shift
;; ;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac esac
shift # past argument or value shift # past argument or value
done done
@ -134,11 +139,11 @@ if [ "${doclean}" = "yes" ]; then
make clean make clean
fi fi
make 1>/dev/null make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
if [ "x${lprefix}" != "x" ]; then if [ "x${lprefix}" != "x" ]; then
make install 1>/dev/null make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
fi fi

View File

@ -39,9 +39,11 @@
## ##
## the -clean argument will force a full rebuild. ## the -clean argument will force a full rebuild.
## if --prefix is given as absolute path the library is installed into there ## if --prefix is given as absolute path the library is installed into there
## use -q or --quiet to redirect build output to /dev/null instead of /dev/stdout
## ##
doclean="" doclean=""
stdout_target="/dev/stdout"
lprefix="" lprefix=""
libPath=".libs" libPath=".libs"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -55,6 +57,9 @@ while [[ $# -gt 0 ]]; do
libPath="${lprefix}/lib" libPath="${lprefix}/lib"
shift shift
;; ;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac esac
shift # past argument or value shift # past argument or value
done done
@ -126,10 +131,10 @@ if [ "${doclean}" = "yes" ]; then
make clean make clean
fi fi
make 1>/dev/null make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
if [ "x${lprefix}" != "x" ]; then if [ "x${lprefix}" != "x" ]; then
make install 1>/dev/null make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
fi fi