# 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.
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"
# 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
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
# 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() {
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 \