OSDN Git Service

Assign icon to temporary GUI executable file.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Mon, 16 Apr 2012 19:13:48 +0000 (19:13 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Mon, 16 Apr 2012 19:13:48 +0000 (19:13 +0000)
ChangeLog
Makefile.in
configure.ac
icons/pkgicon.ico [new file with mode: 0644]

index 9bcb471..11f42d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-04-16  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Assign icon to temporary GUI executable file.
+
+       * icons/pkgicon.ico: New file, shamelessly copied from synaptic.
+
+       * configure.ac: Add identification for windres; propagate it to...
+       * Makefile.in: ...here; use it to compile object from icon files...
+       (srcdir/icons) [%.ico]: ...from this new vpath location.
+       (gui.exe): Link to compiled icon's object file.
+       (SRCDIST_SUBDIRS): Add icons directory.
+
 2012-04-15  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Ensure that package removal requests are correctly scheduled.
index 17dffc6..7458161 100644 (file)
@@ -32,6 +32,7 @@ abs_top_srcdir = @abs_top_srcdir@
 
 DEBUGLEVEL = @DEBUGLEVEL@
 
+vpath %.ico @srcdir@/icons
 VPATH = @top_srcdir@/src:@top_srcdir@/src/pkginfo:@top_srcdir@/tinyxml
 
 CC = @CC@
@@ -48,6 +49,8 @@ LEX = @LEX@
 AR = @AR@
 ARFLAGS = @ARFLAGS@
 
+WINDRES = @WINDRES@
+
 OBJEXT = @OBJEXT@
 EXEEXT = @EXEEXT@
 
@@ -81,7 +84,17 @@ mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT) getopt.$(OBJEXT)
 
 GUI_LDFLAGS = -mwindows $(LDFLAGS)
 
-gui$(EXEEXT): guimain.$(OBJEXT)
+# FIXME: the following is a Q&D kludge, to assign my choice of icon
+# to the GUI mode executable stub.  Eventually, this will need to be
+# assigned within a resource definition file, but for the time being,
+# besides providing a notification that the GUI is not yet available,
+# the stub serves only to illustrate mingw-get's shortcut creation
+# capability; thus, this simple hack will suffice.
+#
+%.$(OBJEXT): %.ico
+       echo $* ICON $*.ico | $(WINDRES) -I ${srcdir}/icons -o $@
+#
+gui$(EXEEXT): guimain.$(OBJEXT) pkgicon.$(OBJEXT)
        $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+
 
 lastrites$(EXEEXT): rites.$(OBJEXT)
@@ -159,7 +172,7 @@ LICENCE_FILES = README COPYING
 SRCDIST_FILES = $(LICENCE_FILES) ChangeLog NEWS INSTALL \
   aclocal.m4 configure.ac configure Makefile.in version.c.in
 
-SRCDIST_SUBDIRS = build-aux m4 src src/pkginfo srcdist-doc \
+SRCDIST_SUBDIRS = build-aux icons m4 src src/pkginfo srcdist-doc \
   scripts/libexec tinyxml xml
 
 # The names of distributed pacakge archive files incorporate version
index 19c2243..7d80764 100644 (file)
   AC_PROG_CC
   AC_PROG_CXX
 
-# We also need a lexical analyser generator
+# We also need a Windows resource compiler,
+# and a lexical analyser generator
 #
+  AC_CHECK_TOOL([WINDRES],[windres],[windres])
   AC_PROG_LEX
 
 # Ensure that (at least the headers for) prerequisite libraries,
diff --git a/icons/pkgicon.ico b/icons/pkgicon.ico
new file mode 100644 (file)
index 0000000..4310b0e
Binary files /dev/null and b/icons/pkgicon.ico differ