diff options
author | Louie S <louie@example.com> | 2023-03-04 13:43:45 -0800 |
---|---|---|
committer | Louie S <louie@example.com> | 2023-03-04 13:43:45 -0800 |
commit | 00403d8413157e08eeaba7a1932f17c3c7b0758e (patch) | |
tree | 6f2b20ff98092bd7cbac529d64bbd31b2519b909 | |
parent | 712af9ea3cb3d0de866221ade19341fd114f7000 (diff) |
Configure flag for disabling icon embed for windows executable
-rwxr-xr-x | configure | 25 | ||||
-rw-r--r-- | configure.ac | 17 | ||||
-rw-r--r-- | data/Makefile.am | 3 | ||||
-rw-r--r-- | data/Makefile.in | 2 | ||||
-rw-r--r-- | docs/windows_compile_instructions.md | 4 | ||||
-rw-r--r-- | src/Makefile.am | 25 | ||||
-rw-r--r-- | src/Makefile.in | 47 | ||||
-rw-r--r-- | src/icon/terminal-media-launcher.ico (renamed from data/terminal-media-launcher.ico) | bin | 311073 -> 311073 bytes | |||
-rw-r--r-- | src/icon/terminal-media-launcher.rc | 1 |
9 files changed, 96 insertions, 28 deletions
@@ -623,6 +623,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +EMBED_ICON_FALSE +EMBED_ICON_TRUE DESKTOP_ENTRY_FALSE DESKTOP_ENTRY_TRUE WINDOWS_FALSE @@ -736,6 +738,7 @@ enable_dependency_tracking with_ncurses with_ncursesw enable_desktop_entry +enable_embed_icon ' ac_precious_vars='build_alias host_alias @@ -1388,6 +1391,7 @@ Optional Features: --disable-dependency-tracking speeds up one-time build --enable-desktop-entry install a desktop entry (default is no) + --disable-embed-icon embed icon in windows executable (default is yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -5734,7 +5738,6 @@ else desktop_entry=no fi - if test "$desktop_entry" = "yes"; then DESKTOP_ENTRY_TRUE= DESKTOP_ENTRY_FALSE='#' @@ -5744,6 +5747,21 @@ else fi +embed_icon=yes +# Check whether --enable-embed_icon was given. +if test "${enable_embed_icon+set}" = set; then : + enableval=$enable_embed_icon; embed_icon=no +fi + + if test "$embed_icon" = "yes"; then + EMBED_ICON_TRUE= + EMBED_ICON_FALSE='#' +else + EMBED_ICON_TRUE='#' + EMBED_ICON_FALSE= +fi + + ac_config_files="$ac_config_files Makefile src/Makefile docs/Makefile data/Makefile spec/terminal-media-launcher.spec" cat >confcache <<\_ACEOF @@ -5927,6 +5945,10 @@ if test -z "${DESKTOP_ENTRY_TRUE}" && test -z "${DESKTOP_ENTRY_FALSE}"; then as_fn_error $? "conditional \"DESKTOP_ENTRY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${EMBED_ICON_TRUE}" && test -z "${EMBED_ICON_FALSE}"; then + as_fn_error $? "conditional \"EMBED_ICON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -7078,4 +7100,5 @@ cat << EOF Compiler: ${CC} ${CFLAGS} ${CPPFLAGS} Libraries: ${LIBS} Desktop Entry: ${desktop_entry} + Embed Icon: ${embed_icon} EOF diff --git a/configure.ac b/configure.ac index 5ffbe5f..5ddeef4 100644 --- a/configure.ac +++ b/configure.ac @@ -47,13 +47,19 @@ AM_CONDITIONAL([WINDOWS], [test "$build_windows" = "yes"]) # enable/disable options AC_ARG_ENABLE([desktop-entry], - [AS_HELP_STRING([--enable-desktop-entry], - [install a desktop entry (default is no)])], - [desktop_entry=$enableval], - [desktop_entry=no]) - + [AS_HELP_STRING([--enable-desktop-entry], + [install a desktop entry (default is no)])], + [desktop_entry=$enableval], + [desktop_entry=no]) AM_CONDITIONAL([DESKTOP_ENTRY], [test "$desktop_entry" = "yes"]) +embed_icon=yes +AC_ARG_ENABLE([embed_icon], + [AS_HELP_STRING([--disable-embed-icon], + [embed icon in windows executable (default is yes)])], + [embed_icon=no]) +AM_CONDITIONAL([EMBED_ICON], [test "$embed_icon" = "yes"]) + AC_CONFIG_FILES([Makefile src/Makefile docs/Makefile @@ -70,4 +76,5 @@ cat << EOF Compiler: ${CC} ${CFLAGS} ${CPPFLAGS} Libraries: ${LIBS} Desktop Entry: ${desktop_entry} + Embed Icon: ${embed_icon} EOF diff --git a/data/Makefile.am b/data/Makefile.am index b051ebb..5a39270 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST = terminal-media-launcher.ico terminal-media-launcher.svg +EXTRA_DIST = $(PACKAGE_NAME).svg # Build a .desktop entry if DESKTOP_ENTRY @@ -27,3 +27,4 @@ desktop_DATA = $(PACKAGE_NAME).desktop icon_DATA = $(PACKAGE_NAME).svg endif + diff --git a/data/Makefile.in b/data/Makefile.in index 81264d9..1720180 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -249,7 +249,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -EXTRA_DIST = terminal-media-launcher.ico terminal-media-launcher.svg +EXTRA_DIST = $(PACKAGE_NAME).svg # Build a .desktop entry @DESKTOP_ENTRY_TRUE@CLEANFILES = $(PACKAGE_NAME).desktop diff --git a/docs/windows_compile_instructions.md b/docs/windows_compile_instructions.md index 8bdb3ef..b24f058 100644 --- a/docs/windows_compile_instructions.md +++ b/docs/windows_compile_instructions.md @@ -14,10 +14,10 @@ Compiling on Windows requires access to the MinGW toolchain. The easiest way to $ pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-ncurses make ``` -5. (optional) An icon can be embedded into the executable built at `src/terminal-media-launcher.exe` using the [rcedit](https://github.com/electron/rcedit) tool: +5. (optional) Embedding an icon will require the `windres` tool. This is enabled by default, but can be disabled as part of the configuration: ``` -$ rcedit.exe "src/terminal-media-launcher.exe" --set-icon "data/terminal-media-launcher.ico" +$ ./configure --disable-embed-icon ``` Open File Explorer in the current directory (can be done by running `explorer .` in MSYS2 terminal) and double click the generated executable in `src/` to run the program. If your MSYS2 `/bin` is set in your system PATH (see below), then you can also follow the Unix installation instructions to install `terminal-media-launcher` on your Windows system. diff --git a/src/Makefile.am b/src/Makefile.am index 09eb6bd..9e670c6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,13 +1,26 @@ AUTOMAKE_OPTIONS = subdir-objects -EXTRA_DIST = include unix windows +EXTRA_DIST = include unix windows + +bin_PROGRAMS = terminal-media-launcher +terminal_media_launcher_SOURCES = cache.c draw.c read_cfg.c group.c entry.c $(PLATFORM)/cache.c $(PLATFORM)/draw.c $(PLATFORM)/read_cfg.c +terminal_media_launcher_LDADD = @CURSES_LIBS@ +terminal_media_launcher_CPPFLAGS = @CURSES_CFLAGS@ if WINDOWS PLATFORM=windows + +# Embed icon +if EMBED_ICON + +terminal_media_launcher_SOURCES += icon/$(PACKAGE_NAME).rc icon/$(PACKAGE_NAME).ico +terminal_media_launcher_LDADD += icon/$(PACKAGE_NAME).res +BUILT_SOURCES = icon/$(PACKAGE_NAME).res +CLEANFILES = icon/$(PACKAGE_NAME).res + +icon/$(PACKAGE_NAME).res: icon/$(PACKAGE_NAME).ico icon/$(PACKAGE_NAME).rc + windres icon/$(PACKAGE_NAME).rc -O coff -o $@ + +endif else PLATFORM=unix endif - -bin_PROGRAMS = terminal-media-launcher -terminal_media_launcher_SOURCES = cache.c draw.c read_cfg.c group.c entry.c $(PLATFORM)/cache.c $(PLATFORM)/draw.c $(PLATFORM)/read_cfg.c -terminal_media_launcher_LDADD = @CURSES_LIBS@ -terminal_media_launcher_CPPFLAGS = @CURSES_CFLAGS@ diff --git a/src/Makefile.in b/src/Makefile.in index 9a48bc5..93e4ac6 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -89,6 +89,10 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = terminal-media-launcher$(EXEEXT) + +# Embed icon +@EMBED_ICON_TRUE@@WINDOWS_TRUE@am__append_1 = icon/$(PACKAGE_NAME).rc icon/$(PACKAGE_NAME).ico +@EMBED_ICON_TRUE@@WINDOWS_TRUE@am__append_2 = icon/$(PACKAGE_NAME).res subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -100,7 +104,12 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) +am__terminal_media_launcher_SOURCES_DIST = cache.c draw.c read_cfg.c \ + group.c entry.c $(PLATFORM)/cache.c $(PLATFORM)/draw.c \ + $(PLATFORM)/read_cfg.c icon/$(PACKAGE_NAME).rc \ + icon/$(PACKAGE_NAME).ico am__dirstamp = $(am__leading_dot)dirstamp +am__objects_1 = am_terminal_media_launcher_OBJECTS = \ terminal_media_launcher-cache.$(OBJEXT) \ terminal_media_launcher-draw.$(OBJEXT) \ @@ -109,10 +118,11 @@ am_terminal_media_launcher_OBJECTS = \ terminal_media_launcher-entry.$(OBJEXT) \ $(PLATFORM)/terminal_media_launcher-cache.$(OBJEXT) \ $(PLATFORM)/terminal_media_launcher-draw.$(OBJEXT) \ - $(PLATFORM)/terminal_media_launcher-read_cfg.$(OBJEXT) + $(PLATFORM)/terminal_media_launcher-read_cfg.$(OBJEXT) \ + $(am__objects_1) terminal_media_launcher_OBJECTS = \ $(am_terminal_media_launcher_OBJECTS) -terminal_media_launcher_DEPENDENCIES = +terminal_media_launcher_DEPENDENCIES = $(am__append_2) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -155,7 +165,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(terminal_media_launcher_SOURCES) -DIST_SOURCES = $(terminal_media_launcher_SOURCES) +DIST_SOURCES = $(am__terminal_media_launcher_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -284,13 +294,18 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects -EXTRA_DIST = include unix windows +EXTRA_DIST = include unix windows +terminal_media_launcher_SOURCES = cache.c draw.c read_cfg.c group.c \ + entry.c $(PLATFORM)/cache.c $(PLATFORM)/draw.c \ + $(PLATFORM)/read_cfg.c $(am__append_1) +terminal_media_launcher_LDADD = @CURSES_LIBS@ $(am__append_2) +terminal_media_launcher_CPPFLAGS = @CURSES_CFLAGS@ @WINDOWS_FALSE@PLATFORM = unix @WINDOWS_TRUE@PLATFORM = windows -terminal_media_launcher_SOURCES = cache.c draw.c read_cfg.c group.c entry.c $(PLATFORM)/cache.c $(PLATFORM)/draw.c $(PLATFORM)/read_cfg.c -terminal_media_launcher_LDADD = @CURSES_LIBS@ -terminal_media_launcher_CPPFLAGS = @CURSES_CFLAGS@ -all: all-am +@EMBED_ICON_TRUE@@WINDOWS_TRUE@BUILT_SOURCES = icon/$(PACKAGE_NAME).res +@EMBED_ICON_TRUE@@WINDOWS_TRUE@CLEANFILES = icon/$(PACKAGE_NAME).res +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj @@ -621,14 +636,17 @@ distdir-am: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am -install-exec: install-exec-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -649,6 +667,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -659,6 +678,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am @@ -742,7 +762,7 @@ ps-am: uninstall-am: uninstall-binPROGRAMS -.MAKE: install-am install-strip +.MAKE: all check install install-am install-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ @@ -761,6 +781,9 @@ uninstall-am: uninstall-binPROGRAMS .PRECIOUS: Makefile +@EMBED_ICON_TRUE@@WINDOWS_TRUE@icon/$(PACKAGE_NAME).res: icon/$(PACKAGE_NAME).ico icon/$(PACKAGE_NAME).rc +@EMBED_ICON_TRUE@@WINDOWS_TRUE@ windres icon/$(PACKAGE_NAME).rc -O coff -o $@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/data/terminal-media-launcher.ico b/src/icon/terminal-media-launcher.ico Binary files differindex e136781..e136781 100644 --- a/data/terminal-media-launcher.ico +++ b/src/icon/terminal-media-launcher.ico diff --git a/src/icon/terminal-media-launcher.rc b/src/icon/terminal-media-launcher.rc new file mode 100644 index 0000000..4ffd9db --- /dev/null +++ b/src/icon/terminal-media-launcher.rc @@ -0,0 +1 @@ +id ICON "./terminal-media-launcher.ico" |