summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2023-03-14 17:03:34 +0000
committerBen Gamari <ben@well-typed.com>2023-03-14 17:03:34 +0000
commit6f60da52a8cf17edcdf741af7948ef1eaa9b17db (patch)
tree0bf6b212b393cae2330568f6653a731e0af10b40
parentee17001e54c3c6adccc5e3b67b629655c14da43a (diff)
downloadhaskell-wip/T23116.tar.gz
configure: Fix FIND_CXX_STD_LIB test on Darwinwip/T23116
Annoyingly, Darwin's <cstddef> includes <version> and APFS is case-insensitive. Consequently, it will end up #including the `VERSION` file generated by the `configure` script on the second and subsequent runs of the `configure` script. See #23116.
-rw-r--r--m4/fp_find_cxx_std_lib.m411
1 files changed, 11 insertions, 0 deletions
diff --git a/m4/fp_find_cxx_std_lib.m4 b/m4/fp_find_cxx_std_lib.m4
index 09f4524d89..65357fe19e 100644
--- a/m4/fp_find_cxx_std_lib.m4
+++ b/m4/fp_find_cxx_std_lib.m4
@@ -4,6 +4,14 @@
# Identify which C++ standard library implementation the C++ toolchain links
# against.
AC_DEFUN([FP_FIND_CXX_STD_LIB],[
+ # Annoyingly, Darwin's <cstddef> includes <version> and APFS is
+ # case-insensitive. Consequently, it will end up #including the
+ # VERSION file generated by the configure script on the second
+ # and subsequent runs of the configure script.
+ # See #23116.
+ mkdir -p actest.tmp
+ cd actest.tmp
+
# If this is non-empty then assume that the user has specified these
# manually.
if test -z "$CXX_STD_LIB_LIBS"; then
@@ -87,6 +95,9 @@ EOF
rm -f actest.cpp actest.o actest
fi
+ cd ..
+ rm -R actest.tmp
+
AC_SUBST([CXX_STD_LIB_LIBS])
AC_SUBST([CXX_STD_LIB_LIB_DIRS])
AC_SUBST([CXX_STD_LIB_DYN_LIB_DIRS])