blob: 144c4f12488a198df08c72f43e89863e9aac9a39 [file] [log] [blame] [edit]
From 7c50215fdb389f4c094e15411732fe218b4fa261 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
<alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:51:15 +0530
Subject: [PATCH 006/N] MINGW preset configure defaults
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
---
Misc/config_mingw | 12 ++++++++++++
Misc/cross_mingw32 | 11 +++++++++++
configure.ac | 22 ++++++++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 Misc/config_mingw
create mode 100644 Misc/cross_mingw32
diff --git a/Misc/config_mingw b/Misc/config_mingw
new file mode 100644
index 0000000..513065d
--- /dev/null
+++ b/Misc/config_mingw
@@ -0,0 +1,12 @@
+# configure defaults for mingw* hosts
+
+# mingw functions to ignore
+ac_cv_func_ftruncate=ignore # implement it as _chsize
+
+# mingw-w64 functions to ignore
+ac_cv_func_truncate=ignore
+ac_cv_func_alarm=ignore
+
+# files to ignore
+ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist
+ac_cv_file__dev_ptc=no
diff --git a/Misc/cross_mingw32 b/Misc/cross_mingw32
new file mode 100644
index 0000000..03fde9e
--- /dev/null
+++ b/Misc/cross_mingw32
@@ -0,0 +1,11 @@
+# configure defaults for mingw32 host if cross-build
+
+ac_cv_little_endian_double=yes
+ac_cv_big_endian_double=no
+ac_cv_mixed_endian_double=no
+
+ac_cv_tanh_preserves_zero_sign=yes
+
+ac_cv_wchar_t_signed=no
+
+ac_cv_have_size_t_format=no
diff --git a/configure.ac b/configure.ac
index ecdf22d..6058002 100644
--- a/configure.ac
+++ b/configure.ac
@@ -920,6 +920,28 @@ if test x$MULTIARCH != x; then
fi
AC_SUBST(MULTIARCH_CPPFLAGS)
+# initialize default configuration
+py_config=
+case $host in
+ *-*-mingw*) py_config=mingw ;;
+esac
+if test -n "$py_config" ; then
+ AC_MSG_NOTICE([loading configure defaults from .../Misc/config_$py_config"])
+ . "$srcdir/Misc/config_$py_config"
+fi
+
+# initialize defaults for cross-builds
+if test "$cross_compiling" = yes; then
+ py_config=$host_os
+ case $py_config in
+ mingw32*) py_config=mingw32 ;;
+ esac
+ if test -f "$srcdir/Misc/cross_$py_config" ; then
+ AC_MSG_NOTICE([loading cross defaults from .../Misc/cross_$py_config"])
+ . "$srcdir/Misc/cross_$py_config"
+ fi
+fi
+
AC_MSG_CHECKING([for -Wl,--no-as-needed])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
--
2.32.0