summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/get-antlr-3.479
-rwxr-xr-xcontrib/get-gmp-dev13
-rwxr-xr-xcontrib/get-win-dependencies111
3 files changed, 46 insertions, 157 deletions
diff --git a/contrib/get-antlr-3.4 b/contrib/get-antlr-3.4
index 45dc86583..ed7d02496 100755
--- a/contrib/get-antlr-3.4
+++ b/contrib/get-antlr-3.4
@@ -2,9 +2,13 @@
#
source "$(dirname "$0")/get-script-header.sh"
ANTLR_HOME_DIR="$DEPS_DIR/antlr-3.4"
+rm -rf "$ANTLR_HOME_DIR"
-if [ -z "${BUILD_TYPE}" ]; then
- BUILD_TYPE="--disable-shared --enable-static"
+[ -z "${BUILD_TYPE}" ] && BUILD_TYPE="--disable-shared --enable-static"
+if [ -n "$HOST" ]; then
+ ANTLR_CONFIGURE_ARGS="--host=$HOST"
+ MACHINE_TYPE="$(echo "$HOST" | cut -d '-' -f 1)"
+ echo "Using MACHINE_TYPE=$MACHINE_TYPE for HOST=$HOST"
fi
if [ -z "${MACHINE_TYPE}" ]; then
@@ -34,7 +38,7 @@ webget \
mkdir -p "$ANTLR_HOME_DIR/bin"
tee "$ANTLR_HOME_DIR/bin/antlr3" <<EOF
#!/usr/bin/env bash
-JAR_FILE="\$(find "\$(dirname "\$0")/../" -name antlr-3.4-complete.jar)"
+JAR_FILE="$INSTALL_DIR/share/java/antlr-3.4-complete.jar"
exec java -cp "\$JAR_FILE" org.antlr.Tool "\$@"
EOF
chmod a+x "$ANTLR_HOME_DIR/bin/antlr3"
@@ -43,63 +47,58 @@ install_bin "$ANTLR_HOME_DIR/bin/antlr3"
setup_dep \
"https://www.antlr3.org/download/C/libantlr3c-3.4.tar.gz" \
"$ANTLR_HOME_DIR/libantlr3c-3.4"
-cd "$ANTLR_HOME_DIR/libantlr3c-3.4"
+cd "$ANTLR_HOME_DIR/libantlr3c-3.4" || exit 1
+
+# Add aarch64 architecture
+sed 's/avr32 \\$/avr32 | aarch64 \\/' config.sub > config.sub.new
+mv config.sub.new config.sub
# 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-antlrdebug --prefix="$INSTALL_DIR" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
+
+# Enable 64-bit build
+if [[ "${MACHINE_TYPE}" == *"64" ]]; then
+ ANTLR_CONFIGURE_ARGS="$ANTLR_CONFIGURE_ARGS --enable-64bit"
+ 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-antlr-3.4"
else
- # 32-bit stuff here
- ./configure --disable-antlrdebug --prefix="$INSTALL_DIR" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
+ 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-antlr-3.4"
fi
+# Build static ANTLR library
+
+./configure --disable-antlrdebug --prefix="$INSTALL_DIR" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
+
cp Makefile Makefile.orig
sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile
make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" LDFLAGS="${MAKE_LDFLAGS}"
make install
-if [[ $WINDOWS_BUILD == "yes" ]]; then
- exit 0
-fi
+# Build shared ANTLR library
+
+# On some systems the library may be installed to lib64/ instead of lib/
+LIB_DIR="$(dirname "$(find "$INSTALL_DIR" -name libantlr3c.a)")"
-mv "$INSTALL_LIB_DIR/libantlr3c.a" "$INSTALL_LIB_DIR/libantlr3c-static.a"
+mv "$LIB_DIR/libantlr3c.a" "$LIB_DIR/libantlr3c-static.a"
make clean
-if [ "${MACHINE_TYPE}" == 'x86_64' ]; then
- # 64-bit stuff here
- ./configure --enable-64bit --with-pic --disable-antlrdebug --prefix="$INSTALL_DIR" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
-else
- # 32-bit stuff here
- ./configure --with-pic --disable-antlrdebug --prefix="$INSTALL_DIR" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
-fi
+./configure --with-pic --disable-antlrdebug --prefix="$INSTALL_DIR" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE
cp Makefile Makefile.orig
sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile
make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" LDFLAGS="${MAKE_LDFLAGS}"
make install
-mv "$INSTALL_LIB_DIR/libantlr3c.la" "$INSTALL_LIB_DIR/libantlr3c.la.orig"
-
-awk '/^old_library=/ {print "old_library='\''libantlr3c-static.a'\''"} /^library_names=/ {print "library_names='\''libantlr3c.a'\''"} !/^old_library=/ && !/^library_names=/ {print}' < "$INSTALL_LIB_DIR/libantlr3c.la.orig" > "$INSTALL_LIB_DIR/libantlr3c.la"
-rm "$INSTALL_LIB_DIR/libantlr3c.la.orig"
+mv "$LIB_DIR/libantlr3c.la" "$LIB_DIR/libantlr3c.la.orig"
-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
+awk '/^old_library=/ {print "old_library='\''libantlr3c-static.a'\''"} /^library_names=/ {print "library_names='\''libantlr3c.a'\''"} !/^old_library=/ && !/^library_names=/ {print}' < "$LIB_DIR/libantlr3c.la.orig" > "$LIB_DIR/libantlr3c.la"
+rm "$LIB_DIR/libantlr3c.la.orig"
echo
echo ===================== Now configure CVC4 with =====================
diff --git a/contrib/get-gmp-dev b/contrib/get-gmp-dev
index 3fc913a7d..d0ce045e4 100755
--- a/contrib/get-gmp-dev
+++ b/contrib/get-gmp-dev
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
#
# This script should only be used if your distribution does not ship with the
-# GMP configuration you need. For example, contrib/get-win-dependencies
-# cross-compiles GMP for Windows. You can also use the script if your
+# GMP configuration you need. For example, for cross-compiling GMP for Windows
+# or Linux ARM platforms. You can also use the script if your
# distribution does not ship with static GMP libraries (e.g., Arch Linux) and
# you want to build CVC4 statically.
# In most of the cases the GMP version installed on your system is the one you
@@ -16,14 +16,15 @@ source "$(dirname "$0")/get-script-header.sh"
[ -z "$GMPVERSION" ] && GMPVERSION=6.2.0
GMP_DIR="$DEPS_DIR/gmp-$GMPVERSION"
+rm -rf "$GMP_DIR"
echo =============================================================================
echo
echo "This script should only be used if your distribution does not ship with the"
-echo "GMP configuration you need. For example, contrib/get-win-dependencies cross-"
-echo "compiles GMP for Windows. You can also use the script if your distribution"
-echo "does not ship with static GMP libraries (e.g., Arch Linux) and you want to"
-echo "build CVC4 statically."
+echo "GMP configuration you need. For example, for cross-compiling GMP for"
+echo "Windows or Linux ARM platforms. You can also use the script if your Linux"
+echo "distribution does not ship with static GMP libraries (e.g., Arch Linux)"
+echo "and you want to build CVC4 statically."
echo
echo "In most of the cases the GMP version installed on your system is the one you"
echo "want and should use."
diff --git a/contrib/get-win-dependencies b/contrib/get-win-dependencies
deleted file mode 100755
index 47acc7c08..000000000
--- a/contrib/get-win-dependencies
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env bash
-#
-# win32-build script
-# Morgan Deters <mdeters@cs.nyu.edu>
-# Tue, 15 Jan 2013 11:11:24 -0500
-#
-
-set -e -o pipefail
-
-export WINDOWS_BUILD=yes
-export MAKE_CFLAGS=
-export MAKE_CXXFLAGS=
-export MAKE_LDFLAGS=
-export BUILD_TYPE="--disable-shared --enable-static"
-while getopts ":s" opt; do
- case ${opt} in
- s )
- MAKE_CFLAGS="-static-libgcc -static-libstdc++"
- MAKE_CXXFLAGS="-static-libgcc -static-libstdc++"
- # CVC4 uses some internal symbols of ANTLR, so all symbols need to be
- # exported
- MAKE_LDFLAGS="-no-undefined -Wl,--export-all-symbols"
- BUILD_TYPE="--enable-shared --disable-static"
- ;;
- esac
-done
-
-if [ -z "$HOST" ]; then
- HOST=x86_64-w64-mingw32
- echo "WARNING:"
- echo "WARNING: Using default HOST value: $HOST"
- echo "WARNING: You should probably run this script like this:"
- echo "WARNING:"
- echo "WARNING: HOST=i686-w64-mingw32 win-build"
- echo "WARNING:"
- echo "WARNING: (replacing the i686-w64-mingw32 with your build host)"
- echo "WARNING: to ensure the script builds correctly."
- echo "WARNING:"
-fi
-
-GMPVERSION=6.2.0
-BOOSTVERSION=1.55.0
-BOOSTBASE=boost_1_55_0
-
-function reporterror {
- echo
- echo =============================================================================
- echo
- echo "There was an error setting up the prerequisites. Look above for details."
- echo
- exit 1
-}
-
-function webget {
- if [ -x "$(command -v wget)" ]; then
- wget -c -O "$2" "$1"
- elif [ -x "$(command -v curl)" ]; then
- curl -L "$1" >"$2"
- else
- echo "Can't figure out how to download from web. Please install wget or curl." >&2
- exit 1
- fi
-}
-
-for dir in antlr-3.4 gmp-$GMPVERSION boost-$BOOSTVERSION; do
- if [ -e "$dir" ]; then
- echo "error: $dir directory exists; please move it out of the way." >&2
- exit 1
- fi
-done
-
-echo =============================================================================
-echo
-echo "Setting up ANTLR 3.4..."
-echo
-MACHINE_TYPE="x86_64" ANTLR_CONFIGURE_ARGS="--host=$HOST" contrib/get-antlr-3.4 | grep -v 'Now configure CVC4 with' | grep -v '\./configure --with-antlr-dir='
-[ ${PIPESTATUS[0]} -eq 0 ] || reporterror
-echo
-
-# Setup GMP
-HOST="$HOST" \
-BUILD_TYPE="$BUILD_TYPE" \
-MAKE_CFLAGS="$MAKE_CFLAGS" \
-MAKE_CXXFLAGS="$MAKE_CXXFLAGS" \
-MAKE_LDFLAGS="$MAKE_LDFLAGS" \
-GMPVERSION="$GMPVERSION" \
- contrib/get-gmp-dev || reporterror
-
-echo
-echo =============================================================================
-echo
-echo "Setting up Boost..."
-echo
-( mkdir boost-$BOOSTVERSION &&
- cd boost-$BOOSTVERSION &&
- webget https://sourceforge.net/projects/boost/files/boost/$BOOSTVERSION/$BOOSTBASE.tar.gz/download $BOOSTBASE.tar.gz &&
- tar xfz $BOOSTBASE.tar.gz &&
- cd $BOOSTBASE &&
- ./bootstrap.sh --with-toolset=gcc --prefix=`pwd`/.. --with-libraries=thread &&
- echo "using gcc : mingw32 : $HOST-gcc ;" >> project-config.jam &&
- cp tools/build/v2/tools/gcc.jam tools/build/v2/tools/gcc.jam.orig &&
- sed 's,option = -pthread ; libs = rt ;,,' tools/build/v2/tools/gcc.jam.orig > tools/build/v2/tools/gcc.jam &&
- ./b2 gcc-mingw32 threadapi=win32 link=static install ) || exit 1
-echo
-echo =============================================================================
-echo
-echo 'Now just run:'
-echo " ./configure --enable-static-binary --disable-shared --host=$HOST LDFLAGS=\"-L`pwd`/gmp-$GMPVERSION/lib -L`pwd`/antlr-3.4/lib -L`pwd`/boost-$BOOSTVERSION/lib\" CPPFLAGS=\"-I`pwd`/gmp-$GMPVERSION/include -I`pwd`/antlr-3.4/include -I`pwd`/boost-$BOOSTVERSION/include\" --with-antlr-dir=\"`pwd`/antlr-3.4\" ANTLR=\"`pwd`/antlr-3.4/bin/antlr3\""
-echo ' make'
-echo
-echo =============================================================================
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback