Skip to content

Commit

Permalink
Bug 1460600: Remove unsupported --enable-system-hunspell flag. r=glan…
Browse files Browse the repository at this point in the history
…dium

Our bundled Hunspell now significantly differs from upstream Hunspell. Most
importantly, it supports loading dictionaries from jar: URIs, which is now a
requirement for loading bundled and extension dictionaries. This means that
system Hunspell libraries are no longer compatible with our spell checker
code. We should remove the option to use them so that users don't fall into
the trap of trying to use them.

MozReview-Commit-ID: 2ihJe6YOnGf

--HG--
extra : rebase_source : ceb091b9475a2b101156405a02a60015fc36da17
  • Loading branch information
kmaglione committed May 10, 2018
1 parent d7faefd commit f8506d4
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 52 deletions.
5 changes: 0 additions & 5 deletions config/system-headers.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -1270,11 +1270,6 @@ if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
'libsn/sn-util.h',
]

if CONFIG['MOZ_SYSTEM_HUNSPELL']:
system_headers += [
'hunspell.hxx',
]

if CONFIG['MOZ_SYSTEM_LIBEVENT']:
system_headers += [
'event2/event_compat.h',
Expand Down
10 changes: 3 additions & 7 deletions extensions/spellcheck/hunspell/glue/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ UNIFIED_SOURCES += [

FINAL_LIBRARY = 'xul'

if CONFIG['MOZ_SYSTEM_HUNSPELL']:
CXXFLAGS += CONFIG['MOZ_HUNSPELL_CFLAGS']
else:
LOCAL_INCLUDES += ['../src']

LOCAL_INCLUDES += [
'../src',
'/dom/base',
'/extensions/spellcheck/src',
]
Expand All @@ -34,6 +30,6 @@ EXPORTS.mozilla += [
'RemoteSpellCheckEngineParent.h',
]

# This variable is referenced in configure.in. Make sure to change that file
# too if you need to change this variable.
# This variable is referenced in mozilla-config.h.in. Make sure to change
# that file too if you need to change this variable.
DEFINES['HUNSPELL_STATIC'] = True
4 changes: 1 addition & 3 deletions extensions/spellcheck/hunspell/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

DIRS += ['glue']
if not CONFIG['MOZ_SYSTEM_HUNSPELL']:
DIRS += ['src']
DIRS += ['glue', 'src']

if CONFIG['ENABLE_TESTS']:
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
14 changes: 1 addition & 13 deletions extensions/spellcheck/hunspell/src/hunvisapi.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#ifndef HUNSPELL_VISIBILITY_H_
#define HUNSPELL_VISIBILITY_H_

#if defined(HUNSPELL_STATIC)
# define LIBHUNSPELL_DLL_EXPORTED
#elif defined(_MSC_VER)
# if defined(BUILDING_LIBHUNSPELL)
# define LIBHUNSPELL_DLL_EXPORTED __declspec(dllexport)
# else
# define LIBHUNSPELL_DLL_EXPORTED __declspec(dllimport)
# endif
#elif defined(BUILDING_LIBHUNSPELL) && 1
# define LIBHUNSPELL_DLL_EXPORTED __attribute__((__visibility__("default")))
#else
# define LIBHUNSPELL_DLL_EXPORTED
#endif
#define LIBHUNSPELL_DLL_EXPORTED

#endif
4 changes: 2 additions & 2 deletions extensions/spellcheck/hunspell/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ UNIFIED_SOURCES += [
'suggestmgr.cxx',
]

# This variable is referenced in configure.in. Make sure to change that file
# too if you need to change this variable.
# This variable is referenced in mozilla-config.h.in. Make sure to change
# that file too if you need to change this variable.
DEFINES['HUNSPELL_STATIC'] = True

FINAL_LIBRARY = 'xul'
Expand Down
6 changes: 1 addition & 5 deletions extensions/spellcheck/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ UNIFIED_SOURCES += [

FINAL_LIBRARY = 'xul'

if CONFIG['MOZ_SYSTEM_HUNSPELL']:
CXXFLAGS += CONFIG['MOZ_HUNSPELL_CFLAGS']
else:
LOCAL_INCLUDES += ['../hunspell/src']

LOCAL_INCLUDES += [
'../hunspell/glue',
'../hunspell/src',
'/dom/base',
]
EXPORTS.mozilla += [
Expand Down
12 changes: 0 additions & 12 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -481,18 +481,6 @@ check_prog('HFS_TOOL', extra_programs.HFS_TOOL,
check_prog('RPMBUILD', extra_programs.RPMBUILD,
allow_missing=True)

option('--enable-system-hunspell',
help="Use system hunspell (located with pkgconfig)")

@depends('--enable-system-hunspell', compile_environment)
def check_for_hunspell(value, compile_env):
return value and compile_env

system_hunspell = pkg_check_modules('MOZ_HUNSPELL', 'hunspell',
when=check_for_hunspell)

set_config('MOZ_SYSTEM_HUNSPELL', depends_if(system_hunspell)(lambda _: True))


@depends(target)
@imports('os')
Expand Down
3 changes: 1 addition & 2 deletions mozilla-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
* Force-include hunspell_alloc_hooks.h and hunspell_fopen_hooks.h for hunspell,
* so that we don't need to modify them directly.
*
* HUNSPELL_STATIC is defined in extensions/spellcheck/hunspell/src/Makefile.in,
* unless --enable-system-hunspell is defined.
* HUNSPELL_STATIC is defined in extensions/spellcheck/hunspell/src/moz.build
*/
#if defined(HUNSPELL_STATIC)
#include "hunspell_alloc_hooks.h"
Expand Down
3 changes: 0 additions & 3 deletions toolkit/library/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ if CONFIG['MOZ_SYSTEM_JPEG']:
if CONFIG['MOZ_SYSTEM_PNG']:
OS_LIBS += CONFIG['MOZ_PNG_LIBS']

if CONFIG['MOZ_SYSTEM_HUNSPELL']:
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']

if CONFIG['MOZ_SYSTEM_LIBEVENT']:
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']

Expand Down

0 comments on commit f8506d4

Please sign in to comment.