4 # Morgan Deters <mdeters@cs.nyu.edu>
5 # Tue, 15 Jan 2013 11:11:24 -0500
8 export WINDOWS_BUILD
=yes
12 export BUILD_TYPE
="--disable-shared --enable-static"
13 while getopts ":s" opt
; do
16 MAKE_CFLAGS
="-static-libgcc -static-libstdc++"
17 MAKE_CXXFLAGS
="-static-libgcc -static-libstdc++"
18 # CVC4 uses some internal symbols of ANTLR, so all symbols need to be
20 MAKE_LDFLAGS
="-no-undefined -Wl,--export-all-symbols"
21 BUILD_TYPE
="--enable-shared --disable-static"
26 if [ -z "$HOST" ]; then
29 echo "WARNING: Using default HOST value: $HOST"
30 echo "WARNING: You should probably run this script like this:"
32 echo "WARNING: HOST=i686-w64-mingw32 win-build"
34 echo "WARNING: (replacing the i686-w64-mingw32 with your build host)"
35 echo "WARNING: to ensure the script builds correctly."
41 BOOSTBASE
=boost_1_55_0
43 function reporterror
{
45 echo =============================================================================
47 echo "There was an error setting up the prerequisites. Look above for details."
53 if which curl
&>/dev
/null
; then
55 elif which wget
&>/dev
/null
; then
58 echo "Can't figure out how to download from web. Please install wget or curl." >&2
63 for dir
in antlr-3.4 gmp-
$GMPVERSION boost-
$BOOSTVERSION; do
64 if [ -e "$dir" ]; then
65 echo "error: $dir directory exists; please move it out of the way." >&2
70 echo =============================================================================
72 echo "Setting up ANTLR 3.4..."
74 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='
75 [ ${PIPESTATUS[0]} -eq 0 ] || reporterror
80 BUILD_TYPE
="$BUILD_TYPE" \
81 MAKE_CFLAGS
="$MAKE_CFLAGS" \
82 MAKE_CXXFLAGS
="$MAKE_CXXFLAGS" \
83 MAKE_LDFLAGS
="$MAKE_LDFLAGS" \
84 GMPVERSION
="$GMPVERSION" \
85 contrib
/get-gmp || reporterror
88 echo =============================================================================
90 echo "Setting up Boost..."
92 ( mkdir boost-
$BOOSTVERSION &&
93 cd boost-
$BOOSTVERSION &&
94 webget https
://sourceforge.net
/projects
/boost
/files
/boost
/$BOOSTVERSION/$BOOSTBASE.
tar.gz
/download
$BOOSTBASE.
tar.gz
&&
95 tar xfz
$BOOSTBASE.
tar.gz
&&
97 .
/bootstrap.sh
--with-toolset=gcc
--prefix=`pwd`/..
--with-libraries=thread
&&
98 echo "using gcc : mingw32 : $HOST-gcc ;" >> project-config.jam
&&
99 cp tools
/build
/v
2/tools
/gcc.jam tools
/build
/v
2/tools
/gcc.jam.orig
&&
100 sed 's,option = -pthread ; libs = rt ;,,' tools
/build
/v
2/tools
/gcc.jam.orig
> tools
/build
/v
2/tools
/gcc.jam
&&
101 .
/b2 gcc-mingw32 threadapi
=win32 link
=static
install ) ||
exit 1
103 echo =============================================================================
106 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\""
109 echo =============================================================================