win32_build.sh: use ENABLE_SHARED=ON by default

The Windows build script uses static linking by default, the
reason being that some tests were failing to build otherwise,
mostly due to unspecified dependencies.

Now that the issue was addressed, we can enable dynamic linking
by default.

Worth mentioning that the Ceph MSI build script already uses
dynamic linking.

While at it, we'll drop some duplicate defaults from
"win32_deps_build.sh". For better clarity, we'll avoid exporting
some "win32_build.sh" variables, instead passing them explicitly
to "win32_deps_build.sh".

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
This commit is contained in:
Lucian Petrut 2023-09-04 10:01:48 +00:00
parent 0a4bb7e9a5
commit 4ec8e9938b
4 changed files with 13 additions and 21 deletions

View File

@ -54,7 +54,7 @@ EMBEDDED_DBG_SYM By default, the generated
symbols. If this flag is set,
the debug symbols will remain
embedded in the executables.
ENABLE_SHARED Dynamically link Ceph libs. False
ENABLE_SHARED Dynamically link Ceph libs. ON
================= =============================== ===============================
The following command will build the binaries and add them to a zip archive

View File

@ -17,6 +17,9 @@
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
MINGW_CMAKE_FILE=${MINGW_CMAKE_FILE:-}
MINGW_POSIX_FLAGS=${MINGW_POSIX_FLAGS:-}
if [[ -n $USE_MINGW_LLVM ]]; then
MINGW_LLVM_DIR=${MINGW_LLVM_DIR:-"$SCRIPT_DIR/build.deps/mingw-llvm"}
fi

View File

@ -58,7 +58,6 @@ if [[ -z $OS ]]; then
;;
esac
fi
export OS="$OS"
# The main advantages of mingw-llvm:
# * not affected by the libstdc++/winpthread rw lock bugs
@ -68,7 +67,7 @@ TOOLCHAIN=${TOOLCHAIN:-"mingw-llvm"}
case "$TOOLCHAIN" in
mingw-llvm)
echo "Using mingw-llvm."
export USE_MINGW_LLVM=1
USE_MINGW_LLVM=1
;;
mingw-gcc)
echo "Using mingw-gcc"
@ -93,9 +92,7 @@ if [[ -z $CMAKE_BUILD_TYPE ]]; then
CMAKE_BUILD_TYPE=Release
fi
# Some tests can't use shared libraries yet due to unspecified dependencies.
# We'll do a static build by default for now.
ENABLE_SHARED=${ENABLE_SHARED:-OFF}
ENABLE_SHARED=${ENABLE_SHARED:-ON}
binDir="$BUILD_DIR/bin"
strippedBinDir="$BUILD_DIR/bin_stripped"
@ -145,8 +142,12 @@ cd $BUILD_DIR
if [[ ! -f ${depsToolsetDir}/completed ]]; then
echo "Preparing dependencies: $DEPS_DIR. Log: ${BUILD_DIR}/build_deps.log"
NUM_WORKERS=$NUM_WORKERS DEPS_DIR=$DEPS_DIR OS="$OS"\
"$SCRIPT_DIR/win32_deps_build.sh" | tee "${BUILD_DIR}/build_deps.log"
NUM_WORKERS=$NUM_WORKERS \
DEPS_DIR=$DEPS_DIR \
OS="$OS" \
ENABLE_SHARED=$ENABLE_SHARED \
USE_MINGW_LLVM=$USE_MINGW_LLVM \
"$SCRIPT_DIR/win32_deps_build.sh" | tee "${BUILD_DIR}/build_deps.log"
fi
# Due to distribution specific mingw settings, the mingw.cmake file

View File

@ -1,17 +1,10 @@
#!/usr/bin/env bash
set -e
set -eu
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
USE_MINGW_LLVM=${USE_MINGW_LLVM:-}
ENABLE_SHARED=${ENABLE_SHARED:-OFF}
num_vcpus=$(nproc)
NUM_WORKERS=${NUM_WORKERS:-$num_vcpus}
DEPS_DIR="${DEPS_DIR:-$SCRIPT_DIR/build.deps}"
depsSrcDir="$DEPS_DIR/src"
depsToolsetDir="$DEPS_DIR/mingw"
@ -51,11 +44,6 @@ mingwLlvmUrl="https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/
mingwLlvmSha256Sum="bc97745e702fb9e8f2a16f7d09dd5061ceeef16554dd12e542f619ce937e8d7a"
mingwLlvmDir="${DEPS_DIR}/mingw-llvm"
# Allow for OS specific customizations through the OS flag (normally
# passed through from win32_build).
# Valid options are currently "ubuntu", "rhel", and "suse".
OS=${OS:-"ubuntu"}
function _make() {
make -j $NUM_WORKERS $@
}