From 37990e63c4751493f9c2af8c46e0c230a49e286f Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Sun, 11 Jun 2023 17:39:15 -0700 Subject: Make some changes to configure.ac to suppor MinGW (#3096) Adds some H5pubconf.h entries and cpp flags for building on MinGW using the Autotools. Also updates the Windows-related H5pubconf.h comments to be more accurate in CMake. --- config/cmake/H5pubconf.h.in | 4 ++-- configure.ac | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 4c80cd3..a5f0b05 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -14,13 +14,13 @@ #ifndef H5_CONFIG_H_ #define H5_CONFIG_H_ -/* Define if the Windows virtual file driver should be compiled */ +/* Define if this is a Windows machine */ #cmakedefine H5_HAVE_WINDOWS @H5_HAVE_WINDOWS@ /* Define if using MinGW */ #cmakedefine H5_HAVE_MINGW @H5_HAVE_MINGW@ -/* Define if on the Windows platform and default WIN32 API */ +/* Define if on the Windows platform and using the Win32 API */ #cmakedefine H5_HAVE_WIN32_API @H5_HAVE_WIN32_API@ /* Define if using a Windows compiler (i.e. Visual Studio) */ diff --git a/configure.ac b/configure.ac index a545435..7e4addc 100644 --- a/configure.ac +++ b/configure.ac @@ -1461,7 +1461,12 @@ case "$host_cpu-$host_vendor-$host_os" in ## VFD on Linux systems. H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ;; - + *mingw*) + AC_DEFINE([HAVE_WINDOWS], [1], [Define if this is a Windows machine]) + AC_DEFINE([HAVE_WIN32_API], [1], [Define if on the Windows platform using the Win32 API]) + AC_DEFINE([HAVE_MINGW], [1], [Define if using MinGW]) + H5_CPPFLAGS="-D_GNU_SOURCE -D__USE_MINGW_ANSI_STDIO $H5_CPPFLAGS" + ;; esac ## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible -- cgit v0.12