From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1873) id DE1E93858425; Tue, 21 Dec 2021 20:30:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE1E93858425 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain Buclaw To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6091] config: Add check whether D compiler works (PR103528) X-Act-Checkin: gcc X-Git-Author: Iain Buclaw X-Git-Refname: refs/heads/master X-Git-Oldrev: 0c3fc06c300f5b71f299812c7fcac82b0236e5ac X-Git-Newrev: 7c6ae994fb587c19ca14aebe18dbc9aca83be609 Message-Id: <20211221203041.DE1E93858425@sourceware.org> Date: Tue, 21 Dec 2021 20:30:41 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2021 20:30:42 -0000 https://gcc.gnu.org/g:7c6ae994fb587c19ca14aebe18dbc9aca83be609 commit r12-6091-g7c6ae994fb587c19ca14aebe18dbc9aca83be609 Author: Iain Buclaw Date: Thu Dec 16 23:56:16 2021 +0100 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. Diff: --- config/acx.m4 | 13 +++++++++++++ configure | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) 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 <&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 diff --git a/configure b/configure index 2e2dcd0ab30..9c2d7df1bb2 100755 --- a/configure +++ b/configure @@ -5727,7 +5727,26 @@ else GDC="$ac_cv_prog_GDC" 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 <&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 else have_gdc=no