-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·58 lines (47 loc) · 1.32 KB
/
build.sh
File metadata and controls
executable file
·58 lines (47 loc) · 1.32 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
#!/bin/bash
set -e
VERSION=7.77.0
REPO_PATH=repo
BUILD_PATH="${REPO_PATH}/_build"
BUILD_PATH_RELEASE="${BUILD_PATH}/release"
BUILD_PATH_DEBUG="${BUILD_PATH}/debug"
get_suffix() {
local system_version=$(lsb_release -sr | tr -d '.')
local system_name=$(lsb_release -si | tr '[:upper:]' '[:lower:]')
local system_machine=$(uname -m | tr '_' '-')
echo "${system_machine}-${system_name}-${system_version}"
}
SUFFIX_NAME=$(get_suffix)
build() {
local source_path="${1}"
local version="${2}"
local build_type="${3}"
local debug_suffix=""
local build_path="${source_path}/${build_type}"
mkdir -p "${build_path}"
if ! [ "${build_type}" == "Release" ]; then
debug_suffix="d"
fi
pushd "${build_path}"
local stripped_version=$(echo -n ${version} | tr '.' '_' )
git checkout curl-${stripped_version}
cmake -DCMAKE_BUILD_TYPE=${build_type} \
-DHTTP_ONLY=ON \
-DCPPFLAG_CURL_STATICLIB="-fPIC" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=INSTALL \
../
make -j 10
make install
pushd INSTALL
zip -r libcurl${debug_suffix}-dev_v${version}_${SUFFIX_NAME}.zip ./*
popd
mv INSTALL/*.zip ./
popd
mv ${build_path}/*.zip ./
}
if ! [ -d "${REPO_PATH}" ]; then
git clone https://github.com/curl/curl.git "${REPO_PATH}"
fi
build "${REPO_PATH}" "${VERSION}" Release
build "${REPO_PATH}" "${VERSION}" Debug