[Kst] kdeextragear-2/kst

George Staikos staikos at kde.org
Sat Apr 16 18:17:15 CEST 2005


CVS commit by staikos: 

add configure check for kstcmd


  M +14 -0     configure.in.in   1.53
  M +3 -1      kst/extensions/js/Makefile.am   1.36
  M +0 -1      kst/extensions/js/TODO   1.19
  M +1 -1      kst/extensions/js/bindings.txt   1.16
  M +10 -0     kst/extensions/js/js.cpp   1.28


--- kdeextragear-2/kst/configure.in.in  #1.52:1.53
@@ -129,4 +129,18 @@
 AM_CONDITIONAL(include_netcdf, test -n "$NETCDFLIBS")
 
+# Readline and ncurses check
+KDE_CHECK_HEADER(readline/readline.h, AC_DEFINE(HAVE_READLINE_H, 1, [If we have libreadline headers]) have_readline_h=yes, , )
+KDE_CHECK_LIB(readline, rl_cleanup_after_signal, LIBREADLINE="-lreadline -lncurses", , -lncurses)
+if test $ac_cv_lib_readline_rl_cleanup_after_signal = yes; then
+  if test $have_readline_h = yes; then
+    AC_SUBST(LIBREADLINE)
+    AC_DEFINE(KST_HAVE_READLINE, 1, [If we have libreadline.])
+  else
+    AC_MSG_WARN([kstcmd will not be compiled. Please install readline and ncurses])
+  fi
+else
+  AC_MSG_WARN([kstcmd will not be compiled. Please install readline and ncurses])
+fi
+AM_CONDITIONAL(include_kstcmd, test -n "$LIBREADLINE")
 
 # GSL Tests

--- kdeextragear-2/kst/kst/extensions/js/Makefile.am  #1.35:1.36
@@ -12,9 +12,11 @@
 
 kde_module_LTLIBRARIES=kstextension_js.la
+if include_kstcmd
 bin_PROGRAMS=kstcmd
 
 kstcmd_SOURCES=kstcmd.cpp
-kstcmd_LDADD=$(LIB_KDECORE) -lreadline -lncurses
+kstcmd_LDADD=$(LIB_KDECORE) $(LIBREADLINE)
 kstcmd_LDFLAGS=$(all_libraries)
+endif
 
 kstextension_js_la_LDFLAGS=$(all_libraries) -module -avoid-version

--- kdeextragear-2/kst/kst/extensions/js/TODO  #1.18:1.19
@@ -1,4 +1,3 @@
 Major:
-- configure check for readline and ncurses
 - more verbose error messages (ie: which argument is wrong, and why)
 - what should we do for toString()?  It's basically empty in all classes

--- kdeextragear-2/kst/kst/extensions/js/bindings.txt  #1.15:1.16
@@ -17,5 +17,5 @@
 Fit
 Filter
-KPlugin         Name?
+Plugin          DONE (needs work)
 Histogram       DONE (issue with the type of histogram remains)
 Curve           DONE (maybe still do some minX etc stuff)

--- kdeextragear-2/kst/kst/extensions/js/js.cpp  #1.27:1.28
@@ -22,4 +22,6 @@
 #undef private
 
+#include <config.h>
+
 #include "js.h"
 #include "jsiface_impl.h"
@@ -66,6 +68,8 @@ KstJS::KstJS(QObject *parent, const char
   createBindings();
 
+#ifdef KST_HAVE_READLINE
   _showAction = new KToggleAction(i18n("Show &JavaScript Console"), 0, 0, 0, 0, actionCollection(), "js_console_show");
   connect(_showAction, SIGNAL(toggled(bool)), this, SLOT(doShow(bool)));
+#endif
   new KAction(i18n("Load JavaScript..."), 0, 0, this, SLOT(loadScript()), actionCollection(), "js_load");
   new KAction(i18n("Clear JavaScript &Interpreter"), 0, 0, this, SLOT(resetInterpreter()), actionCollection(), "js_reset");
@@ -147,4 +151,5 @@ static char shellStr[30];
 
 void KstJS::showConsole() {
+#ifdef KST_HAVE_READLINE
   _showAction->setText(i18n("Hide &JavaScript Console"));
   if (!_konsolePart) {
@@ -174,12 +179,15 @@ void KstJS::showConsole() {
   _splitter->show();
   _konsolePart->widget()->show();
+#endif
 }
 
 
 void KstJS::shellExited() {
+#ifdef KST_HAVE_READLINE
   _showAction->setChecked(false);
   _showAction->setText(i18n("Show &JavaScript Console"));
   _konsolePart = 0L;
   QTimer::singleShot(0, this, SLOT(restoreUI())); // konsole crashes otherwise
+#endif
 }
 
@@ -196,4 +204,5 @@ void KstJS::restoreUI() {
 
 void KstJS::hideConsole() {
+#ifdef KST_HAVE_READLINE
   _showAction->setText(i18n("Show &JavaScript Console"));
   if (_konsolePart) {
@@ -201,4 +210,5 @@ void KstJS::hideConsole() {
     _konsolePart->widget()->hide();
   }
+#endif
 }
 




More information about the Kst mailing list