diff --git a/configure.ac b/configure.ac index 10b7c6ea5..0b674751c 100644 --- a/configure.ac +++ b/configure.ac @@ -609,6 +609,22 @@ case $host_os in esac AM_CONDITIONAL([WINCONSOLE], [test "x$has_winconsole" = xyes]) +if test "x$has_winconsole" = xyes; then + AC_CHECK_PROGS([WINRES], [windres windres.exe], [no]) + if test "x$WINRES" = xno; then + AC_MSG_WARN([If you want adding the icon you should install windres]) + fi +fi + +if test "x$with_wingui" = xyes; then + AC_CHECK_PROGS([WINRES], [windres windres.exe], [no]) + if test "x$WINRES" = xno; then + AC_MSG_WARN([If you want adding the icon you should install windres]) + fi +fi + +AM_CONDITIONAL([WINRESOURCE], [test "x$WINRES" = xwindres]) + case $with_wingui in yes ) AC_DEFINE([X_DISPLAY_MISSING]) diff --git a/src/Makefile.am b/src/Makefile.am index 2e9a68ef2..22daf277c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,11 +103,7 @@ DYNAMIC_DEVICELIBS = \ ## Build ngspice first: ## compile the icon: -if WINGUI -ngicon.o: ngicon.rc - windres $(srcdir)/ngicon.rc -O coff -o ngicon.o -endif -if WINCONSOLE +if WINRESOURCE ngicon.o: ngicon.rc windres $(srcdir)/ngicon.rc -O coff -o ngicon.o endif @@ -202,11 +198,7 @@ ngspice_LDADD += frontend/help/libhlp.la endif endif -if WINGUI -ngspice_LDADD += ngicon.o -endif - -if WINCONSOLE +if WINRESOURCE ngspice_LDADD += ngicon.o endif