Reported by Michele Locati <michele@locati.it>.
* build-aux/csharpcomp.sh.in: Don't produce -reference options for DLLs
whose name starts with a lowercase letter or contains '.Native.'.
* lib/csharpcomp.c (name_is_dll): Filter our file names that start with
a lowercase letter or contain '.Native.'.
+2024-10-09 Bruno Haible <bruno@clisp.org>
+
+ csharpcomp: Avoid error on Windows.
+ Reported by Michele Locati <michele@locati.it>.
+ * build-aux/csharpcomp.sh.in: Don't produce -reference options for DLLs
+ whose name starts with a lowercase letter or contains '.Native.'.
+ * lib/csharpcomp.c (name_is_dll): Filter our file names that start with
+ a lowercase letter or contain '.Native.'.
+
2024-10-08 Bruno Haible <bruno@clisp.org>
csharpcomp: Add support for dotnet.
;;
esac
options_csc="$options_csc -lib:"`echo "$arg" | sed -e "$sed_quote_subst"`
- for file in `cd "$dotnet_runtime_dir" && echo *.dll`; do
- options_csc="$options_csc -reference:"`echo "$file" | sed -e "$sed_quote_subst"`
+ for file in `cd "$dotnet_runtime_dir" && echo [ABCDEFGHIJKLMNOPQRSTUVWXYZ]*.dll`; do
+ case "$file" in
+ *.Native.*) ;;
+ *) options_csc="$options_csc -reference:"`echo "$file" | sed -e "$sed_quote_subst"` ;;
+ esac
done
csc="$dotnet_sdk_dir/Roslyn/bincore/csc.dll"
case "@build_os@" in
{
size_t d_name_len = strlen (d->d_name);
if (d_name_len > 4 && memcmp (d->d_name + d_name_len - 4, ".dll", 4) == 0)
- return 1;
+ /* Filter out files that start with a lowercase letter and files that
+ contain the substring ".Native.", since on Windows these files
+ produce an error "PE image doesn't contain managed metadata". */
+ if (d->d_name[0] >= 'A' && d->d_name[0] <= 'Z'
+ && strstr (d->d_name, ".Native.") == NULL)
+ return 1;
}
return 0;
}