Add version string resources to the windows DLL.

This commit is contained in:
Erik de Castro Lopo 2010-10-10 12:43:08 +11:00
parent 08f50fb701
commit 84d1393898
5 changed files with 65 additions and 3 deletions

View File

@ -86,6 +86,7 @@ src/sndfile.h
src/stamp-h1
src/test_endswap.c
src/test_main
src/version-metadata.rc
tests/*_test
tests/benchmark
tests/benchmark.c
@ -94,6 +95,7 @@ tests/floating_point_test.c
tests/header_test.c
tests/libsndfile-1.dll
tests/pcm_test.c
tests/pedantic-header-test.sh
tests/pipe_test.c
tests/rdwr_test.c
tests/scale_clip_test.c
@ -102,4 +104,3 @@ tests/test_wrapper.sh
tests/utils.c
tests/utils.h
tests/write_read_test.c
tests/pedantic-header-test.sh

View File

@ -1,3 +1,8 @@
2010-10-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* configure.ac src/version-metadata.rc.in src/Makefile.am
Add version string resources to the windows DLL.
2010-10-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* tests/pedantic-header-test.sh.in

View File

@ -38,7 +38,10 @@ AC_LANG([C])
# 6. If any interfaces have been removed since the last public release, then set age
# to 0.
SHARED_VERSION_INFO="1:21:0"
CLEAN_VERSION=`echo $PACKAGE_VERSION | sed "s/p.*//"`
VERSION_MINOR=`echo $CLEAN_VERSION | sed "s/.*\.//"`
SHARED_VERSION_INFO="1:$VERSION_MINOR:0"
AC_PROG_CC
AM_PROG_CC_C_O
@ -48,6 +51,7 @@ AC_PROG_CXX
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AM_PROG_LIBTOOL
LT_PROG_RC
AC_CHECK_PROG(HAVE_AUTOGEN, autogen, yes, no)
AC_CHECK_PROG(HAVE_WINE, wine, yes, no)
@ -388,6 +392,8 @@ AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32
AC_DEFINE_UNQUOTED(OS_IS_MACOSX, ${os_is_macosx}, [Set to 1 if compiling for MacOSX])
AC_DEFINE_UNQUOTED(USE_WINDOWS_API, ${use_windows_api}, [Set to 1 to use the native windows API])
AM_CONDITIONAL(USE_WIN_VERSION_FILE, test ${use_windows_api} -eq 1)
#====================================================================================
# Check for ALSA.
@ -573,6 +579,8 @@ if test "$HOST_TRIPLET" = "x86_64-w64-mingw32" ; then
OS_SPECIFIC_LINKS=" -static-libgcc $OS_SPECIFIC_LINKS"
fi
WIN_RC_VERSION=`echo $PACKAGE_VERSION | sed -re "s/p.*//" -e "s/\./,/g"`
#-------------------------------------------------------------------------------
AC_SUBST(HOST_TRIPLET)
@ -583,6 +591,9 @@ AC_SUBST(HTML_FGCOLOUR)
AC_SUBST(SHLIB_VERSION_ARG)
AC_SUBST(SHARED_VERSION_INFO)
AC_SUBST(CLEAN_VERSION)
AC_SUBST(WIN_RC_VERSION)
AC_SUBST(OS_SPECIFIC_CFLAGS)
AC_SUBST(OS_SPECIFIC_LINKS)
AC_SUBST(ALSA_LIBS)
@ -602,6 +613,7 @@ SHAVE_INIT([],[enable])
AC_CONFIG_FILES([ \
shave shave-libtool \
src/sndfile.h src/Makefile src/GSM610/Makefile src/G72x/Makefile \
src/version-metadata.rc \
man/Makefile examples/Makefile tests/Makefile regtest/Makefile \
M4/Makefile doc/Makefile Win32/Makefile Octave/Makefile \
programs/Makefile doc/libsndfile.css \

View File

@ -27,7 +27,7 @@ COMMON = common.c file_io.c command.c pcm.c ulaw.c alaw.c float32.c \
double64.c ima_adpcm.c ms_adpcm.c gsm610.c dwvw.c vox_adpcm.c \
interleave.c strings.c dither.c broadcast.c audio_detect.c \
ima_oki_adpcm.c ima_oki_adpcm.h chunk.c chanmap.c \
windows.c id3.c
windows.c id3.c $(WIN_VERSION_FILE)
FILESPECIFIC = sndfile.c aiff.c au.c avr.c caf.c dwd.c flac.c g72x.c htk.c ircam.c \
macbinary3.c macos.c mat4.c mat5.c nist.c ogg.c paf.c pvf.c raw.c rx2.c sd2.c \
@ -35,6 +35,12 @@ FILESPECIFIC = sndfile.c aiff.c au.c avr.c caf.c dwd.c flac.c g72x.c htk.c ircam
CLEANFILES = *~
if USE_WIN_VERSION_FILE
WIN_VERSION_FILE = version-metadata.rc
else
WIN_VERSION_FILE =
endif
#===============================================================================
# MinGW requires -no-undefined if a DLL is to be built.
libsndfile_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@ @SHLIB_VERSION_ARG@
@ -87,6 +93,12 @@ Symbols.static: create_symbols_file.py
# Fake dependancy to force the creation of these files.
sndfile.o : $(SYMBOL_FILES)
#======================================================================
# Building windows resource files (if needed).
.rc.lo:
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) $< -o $@
#======================================================================
# Disable autoheader.
AUTOHEADER=echo

View File

@ -0,0 +1,32 @@
#include <windows.h>
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
1 VERSIONINFO
FILEVERSION @WIN_RC_VERSION@,0
PRODUCTVERSION @WIN_RC_VERSION@,0
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
FILEFLAGSMASK 0x00000000
FILEFLAGS 0x00000000
{
BLOCK "StringFileInfo"
{
BLOCK "040904e4"
{
VALUE "FileDescription", "A library for reading and writing audio files."
VALUE "FileVersion", "@CLEAN_VERSION@.0\0"
VALUE "Full Version", "@PACKAGE_VERSION@"
VALUE "InternalName", "libsndfile"
VALUE "LegalCopyright", "Copyright (C) 1999-2010, Licensed LGPL"
VALUE "OriginalFilename", "libsndfile-1.dll"
VALUE "ProductName", "libsndfile-1 DLL"
VALUE "ProductVersion", "@CLEAN_VERSION@.0\0"
VALUE "Language", "Language Neutral"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 0x04E4
}
}