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.
This commit is contained in:
Georg Baum 2016-05-08 10:16:12 +02:00 committed by Richard Heck
parent 797f12c29a
commit 26526b13c5
2 changed files with 7 additions and 3 deletions

View 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

View 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