]> git.lyx.org Git - lyx.git/commitdiff
Properly check for windres
authorGeorg Baum <baum@lyx.org>
Sun, 8 May 2016 08:16:12 +0000 (10:16 +0200)
committerRichard Heck <rgheck@lyx.org>
Sun, 29 May 2016 21:55:43 +0000 (17:55 -0400)
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.

configure.ac
src/Makefile.am

index 7b8b742a63947cb8e7483dff4abe25d553f204aa..0b7a64bad40376ebdf7bd30eb1accb3969a73b6c 100644 (file)
@@ -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
 
index 57f66d90701187c78bf74056d280cc2b3f13af0b..90fb3e65af31833dc54a016b2ca1e0e0acda8c61 100644 (file)
@@ -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