Skip to content

Commit

Permalink
win32: add rhel option
Browse files Browse the repository at this point in the history
Add an option for building the Windows client on RHEL. I've tested this
on RHEL 9.

Signed-off-by: Ken Dreyer <[email protected]>
  • Loading branch information
ktdreyer committed Sep 27, 2022
1 parent 32863d9 commit 4954fe1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
13 changes: 11 additions & 2 deletions mingw_conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"
Expand Down
10 changes: 7 additions & 3 deletions win32_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 21 additions & 1 deletion win32_deps_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 \
Expand Down

0 comments on commit 4954fe1

Please sign in to comment.