-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathautogen.sh
More file actions
executable file
·42 lines (34 loc) · 1.25 KB
/
autogen.sh
File metadata and controls
executable file
·42 lines (34 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/sh
set -e
command -v automake >/dev/null 2>&1 || { echo >&2 "Automake missing. Aborting."; exit 1; }
command -v autoconf >/dev/null 2>&1 || { echo >&2 "Autoconf missing. Aborting."; exit 1; }
[ -d m4 ] || mkdir m4
srcdir=$(dirname "$0")
test -z "$srcdir" && srcdir=.
ORIGDIR=$(pwd)
cd "$srcdir"
. ./data/scripts/add_cl_if_not_present.sh # add --with-cuda-host-compiler=<cl> to current params (Win)
# install config.guess config.sub install-sh missing
echo "Running automake..."
RES=$(automake --add-missing -c 2>&1 || true) # actual call will fail - we do not have Makefile.am
if test -n "$RES" -a -z "$(echo "$RES" | grep Makefile.am)"; then
echo "$RES"
exit 1
fi
# Running autoreconf is preferred over aclocal/autoheader/autoconf.
# It, however, needs to be a little bit bent because we do not use automake.
echo "Running autoreconf..."
set +e
RES=$(autoreconf -i 2>&1)
# check if the error was the expected absence of Makefile.am or something else - then fail
RES_WO_AM=$(echo "$RES" | grep -Ev "Makefile.am|automake failed with exit status")
if echo "$RES_WO_AM" | grep -q error; then
echo "$RES" >&2
exit 1
fi
if [ "$RES_WO_AM" ]; then
echo "$RES_WO_AM"
fi
cd "$ORIGDIR"
echo "Running configure..."
"$srcdir"/configure "$@"