Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Timo Rothenpieler <timo@rothenpieler.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Timo Rothenpieler <timo@rothenpieler.org>
Subject: [FFmpeg-devel] [PATCH 3/3] compat: add msvc windres wrapper
Date: Sun,  7 Aug 2022 17:12:48 +0200
Message-ID: <20220807151248.15182-3-timo@rothenpieler.org> (raw)
In-Reply-To: <20220807151248.15182-1-timo@rothenpieler.org>

This is by no means a complete wrapper. It's only designed to fit the
usecase ffmpegs build system has.
---
 compat/windows/mswindres | 32 ++++++++++++++++++++++++++++++++
 configure                |  2 ++
 2 files changed, 34 insertions(+)
 create mode 100755 compat/windows/mswindres

diff --git a/compat/windows/mswindres b/compat/windows/mswindres
new file mode 100755
index 0000000000..450525a33e
--- /dev/null
+++ b/compat/windows/mswindres
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+if [ "$1" = "--version" ]; then
+    rc.exe /?
+    exit $?
+fi
+
+if [ $# -lt 2 ]; then
+    echo "Usage: mswindres [-I/include/path ...] [-DSOME_DEFINE ...] [-o output.o] input.rc [output.o]" >&2
+    exit 0
+fi
+
+EXTRA_OPTS="/nologo"
+
+while [ $# -gt 2 ]; do
+    case $1 in
+    -D*) EXTRA_OPTS="$EXTRA_OPTS /d$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;;
+    -I*) EXTRA_OPTS="$EXTRA_OPTS /i$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;;
+    -o)  OPT_OUT="$2"; shift ;;
+    esac
+    shift
+done
+
+IN="$1"
+if [ -z "$OPT_OUT" ]; then
+    OUT="$2"
+else
+    OUT="$OPT_OUT"
+fi
+
+eval set -- $EXTRA_OPTS
+rc.exe "$@" /fo "$OUT" "$IN"
diff --git a/configure b/configure
index 09fbe66e9b..6761d0cb32 100755
--- a/configure
+++ b/configure
@@ -4369,6 +4369,7 @@ case "$toolchain" in
             die "Unsupported MSVC version (2013 or newer required)"
         fi
         ld_default="$source_path/compat/windows/mslink"
+        windres_default="$source_path/compat/windows/mswindres"
         nm_default="dumpbin.exe -symbols"
         ar_default="lib.exe"
         case "${arch:-$arch_default}" in
@@ -5619,6 +5620,7 @@ case $target_os in
             # Cannot build both shared and static libs with MSVC or icl.
             disable static
         fi
+        ! enabled small && test_cmd $windres --version && enable gnu_windres
         enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
         shlibdir_default="$bindir_default"
         SLIBPREF=""
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2022-08-07 15:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07 15:12 [FFmpeg-devel] [PATCH 1/3] configure: always enable gnu_windres if available Timo Rothenpieler
2022-08-07 15:12 ` [FFmpeg-devel] [PATCH 2/3] fftools: add DPI awareness manifest Timo Rothenpieler
2022-08-07 15:12 ` Timo Rothenpieler [this message]
2022-08-07 15:51 ` [FFmpeg-devel] [PATCH 1/3] configure: always enable gnu_windres if available Andreas Rheinhardt
2022-08-07 17:44   ` Timo Rothenpieler
2022-08-07 16:04 ` Andreas Rheinhardt
2022-08-07 17:45   ` Timo Rothenpieler
2022-08-10 11:59 ` Timo Rothenpieler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220807151248.15182-3-timo@rothenpieler.org \
    --to=timo@rothenpieler.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git