Signed-off-by: Antonin Décimo <anto...@tarides.com>
---
 .../winpthreads/build-aux/windres-rc          | 158 ++++++++++++++++++
 mingw-w64-libraries/winpthreads/configure     |  13 +-
 mingw-w64-libraries/winpthreads/configure.ac  |   8 +-
 .../winpthreads/src/version.rc                |  18 +-
 4 files changed, 185 insertions(+), 12 deletions(-)
 create mode 100644 mingw-w64-libraries/winpthreads/build-aux/windres-rc

diff --git a/mingw-w64-libraries/winpthreads/build-aux/windres-rc 
b/mingw-w64-libraries/winpthreads/build-aux/windres-rc
new file mode 100644
index 000000000..fbd1e38e9
--- /dev/null
+++ b/mingw-w64-libraries/winpthreads/build-aux/windres-rc
@@ -0,0 +1,158 @@
+#! /bin/sh
+
+# MIT License
+
+# Copyright (c) Microsoft Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
of this
+# software and associated documentation files (the "Software"), to deal in the 
Software
+# without restriction, including without limitation the rights to use, copy, 
modify,
+# merge, publish, distribute, sublicense, and/or sell copies of the Software, 
and to
+# permit persons to whom the Software is furnished to do so, subject to the 
following
+# conditions:
+
+# The above copyright notice and this permission notice shall be included in 
all copies
+# or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED,
+# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
ACTION OF
+# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
SOFTWARE
+# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# 
https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/buildsystems/make_wrapper/windres-rc
+
+
+# Wrapper for windres to rc which do not understand '-i -o --output-format'.
+# cvtres is invoked by the linker
+scriptversion=2022-08-24.12; # UTC
+
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN* | MSYS*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin/* | msys/*)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine/*)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_windres_wrapper rc args...
+# Adjust compile command to suit rc instead of windres
+func_windres_wrapper ()
+{
+  # Assume a capable shell
+  bin=
+  in=
+  out=
+
+  for arg
+  do
+    if test -z "$bin"; then
+      bin=$1
+    elif test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       --output-format=*)
+         ;;
+       --define*)
+         eat=1
+         set -- "$@" "-d $2"
+         ;;
+       --include-dir*)
+         eat=1
+         func_file_conv "$2"
+         set -- "$@" "-I $file"
+         ;;
+       -o)
+         eat=1
+         func_file_conv "$2"
+         out="$file"
+         echo "OUTPUT:$file"
+         ;;
+       *.obj)
+         func_file_conv "$1"
+         out="$file"
+         echo "OUTPUT:$file"
+         ;;
+       -i)
+         eat=1
+         func_file_conv "$2" mingw
+         in="$file"
+         echo "INPUT:$file"
+         ;;
+       -*)
+         set -- "$@" "${1//\\\"/\"}"
+         ;;
+       *)
+         # libtool reorders arguments; save unqualified one as input
+         func_file_conv "$1"
+         in="$file"
+         echo "INPUT:$file"
+         ;;
+      esac
+    fi
+    shift
+  done
+  echo "$bin" "$@" -fo "$out" "$in"
+  exec "$bin" "$@" -fo "$out" "$in"
+  exit 1
+}
+
+eat=
+
+func_windres_wrapper "$@"
+
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/mingw-w64-libraries/winpthreads/configure 
b/mingw-w64-libraries/winpthreads/configure
index 36a217e5f..e988598b9 100755
--- a/mingw-w64-libraries/winpthreads/configure
+++ b/mingw-w64-libraries/winpthreads/configure
@@ -664,7 +664,6 @@ ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
-RCFLAGS
 COPY_STATIC_FALSE
 COPY_STATIC_TRUE
 COPY_SHARED_FALSE
@@ -693,6 +692,7 @@ LIBTOOL
 OBJDUMP
 DLLTOOL
 AS
+RCFLAGS
 ac_ct_AR
 AR
 am__fastdepCCAS_FALSE
@@ -4961,6 +4961,15 @@ unknown)
 esac
 
 
+case $CC in #(
+  *cl|*cl.exe|*clang-cl|*clang-cl.exe) :
+    RC="$am_aux_dir/windres-rc rc.exe"
+     CPPFLAGS="${CPPFLAGS} -nologo" ;; #(
+  *) :
+     ;;
+esac
+
+
 # Libtool 2.4 should check them correctly
 # AC_CHECK_TOOLS([AR],[ar],[:])
 
@@ -13730,8 +13739,6 @@ fi
 # mingw-w64 should already have them
 #AC_CHECK_FUNCS([ftime gettimeofday memset])
 
-
-
 ac_config_files="$ac_config_files Makefile tests/Makefile"
 
 cat >confcache <<\_ACEOF
diff --git a/mingw-w64-libraries/winpthreads/configure.ac 
b/mingw-w64-libraries/winpthreads/configure.ac
index e72316752..01602159b 100644
--- a/mingw-w64-libraries/winpthreads/configure.ac
+++ b/mingw-w64-libraries/winpthreads/configure.ac
@@ -19,6 +19,12 @@ AC_PROG_CC
 AM_PROG_AS
 AM_PROG_AR
 
+AS_CASE([$CC],
+  [*cl|*cl.exe|*clang-cl|*clang-cl.exe],
+    [RC="$am_aux_dir/windres-rc rc.exe"
+     CPPFLAGS="${CPPFLAGS} -nologo"])
+AC_SUBST([RCFLAGS])
+
 # Libtool 2.4 should check them correctly
 # AC_CHECK_TOOLS([AR],[ar],[:])
 
@@ -50,7 +56,5 @@ AC_TYPE_SIZE_T
 # mingw-w64 should already have them
 #AC_CHECK_FUNCS([ftime gettimeofday memset])
 
-AC_SUBST([RCFLAGS])
-
 AC_CONFIG_FILES([Makefile tests/Makefile])
 AC_OUTPUT
diff --git a/mingw-w64-libraries/winpthreads/src/version.rc 
b/mingw-w64-libraries/winpthreads/src/version.rc
index 43a611763..a9452bbcd 100644
--- a/mingw-w64-libraries/winpthreads/src/version.rc
+++ b/mingw-w64-libraries/winpthreads/src/version.rc
@@ -23,11 +23,15 @@
 #include <winver.h>
 #include "wpth_ver.h"
 
-#define WPTH_VERSIONINFO_NAME "WinPthreadGC\0"
-#ifdef _WIN64
-#define WPTH_VERSIONINFO_COMMENT "GNU C build -- MinGW-w64 64-bit\0"
+#if defined(__MINGW64__)
+# define WPTH_VERSIONINFO_COMMENT "GNU C build -- MinGW-w64 64-bit\0"
+# define WPTH_VERSIONINFO_NAME "WinPthreadGC\0"
+#elif defined(__MINGW32__)     
+# define WPTH_VERSIONINFO_COMMENT "GNU C build -- MinGW-w64 32-bit\0"
+# define WPTH_VERSIONINFO_NAME "WinPthreadGC\0"
 #else
-#define WPTH_VERSIONINFO_COMMENT "GNU C build -- MinGW-w64 32-bit\0"
+# define WPTH_VERSIONINFO_COMMENT "MSVC build\0"
+# define WPTH_VERSIONINFO_NAME "WinPthreadMS\0"
 #endif
 
 VS_VERSION_INFO VERSIONINFO
@@ -47,10 +51,10 @@ BEGIN
             VALUE "FileVersion", WPTH_VERSION_STRING
             VALUE "InternalName", WPTH_VERSIONINFO_NAME
             VALUE "OriginalFilename", WPTH_VERSIONINFO_NAME
-            VALUE "CompanyName", "MingW-W64 Project. All rights reserved.\0"
-            VALUE "LegalCopyright", "Copyright (C) MingW-W64 Project Members 
2010-2011\0"
+            VALUE "CompanyName", "MinGW-W64 Project. All rights reserved.\0"
+            VALUE "LegalCopyright", "Copyright (C) MinGW-W64 Project Members 
2010-2023\0"
             VALUE "Licence", "ZPL\0"
-            VALUE "Info", "http://mingw-w64.sourceforge.net/\0";
+            VALUE "Info", "https://www.mingw-w64.org/\0";
            VALUE "Comment", WPTH_VERSIONINFO_COMMENT
         END
     END
-- 
2.43.0



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to