From: Ken Dreyer Date: Fri, 9 Sep 2022 17:37:16 +0000 (+0000) Subject: win32: add rhel option X-Git-Tag: v18.1.0~1096^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4954fe19e5594ca5cac1d639fcfa49941abbbfa9;p=ceph.git win32: add rhel option Add an option for building the Windows client on RHEL. I've tested this on RHEL 9. Signed-off-by: Ken Dreyer --- diff --git a/mingw_conf.sh b/mingw_conf.sh index 3af7de09967f..aa1ac941849b 100644 --- a/mingw_conf.sh +++ b/mingw_conf.sh @@ -3,8 +3,8 @@ # and directories must be determined (or defined) prior to building. # This script expects the following variables: -# * OS - currently ubuntu or suse. In the future we may attempt to detect the -# platform. +# * OS - currently ubuntu, rhel, or suse. In the future we may attempt to +# detect the platform. # * MINGW_CMAKE_FILE - if set, a cmake toolchain file will be created # * MINGW_POSIX_FLAGS - if set, Mingw Posix compatibility mode will be # enabled by defining the according flags. @@ -28,6 +28,15 @@ case "$OS" in PTW32Include=/usr/share/mingw-w64/include PTW32Lib=/usr/x86_64-w64-mingw32/lib ;; + rhel) + mingwPosix="" + mingwLibDir="/usr/lib64/gcc" + mingwVersion="$(${MINGW_CPP}${mingwPosix} -dumpversion)" + mingwTargetLibDir="/usr/${MINGW_BASE}/sys-root/mingw/bin" + mingwLibpthreadDir="$mingwTargetLibDir" + PTW32Include=/usr/x86_64-w64-mingw32/sys-root/mingw/include + PTW32Lib=/usr/x86_64-w64-mingw32/sys-root/mingw/lib + ;; suse) mingwPosix="" mingwLibDir="/usr/lib64/gcc" diff --git a/win32_build.sh b/win32_build.sh index 1f81d34ae493..d6fc366e4a90 100755 --- a/win32_build.sh +++ b/win32_build.sh @@ -35,7 +35,7 @@ SKIP_ZIP=${SKIP_ZIP:-} # well as llvm rely on mspdb*.dll in order to support this proprietary format. EMBEDDED_DBG_SYM=${EMBEDDED_DBG_SYM:-} # Allow for OS specific customizations through the OS flag. -# Valid options are currently "ubuntu" and "suse". +# Valid options are currently "ubuntu", "suse", and "rhel". OS=${OS} if [[ -z $OS ]]; then @@ -44,12 +44,16 @@ if [[ -z $OS ]]; then opensuse*|suse|sles) OS="suse" ;; + rhel|centos) + OS="rhel" + ;; ubuntu) OS="ubuntu" ;; *) - echo "Unsupported Linux distro $ID, only SUSE and Ubuntu are currently \ -supported. Set the OS variable to override" + echo "Unsupported Linux distro $ID." + echo "only SUSE, Ubuntu and RHEL are supported." + echo "Set the OS environment variable to override." exit 1 ;; esac diff --git a/win32_deps_build.sh b/win32_deps_build.sh index b92465cbe59e..fc2b02667577 100755 --- a/win32_deps_build.sh +++ b/win32_deps_build.sh @@ -45,7 +45,7 @@ dokanLibDir="${depsToolsetDir}/dokany/lib" # Allow for OS specific customizations through the OS flag (normally # passed through from win32_build). -# Valid options are currently "ubuntu" and "suse". +# Valid options are currently "ubuntu", "rhel", and "suse". OS=${OS:-"ubuntu"} function _make() { @@ -63,6 +63,26 @@ mkdir -p $depsSrcDir echo "Installing required packages." case "$OS" in + rhel) + # pkgconf needs https://bugzilla.redhat.com/show_bug.cgi?id=1975416 + sudo yum -y --setopt=skip_missing_names_on_install=False install \ + mingw64-gcc-c++ \ + cmake \ + pkgconf \ + python3-devel \ + autoconf \ + libtool \ + ninja-build \ + zip \ + python3-Cython \ + python3-PyYAML \ + gcc \ + diffutils \ + patch \ + wget \ + perl \ + git-core + ;; ubuntu) sudo apt-get update sudo env DEBIAN_FRONTEND=noninteractive apt-get -y install \