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.
This commit is contained in:
Iain Buclaw 2021-12-16 23:56:16 +01:00
parent 0c3fc06c30
commit 7c6ae994fb
2 changed files with 32 additions and 0 deletions

View File

@ -425,7 +425,20 @@ AC_DEFUN([ACX_PROG_GDC],
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CC])
AC_CHECK_TOOL(GDC, gdc, no) 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 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 have_gdc=yes
else else
have_gdc=no have_gdc=no

19
configure vendored
View File

@ -5727,7 +5727,26 @@ else
GDC="$ac_cv_prog_GDC" GDC="$ac_cv_prog_GDC"
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D compiler works" >&5
$as_echo_n "checking whether the D compiler works... " >&6; }
if ${acx_cv_d_compiler_works+:} false; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.d <<EOF
module conftest; int main() { return 0; }
EOF
acx_cv_d_compiler_works=no
if test "x$GDC" != xno; then if test "x$GDC" != xno; then
errors=`(${GDC} -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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_d_compiler_works" >&5
$as_echo "$acx_cv_d_compiler_works" >&6; }
if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then
have_gdc=yes have_gdc=yes
else else
have_gdc=no have_gdc=no