-
Notifications
You must be signed in to change notification settings - Fork 54
/
autogen.sh
executable file
·45 lines (34 loc) · 1.25 KB
/
autogen.sh
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
42
43
44
#! /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..."
RES=$(autoreconf -i 2>&1 || true)
# check if the error was the expected absence of Makefile.am or something else - then fail
if test -n "$RES" -a -z "$(echo $RES | grep Makefile.am)"; then
echo "$RES"
exit 1
fi
CONFIGURE_OPTS=
if [ -n "$DEBUG" ]; then
CONFIGURE_OPTS="$CONFIGURE_OPTS --enable-debug"
fi
cd $ORIGDIR
echo "Running configure..."
$srcdir/configure $CONFIGURE_OPTS "$@"
cd $ORIGDIR