34
34
die() { echo "$@"; exit 1; }
37
type "$1" &> /dev/null ;
41
echo $TESTS_ENVIRONMENT
43
AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
46
AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
49
AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
52
AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
54
AUTORECONF_FLAGS="--install --force --verbose -Wall"
57
LIBTOOLIZE_FLAGS="--force --verbose"
59
if [ $(uname) = "Darwin" ]
61
LIBTOOLIZE=glibtoolize
62
elif [ -z "$LIBTOOLIZE" ]
69
# Set ENV DEBUG in order to enable debugging
72
DEBUG="--enable-debug"
75
# Set ENV ASSERT in order to enable assert
78
ASSERT="--enable-assert"
81
# Set ENV MAKE in order to override "make"
87
# Set ENV MAKE_J in order to override "-j2"
93
# Set ENV PREFIX in order to set --prefix for ./configure
96
PREFIX="--prefix=$PREFIX"
101
$MAKE $MAKE_J maintainer-clean
104
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute $LIBTOOLIZE"
105
run $AUTORECONF $AUTORECONF_FLAGS || die "Can't execute $AUTORECONF"
107
# If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
108
if [ $(uname) = "Darwin" ]
110
CC=clang CXX=clang++ ./configure $DEBUG $ASSERT $PREFIX || die "configure failed to run"
112
./configure $DEBUG $ASSERT $PREFIX || die "configure failed to run"
115
# Set ENV MAKE_TARGET in order to override default of "all"
116
if [ -z "$MAKE_TARGET" ]
121
run $MAKE $MAKE_J $MAKE_TARGET || die "Can't execute make"
49
AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
52
AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
55
AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
58
AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
60
AUTORECONF_FLAGS="--install --force --verbose -Wall"
63
LIBTOOLIZE_FLAGS="--force --verbose"
65
if [ $(uname) = "Darwin" ]
67
LIBTOOLIZE=glibtoolize
68
elif [ -z "$LIBTOOLIZE" ]
76
AUTOMAKE_FLAGS=--add-missing
79
# Set ENV DEBUG in order to enable debugging
82
DEBUG="--enable-debug"
85
# Set ENV ASSERT in order to enable assert
88
ASSERT="--enable-assert"
91
# Set ENV VALGRIND in order to enable assert
92
if [ -n "$VALGRIND" ] && command_exists valgrind
94
VALGRIND="valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE"
95
TESTS_ENVIRONMENT="$VALGRIND"
98
# Set ENV MAKE in order to override "make"
104
# Set ENV MAKE_J in order to override "-j2"
110
# Set ENV PREFIX in order to set --prefix for ./configure
113
PREFIX="--prefix=$PREFIX"
118
$MAKE $MAKE_J maintainer-clean
121
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute $LIBTOOLIZE"
122
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute $AUTORECONF"
123
run $AUTORECONF $AUTORECONF_FLAGS || die "Can't execute $AUTORECONF"
125
# If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
126
if [ $(uname) = "Darwin" ]
128
CC=clang CXX=clang++ ./configure $DEBUG $ASSERT $PREFIX || die "configure failed to run"
130
./configure $DEBUG $ASSERT $PREFIX || die "configure failed to run"
133
if [[ -n "$TESTS_ENVIRONMENT" ]] && [[ -f libtool ]]
135
TESTS_ENVIRONMENT="./libtool --mode=execute $TESTS_ENVIRONMENT"
136
export TESTS_ENVIRONMENT
139
if [ -f docs/conf.py ]
141
run $MAKE $MAKE_J man || die "Can't execute make"
144
# Set ENV MAKE_TARGET in order to override default of "all"
145
if [ -z "$MAKE_TARGET" ]
150
run $MAKE $MAKE_J $MAKE_TARGET || die "Can't execute make"