]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
win32_build.sh: use ENABLE_SHARED=ON by default 53273/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 4 Sep 2023 10:01:48 +0000 (10:01 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 6 Sep 2023 11:17:16 +0000 (11:17 +0000)
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>
README.windows.rst
mingw_conf.sh
win32_build.sh
win32_deps_build.sh

index b8065b6b282ba739341ebf70a6da81924a4b9dd7..5a7013900569bf696700f2de56b42d1982bb551d 100644 (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
index 7c0d527e1e2d74d3ddbedc29cb979051127b7aaa..6a226da5f040db2fd08741a9e18859c61b45f1ec 100644 (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
index 8edf40326292bc77c9804527ce899d0452250dc5..4c65e7ae26002ee267a0cb843a1768d480eeb404 100755 (executable)
@@ -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
index adc34a018344180aeaea201190d06e27d16ade7f..6eea81d1b8a212b468ddc1b8481c59c0b0680aa5 100755 (executable)
@@ -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 $@
 }