[gjs: 1/2] maint: create a '--disable-readline' and use it



commit a806dbd9837ab7fe62b66d0b74ccad6e57df38ed
Author: Claudio André <claudioandre br gmail com>
Date:   Tue Jul 17 14:28:30 2018 -0300

    maint: create a '--disable-readline' and use it
    
    GJS has alternate code in case the library is not present.

 .gitlab-ci.yml | 19 +++++++++++++++----
 configure.ac   | 47 +++++++++++++++++++++++++++++------------------
 2 files changed, 44 insertions(+), 22 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ca30df3b..d1b44863 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -123,7 +123,7 @@ stages:
 fedora:
   <<: *build
   stage: source_check
-  image: claudioandre/spidermonkey:job-485.9_SM52-debug-gcc.fedora-dev  # pinned on purpose
+  image: claudioandre/spidermonkey:job-512.9_SM52-debug-gcc.fedora-dev  # pinned on purpose
   variables:
     TASK_ID: "fedora-x86_64-gcc-debug-default-check"
     TEST: "check"
@@ -152,7 +152,7 @@ with_logging:
   variables:
     TASK_ID: "fedora-x86_64-clang-default-logging-check"
     CC: clang
-    BUILD_OPTS: CPPFLAGS='-DGJS_VERBOSE_ENABLE_PROPS=1 -DGJS_VERBOSE_ENABLE_MARSHAL=1 
-DGJS_VERBOSE_ENABLE_LIFECYCLE=1 -DGJS_VERBOSE_ENABLE_GI_USAGE=1 -DGJS_VERBOSE_ENABLE_CLOSURE=1 
-DGJS_VERBOSE_ENABLE_GSIGNAL=1'
+    BUILD_OPTS: "--disable-readline CPPFLAGS='-DGJS_VERBOSE_ENABLE_PROPS=1 -DGJS_VERBOSE_ENABLE_MARSHAL=1 
-DGJS_VERBOSE_ENABLE_LIFECYCLE=1 -DGJS_VERBOSE_ENABLE_GI_USAGE=1 -DGJS_VERBOSE_ENABLE_CLOSURE=1 
-DGJS_VERBOSE_ENABLE_GSIGNAL=1'"
     TEST: "check"
   except:
     - schedules
@@ -179,6 +179,17 @@ no_profiler:
   except:
     - schedules
 
+no_readline:
+  <<: *build
+  stage: test
+  image: claudioandre/spidermonkey:SM52-gcc.fedora-dev
+  variables:
+    TASK_ID: "fedora-x86_64-gcc-default-disable_readline-check"
+    TEST: "check"
+    BUILD_OPTS: "--disable-readline"
+  except:
+    - schedules
+
 # Generates
 # The Code Coverage Report
 coverage-automatic:
@@ -289,7 +300,7 @@ sanitizer_clang:
   variables:
     TASK_ID: "fedora-x86_64-clang_ubsan_asan-default-default-check"
     CC: clang
-    BUILD_OPTS: "--enable-asan --enable-ubsan"
+    BUILD_OPTS: "--enable-asan --enable-ubsan --disable-readline"
     TEST: "check"
   only:
     variables:
@@ -508,7 +519,7 @@ sanitizer_clang:
   variables:
     TASK_ID: "fedora-x86_64-clang_ubsan_asan-default-default-check"
     CC: clang
-    BUILD_OPTS: "--enable-asan --enable-ubsan"
+    BUILD_OPTS: "--enable-asan --enable-ubsan --disable-readline"
     TEST: "check"
   when: manual
   except:
diff --git a/configure.ac b/configure.ac
index efe51dc2..1ea98917 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,30 +160,41 @@ Configure with --disable-profiler to skip it on other platforms.])])
 ])
 AM_CONDITIONAL([ENABLE_PROFILER], [test x$enable_profiler != xno])
 
+# Optional redline dep (enabled by default)
+AC_ARG_ENABLE([readline],
+  [AS_HELP_STRING([--disable-readline], [Don't build readline-related code @<:@default=no@:>@])])
+
 PKG_CHECK_VAR([GI_DATADIR], [gobject-introspection-1.0], [gidatadir])
 
 # readline
 LIBS_no_readline=$LIBS
 
-# On some systems we need to link readline to a termcap compatible
-# library.
-gjs_cv_lib_readline=no
-AC_MSG_CHECKING([how to link readline libs])
-for gjs_libtermcap in "" ncursesw ncurses curses termcap; do
-  if test -z "$gjs_libtermcap"; then
-    READLINE_LIBS="-lreadline"
-  else
-    READLINE_LIBS="-lreadline -l$gjs_libtermcap"
-  fi
-  LIBS="$READLINE_LIBS $LIBS_no_readline"
-  AC_LINK_IFELSE(
-    [AC_LANG_CALL([],[readline])],
-    [gjs_cv_lib_readline=yes])
-  if test $gjs_cv_lib_readline = yes; then
-    break
-  fi
-done
+AS_IF([test x$enable_readline != xno],[
+
+  # On some systems we need to link readline to a termcap compatible
+  # library.
+  gjs_cv_lib_readline=no
+  AC_MSG_CHECKING([how to link readline libs])
+  for gjs_libtermcap in "" ncursesw ncurses curses termcap; do
+    if test -z "$gjs_libtermcap"; then
+      READLINE_LIBS="-lreadline"
+    else
+      READLINE_LIBS="-lreadline -l$gjs_libtermcap"
+    fi
+    LIBS="$READLINE_LIBS $LIBS_no_readline"
+    AC_LINK_IFELSE(
+      [AC_LANG_CALL([],[readline])],
+      [gjs_cv_lib_readline=yes])
+    if test $gjs_cv_lib_readline = yes; then
+      break
+    fi
+  done
+],[gjs_cv_lib_readline=no])
+
 if test $gjs_cv_lib_readline = no; then
+  AS_IF([test x$enable_readline != xno],
+    [AC_MSG_ERROR([Readline requested but not found. Configure with --disable-readline.])]
+  )
   AC_MSG_RESULT([none])
   READLINE_LIBS=""
   ac_cv_header_readline_readline_h=no


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]