From patchwork Thu Dec 16 23:12:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 49030 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC8EA3858430 for ; Thu, 16 Dec 2021 23:13:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC8EA3858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1639696424; bh=gF62++j3i8voz5eGhR17zxVyVrl3An1/lrE2Qcyd654=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=crTkaoacZ1La24WUtV1m+wluQ44WglDIdQPENQajQmMB/2W0aV/V07qOf1zRNn735 jjFY/FPlRf1H90VdShCdW9/paYwOvTtJqRzS2DbIsk/nEpCavu9DxIy2Ebq0NN86lg LqJmhuqCjW6ta5/WZ2ySWAzo63SG3jIq6OFOn6KU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050::465:102]) by sourceware.org (Postfix) with ESMTPS id E53A93858D28 for ; Thu, 16 Dec 2021 23:13:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E53A93858D28 Received: from smtp102.mailbox.org (smtp102.mailbox.org [80.241.60.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4JFSZw6sZDzQjYK; Fri, 17 Dec 2021 00:13:12 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de To: gcc-patches@gcc.gnu.org Subject: [PATCH] config: Add check whether D compiler works (PR103528) Date: Fri, 17 Dec 2021 00:12:28 +0100 Message-Id: <20211216231228.106506-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Cc: iain@sandoe.co.uk, segher@kernel.crashing.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch extends AC_PROG_GDC so that 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. Tested on a system running powerpcle-linux both without a D compiler, and with a D compiler configured with --disable-libphobos. This would also help with Solaris and Darwin ports, where support for both D and runtime isn't present across all current releases. OK for mainline? Regards, Iain --- config/ChangeLog: PR d/103528 * acx.m4 (ACX_PROG_GDC): Add check whether D compiler works. ChangeLog: * configure: Regenerate. --- 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 7f619d24ec5..869c654ea71 100755 --- a/configure +++ b/configure @@ -5721,7 +5721,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