-
Notifications
You must be signed in to change notification settings - Fork 0
/
curlinstall
66 lines (57 loc) · 1.29 KB
/
curlinstall
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
#!/bin/sh
if test "x$1" = x -o "x$2" = x ; then
echo "Syntax:"
echo "curlinstall ares_path libcurl_path"
echo ""
exit 1
fi
if [ "`eval echo -n 'a'`" = "-n a" ] ; then
c="\c"
else
n="-n"
fi
save_PWD=`pwd`
echo "Installing ares"
cd $1
./configure --prefix=$HOME/ares && make && make install
SSLFLAG=""
while [ -z "$SSLFLAG" ] ; do
echo ""
echo "Should libcurl be built with SSL support?"
echo $n "-> " $c
read cc
case "$cc" in
[Yy]*)
SSLFLAG="--with-ssl"
;;
[Nn]*)
SSLFLAG="--without-ssl"
;;
*)
echo ""
echo "You must enter either Yes or No"
;;
esac
done
if [ -f $HOME/ares/lib/libcares.a ] ; then
if [ -f $HOME/ares/lib/libares.a ] ; then
rm -f $HOME/ares/lib/libares.a
fi
cp $HOME/ares/lib/libcares.a $HOME/ares/lib/libares.a
fi
echo "Installing libcurl"
cd $2
CPPFLAGS="-I$HOME/ares/include" ./configure --prefix=$HOME/curl --disable-shared \
--disable-thread --enable-ares=$HOME/ares --disable-ipv6 $SSLFLAG
cp -R $HOME/ares/lib ares
make && make install
if [ -f $HOME/curl/lib/libares.a ] ; then
rm -f $HOME/curl/lib/libares.a
fi
cp $HOME/ares/lib/libares.a $HOME/curl/lib
cd $save_PWD
echo ""
echo ""
echo "libcurl has been installed. When running ./Config specify:"
echo "$HOME/curl"
echo "for the directory you installed libcurl to."