>       dcomp-script: New module.
>       * m4/dcomp.m4: New file.
>       * build-aux/dcomp.sh.in: New file.
>       * modules/dcomp-script: New file.

On Cygwin, with gdc, I see this warning message:

Warning: implementation flavor of 'x86_64-pc-cygwin-gdc' not recognized.

This patch fixes it.


2025-04-01  Bruno Haible  <br...@clisp.org>

        dcomp-script: Handle gdc binaries named <host>-gdc.
        * m4/dcomp.m4 (gt_DCOMP): Look only at the first word of the --version
        output and accept a "<host>-" prefix.
        * build-aux/dcomp.sh.in: Likewise.

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])




  • new module 'dcomp-script' Bruno Haible via Gnulib discussion list
    • Re: new module 'dcomp-script' Bruno Haible via Gnulib discussion list

Reply via email to