Remove PropositionalQuery class and all CUDD-related build stuff (and references)
[cvc5.git] / contrib / win32-build
1 #!/bin/bash
2 #
3 # win32-build script
4 # Morgan Deters <mdeters@cs.nyu.edu>
5 # Tue, 15 Jan 2013 11:11:24 -0500
6 #
7
8 if [ -z "$HOST" ]; then
9 HOST=i586-mingw32msvc
10 echo "WARNING:"
11 echo "WARNING: Using default HOST value: $HOST"
12 echo "WARNING: You should probably run this script like this:"
13 echo "WARNING:"
14 echo "WARNING: HOST=i586-mingw32msvc win32-build"
15 echo "WARNING:"
16 echo "WARNING: (replacing the i586-mingw32msvc with your build host)"
17 echo "WARNING: to ensure the script builds correctly."
18 echo "WARNING:"
19 fi
20
21 GMPVERSION=5.1.0
22
23 if [ $# -ne 0 ]; then
24 echo "usage: `basename $0`" >&2
25 echo >&2
26 echo "This script attempts to build CVC4 for Win32 using mingw." >&2
27 exit 1
28 fi
29
30 function reporterror {
31 echo
32 echo =============================================================================
33 echo
34 echo "There was an error setting up the prerequisites. Look above for details."
35 echo
36 exit 1
37 }
38
39 function webget {
40 if which wget &>/dev/null; then
41 wget -c -O "$2" "$1"
42 elif which curl &>/dev/null; then
43 curl "$1" >"$2"
44 else
45 echo "Can't figure out how to download from web. Please install wget or curl." >&2
46 exit 1
47 fi
48 }
49
50 for dir in antlr-3.4 gmp-$GMPVERSION boost-include; do
51 if [ -e "$dir" ]; then
52 echo "error: $dir directory exists; please move it out of the way." >&2
53 exit 1
54 fi
55 done
56
57 echo =============================================================================
58 echo
59 echo "Setting up ANTLR 3.4..."
60 echo
61 MACHINE_TYPE=x86 ANTLR_CONFIGURE_ARGS=--host=$HOST contrib/get-antlr-3.4 | grep -v 'Now configure CVC4 with' | grep -v '\./configure --with-antlr-dir='
62 [ ${PIPESTATUS[0]} -eq 0 ] || reporterror
63 echo
64 echo =============================================================================
65 echo
66 echo "Setting up GMP $GMPVERSION..."
67 echo
68 ( set -ex
69 mkdir gmp-$GMPVERSION
70 cd gmp-$GMPVERSION
71 gmpprefix=`pwd` &&
72 mkdir src &&
73 cd src &&
74 webget ftp://ftp.gmplib.org/pub/gmp-$GMPVERSION/gmp-$GMPVERSION.tar.bz2 gmp-$GMPVERSION.tar.bz2 &&
75 tar xfj gmp-$GMPVERSION.tar.bz2 &&
76 cd gmp-$GMPVERSION &&
77 ./configure --host=$HOST --prefix="$gmpprefix" --enable-cxx &&
78 make &&
79 make install
80 ) || exit 1
81 echo
82 echo =============================================================================
83 echo
84 echo "Setting up BOOST includes..."
85 echo
86 ( mkdir boost-include &&
87 ln -sv /usr/include/boost boost-include/boost ) || exit 1
88 echo
89 echo =============================================================================
90 echo
91 echo 'Now just run:'
92 echo " ./configure --host=$HOST LDFLAGS=\"-L`pwd`/gmp-$GMPVERSION/lib -L`pwd`/antlr-3.4/lib\" CPPFLAGS=\"-I`pwd`/gmp-$GMPVERSION/include -I`pwd`/antlr-3.4/include -I`pwd`/boost-include\" ANTLR_HOME=\"`pwd`/antlr-3.4\""
93 echo ' make'
94 echo
95 echo =============================================================================