Skip to content

Commit

Permalink
Add patch from MINGW (fix #405)
Browse files Browse the repository at this point in the history
  • Loading branch information
rrthomas committed Jan 6, 2025
1 parent d5346b1 commit 07d7694
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ else
fi
AC_SUBST([ISYSTEM])

AC_MSG_CHECKING([for native Win32])
native_win32=no
case "$host" in
*-*-mingw*)
native_win32=yes
;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)

AM_CONDITIONAL([SHLIBS_IN_BINDIR], [case "$host_os" in mingw* | cygwin*) true;; *) false;; esac])

dnl ===========================================================================
Expand Down
3 changes: 3 additions & 0 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# along with this program; if not, see <https://www.gnu.org/licenses/>.

AM_VALAFLAGS = --debug --no-color --vapidir=$(srcdir) --pkg configmake --pkg internal --pkg posix --pkg gnu --pkg gio-2.0 --pkg gmodule-2.0
if OS_WIN32
AM_VALAFLAGS += -D OS_WIN32
endif
AM_CPPFLAGS = --include config.h -I$(top_srcdir) $(ISYSTEM)$(top_builddir)/libgnu $(ISYSTEM)$(top_srcdir)/libgnu $(GLIB_CFLAGS) $(WARN_CFLAGS) -DG_LOG_DOMAIN='"libenchant"'

# FIXME: Require Vala 0.58 when released, and remove copy of gnu.vapi
Expand Down
7 changes: 7 additions & 0 deletions lib/broker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public class EnchantBroker {
if (!Module.supported())
return;

#if OS_WIN32
// gnulib's relocation does not work properly on Win32 without setting
// the prefix explicitly.
string module_dir = GLib.Win32.get_package_installation_directory_of_module(null);
enchant_set_prefix_dir(module_dir);
#endif

this.load_providers();
this.load_provider_ordering();
this.dicts = new GenericSet<EnchantDict>(direct_hash, direct_equal);
Expand Down

0 comments on commit 07d7694

Please sign in to comment.