forked from microsoft/libHttpClient
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcurl_Linux.bash
More file actions
63 lines (54 loc) · 1.84 KB
/
curl_Linux.bash
File metadata and controls
63 lines (54 loc) · 1.84 KB
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
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CONFIGURATION="Release"
while [[ $# -gt 0 ]]; do
case $1 in
-c|--config)
CONFIGURATION="$2"
shift # past argument
shift # past value
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done
pushd "$SCRIPT_DIR"/../../External/curl
if [ ! -f ./configure ]; then
if [ -f configure.ac ]; then
if command -v autoreconf >/dev/null 2>&1; then
autoreconf -fi
else
echo "autoreconf not found; skipping"
fi
else
echo "Missing cURL sources. Please run 'git submodule update --init --recursive'."
exit 1
fi
fi
if [ -f "$SCRIPT_DIR/../../Out/x64/$CONFIGURATION/libcurl.Linux/libcurl.a" ]; then
echo "Previously-built library present at $SCRIPT_DIR/../../Out/x64/$CONFIGURATION/libcurl.Linux/libcurl.a - skipping build"
exit 0
else
echo "No previously-built library present at $SCRIPT_DIR/../../Out/x64/$CONFIGURATION/libcurl.Linux/libcurl.a - performing build"
fi
if [ "$CONFIGURATION" = "Debug" ]; then
# make libcrypto and libssl
./configure --disable-shared --with-zlib --disable-dependency-tracking -with-openssl=/usr/local/ssl --enable-symbol-hiding --enable-debug --without-brotli
else
# make libcrypto and libssl
./configure --disable-shared --with-zlib --disable-dependency-tracking -with-openssl=/usr/local/ssl --enable-symbol-hiding --disable-debug --without-brotli
fi
make
# copies binaries to final directory
mkdir -p "$SCRIPT_DIR"/../../Out/x64/"$CONFIGURATION"/libcurl.Linux
cp -R "$PWD"/lib/.libs/* "$SCRIPT_DIR"/../../Out/x64/"$CONFIGURATION"/libcurl.Linux
if [ -f Makefile ] && make -n clean >/dev/null 2>&1; then
make clean
fi
popd