changeset 29129:3b1d005aabbf

configure.ac: Set target Windows version early. * configure.ac: Set target Windows version before initializing gnulib (after compiler detection) so that it can use all functions that are available in that version.
author Markus Mützel <markus.muetzel@gmx.de>
date Wed, 02 Dec 2020 20:36:20 +0100
parents cdc2f3799c85
children 8bb14f4979ca
files configure.ac
diffstat 1 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Wed Dec 02 20:05:12 2020 +0100
+++ b/configure.ac	Wed Dec 02 20:36:20 2020 +0100
@@ -1058,6 +1058,24 @@
 ## Does the C compiler support Automake subdir-objects option?
 AM_PROG_CC_C_O
 
+## Set the target Windows version early so that gnulib can use all functions
+## that are available in that version.
+case $host_os in
+  msdosmsvc | mingw*)
+    AC_MSG_CHECKING([for required _WIN32_WINNT])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+        #include <windows.h>
+        #if _WIN32_WINNT < 0x0403
+        #error "Wrong version"
+        #endif
+        ]], [])],
+      [AC_MSG_RESULT([none])],
+      [AC_DEFINE(_WIN32_WINNT, 0x0403,
+        [Define to 0x0403 to access InitializeCriticalSectionAndSpinCount.])
+       AC_MSG_RESULT([0x0403])])
+  ;;
+esac
+
 ### gnulib initialization: part 2
 dnl Must take place after part 1, and after standard compiler options and
 dnl search paths have been established, and at the same priority level as
@@ -1227,23 +1245,6 @@
   AC_MSG_ERROR([MATH DEFINES in math.h such as M_PI are required to build Octave])
 fi
 
-## Windows-specific tests for extra #defines
-case $host_os in
-  msdosmsvc | mingw*)
-    AC_MSG_CHECKING([for required _WIN32_WINNT])
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-        #include <windows.h>
-        #if _WIN32_WINNT < 0x0403
-        #error "Wrong version"
-        #endif
-        ]], [])],
-      [AC_MSG_RESULT([none])],
-      [AC_DEFINE(_WIN32_WINNT, 0x0403,
-        [Define to 0x0403 to access InitializeCriticalSectionAndSpinCount.])
-       AC_MSG_RESULT([0x0403])])
-  ;;
-esac
-
 ## Windows-specific use of functions
 case $host_os in
   msdosmsvc | mingw*)