-
Notifications
You must be signed in to change notification settings - Fork 6
/
spkg-install
executable file
·65 lines (52 loc) · 1.52 KB
/
spkg-install
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
63
64
65
#!/usr/bin/env bash
if [ "$SAGE_LOCAL" = "" ]; then
echo "SAGE_LOCAL undefined ... exiting";
echo "Maybe run 'sage -sh'?"
exit 1
fi
if [ $UNAME = "CYGWIN" ]; then
echo "Detected Cygwin -- checking for openssl development headers, since we use openssl instead."
if [ -d /usr/include/openssl ]; then
exit 0
else
echo "On Cygwin you *must* install Cygwin's openssl-devel development package (using Cygwin's setup.exe program)."
exit 1
fi
fi
if [ `uname` = "Darwin" -a "$SAGE64" = "yes" ]; then
echo "64 bit MacIntel"
CFLAGS="-O2 -g -m64 "; export CFLAGS
CXXFLAGS="-O2 -g -m64 "; export CXXFLAGS
fi
if [ `uname` = "SunOS" -a "$SAGE64" = "yes" ]; then
echo "64 bit Solaris"
CFLAGS="-O2 -g -m64 "; export CFLAGS
CXXFLAGS="-O2 -g -m64 "; export CXXFLAGS
fi
CPPFLAGS=-I$SAGE_LOCAL/include; export CPPFLAGS
# On Fedora 14, the gpg-error is not linked, and thus it fails to build with
# the following error: https://gist.github.com/961767
export LDFLAGS="-lgpg-error"
cd src
if [ `uname -s` = 'Darwin' ]; then
./configure --disable-asm --prefix="$SAGE_LOCAL" --disable-padlock-support
else
./configure --prefix="$SAGE_LOCAL" --disable-padlock-support
fi
if [ $? -ne 0 ]; then
echo "failed to configure libgcrypt"
exit 1
fi
make
if [ $? -ne 0 ]; then
echo "failed to build libgcrypt"
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "failed to install libgcrypt"
exit 1
fi
if [ `uname` = 'FreeBSD' ]; then
ln -s libgcrypt.so.15.3 $SAGE_LOCAL/lib/libgcrypt.so
fi