From 60ef06ac51c8e5fab1c4d19f14d95f3f004a4333 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 23 Jan 2023 09:44:51 +0100 Subject: Merging upstream version 1.7.3. Signed-off-by: Daniel Baumann --- scripts/cross-build.sh | 18 +++++++++++++++--- scripts/mingw-build.sh | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'scripts') 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 \ -- cgit v1.2.3