5 cd "$(dirname "$0")/.."
7 if ! [ -e src
/parser
/cvc
/Cvc.g
]; then
8 echo "$(basename $0): I expect to be in the contrib/ of a CVC4 source tree," >&2
9 echo "but apparently:" >&2
13 echo "is not a CVC4 source tree ?!" >&2
18 if which wget
&>/dev
/null
; then
20 elif which curl
&>/dev
/null
; then
23 echo "Can't figure out how to download from web. Please install wget or curl." >&2
28 if [[ -z "${MACHINE_TYPE}" ]]; then
29 MACHINE_TYPE
=`uname -m`
33 mkdir
-p antlr-3.4
/share
/java
34 mkdir
-p antlr-3.4
/bin
35 mkdir
-p antlr-3.4
/src
37 webget http
://antlr3.org
/download
/antlr-3.4
-complete.jar
share
/java
/antlr-3.4
-complete.jar
38 webget http
://antlr3.org
/download
/C
/libantlr3c-3.4.
tar.gz src
/libantlr3c-3.4.
tar.gz
41 export CLASSPATH=`pwd`/share/java/antlr-3.4-complete.jar:\$CLASSPATH
42 exec java org.antlr.Tool "\$@"
46 gunzip
-f libantlr3c-3.4.
tar.gz
47 tar xfv libantlr3c-3.4.
tar
50 if [ ${MACHINE_TYPE} == 'x86_64' ]; then
52 .
/configure
--enable-64bit --disable-shared --disable-antlrdebug --prefix=`pwd`/..
/..
$ANTLR_CONFIGURE_ARGS
55 .
/configure
--disable-shared --disable-antlrdebug --prefix=`pwd`/..
/..
$ANTLR_CONFIGURE_ARGS
58 cp Makefile Makefile.orig
59 sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig
> Makefile
66 echo Invalidating generated parsers..
67 touch src
/parser
/*/*.g
69 if [ ${MACHINE_TYPE} == 'x86_64' ]; then
71 echo ============== WARNING
====================
72 echo The
script guessed that this machine is
64 bit.
73 echo If antlr should be built as
32 bit \
(i.e.
-m32\
),
74 echo please rerun the
script as
75 echo MACHINE_TYPE
=\"x86
\" .
/get-antlr3.4
79 echo ============== WARNING
====================
80 echo The
script guessed that this machine is
32 bit.
81 echo If antlr should be built as
64 bit \
(i.e.
-m64\
),
82 echo please rerun the
script as
83 echo MACHINE_TYPE
=\"x86_64
\" .
/get-antlr3.4
87 echo ===================== Now configure CVC4 with
=====================
88 echo .
/configure
--with-antlr-dir=`pwd`/antlr-3.4 ANTLR
=`pwd`/antlr-3.4
/bin
/antlr3