From: Avuton Olrich Date: Sun, 19 Feb 2012 00:31:36 +0000 (-0800) Subject: win32: Add a Windows OS resource file and icon X-Git-Tag: release-0.21~27 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cf6fec9daebebb24b4ae21cca93e21b916b88d0c;p=ncmpc.git win32: Add a Windows OS resource file and icon --- diff --git a/Makefile.am b/Makefile.am index 8848266..17cdb9f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -102,7 +102,22 @@ src_ncmpc_SOURCES = \ src/charset.c \ src/wreadln.c \ src/strfsong.c \ - src/utils.c + src/utils.c \ + src/win/ncmpc.rc + +# +# Windows resource file +# + +src/win/ncmpc_win32_rc.$(OBJEXT): src/win/ncmpc_win32_rc.rc + $(WINDRES) -i $< -o $@ + +if HAVE_WINDOWS +noinst_DATA = src/win/ncmpc_win32_rc.rc + +src_ncmpc_DEPENDENCIES = src/win/ncmpc_win32_rc.$(OBJEXT) +src_ncmpc_LDFLAGS = -Wl,src/win/ncmpc_win32_rc.$(OBJEXT) +endif if NCMPC_MINI else @@ -234,4 +249,5 @@ endif EXTRA_DIST = autogen.sh \ $(lyrics_plugins) \ - $(man_MANS) $(doc_DATA) doc/doxygen.conf + $(man_MANS) $(doc_DATA) doc/doxygen.conf \ + src/win/ncmpc_win32_rc.rc.in diff --git a/configure.ac b/configure.ac index 603829c..c50445e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,11 @@ AC_PREREQ(2.60) AC_INIT(ncmpc, 0.21~git, max@duempel.org) + +VERSION_MAJOR=0 +VERSION_MINOR=21 +VERSION_REVISION=0 +VERSION_EXTRA=0 + AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR(build) AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects]) @@ -51,8 +57,13 @@ AC_CANONICAL_HOST case "$host_os" in mingw32* | windows*) LIBS="$LIBS -lws2_32" - ;; + AC_CONFIG_FILES([ + src/win/ncmpc_win32_rc.rc + ]) + AC_CHECK_TOOL(WINDRES, windres) + HAVE_WINDOWS=1 + ;; *) AC_CHECK_FUNC([socket], [], @@ -66,6 +77,7 @@ mingw32* | windows*) [AC_MSG_ERROR(No UNIX gethostbyname API found)]) ]) esac +AM_CONDITIONAL([HAVE_WINDOWS], [test $HAVE_WINDOWS -eq 1]) dnl multi-byte character support @@ -327,6 +339,13 @@ AM_CONDITIONAL(ENABLE_OUTPUTS_SCREEN, test x$enable_outputs_screen = xyes) AC_MSG_RESULT([$enable_outputs_screen]) +dnl +dnl Windows OS Resource File +dnl +AC_SUBST(VERSION_MAJOR) +AC_SUBST(VERSION_MINOR) +AC_SUBST(VERSION_REVISION) +AC_SUBST(VERSION_EXTRA) dnl dnl build options diff --git a/src/win/ncmpc.ico b/src/win/ncmpc.ico new file mode 100644 index 0000000..53fb4e5 Binary files /dev/null and b/src/win/ncmpc.ico differ diff --git a/src/win/ncmpc_win32_rc.rc.in b/src/win/ncmpc_win32_rc.rc.in new file mode 100644 index 0000000..875241f --- /dev/null +++ b/src/win/ncmpc_win32_rc.rc.in @@ -0,0 +1,34 @@ +#include + +#define VERSION_NUMBER @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,@VERSION_EXTRA@ +#define VERSION_NUMBER_STR "@VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,@VERSION_EXTRA@" + +NCMPC_ICON ICON "@top_srcdir@/src/win/ncmpc.ico" + +1 VERSIONINFO +FILETYPE VFT_APP +FILEOS VOS__WINDOWS32 +PRODUCTVERSION VERSION_NUMBER + +FILEVERSION VERSION_NUMBER +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "The Music Player Daemon Project" + VALUE "ProductName", "aN Curses Music Player Client" + VALUE "ProductVersion", VERSION_NUMBER_STR + VALUE "InternalName", "ncmpc" + VALUE "OriginalFilename", "ncmpc.exe" + VALUE "FileVersion", "@VERSION@" + VALUE "FileDescription", "aN Curses Music Player Client @VERSION@" + VALUE "LegalCopyright", "Copyright \251 The Music Player Daemon Project" + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END