1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#!/bin/bash
#
set -e
commit=3c5d3319120b
cd "$(dirname "$0")/.."
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
echo >&2
echo " $(pwd)" >&2
echo >&2
echo "is not a CVC4 source tree ?!" >&2
exit 1
fi
function webget {
if which wget &>/dev/null; then
wget -c -O "$2" "$1"
elif which curl &>/dev/null; then
curl "$1" >"$2"
else
echo "Can't figure out how to download from web. Please install wget or curl." >&2
exit 1
fi
}
if [ -e abc ]; then
echo 'error: file or directory "abc" exists; please move it out of the way.' >&2
exit 1
fi
mkdir abc
cd abc
webget https://bitbucket.org/alanmi/abc/get/$commit.tar.gz abc-$commit.tar.gz
gunzip -f abc-$commit.tar.gz
tar xfv abc-$commit.tar
cd alanmi-abc-$commit
cp src/base/main/main.c src/base/main/main.c.orig
sed 's,^// *#define ABC_LIB *$,#define ABC_LIB,' src/base/main/main.c.orig > src/base/main/main.c
# Strip out libSupport.c, it is in charge of loading extensions and we
# don't want different behavior based on ABC_LIB_PATH, or based on what
# .so is in the current directory!
cp src/base/main/module.make src/base/main/module.make.orig
grep -v 'libSupport\.c' src/base/main/module.make.orig > src/base/main/module.make
cp src/base/main/mainInit.c src/base/main/mainInit.c.orig
sed 's,\( *\)\(.*Libs_Init(\),\1//\2,;s,\( *\)\(.*Libs_End(\),\1//\2,' src/base/main/mainInit.c.orig > src/base/main/mainInit.c
# Build optimized, without readline, without pthreads.
# These aren't necessary for our usage and we don't want the dependencies.
make libabc.a OPTFLAGS=-O READLINE=0 PTHREADS=0
mv libabc.a libabc-static.a
make clean
make libabc.a OPTFLAGS='-O -fPIC' READLINE=0 PTHREADS=0
echo
echo ===================== Now configure CVC4 with =====================
echo ./configure --with-abc --with-abc-dir=`pwd`
|