summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-23 08:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-23 08:45:08 +0000
commit60ef06ac51c8e5fab1c4d19f14d95f3f004a4333 (patch)
tree91b176a8d7d7730f9fd95413ea881095f9da9e23 /scripts
parentReleasing debian version 1.7.2-1. (diff)
downloadttyd-60ef06ac51c8e5fab1c4d19f14d95f3f004a4333.tar.xz
ttyd-60ef06ac51c8e5fab1c4d19f14d95f3f004a4333.zip
Merging upstream version 1.7.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cross-build.sh18
-rw-r--r--scripts/mingw-build.sh2
2 files changed, 16 insertions, 4 deletions
diff --git a/scripts/cross-build.sh b/scripts/cross-build.sh
index 75aaf94..ea9fc7a 100755
--- a/scripts/cross-build.sh
+++ b/scripts/cross-build.sh
@@ -34,6 +34,8 @@ build_json-c() {
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX="${STAGE_DIR}" \
-DBUILD_SHARED_LIBS=OFF \
+ -DBUILD_TESTING=OFF \
+ -DDISABLE_THREAD_LOCAL_STORAGE=ON \
..
make -j"$(nproc)" install
popd
@@ -65,7 +67,7 @@ build_libuv() {
install_cmake_cross_file() {
cat << EOF > "${BUILD_DIR}/cross-${TARGET}.cmake"
-set(CMAKE_SYSTEM_NAME Linux)
+SET(CMAKE_SYSTEM_NAME $1)
set(CMAKE_C_COMPILER "${TARGET}-gcc")
set(CMAKE_CXX_COMPILER "${TARGET}-g++")
@@ -131,11 +133,18 @@ build() {
STAGE_DIR="${STAGE_ROOT}/${TARGET}"
BUILD_DIR="${BUILD_ROOT}/${TARGET}"
MUSL_CC_URL="https://github.com/tsl0922/musl-toolchains/releases/download/2021-11-23"
+ COMPONENTS="1"
+ SYSTEM="Linux"
+
+ if [ "$ALIAS" = "win32" ]; then
+ COMPONENTS=2
+ SYSTEM="Windows"
+ fi
echo "=== Installing toolchain ${ALIAS} (${TARGET})..."
mkdir -p "${CROSS_ROOT}" && export PATH="${PATH}:/opt/cross/bin"
- curl -fSsLo- "${MUSL_CC_URL}/${TARGET}-cross.tgz" | tar xz -C "${CROSS_ROOT}" --strip-components 1
+ curl -fSsLo- "${MUSL_CC_URL}/${TARGET}-cross.tgz" | tar xz -C "${CROSS_ROOT}" --strip-components=${COMPONENTS}
echo "=== Building target ${ALIAS} (${TARGET})..."
@@ -143,7 +152,7 @@ build() {
mkdir -p "${STAGE_DIR}" "${BUILD_DIR}"
export PKG_CONFIG_PATH="${STAGE_DIR}/lib/pkgconfig"
- install_cmake_cross_file
+ install_cmake_cross_file ${SYSTEM}
build_zlib
build_json-c
@@ -172,6 +181,9 @@ case ${BUILD_TARGET} in
armv7l)
build armv7l-linux-musleabihf "${BUILD_TARGET}"
;;
+ win32)
+ build x86_64-w64-mingw32 "${BUILD_TARGET}"
+ ;;
*)
echo "unknown cross target: ${BUILD_TARGET}" && exit 1
esac
diff --git a/scripts/mingw-build.sh b/scripts/mingw-build.sh
index 6366dcb..750d147 100644
--- a/scripts/mingw-build.sh
+++ b/scripts/mingw-build.sh
@@ -16,7 +16,7 @@ build_libwebsockets() {
build_libwebsockets
# workaround for the lib name change
-cp /mingw64/lib/libuv_a.a /mingw64/lib/libuv.a
+cp ${MINGW_PREFIX}/lib/libuv_a.a ${MINGW_PREFIX}/lib/libuv.a
rm -rf build && mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE \