]> Savannah Git Hosting - gnulib.git/commitdiff
csharpcomp-script: Improve Cygwin support.
authorBruno Haible <bruno@clisp.org>
Mon, 7 Oct 2024 18:20:14 +0000 (20:20 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 16 Oct 2024 12:03:48 +0000 (14:03 +0200)
* build-aux/csharpcomp.sh.in: Convert the file names passed to 'csc' to
native Windows syntax.

ChangeLog
build-aux/csharpcomp.sh.in

index e22466cb9c961a8207b118db1c242066bb386533..47725d879d90e602927ed6ab4a8aca29503743a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-10-07  Bruno Haible  <bruno@clisp.org>
+
+       csharpcomp-script: Improve Cygwin support.
+       * build-aux/csharpcomp.sh.in: Convert the file names passed to 'csc' to
+       native Windows syntax.
+
 2024-10-07  Bruno Haible  <bruno@clisp.org>
 
        csharpexec: Improve Cygwin support.
index 0ffbb480a360e6c78f5a90a2841d90d36f1b538f..9febcddd7268266637e62d27e9c76815f3a76ca7 100644 (file)
@@ -68,6 +68,7 @@ sed_quote_subst='s/\([|&;<>()$`"'"'"'*?[#~=%  \\]\)/\\\1/g'
 options_mcs=
 options_csc="-nologo"
 sources=
+sources_csc=
 while test $# != 0; do
   case "$1" in
     -o)
@@ -81,12 +82,28 @@ while test $# != 0; do
           ;;
       esac
       options_mcs="$options_mcs -out:"`echo "$2" | sed -e "$sed_quote_subst"`
-      options_csc="$options_csc -out:"`echo "$2" | sed -e "$sed_quote_subst"`
+      # On Windows, assume that 'csc' is a native Windows program,
+      # not a Cygwin program.
+      arg="$2"
+      case "@build_os@" in
+        cygwin*)
+          arg=`cygpath -w "$arg"`
+          ;;
+      esac
+      options_csc="$options_csc -out:"`echo "$arg" | sed -e "$sed_quote_subst"`
       shift
       ;;
     -L)
       options_mcs="$options_mcs -lib:"`echo "$2" | sed -e "$sed_quote_subst"`
-      options_csc="$options_csc -lib:"`echo "$2" | sed -e "$sed_quote_subst"`
+      # On Windows, assume that 'csc' is a native Windows program,
+      # not a Cygwin program.
+      arg="$2"
+      case "@build_os@" in
+        cygwin*)
+          arg=`cygpath -w "$arg"`
+          ;;
+      esac
+      options_csc="$options_csc -lib:"`echo "$arg" | sed -e "$sed_quote_subst"`
       shift
       ;;
     -l)
@@ -107,10 +124,27 @@ while test $# != 0; do
       ;;
     *.resources)
       options_mcs="$options_mcs -resource:"`echo "$1" | sed -e "$sed_quote_subst"`
-      options_csc="$options_csc -resource:"`echo "$1" | sed -e "$sed_quote_subst"`
+      # On Windows, assume that 'csc' is a native Windows program,
+      # not a Cygwin program.
+      arg="$1"
+      case "@build_os@" in
+        cygwin*)
+          arg=`cygpath -w "$arg"`
+          ;;
+      esac
+      options_csc="$options_csc -resource:"`echo "$arg" | sed -e "$sed_quote_subst"`
       ;;
     *.cs)
       sources="$sources "`echo "$1" | sed -e "$sed_quote_subst"`
+      # On Windows, assume that 'csc' is a native Windows program,
+      # not a Cygwin program.
+      arg="$1"
+      case "@build_os@" in
+        cygwin*)
+          arg=`cygpath -w "$arg"`
+          ;;
+      esac
+      sources_csc="$sources_csc "`echo "$arg" | sed -e "$sed_quote_subst"`
       ;;
     *)
       echo "csharpcomp: unknown type of argument '$1'" 1>&2
@@ -136,8 +170,8 @@ if test -n "@HAVE_MCS@"; then
   exit $result
 else
   if test -n "@HAVE_CSC@"; then
-    test -z "$CSHARP_VERBOSE" || echo csc $options_csc $sources
-    exec csc $options_csc $sources
+    test -z "$CSHARP_VERBOSE" || echo csc $options_csc $sources_csc
+    exec csc $options_csc $sources_csc
   else
     echo 'C# compiler not found, try installing mono, then reconfigure' 1>&2
     exit 1