Skip to content

Commit

Permalink
Build Mac: add --quiet option to dependency build scripts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ChristianBeer committed Aug 10, 2017
1 parent a54b1d5 commit aaec0f9
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 18 deletions.
6 changes: 5 additions & 1 deletion 3rdParty/buildMacDependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ fi
ROOTDIR=$(pwd)
cache_dir=""
doclean=""
extra_options=""
wxoption="--nodebug"
while [[ $# -gt 0 ]]; do
key="$1"
Expand All @@ -75,6 +76,9 @@ while [[ $# -gt 0 ]]; do
--debug)
wxoption=""
;;
-q|--quiet)
extra_options="${extra_options} --quiet"
;;
*)
echo "unrecognized option $key"
;;
Expand Down Expand Up @@ -111,7 +115,7 @@ download_and_build() {
tar -xf ${FILENAME}
fi
cd ${DIRNAME} || exit 1
source ${BUILDSCRIPT} --prefix ${PREFIX}
source ${BUILDSCRIPT} --prefix ${PREFIX} ${extra_options}
if [ $? -ne 0 ]; then exit 1; fi
cd ../.. || exit 1
touch ${FLAGFILE}
Expand Down
15 changes: 10 additions & 5 deletions mac_build/buildFTGL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
##
## the -clean argument will force a full rebuild.
## 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=""
stdout_target="/dev/stdout"
lprefix=""
libPath="src/.libs"
libftpath="`pwd`/../freetype_install/"
Expand All @@ -57,6 +59,9 @@ while [[ $# -gt 0 ]]; do
libftpath="${lprefix}"
shift
;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac
shift # past argument or value
done
Expand Down Expand Up @@ -120,11 +125,11 @@ else
fi

if [ "${doclean}" = "yes" ]; then
make clean 1>/dev/null
make clean 1>$stdout_target
fi

cd src || return 1
make 1>/dev/null
make 1>$stdout_target
if [ $? -ne 0 ]; then
cd "${SRCDIR}" || return 1
return 1;
Expand All @@ -135,7 +140,7 @@ mv -f .libs/libftgl.a libftgl_i386.a
cd "${SRCDIR}" || return 1

# Build for x86_64 architecture
make clean 1>/dev/null
make clean 1>$stdout_target

export CC="${GCCPATH}";export CXX="${GPPPATH}"
export LDFLAGS="-Wl,-syslibroot,${SDKPATH},-arch,x86_64"
Expand All @@ -157,7 +162,7 @@ if [ $retval -ne 0 ]; then
fi

cd src || return 1
make 1>/dev/null
make 1>$stdout_target
if [ $? -ne 0 ]; then
rm -f libftgl_i386.a
cd "${SRCDIR}" || return 1
Expand All @@ -178,7 +183,7 @@ rm -f .libs/libftgl_x86_64.a

if [ "x${lprefix}" != "x" ]; then
# this installs the modified library
make install 1>/dev/null
make install 1>$stdout_target
if [ $? -ne 0 ]; then
cd "${SRCDIR}" || return 1
return 1;
Expand Down
5 changes: 5 additions & 0 deletions mac_build/buildWxMac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
## the -clean argument will force a full rebuild.
## 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
## use -q or --quiet to redirect build output to /dev/null instead of /dev/stdout
#

SRCDIR=$PWD
Expand Down Expand Up @@ -144,6 +145,7 @@ fi
echo ""

doclean=""
stdout_target="/dev/stdout"
lprefix=""
libPathRel="build/osx/build/Release"
libPathDbg="build/osx/build/Debug"
Expand All @@ -164,6 +166,9 @@ while [[ $# -gt 0 ]]; do
libPathDbg="${lprefix}/lib/debug"
shift
;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac
shift # past argument or value
done
Expand Down
9 changes: 7 additions & 2 deletions mac_build/buildc-ares.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@
##
## the -clean argument will force a full rebuild.
## 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=""
stdout_target="/dev/stdout"
lprefix="/tmp/installed-c-ares"
libPath=".libs"
while [[ $# -gt 0 ]]; do
Expand All @@ -58,6 +60,9 @@ while [[ $# -gt 0 ]]; do
libPath="${lprefix}/lib"
shift
;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac
shift # past argument or value
done
Expand Down Expand Up @@ -124,9 +129,9 @@ if [ "${doclean}" = "yes" ]; then
make clean
fi

make 1>/dev/null
make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi
make install 1>/dev/null
make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi

lprefix=""
Expand Down
9 changes: 7 additions & 2 deletions mac_build/buildcurl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
##
## the -clean argument will force a full rebuild.
## 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`
Expand Down Expand Up @@ -82,6 +83,7 @@ fi

doclean=""
lprefix=""
stdout_target="/dev/stdout"
libPath="lib/.libs"
libcares="/tmp/installed-c-ares"
while [[ $# -gt 0 ]]; do
Expand All @@ -96,6 +98,9 @@ while [[ $# -gt 0 ]]; do
libcares="$libPath"
shift
;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac
shift # past argument or value
done
Expand Down Expand Up @@ -184,11 +189,11 @@ if [ "${doclean}" = "yes" ]; then
make clean
fi

make 1>/dev/null
make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi

if [ "x${lprefix}" != "x" ]; then
make install 1>/dev/null
make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi
else
# Delete temporarily installed c-ares.
Expand Down
13 changes: 9 additions & 4 deletions mac_build/buildfreetype.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
##
## the -clean argument will force a full rebuild.
## 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
##


Expand All @@ -60,6 +61,7 @@ if [ "$?" -eq "0" ]; then
fi

doclean=""
stdout_target="/dev/stdout"
lprefix="`pwd`/../freetype_install/"
libPath="objs/.libs"
while [[ $# -gt 0 ]]; do
Expand All @@ -73,6 +75,9 @@ while [[ $# -gt 0 ]]; do
libPath="${lprefix}/lib"
shift
;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac
shift # past argument or value
done
Expand Down Expand Up @@ -141,14 +146,14 @@ if [ "${doclean}" = "yes" ]; then
make clean
fi

make 1>/dev/null
make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi

# save i386 lib for later use
mv -f objs/.libs/libfreetype.a objs/.libs/libfreetype_i386.a

# Build for x86_64 architecture
make clean 1>/dev/null
make clean 1>$stdout_target

export CC="${GCCPATH}";export CXX="${GPPPATH}"
export LDFLAGS="-Wl,-syslibroot,${SDKPATH},-arch,x86_64"
Expand All @@ -159,7 +164,7 @@ export MACOSX_DEPLOYMENT_TARGET=10.6

./configure --enable-shared=NO --prefix=${lprefix} --host=x86_64
if [ $? -ne 0 ]; then return 1; fi
make 1>/dev/null
make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi

mv -f objs/.libs/libfreetype.a objs/.libs/libfreetype_x86_64.a
Expand All @@ -172,7 +177,7 @@ rm -f objs/.libs/libfreetype_x86_64.a

# Building ftgl requires [install-path]/bin/freetype-config
# this installs the modified library
make install 1>/dev/null
make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi

# remove installed items not needed by ftgl build
Expand Down
9 changes: 7 additions & 2 deletions mac_build/buildopenssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
##
## the -clean argument will force a full rebuild.
## 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=""
stdout_target="/dev/stdout"
lprefix=""
libPath="."
while [[ $# -gt 0 ]]; do
Expand All @@ -62,6 +64,9 @@ while [[ $# -gt 0 ]]; do
libPath="${lprefix}/lib"
shift
;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac
shift # past argument or value
done
Expand Down Expand Up @@ -134,11 +139,11 @@ if [ "${doclean}" = "yes" ]; then
make clean
fi

make 1>/dev/null
make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi

if [ "x${lprefix}" != "x" ]; then
make install 1>/dev/null
make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi
fi

Expand Down
9 changes: 7 additions & 2 deletions mac_build/buildsqlite3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
##
## the -clean argument will force a full rebuild.
## 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=""
stdout_target="/dev/stdout"
lprefix=""
libPath=".libs"
while [[ $# -gt 0 ]]; do
Expand All @@ -55,6 +57,9 @@ while [[ $# -gt 0 ]]; do
libPath="${lprefix}/lib"
shift
;;
-q|--quiet)
stdout_target="/dev/null"
;;
esac
shift # past argument or value
done
Expand Down Expand Up @@ -126,10 +131,10 @@ if [ "${doclean}" = "yes" ]; then
make clean
fi

make 1>/dev/null
make 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi
if [ "x${lprefix}" != "x" ]; then
make install 1>/dev/null
make install 1>$stdout_target
if [ $? -ne 0 ]; then return 1; fi
fi

Expand Down

0 comments on commit aaec0f9

Please sign in to comment.