build: Set OS_WINDOWS in scripts/defines.sh to aid with Windows detection in test cases

This uses the result AC_CANONICAL_HOST and a pre-existing case statement checking for mingw32, cygwin, interix to determine if the build system is Windows based... We make the not unreasonable assumption that if the build system is Windows based, the tests will also be running on a Windows system.
This commit is contained in:
Arran Cudbard-Bell 2025-07-01 07:57:59 -04:00
parent fcf6cb40b7
commit b6bed508f5
No known key found for this signature in database
GPG key ID: FFA4D5829FB6D7CA
3 changed files with 21 additions and 3 deletions

View file

@ -703,10 +703,23 @@ OL_MSVC
dnl ----------------------------------------------------------------
dnl Checks for Windows NT
case $host_os in
*mingw32* ) ac_cv_mingw32=yes ;;
*cygwin* ) ac_cv_cygwin=yes ;;
*interix* ) ac_cv_interix=yes ;;
*mingw32* )
ac_cv_mingw32=yes
OS_WINDOWS=yes
;;
*cygwin* )
ac_cv_cygwin=yes
OS_WINDOWS=yes
;;
*interix* )
ac_cv_interix=yes
OS_WINDOWS=yes
;;
* )
OS_WINDOWS=no
;;
esac
AC_SUBST([OS_WINDOWS])
AC_CHECK_TOOL(RC, windres, )

View file

@ -46,6 +46,9 @@ AC_WITH_MODULES_ENABLED=@WITH_MODULES_ENABLED@
AC_ACI_ENABLED=aci@WITH_ACI_ENABLED@
AC_LIBS_DYNAMIC=lib@BUILD_LIBS_DYNAMIC@
# environment
AC_OS_WINDOWS=@OS_WINDOWS@
export AC_lloadd \
AC_WITH_SASL AC_WITH_TLS AC_WITH_MODULES_ENABLED AC_ACI_ENABLED \
AC_LIBS_DYNAMIC AC_WITH_TLS AC_TLS_TYPE

View file

@ -78,6 +78,8 @@ SLEEP1=${SLEEP1-7}
SLEEP2=${SLEEP2-15}
TIMEOUT=${TIMEOUT-8}
OS_WINDOWS=${AC_OS_WINDOWS-no}
# dirs
PROGDIR="$OBJDIR/tests/progs"
DATADIR=${USER_DATADIR-./testdata}