Bug 1460600: Remove unsupported --enable-system-hunspell flag. r=glandium
authorKris Maglione <maglione.k@gmail.com>
Thu, 10 May 2018 10:36:53 -0700
changeset 419423 1becc594554c1a273535ed175895e801667735e9
parent 419422 eceb175f714a6b6821c9b5ea874b2982defaa883
child 419424 4e701e816acbd5b1167fc2715d393b400edd8849
push id34037
push userdluca@mozilla.com
push dateWed, 23 May 2018 09:51:55 +0000
treeherdermozilla-central@d36cd8bdbc5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1460600
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1460600: Remove unsupported --enable-system-hunspell flag. r=glandium 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
config/system-headers.mozbuild
extensions/spellcheck/hunspell/glue/moz.build
extensions/spellcheck/hunspell/moz.build
extensions/spellcheck/hunspell/src/hunvisapi.h
extensions/spellcheck/hunspell/src/moz.build
extensions/spellcheck/src/moz.build
moz.configure
mozilla-config.h.in
toolkit/library/moz.build
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1265,21 +1265,16 @@ if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATI
         'libsn/sn-common.h',
         'libsn/sn.h',
         'libsn/sn-launchee.h',
         'libsn/sn-launcher.h',
         'libsn/sn-monitor.h',
         'libsn/sn-util.h',
     ]
 
-if CONFIG['MOZ_SYSTEM_HUNSPELL']:
-    system_headers += [
-        'hunspell.hxx',
-    ]
-
 if CONFIG['MOZ_SYSTEM_LIBEVENT']:
     system_headers += [
         'event2/event_compat.h',
         'event2/event.h',
         'event2/event_struct.h',
         'event.h',
     ]
 else:
--- a/extensions/spellcheck/hunspell/glue/moz.build
+++ b/extensions/spellcheck/hunspell/glue/moz.build
@@ -8,32 +8,28 @@ UNIFIED_SOURCES += [
     'mozHunspell.cpp',
     'mozHunspellFileMgr.cpp',
     'RemoteSpellCheckEngineChild.cpp',
     'RemoteSpellCheckEngineParent.cpp',
 ]
 
 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',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 IPDL_SOURCES = [
     'PRemoteSpellcheckEngine.ipdl',
 ]
 
 EXPORTS.mozilla += [
      'RemoteSpellCheckEngineChild.h',
      '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
--- a/extensions/spellcheck/hunspell/moz.build
+++ b/extensions/spellcheck/hunspell/moz.build
@@ -1,12 +1,10 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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']    
--- a/extensions/spellcheck/hunspell/src/hunvisapi.h
+++ b/extensions/spellcheck/hunspell/src/hunvisapi.h
@@ -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
--- a/extensions/spellcheck/hunspell/src/moz.build
+++ b/extensions/spellcheck/hunspell/src/moz.build
@@ -10,18 +10,18 @@ UNIFIED_SOURCES += [
     'csutil.cxx',
     'hashmgr.cxx',
     'hunspell.cxx',
     'phonet.cxx',
     'replist.cxx',
     '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'
 
 LOCAL_INCLUDES += [
     '../glue',
 ]
 
--- a/extensions/spellcheck/src/moz.build
+++ b/extensions/spellcheck/src/moz.build
@@ -12,23 +12,19 @@ UNIFIED_SOURCES += [
     'mozPersonalDictionary.cpp',
     'mozSpellChecker.cpp',
     'mozSpellCheckerFactory.cpp',
     'mozSpellI18NManager.cpp',
 ]
 
 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 += [
      'mozInlineSpellChecker.h',
      'mozSpellChecker.h',
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
--- a/moz.configure
+++ b/moz.configure
@@ -476,28 +476,16 @@ check_prog('DSYMUTIL', extra_programs.DS
            allow_missing=True)
 check_prog('MKFSHFS', extra_programs.MKFSHFS,
            allow_missing=True)
 check_prog('HFS_TOOL', extra_programs.HFS_TOOL,
            allow_missing=True)
 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')
 def makensis_progs(target):
     if target.kernel != 'WINNT':
         return
 
     candidates = [
--- a/mozilla-config.h.in
+++ b/mozilla-config.h.in
@@ -36,18 +36,17 @@
 #if defined(__clang__)
 #pragma clang diagnostic pop
 #endif
 
 /*
  * 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"
 #include "hunspell_fopen_hooks.h"
 #endif
 
 /*
  * Force-include sdkdecls.h for building the chromium sandbox code.
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -233,19 +233,16 @@ if CONFIG['SERVO_TARGET_DIR']:
         OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo']
 
 if CONFIG['MOZ_SYSTEM_JPEG']:
     OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
 
 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']
 
 if CONFIG['MOZ_SYSTEM_LIBVPX']:
     OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
 
 if not CONFIG['MOZ_TREE_PIXMAN']:
     OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']