summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/get-antlr-3.428
1 files changed, 25 insertions, 3 deletions
diff --git a/contrib/get-antlr-3.4 b/contrib/get-antlr-3.4
index 49b0b54a7..1fcdfed4a 100755
--- a/contrib/get-antlr-3.4
+++ b/contrib/get-antlr-3.4
@@ -25,8 +25,9 @@ function webget {
fi
}
-if [[ -z "${MACHINE_TYPE}" ]]; then
- MACHINE_TYPE=`uname -m`
+if [ -z "${MACHINE_TYPE}" ]; then
+ # get first nibble from config.guess (x86_64, i686, ...)
+ MACHINE_TYPE=`config/config.guess | sed 's,-.*,,'`
fi
set -x
@@ -59,8 +60,29 @@ cp Makefile Makefile.orig
sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile
make
make install
+cd ../..
+mv lib/libantlr3c.a lib/libantlr3c-static.a
+
+cd src/libantlr3c-3.4
+make clean
+
+if [ ${MACHINE_TYPE} == 'x86_64' ]; then
+ # 64-bit stuff here
+ ./configure --enable-64bit --with-pic --disable-shared --disable-antlrdebug --prefix=`pwd`/../.. $ANTLR_CONFIGURE_ARGS
+else
+ # 32-bit stuff here
+ ./configure --with-pic --disable-shared --disable-antlrdebug --prefix=`pwd`/../.. $ANTLR_CONFIGURE_ARGS
+fi
+
+cp Makefile Makefile.orig
+sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile
+make
+make install
+cd ../..
+mv lib/libantlr3c.la lib/libantlr3c.la.orig
+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
set +x
-cd ../../..
+cd ..
echo
echo Invalidating generated parsers..
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback