Code

win32: Add a Windows OS resource file and icon
authorAvuton Olrich <avuton@gmail.com>
Sun, 19 Feb 2012 00:31:36 +0000 (16:31 -0800)
committerAvuton Olrich <avuton@gmail.com>
Fri, 24 Feb 2012 07:01:45 +0000 (23:01 -0800)
Makefile.am
configure.ac
src/win/ncmpc.ico [new file with mode: 0644]
src/win/ncmpc_win32_rc.rc.in [new file with mode: 0644]

index 88482667c9446b8780d4e824e36b64abc24e059d..17cdb9f72b3c0f9ee52ad82c4a0ddf5495232489 100644 (file)
@@ -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
index 603829c770a8bda9f9fb552e6cf60c9dc4818f1f..c50445eaa898f18f2e4fc8ee0c287463f4ee4252 100644 (file)
@@ -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 (file)
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 (file)
index 0000000..875241f
--- /dev/null
@@ -0,0 +1,34 @@
+#include <windows.h>
+
+#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