summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2012-10-23 19:41:12 +0000
committerTim King <taking@cs.nyu.edu>2012-10-23 19:41:12 +0000
commit5e64d60e49db9176c310f15cb206e3fda3e31973 (patch)
tree4d6a0f5ebe272d1fbda86b90ba8d95e88f70672d
parentb11f6d3a27d33b9075e57b37f77ad9d11732fce5 (diff)
The contrib/get-antlr-3.4 script:
- Has no outdated reference to /usr/share/java/stringtemplate.jar (as discussed on the mailing list). - Attempts to determine if the computer is 64 or 32 bit and configure antlr appropriately. - Warns the user about it's guess. - Tells the user how to correct an incorrect guess.
-rwxr-xr-xcontrib/get-antlr-3.438
1 files changed, 34 insertions, 4 deletions
diff --git a/contrib/get-antlr-3.4 b/contrib/get-antlr-3.4
index e9bc26b32..c56bac701 100755
--- a/contrib/get-antlr-3.4
+++ b/contrib/get-antlr-3.4
@@ -25,6 +25,10 @@ function webget {
fi
}
+if [[ -z "${MACHINE_TYPE}" ]]; then
+ MACHINE_TYPE=`uname -m`
+fi
+
set -x
mkdir -p antlr-3.4/share/java
mkdir -p antlr-3.4/bin
@@ -33,15 +37,24 @@ cd antlr-3.4
webget http://antlr.org/download/antlr-3.4-complete.jar share/java/antlr-3.4-complete.jar
webget http://antlr.org/download/C/libantlr3c-3.4.tar.gz src/libantlr3c-3.4.tar.gz
tee bin/antlr3 <<EOF
-#!/bin/sh
-export CLASSPATH=/usr/share/java/stringtemplate.jar:`pwd`/share/java/antlr-3.4-complete.jar:\$CLASSPATH
+#!/bin/bash
+export CLASSPATH=`pwd`/share/java/antlr-3.4-complete.jar:\$CLASSPATH
exec java org.antlr.Tool "\$@"
EOF
chmod a+x bin/antlr3
cd src
-tar xfzv libantlr3c-3.4.tar.gz
+gunzip -f libantlr3c-3.4.tar.gz
+tar xfv libantlr3c-3.4.tar
cd libantlr3c-3.4
-./configure --enable-64bit --prefix=`pwd`/../..
+
+if [ ${MACHINE_TYPE} == 'x86_64' ]; then
+ # 64-bit stuff here
+ ./configure --enable-64bit --prefix=`pwd`/../..
+else
+ # 32-bit stuff here
+ ./configure --prefix=`pwd`/../..
+fi
+
cp Makefile Makefile.orig
sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile
make
@@ -53,6 +66,23 @@ echo
echo Invalidating generated parsers..
touch src/parser/*/*.g
+if [ ${MACHINE_TYPE} == 'x86_64' ]; then
+ # 64-bit stuff here
+ echo ============== WARNING ====================
+ echo The script guessed that this machine is 64 bit.
+ echo If antlr should be built as 32 bit \(i.e. -m32\),
+ echo please rerun the script as
+ echo MACHINE_TYPE=\"x86\" ./get-antlr3.4
+
+else
+ # 32-bit stuff here
+ echo ============== WARNING ====================
+ echo The script guessed that this machine is 32 bit.
+ echo If antlr should be built as 64 bit \(i.e. -m64\),
+ echo please rerun the script as
+ echo MACHINE_TYPE=\"x86_64\" ./get-antlr3.4
+fi
+
echo
echo ===================== Now configure CVC4 with =====================
echo ./configure --with-antlr-dir=`pwd`/antlr-3.4 ANTLR=`pwd`/antlr-3.4/bin/antlr3
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback