Index: /trunk/FACT++/configure
===================================================================
--- /trunk/FACT++/configure	(revision 14047)
+++ /trunk/FACT++/configure	(revision 14048)
@@ -624,4 +624,6 @@
 HAS_GUI_FALSE
 HAS_GUI_TRUE
+HAS_V8_FALSE
+HAS_V8_TRUE
 HAS_DBUS_FALSE
 HAS_DBUS_TRUE
@@ -958,4 +960,7 @@
 with_boost_regex
 with_boost_thread
+with_v8
+with_v8_include
+with_v8_libdir
 with_qt4
 with_qt4_dir
@@ -1727,4 +1732,8 @@
                           to specify a certain library for the linker e.g.
                           --with-boost-thread=boost_thread-gcc-mt
+  --with-v8=DIR	root directory of v8 installation
+  --with-v8-include=DIR        specify exact include dir for v8 headers (e.g. v8.h)
+  --with-v8-libdir=DIR        specify exact library dir for v8 library (e.g. libv8)
+  --without-v8        disables v8 usage completely
   --without-qt4           Disable qt4, i.e. disable gui support.
   --with-qt4-dir          where the root of Qt 4 is installed
@@ -20294,10 +20303,4 @@
 #AX_CHECK_GLUT
 
-# Check for the fits header and zstream support from MARS
-#AC_CHECK_FILE(gui/RawEventsViewer/izstream.h,
-#		HAVE_IZSTREAM_H=yes, HAVE_IZSTREAM_H=no)
-#AC_CHECK_FILE(gui/RawEventsViewer/fits.h,
-#		HAVE_FITS_H=yes, HAVE_FITS_H=no)
-
 # Needed to compile FACT++
 
@@ -22675,4 +22678,142 @@
 #   ]
 #)
+
+######################################################################
+# v8 / JavaScript
+######################################################################
+
+
+
+
+# Check whether --with-v8 was given.
+if test "${with_v8+set}" = set; then :
+  withval=$with_v8; with_v8=$withval
+if test "${with_v8}" != yes; then
+	v8_include="$withval/include"
+	v8_libdir="$withval/lib"
+fi
+
+fi
+
+
+
+# Check whether --with-v8-include was given.
+if test "${with_v8_include+set}" = set; then :
+  withval=$with_v8_include; v8_include="$withval"
+fi
+
+
+
+# Check whether --with-v8-libdir was given.
+if test "${with_v8_libdir+set}" = set; then :
+  withval=$with_v8_libdir; v8_libdir="$withval"
+fi
+
+
+if test "${with_v8}" != no ; then
+	OLD_LIBS=$LIBS
+	OLD_LDFLAGS=$LDFLAGS
+	OLD_CFLAGS=$CFLAGS
+	OLD_CPPFLAGS=$CPPFLAGS
+
+	if test "${v8_libdir}" ; then
+		LDFLAGS="$LDFLAGS -L${v8_libdir}"
+	fi
+	if test "${v8_include}" ; then
+		CPPFLAGS="$CPPFLAGS -I${v8_include}"
+		CFLAGS="$CFLAGS -I${v8_include}"
+	fi
+
+	ac_fn_cxx_check_header_mongrel "$LINENO" "v8.h" "ac_cv_header_v8_h" "$ac_includes_default"
+if test "x$ac_cv_header_v8_h" = xyes; then :
+
+else
+  no_good=yes
+fi
+
+
+
+        ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for v8::HandleScope handle_scope in -lv8" >&5
+$as_echo_n "checking for v8::HandleScope handle_scope in -lv8... " >&6; }
+if ${ac_cv_lib_v8_v8__HandleScope_handle_scope+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+   	ac_check_lib_save_LIBS=$LIBS
+   	LIBS="-lv8  $LIBS"
+   	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <v8.h>
+int
+main ()
+{
+v8::HandleScope handle_scope
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ac_cv_lib_v8_v8__HandleScope_handle_scope=yes
+else
+  ac_cv_lib_v8_v8__HandleScope_handle_scope=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+   	LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_v8_v8__HandleScope_handle_scope" >&5
+$as_echo "$ac_cv_lib_v8_v8__HandleScope_handle_scope" >&6; }
+   	if test $ac_cv_lib_v8_v8__HandleScope_handle_scope = yes; then :
+
+
+           		cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBV8 1
+_ACEOF
+
+   			LIBS="-lv8 $LIBS"
+
+
+else
+  no_good=yes
+fi
+
+
+
+        ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+	if test "$no_good" = yes; then
+		HAVE_V8=no
+
+		LIBS=$OLD_LIBS
+		LDFLAGS=$OLD_LDFLAGS
+		CPPFLAGS=$OLD_CPPFLAGS
+		CFLAGS=$OLD_CFLAGS
+	else
+		HAVE_V8=yes
+
+		$as_echo "#define HAVE_PKG_v8 1" >>confdefs.h
+
+	fi
+
+fi
+
+
 
 ######################################################################
@@ -23859,5 +24000,5 @@
 
 		cat > conftest.$ac_ext <<EOF
-#line 23861 "configure"
+#line 24002 "configure"
 #include "confdefs.h"
 #include <qglobal.h>
@@ -24970,6 +25111,4 @@
 fi
 
-#AM_CONDITIONAL(HAS_IZSTREAM_H,[test "$HAVE_IZSTREAM_H" = yes])
-#AM_CONDITIONAL(HAS_FITS_H,    [test "$HAVE_FITS_H" = yes])
  if test "$HAVE_GL" = yes; then
   HAS_GL_TRUE=
@@ -25028,4 +25167,12 @@
 fi
 
+ if test "$HAVE_V8" = yes; then
+  HAS_V8_TRUE=
+  HAS_V8_FALSE='#'
+else
+  HAS_V8_TRUE='#'
+  HAS_V8_FALSE=
+fi
+
 
  if test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_ROOT_QT" = yes ; then
@@ -25087,10 +25234,8 @@
 
 fi
-
-#AM_COND_IF(HAS_FITS_H, [
-#   AM_COND_IF(HAS_IZSTREAM_H, [
-#   ])
-#],)
-
+if test "$HAVE_V8" = yes; then
+  $as_echo "#define HAVE_V8 1" >>confdefs.h
+
+fi
 
 ##########################################################################
@@ -25445,4 +25590,8 @@
 if test -z "${HAS_DBUS_TRUE}" && test -z "${HAS_DBUS_FALSE}"; then
   as_fn_error $? "conditional \"HAS_DBUS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAS_V8_TRUE}" && test -z "${HAS_V8_FALSE}"; then
+  as_fn_error $? "conditional \"HAS_V8\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
@@ -27937,6 +28086,6 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}:  nova                   / libnova.so         found: $HAVE_NOVA" >&5
 $as_echo "$as_me:  nova                   / libnova.so         found: $HAVE_NOVA" >&6;}
-#AC_MSG_NOTICE([ gui/RawEventsViewer/izstream.h              found: $HAVE_IZSTREAM_H])
-#AC_MSG_NOTICE([ gui/RawEventsViewer/fits.h                  found: $HAVE_FITS_H])
+{ $as_echo "$as_me:${as_lineno-$LINENO}:  v8                     / 'v8.h' / libv8.so  found: $HAVE_V8" >&5
+$as_echo "$as_me:  v8                     / 'v8.h' / libv8.so  found: $HAVE_V8" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}:  GL                     / GL/gl.h            found: $HAVE_GL" >&5
 $as_echo "$as_me:  GL                     / GL/gl.h            found: $HAVE_GL" >&6;}
@@ -28206,4 +28355,10 @@
 $as_echo "$as_me: WARNING:  libnova missing - smartfact will be compiles without astronomy support!" >&2;}
 fi
+if test "$HAVE_V8" = yes; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  libv8 missing - JavaScript support will be disabled!" >&5
+$as_echo "$as_me: WARNING:  libv8 missing - JavaScript support will be disabled!" >&2;}
+fi
 if test "$HAVE_DBUS" = yes; then
   :
Index: /trunk/FACT++/configure.ac
===================================================================
--- /trunk/FACT++/configure.ac	(revision 14047)
+++ /trunk/FACT++/configure.ac	(revision 14048)
@@ -283,4 +283,11 @@
 #   ]
 #)
+
+######################################################################
+# v8 / JavaScript
+######################################################################
+
+AC_CHECK_CLASS(v8, [v8::HandleScope handle_scope], v8, v8.h, 
+	HAVE_V8=yes, HAVE_V8=no)
 
 ######################################################################
@@ -384,4 +391,5 @@
 AM_CONDITIONAL(HAS_SOPRANO,   [test "$HAVE_SOPRANO" = yes])
 AM_CONDITIONAL(HAS_DBUS,      [test "$HAVE_DBUS" = yes])
+AM_CONDITIONAL(HAS_V8,        [test "$HAVE_V8" = yes])
 
 AM_CONDITIONAL(HAS_GUI,       [test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_ROOT_QT" = yes ])
@@ -397,4 +405,5 @@
 AM_COND_IF(HAS_DBUS, [AC_DEFINE(HAVE_DBUS)], )
 AM_COND_IF(HAS_SQL,  [AC_DEFINE(HAVE_SQL)],  )
+AM_COND_IF(HAS_V8,   [AC_DEFINE(HAVE_V8)],   )
 
 ##########################################################################
@@ -457,4 +466,5 @@
 AC_MSG_NOTICE([ zlib                   / 'zlib.h'           found: $HAVE_ZLIB])
 AC_MSG_NOTICE([ nova                   / libnova.so         found: $HAVE_NOVA])
+AC_MSG_NOTICE([ v8                     / 'v8.h' / libv8.so  found: $HAVE_V8])
 AC_MSG_NOTICE([ GL                     / GL/gl.h            found: $HAVE_GL])
 AC_MSG_NOTICE([ GLU                    / GL/glu.h           found: $HAVE_GLU])
@@ -575,4 +585,5 @@
 AM_COND_IF(HAS_SQL,,     AC_MSG_WARN([ database support globally disabled!]))
 AM_COND_IF(HAS_NOVA,,    AC_MSG_WARN([ libnova missing - smartfact will be compiles without astronomy support!]))
+AM_COND_IF(HAS_V8,,      AC_MSG_WARN([ libv8 missing - JavaScript support will be disabled!]))
 AM_COND_IF(HAS_DBUS,,    AC_MSG_WARN([ DBus libraries missing - skypeclient will not be compiled!]))
 AM_COND_IF(HAS_SOPRANO,, AC_MSG_WARN([ Soprano libraries missing - tngweather will not be compiled!]))
