commit 26526b13c59bd64f2c06effb48b35c7c72b9bf09
Author: Georg Baum <b...@lyx.org>
Date:   Sun May 8 10:16:12 2016 +0200

    Properly check for windres
    
    Use the standard way to check for the resource compiler, as e.g.
    libtool does it: AC_CHECK_TOOL does already provide some cross compiling
    magic, and we do also get an error now at configure time if windres is not
    found.

diff --git a/configure.ac b/configure.ac
index 7b8b742..0b7a64b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,8 +117,6 @@ AC_CHECK_LIB(psapi, main, [LIBPSAPI=-lpsapi])
 AC_SUBST(LIBPSAPI)
 AC_CHECK_LIB(gdi32, main)
 AC_CHECK_LIB(ole32, main)
-test x"$WINDRES" = x && WINDRES=windres
-AC_ARG_VAR(WINDRES, [windows resource compiler command])
 
 LYX_USE_INCLUDED_BOOST
 LYX_USE_INCLUDED_MYTHES
@@ -237,6 +235,12 @@ lyx_win_res=false;
 case ${host} in
     *mingw*|*cygwin*) lyx_win_res=true;;
 esac
+if test "x$lyx_win_res" = "xtrue"; then
+    AC_CHECK_TOOL(RC, windres,)
+    if test -z "$RC"; then
+      AC_ERROR([Could not find a resource compiler])
+    fi
+fi
 AM_CONDITIONAL(LYX_WIN_RESOURCE, $lyx_win_res)
 LYX_SET_VERSION_INFO
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 57f66d9..90fb3e6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,7 +42,7 @@ lyx_LDADD = \
 if LYX_WIN_RESOURCE
 .rc.o:
        cp $(top_srcdir)/development/Win32/packaging/icons/lyx_*32x32.ico .
-       $(WINDRES) -I$(top_builddir) --preprocessor "$(CPP) -xc-header 
-DRC_INVOKED" $< -o $@
+       $(RC) -I$(top_builddir) --preprocessor "$(CPP) -xc-header -DRC_INVOKED" 
$< -o $@
 endif
 
 if INSTALL_MACOSX

Reply via email to