+
+# build dll configuration for windows.
+
+dllinfo_generate() {
+ name=$1
+ description=$2
+ version=$3
+ major=${version%%.*}
+ version_commas=`echo $version | tr . ,`,0
+ dllname=`echo $name | sed s/lib//`
+
+ license_str="This FFmpeg build is distributed under the terms of the GNU $license.\r\n"
+ test "$license" = "unredistributable" &&
+ license_str="This FFmpeg build may not be distributed publicly.\r\n"
+
+ cat <<EOF >$TMPRC
+#include <WinVer.h>
+#include "version.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION $version_commas
+ PRODUCTVERSION $version_commas
+ FILEFLAGSMASK 0x17L
+ FILEFLAGS 0x0L
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "$license_str"
+ "Source code is available at http://ffmpeg.org"
+ VALUE "CompanyName", "FFmpeg"
+ VALUE "FileDescription", "$description"
+ VALUE "FileVersion", "$version"
+ VALUE "InternalName", "$name"
+ VALUE "LegalCopyright", "(C) 2000-2008 Fabrice Bellard, et al."
+ VALUE "LegalTrademarks", "FFmpeg"
+ VALUE "OriginalFilename", "$dllname-$major.dll"
+ VALUE "ProductName", "$name"
+ VALUE "ProductVersion", FFMPEG_VERSION
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+EOF
+
+ if ! cmp -s $TMPRC $name/dllinfo.rc; then
+ mv -f $TMPRC $name/dllinfo.rc
+ fi
+ rm -f $TMPRC
+}
+
+if test "$dllinfo" = "yes"; then
+ dllinfo_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
+ dllinfo_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION"
+ dllinfo_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION"
+ dllinfo_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION"
+ dllinfo_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION"
+ dllinfo_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
+ dllinfo_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION"
+fi