forked from cucumber-attic/bool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbison
More file actions
executable file
·26 lines (23 loc) · 787 Bytes
/
bison
File metadata and controls
executable file
·26 lines (23 loc) · 787 Bytes
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
#!/bin/bash
#
# Wrapper script that ensures we'll run the required version.
# If the required version is on the PATH, just use that.
# If not, download and build a local version and use that.
#
set -e
BASEDIR=$(cd `dirname $0` && /bin/pwd)
REQUIRED_BISON_VERSION=3.0.2
PATH=$BASEDIR/bison-$REQUIRED_BISON_VERSION/tests:$PATH
BISON_VERSION=`bison --version | grep ^bison | sed 's/^.* //'`
if [ "$REQUIRED_BISON_VERSION" != "$BISON_VERSION" ] ; then
pushd $BASEDIR
echo "****** DOWNLOADING bison-$REQUIRED_BISON_VERSION"
curl --silent --location http://ftp.gnu.org/gnu/bison/bison-$REQUIRED_BISON_VERSION.tar.gz | tar xvz
echo "****** BUILDING bison-$REQUIRED_BISON_VERSION"
pushd bison-$REQUIRED_BISON_VERSION
./configure
make
popd
popd
fi
bison $@