summaryrefslogtreecommitdiff
path: root/config/acx.m4
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2021-12-16 23:56:16 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2021-12-21 21:29:35 +0100
commit7c6ae994fb587c19ca14aebe18dbc9aca83be609 (patch)
tree4a8b3e59d78cef36d51ef1eeaa7a4370b6f9b2ac /config/acx.m4
parent0c3fc06c300f5b71f299812c7fcac82b0236e5ac (diff)
downloadgcc-7c6ae994fb587c19ca14aebe18dbc9aca83be609.tar.gz
config: Add check whether D compiler works (PR103528)
As well as checking for the existence of a GDC compiler, also validate that it has also been built with libphobos, otherwise warn or fail with the message that GDC is required to build d. config/ChangeLog: PR d/103528 * acx.m4 (ACX_PROG_GDC): Add check whether D compiler works. ChangeLog: * configure: Regenerate.
Diffstat (limited to 'config/acx.m4')
-rw-r--r--config/acx.m413
1 files changed, 13 insertions, 0 deletions
diff --git a/config/acx.m4 b/config/acx.m4
index 3c65d820628..b86c4f9e51d 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -425,7 +425,20 @@ AC_DEFUN([ACX_PROG_GDC],
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
AC_REQUIRE([AC_PROG_CC])
AC_CHECK_TOOL(GDC, gdc, no)
+AC_CACHE_CHECK([whether the D compiler works],
+ acx_cv_d_compiler_works,
+[cat >conftest.d <<EOF
+module conftest; int main() { return 0; }
+EOF
+acx_cv_d_compiler_works=no
if test "x$GDC" != xno; then
+ errors=`(${GDC} $1[]m4_ifval([$1], [ ])-c conftest.d) 2>&1 || echo failure`
+ if test x"$errors" = x && test -f conftest.$ac_objext; then
+ acx_cv_d_compiler_works=yes
+ fi
+ rm -f conftest.*
+fi])
+if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then
have_gdc=yes
else
have_gdc=no