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 curl
&>/dev
/null
; then
20 elif which wget
&>/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 if ! [ -e config
/config.guess
]; then
30 echo "$(basename $0): I need the file config/config.guess to tell MACHINE_TYPE" >&2
31 echo "Try running ./autogen.sh, or set the MACHINE_TYPE environment variable." >&2
35 # get first nibble from config.guess (x86_64, i686, ...)
36 MACHINE_TYPE
=`config/config.guess | sed 's,-.*,,'`
40 mkdir
-p antlr-3.4
/share
/java
41 mkdir
-p antlr-3.4
/bin
42 mkdir
-p antlr-3.4
/src
44 webget http
://www.antlr3.org
/download
/antlr-3.4
-complete.jar
share
/java
/antlr-3.4
-complete.jar
45 webget http
://www.antlr3.org
/download
/C
/libantlr3c-3.4.
tar.gz src
/libantlr3c-3.4.
tar.gz
48 export CLASSPATH=`pwd`/share/java/antlr-3.4-complete.jar:\$CLASSPATH
49 exec java org.antlr.Tool "\$@"
53 gunzip
-f libantlr3c-3.4.
tar.gz
54 tar xfv libantlr3c-3.4.
tar
57 if [ ${MACHINE_TYPE} == 'x86_64' ]; then
59 .
/configure
--enable-64bit --disable-shared --disable-antlrdebug --prefix=`pwd`/..
/..
$ANTLR_CONFIGURE_ARGS
62 .
/configure
--disable-shared --disable-antlrdebug --prefix=`pwd`/..
/..
$ANTLR_CONFIGURE_ARGS
65 cp Makefile Makefile.orig
66 sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig
> Makefile
70 mv lib
/libantlr3c.a lib
/libantlr3c-static.a
75 if [ ${MACHINE_TYPE} == 'x86_64' ]; then
77 .
/configure
--enable-64bit --with-pic --disable-shared --disable-antlrdebug --prefix=`pwd`/..
/..
$ANTLR_CONFIGURE_ARGS
80 .
/configure
--with-pic --disable-shared --disable-antlrdebug --prefix=`pwd`/..
/..
$ANTLR_CONFIGURE_ARGS
83 cp Makefile Makefile.orig
84 sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig
> Makefile
88 mv lib
/libantlr3c.la lib
/libantlr3c.la.orig
89 awk '/^old_library=/ {print "old_library='\''libantlr3c-static.a'\''"} /^library_names=/ {print "library_names='\''libantlr3c.a'\''"} !/^old_library=/ && !/^library_names=/ {print}' < lib
/libantlr3c.la.orig
> lib
/libantlr3c.la
94 # echo Invalidating generated parsers..
95 # touch src/parser/*/*.g
97 if [ ${MACHINE_TYPE} == 'x86_64' ]; then
99 echo ============== WARNING
====================
100 echo The
script guessed that this machine is
64 bit.
101 echo If antlr should be built as
32 bit \
(i.e.
-m32\
),
102 echo please rerun the
script as
103 echo MACHINE_TYPE
=\"x86
\" .
/get-antlr3.4
107 echo ============== WARNING
====================
108 echo The
script guessed that this machine is
32 bit.
109 echo If antlr should be built as
64 bit \
(i.e.
-m64\
),
110 echo please rerun the
script as
111 echo MACHINE_TYPE
=\"x86_64
\" .
/get-antlr3.4
115 echo ===================== Now configure CVC4 with
=====================
116 echo .
/configure
--with-antlr-dir=`pwd`/antlr-3.4 ANTLR
=`pwd`/antlr-3.4
/bin
/antlr3