cryb-otp/autogen.des

75 lines
1.5 KiB
Text
Raw Permalink Normal View History

2017-03-05 00:02:49 +00:00
#!/bin/sh
has() {
which "$@" >/dev/null 2>&1
}
# Evaluate any envar assignments present on the command line
for arg ; do
case "${arg}" in
--prefix=*)
PREFIX="${arg#*=}"
export PREFIX
;;
CC=*|CXX=*|CPP=*|PREFIX=*)
eval "${arg}"
export "${arg%%=*}"
;;
esac
done
2017-03-05 00:02:49 +00:00
# BullseyeCoverage needs to know exactly which compiler we're using
if has "${CC}" "${CXX}" ; then
echo "using CC=${CC}"
elif has clang clang++ ; then
echo "using Clang"
export CC="${CC:-clang}"
export CXX="${CXX:-clang++}"
elif has gcc g++ ; then
echo "using GCC"
export CC="${CC:-gcc}"
export CXX="${CXX:-g++}"
else
echo "WARNING: using default compiler," \
"coverage analysis may not work"
fi
if [ -n "${CC}" ] ; then
export CPP="${CPP:-${CC} -E}"
fi
# If a prefix was provided, look for autoconf and pkg-config directories
if [ -n "${PREFIX}" ] ; then
if [ -f "${PREFIX}/share/aclocal/cryb_to.m4" ] ; then
export ACLOCAL_PATH="${PREFIX}/share/aclocal:${ACLOCAL_PATH}"
ACLOCAL_PATH="${ACLOCAL_PATH%:}"
export ACLOCAL_PATH
fi
if [ -f "${PREFIX}/lib/pkgconfig/cryb-core.pc" ] ; then
PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
PKG_CONFIG_PATH="${PKG_CONFIG_PATH%:}"
export PKG_CONFIG_PATH
fi
fi
2017-03-05 00:02:49 +00:00
set -e
# Push coverage state and disable
2017-03-05 00:02:49 +00:00
if has cov01 ; then
cov01 -qu
cov01 -q0
fi
. ./autogen.sh
./configure \
${PREFIX:+--prefix="${PREFIX}"} \
2017-03-05 00:02:49 +00:00
--enable-all \
--enable-developer-warnings \
--enable-werror \
"$@"
# Restore coverage state
2017-03-05 00:02:49 +00:00
if has cov01 ; then
cov01 -qo
fi