Commit 88f7d760 by Maarten L. Hekkelman

configure check for stdc++fs

parent 244f8b7b
......@@ -5817,6 +5817,59 @@ else
fi
ac_fn_cxx_check_header_mongrel "$LINENO" "filesystem" "ac_cv_header_filesystem" "$ac_includes_default"
if test "x$ac_cv_header_filesystem" = xyes; then :
else
as_fn_error $? "The file <filesystem> is missing, perhaps you should install a more recent libstdc++ implementation." "$LINENO" 5
fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <filesystem>
int
main ()
{
(void)std::filesystem::current_path();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
else
LIBS="$LIBS -lstdc++fs"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <filesystem>
int
main ()
{
(void)std::filesystem::current_path();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
else
as_fn_error $? "Could not link filesystem" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
# Check whether --with-boost was given.
......
......@@ -43,6 +43,27 @@ AX_CHECK_LIBRARY([LIBCIFPP], [cif++/Config.hpp], [cif++],
[],
[AC_MSG_ERROR([libcif++ not found - cannot continue])])
AC_CHECK_HEADER([filesystem], [], [AC_MSG_ERROR([The file <filesystem> is missing, perhaps you should install a more recent libstdc++ implementation.])])
dnl check if we need stdc++fs as library
AC_TRY_LINK(
[#include <filesystem>],
[(void)std::filesystem::current_path();],
[],
[
LIBS="$LIBS -lstdc++fs"
AC_TRY_LINK(
[#include <filesystem>],
[(void)std::filesystem::current_path();],
[],
[
AC_MSG_ERROR([Could not link filesystem])
]
)
]
)
AX_BOOST_BASE([1.65.1], [], [AC_MSG_ERROR([Could not find a recent version of boost])])
AX_BOOST_IOSTREAMS
AX_BOOST_THREAD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment