From 5fc57de6f363545866ce463b3f06085665f00680 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 1 Apr 2025 10:00:54 +0200 Subject: [PATCH] dcomp-script: Handle gdc binaries named -gdc. * m4/dcomp.m4 (gt_DCOMP): Look only at the first word of the --version output and accept a "-" prefix. * build-aux/dcomp.sh.in: Likewise. --- ChangeLog | 7 +++++++ build-aux/dcomp.sh.in | 4 ++-- m4/dcomp.m4 | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f71a3a231..0166a1cdef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-04-01 Bruno Haible + + dcomp-script: Handle gdc binaries named -gdc. + * m4/dcomp.m4 (gt_DCOMP): Look only at the first word of the --version + output and accept a "-" prefix. + * build-aux/dcomp.sh.in: Likewise. + 2025-03-31 Bruno Haible dcomp-script: New module. diff --git a/build-aux/dcomp.sh.in b/build-aux/dcomp.sh.in index 5e3af76e8f..52a6123d22 100644 --- a/build-aux/dcomp.sh.in +++ b/build-aux/dcomp.sh.in @@ -30,8 +30,8 @@ # -Wl,OPTION (for libtool compatility) # Find out which implementation we are using. -case `@DC@ --version | sed -e 1q` in - gdc* | egdc*) flavor=gdc ;; +case `@DC@ --version | sed -e 's/ .*//' -e 1q` in + gdc | *-gdc | egdc | *-egdc) flavor=gdc ;; LDC*) flavor=ldc ;; DMD*) flavor=dmd ;; *) diff --git a/m4/dcomp.m4 b/m4/dcomp.m4 index f5c62d76bd..4481338813 100644 --- a/m4/dcomp.m4 +++ b/m4/dcomp.m4 @@ -1,5 +1,5 @@ # dcomp.m4 -# serial 1 +# serial 2 dnl Copyright (C) 2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -43,9 +43,9 @@ AC_DEFUN([gt_DCOMP], AC_MSG_RESULT([$ac_result]) AC_SUBST([DC]) if test -z "$DFLAGS" && test -n "$DC"; then - case `$DC --version | sed -e 1q` in - gdc* | egdc* | LDC*) DFLAGS="-g -O2" ;; - *) DFLAGS="-g -O" ;; + case `$DC --version | sed -e 's/ .*//' -e 1q` in + gdc | *-gdc | egdc | *-egdc | LDC*) DFLAGS="-g -O2" ;; + *) DFLAGS="-g -O" ;; esac fi AC_SUBST([DFLAGS]) -- 2.39.5