Bug 1639815 - Move --enable-readline to python configure. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 21 May 2020 22:38:46 +0000
changeset 531554 bd8867b35eeeea17a8607f2519d186f1692f9fed
parent 531553 b719a4f5a39f8d0dd8a0c4bf9870ad641aee7afe
child 531555 650751e6df05ecf9d48c720cc48993a4b0a89014
push id37440
push userabutkovits@mozilla.com
push dateFri, 22 May 2020 09:43:16 +0000
treeherdermozilla-central@fbf71e4d2e21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1639815
milestone78.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 1639815 - Move --enable-readline to python configure. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D76287
build/moz.configure/old.configure
js/moz.configure
js/src/old-configure.in
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -223,17 +223,16 @@ def old_configure_options(*options):
     '--enable-logrefcnt',
     '--enable-mobile-optimize',
     '--enable-necko-wifi',
     '--enable-negotiateauth',
     '--enable-nspr-build',
     '--enable-official-branding',
     '--enable-parental-controls',
     '--enable-pref-extensions',
-    '--enable-readline',
     '--enable-sandbox',
     '--enable-startupcache',
     '--enable-strip',
     '--enable-system-cairo',
     '--enable-system-extension-dirs',
     '--enable-system-pixman',
     '--enable-universalchardet',
     '--enable-updater',
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -678,8 +678,31 @@ js_option('--with-sixgill', nargs=1, hel
 @imports('os')
 def sixgill(value):
     for f in ('bin/xdbfind', 'gcc/xgill.so', 'scripts/wrap_gcc/g++'):
         if not os.path.exists(os.path.join(value[0], f)):
             die('The sixgill plugin and binaries are not at the specified path')
     return value[0]
 
 set_config('SIXGILL_PATH', sixgill)
+
+
+# Support for readline
+# =====================================================
+@depends('--enable-js-shell', target_is_windows, compile_environment)
+def editline(js_shell, is_windows, compile_environment):
+    return js_shell and not is_windows and compile_environment
+
+js_option('--enable-readline', help='Link js shell to system readline library',
+          when=editline)
+
+has_readline = check_symbol('readline', flags=['-lreadline'], when='--enable-readline',
+                            onerror=lambda: die('No system readline library found'))
+
+set_config('EDITLINE_LIBS', ['-lreadline'], when=has_readline)
+
+@depends('--enable-readline', editline, when=editline)
+def bundled_editline(readline, editline):
+    return editline and not readline
+
+set_config('JS_BUNDLED_EDITLINE', bundled_editline)
+
+set_define('EDITLINE', True, when=editline)
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -1380,51 +1380,16 @@ if test "$ac_cv_struct_tm_zone_tm_gmtoff
 fi
 fi # ! SKIP_COMPILER_CHECKS
 
 AC_LANG_C
 
 MOZ_EXPAND_LIBS
 
 dnl ========================================================
-dnl = Link js shell to system readline
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(readline,
-[  --enable-readline       Link js shell to system readline library],
-    JS_WANT_READLINE=1,
-    JS_WANT_READLINE= )
-
-JS_BUNDLED_EDITLINE=
-EDITLINE_LIBS=
-
-case "$target" in
-*-mingw*)
-    NO_EDITLINE=1
-    ;;
-*)
-    ;;
-esac
-
-if test -z "$SKIP_LIBRARY_CHECKS" -a -z "$NO_EDITLINE"; then
-  if test -n "$JS_WANT_READLINE"; then
-    AC_CHECK_LIB(readline, readline,
-                 EDITLINE_LIBS="-lreadline",
-                 AC_MSG_ERROR([No system readline library found.]))
-  else
-    dnl By default, we use editline
-    JS_BUNDLED_EDITLINE=1
-  fi
-
-  dnl Either way, we want to build with line editing support.
-  AC_DEFINE(EDITLINE)
-fi
-AC_SUBST(JS_BUNDLED_EDITLINE)
-AC_SUBST_LIST(EDITLINE_LIBS)
-
-dnl ========================================================
 dnl =
 dnl = Standalone module options
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
 
 dnl ========================================================
 dnl =