summaryrefslogtreecommitdiff
path: root/contrib/get-antlr-3.4
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2017-11-01 09:42:15 -0700
committerMathias Preiner <mathias.preiner@gmail.com>2017-11-01 09:42:15 -0700
commitbe11fae39055f213586058ec9129d1276f724b0e (patch)
treef87bb554cfcc6fd7a79934143e83d8b6cb1fb854 /contrib/get-antlr-3.4
parentbdcc170e1bf5bb62904c4a3ebbdc9902096799ba (diff)
Add option to build shared Windows dependencies (#1282)
This commit adds an option to the contrib/get-win-dependencies script (-s) to build shared library versions of ANTLR and GMP, which enables building the shared versions of the CVC4 libraries needed for language bindings.
Diffstat (limited to 'contrib/get-antlr-3.4')
-rwxr-xr-xcontrib/get-antlr-3.427
1 files changed, 21 insertions, 6 deletions
diff --git a/contrib/get-antlr-3.4 b/contrib/get-antlr-3.4
index 6a36681cb..87d6ea450 100755
--- a/contrib/get-antlr-3.4
+++ b/contrib/get-antlr-3.4
@@ -4,6 +4,10 @@ set -e
cd "$(dirname "$0")/.."
+if [ -z "${BUILD_TYPE}" ]; then
+ BUILD_TYPE="--disable-shared --enable-static"
+fi
+
if ! [ -e src/parser/cvc/Cvc.g ]; then
echo "$(basename $0): I expect to be in the contrib/ of a CVC4 source tree," >&2
echo "but apparently:" >&2
@@ -60,18 +64,29 @@ gunzip -f libantlr3c-3.4.tar.gz
tar xfv libantlr3c-3.4.tar
cd libantlr3c-3.4
+# Use an absolute path for the installation directory to avoid spurious libtool
+# warnings about the ANTLR library having moved
+PREFIX=$(realpath `pwd`/../..)
+
+# Make antlr3debughandlers.c empty to avoid unreferenced symbols
+rm -rf src/antlr3debughandlers.c && touch src/antlr3debughandlers.c
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
# 64-bit stuff here
- ./configure --enable-64bit --disable-shared --disable-antlrdebug --prefix=`pwd`/../.. $ANTLR_CONFIGURE_ARGS
+ ./configure --enable-64bit --disable-antlrdebug --prefix="${PREFIX}" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
else
# 32-bit stuff here
- ./configure --disable-shared --disable-antlrdebug --prefix=`pwd`/../.. $ANTLR_CONFIGURE_ARGS
+ ./configure --disable-antlrdebug --prefix="${PREFIX}" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
fi
cp Makefile Makefile.orig
sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile
-make
+make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" LDFLAGS="${MAKE_LDFLAGS}"
make install
+
+if [[ $WINDOWS_BUILD == "yes" ]]; then
+ exit 0
+fi
+
cd ../..
mv lib/libantlr3c.a lib/libantlr3c-static.a
@@ -80,15 +95,15 @@ 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
+ ./configure --enable-64bit --with-pic --disable-antlrdebug --prefix="${PREFIX}" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
else
# 32-bit stuff here
- ./configure --with-pic --disable-shared --disable-antlrdebug --prefix=`pwd`/../.. $ANTLR_CONFIGURE_ARGS
+ ./configure --with-pic --disable-antlrdebug --prefix="${PREFIX}" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
fi
cp Makefile Makefile.orig
sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile
-make
+make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" LDFLAGS="${MAKE_LDFLAGS}"
make install
cd ../..
mv lib/libantlr3c.la lib/libantlr3c.la.orig
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback