diff --git a/configure.in b/configure.in index 44e58497b5..29caa2d5eb 100644 --- a/configure.in +++ b/configure.in @@ -139,7 +139,18 @@ AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes") if test "x$native_win32" = "xyes" ; then HTMLHELP_LIBS= - AC_CHECK_HEADERS(htmlhelp.h,[HTMLHELP_LIBS=-lhtmlhelp],,[#include ]) + AC_MSG_CHECKING(for HtmlHelpW) + saved_LIBS="${LIBS}" + LIBS="${LIBS} -lhtmlhelp" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include + #include ]], [HtmlHelpW(0, (wchar_t*)"", HH_HELP_CONTEXT, 0);])], [ + AC_MSG_RESULT(yes) + HTMLHELP_LIBS=-lhtmlhelp + AC_DEFINE(HAVE_HTMLHELPW,1,[System has HtmlHelpW]) + ], [ + AC_MSG_RESULT(no) + ]) + LIBS="${saved_LIBS}" AC_SUBST(HTMLHELP_LIBS) fi ################################################## diff --git a/packaging/win32/install.sh b/packaging/win32/install.sh index 7e473494b8..05bb5fcdb3 100644 --- a/packaging/win32/install.sh +++ b/packaging/win32/install.sh @@ -341,7 +341,7 @@ function inst_mingwutils() { else wget_unpacked $MINGW_UTILS_URL $DOWNLOAD_DIR $MINGW_UTILS_DIR fi - (quiet which pexports && quiet which reimp) || die "pexports unavailable" + (quiet which pexports && quiet which reimp) || die "mingw-utils not installed correctly" } function inst_exetype() { @@ -636,13 +636,27 @@ function inst_inno() { quiet which iscc || die "iscc (Inno Setup Compiler) not installed correctly" } +function test_for_hh() { + qpushd $TMP_UDIR + cat > ofile.c < +#include +int main(int argc, char **argv) { + HtmlHelpW(0, (wchar_t*)"", HH_HELP_CONTEXT, 0); + return 0; +} +EOF + gcc -o ofile.exe ofile.c $HH_CPPFLAGS $HH_LDFLAGS -lhtmlhelp || return 1 + qpopd +} + function inst_hh() { setup HTML Help Workshop _HH_UDIR=`unix_path $HH_DIR` add_to_env -I$_HH_UDIR/include HH_CPPFLAGS add_to_env -L$_HH_UDIR/lib HH_LDFLAGS add_to_env $_HH_UDIR PATH - if quiet ${LD} $HH_LDFLAGS -lhtmlhelp -o $TMP_UDIR/ofile + if quiet test_for_hh then echo "html help workshop already installed. skipping." else @@ -657,7 +671,7 @@ function inst_hh() { mv htmlhelp.lib htmlhelp.lib.bak qpopd fi - quiet ${LD} $HH_LDFLAGS -lhtmlhelp -o $TMP_UDIR/ofile || die "html help workshop not installed correctly" + quiet test_for_hh || die "html help workshop not installed correctly" } function inst_opensp() { @@ -983,8 +997,8 @@ function make_chm() { cat mymaps >> htmlhelp.hhp rm mymaps hhc htmlhelp.hhp || true - mv -fv htmlhelp.chm $_DOCS_INST_UDIR/$_CHM_LANG/gnucash-$_CHM_TYPE.chm - mv -fv htmlhelp.hhmap $_DOCS_INST_UDIR/$_CHM_LANG/gnucash-$_CHM_TYPE.hhmap + cp -fv htmlhelp.chm $_DOCS_INST_UDIR/$_CHM_LANG/gnucash-$_CHM_TYPE.chm + cp -fv htmlhelp.hhmap $_DOCS_INST_UDIR/$_CHM_LANG/gnucash-$_CHM_TYPE.hhmap qpopd } diff --git a/src/app-utils/gnc-help-utils.c b/src/app-utils/gnc-help-utils.c index 8ab5901b8a..b820cb2d1c 100644 --- a/src/app-utils/gnc-help-utils.c +++ b/src/app-utils/gnc-help-utils.c @@ -23,14 +23,14 @@ #include "config.h" #include -#ifdef HAVE_HTMLHELP_H +#ifdef HAVE_HTMLHELPW # include # include #endif #include "gnc-help-utils.h" -#ifdef HAVE_HTMLHELP_H +#ifdef HAVE_HTMLHELPW static GHashTable * parse_hhmap_file(const gchar *chmfile) @@ -129,7 +129,7 @@ gnc_show_htmlhelp(const gchar *chmfile, const gchar *anchor) g_free(wpath); } -#else /* !HAVE_HTMLHELP_H */ +#else /* !HAVE_HTMLHELPW */ void gnc_show_htmlhelp(const gchar *chmfile, const gchar *anchor) { @@ -148,4 +148,4 @@ gnc_show_htmlhelp(const gchar *chmfile, const gchar *anchor) g_free(argv[1]); } -#endif /* HAVE_HTMLHELP_H */ +#endif /* HAVE_HTMLHELPW */