Index: /trunk/FACT++/configure
===================================================================
--- /trunk/FACT++/configure	(revision 11621)
+++ /trunk/FACT++/configure	(revision 11622)
@@ -753,4 +753,8 @@
 HAS_VIEWER_FALSE
 HAS_VIEWER_TRUE
+HAS_GLU_FALSE
+HAS_GLU_TRUE
+HAS_GL_FALSE
+HAS_GL_TRUE
 HAS_FITS_H_FALSE
 HAS_FITS_H_TRUE
@@ -1042,4 +1046,10 @@
 with_zlib_include
 with_zlib_libdir
+with_GL
+with_GL_include
+with_GL_libdir
+with_GLU
+with_GLU_include
+with_GLU_libdir
 with_cfitsio
 with_cfitsio_include
@@ -1065,4 +1075,7 @@
 with_qt4_includes
 with_qt4_libraries
+with_QGL
+with_QGL_include
+with_QGL_libdir
 with_root
 with_rootsys
@@ -1750,4 +1763,12 @@
   --with-zlib-libdir=DIR        specify exact library dir for zlib library (e.g. libz)
   --without-zlib        disables zlib usage completely
+  --with-GL=DIR	root directory of GL installation
+  --with-GL-include=DIR        specify exact include dir for GL headers (e.g. GL/gl.h)
+  --with-GL-libdir=DIR        specify exact library dir for GL library (e.g. libGL)
+  --without-GL        disables GL usage completely
+  --with-GLU=DIR	root directory of GLU installation
+  --with-GLU-include=DIR        specify exact include dir for GLU headers (e.g. GL/glu.h)
+  --with-GLU-libdir=DIR        specify exact library dir for GLU library (e.g. libGLU)
+  --without-GLU        disables GLU usage completely
   --with-cfitsio=DIR	root directory of cfitsio installation
   --with-cfitsio-include=DIR        specify exact include dir for cfitsio headers (e.g. fitsio.h)
@@ -1804,4 +1825,8 @@
   --with-qt4-includes     where the Qt 4 includes are
   --with-qt4-libraries    where the Qt 4 library is installed
+  --with-QGL=DIR	root directory of QGL installation
+  --with-QGL-include=DIR        specify exact include dir for QGL headers (e.g. QtOpenGL/QGlWidget)
+  --with-QGL-libdir=DIR        specify exact library dir for QGL library (e.g. libQtOpenGL)
+  --without-QGL        disables QGL usage completely
   --without-root          Disable root, i.e. disable gui support.
   --with-rootsys          path to the ROOT executables or top ROOT
@@ -4810,11 +4835,11 @@
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:4812: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:4837: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4815: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:4840: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4818: output\"" >&5)
+  (eval echo "\"\$as_me:4843: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
@@ -6021,5 +6046,5 @@
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6023 "configure"' > conftest.$ac_ext
+  echo '#line 6048 "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7682,9 +7707,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7684: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7709: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7688: \$? = $ac_status" >&5
+   echo "$as_me:7713: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -8021,9 +8046,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8023: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8048: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8027: \$? = $ac_status" >&5
+   echo "$as_me:8052: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -8126,9 +8151,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8128: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8153: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8132: \$? = $ac_status" >&5
+   echo "$as_me:8157: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -8181,9 +8206,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8183: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8208: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8187: \$? = $ac_status" >&5
+   echo "$as_me:8212: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -10565,5 +10590,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10567 "configure"
+#line 10592 "configure"
 #include "confdefs.h"
 
@@ -10661,5 +10686,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10663 "configure"
+#line 10688 "configure"
 #include "confdefs.h"
 
@@ -12617,9 +12642,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12619: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12644: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:12623: \$? = $ac_status" >&5
+   echo "$as_me:12648: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -12716,9 +12741,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12718: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12743: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12722: \$? = $ac_status" >&5
+   echo "$as_me:12747: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -12768,9 +12793,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12770: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12795: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12774: \$? = $ac_status" >&5
+   echo "$as_me:12799: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -18345,4 +18370,240 @@
 
 
+# Check for GL and GLU needed for the raw event viewer
+
+
+
+# Check whether --with-GL was given.
+if test "${with_GL+set}" = set; then :
+  withval=$with_GL; with_GL=$withval
+if test "${with_GL}" != yes; then
+	GL_include="$withval/include"
+	GL_libdir="$withval/lib"
+fi
+
+fi
+
+
+
+# Check whether --with-GL-include was given.
+if test "${with_GL_include+set}" = set; then :
+  withval=$with_GL_include; GL_include="$withval"
+fi
+
+
+
+# Check whether --with-GL-libdir was given.
+if test "${with_GL_libdir+set}" = set; then :
+  withval=$with_GL_libdir; GL_libdir="$withval"
+fi
+
+
+if test "${with_GL}" != no ; then
+	OLD_LIBS=$LIBS
+	OLD_LDFLAGS=$LDFLAGS
+	OLD_CFLAGS=$CFLAGS
+	OLD_CPPFLAGS=$CPPFLAGS
+
+	if test "${GL_libdir}" ; then
+		LDFLAGS="$LDFLAGS -L${GL_libdir}"
+	fi
+	if test "${GL_include}" ; then
+		CPPFLAGS="$CPPFLAGS -I${GL_include}"
+		CFLAGS="$CFLAGS -I${GL_include}"
+	fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glLoadIdentity in -lGL" >&5
+$as_echo_n "checking for glLoadIdentity in -lGL... " >&6; }
+if test "${ac_cv_lib_GL_glLoadIdentity+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lGL  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char glLoadIdentity ();
+int
+main ()
+{
+return glLoadIdentity ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_GL_glLoadIdentity=yes
+else
+  ac_cv_lib_GL_glLoadIdentity=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_GL_glLoadIdentity" >&5
+$as_echo "$ac_cv_lib_GL_glLoadIdentity" >&6; }
+if test "x$ac_cv_lib_GL_glLoadIdentity" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGL 1
+_ACEOF
+
+  LIBS="-lGL $LIBS"
+
+else
+  no_good=yes
+fi
+
+	ac_fn_c_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default"
+if test "x$ac_cv_header_GL_gl_h" = x""yes; then :
+
+else
+  no_good=yes
+fi
+
+
+	if test "$no_good" = yes; then
+		HAVE_GL=no
+
+		LIBS=$OLD_LIBS
+		LDFLAGS=$OLD_LDFLAGS
+		CPPFLAGS=$OLD_CPPFLAGS
+		CFLAGS=$OLD_CFLAGS
+	else
+		HAVE_GL=yes
+
+		$as_echo "#define HAVE_PKG_GL 1" >>confdefs.h
+
+	fi
+
+fi
+
+
+
+
+
+# Check whether --with-GLU was given.
+if test "${with_GLU+set}" = set; then :
+  withval=$with_GLU; with_GLU=$withval
+if test "${with_GLU}" != yes; then
+	GLU_include="$withval/include"
+	GLU_libdir="$withval/lib"
+fi
+
+fi
+
+
+
+# Check whether --with-GLU-include was given.
+if test "${with_GLU_include+set}" = set; then :
+  withval=$with_GLU_include; GLU_include="$withval"
+fi
+
+
+
+# Check whether --with-GLU-libdir was given.
+if test "${with_GLU_libdir+set}" = set; then :
+  withval=$with_GLU_libdir; GLU_libdir="$withval"
+fi
+
+
+if test "${with_GLU}" != no ; then
+	OLD_LIBS=$LIBS
+	OLD_LDFLAGS=$LDFLAGS
+	OLD_CFLAGS=$CFLAGS
+	OLD_CPPFLAGS=$CPPFLAGS
+
+	if test "${GLU_libdir}" ; then
+		LDFLAGS="$LDFLAGS -L${GLU_libdir}"
+	fi
+	if test "${GLU_include}" ; then
+		CPPFLAGS="$CPPFLAGS -I${GLU_include}"
+		CFLAGS="$CFLAGS -I${GLU_include}"
+	fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluNewTess in -lGLU" >&5
+$as_echo_n "checking for gluNewTess in -lGLU... " >&6; }
+if test "${ac_cv_lib_GLU_gluNewTess+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lGLU  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gluNewTess ();
+int
+main ()
+{
+return gluNewTess ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_GLU_gluNewTess=yes
+else
+  ac_cv_lib_GLU_gluNewTess=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_GLU_gluNewTess" >&5
+$as_echo "$ac_cv_lib_GLU_gluNewTess" >&6; }
+if test "x$ac_cv_lib_GLU_gluNewTess" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGLU 1
+_ACEOF
+
+  LIBS="-lGLU $LIBS"
+
+else
+  no_good=yes
+fi
+
+	ac_fn_c_check_header_mongrel "$LINENO" "GL/glu.h" "ac_cv_header_GL_glu_h" "$ac_includes_default"
+if test "x$ac_cv_header_GL_glu_h" = x""yes; then :
+
+else
+  no_good=yes
+fi
+
+
+	if test "$no_good" = yes; then
+		HAVE_GLU=no
+
+		LIBS=$OLD_LIBS
+		LDFLAGS=$OLD_LDFLAGS
+		CPPFLAGS=$OLD_CPPFLAGS
+		CFLAGS=$OLD_CFLAGS
+	else
+		HAVE_GLU=yes
+
+		$as_echo "#define HAVE_PKG_GLU 1" >>confdefs.h
+
+	fi
+
+fi
+
+
+
+# Taken from http://code.google.com/p/autoconf-gl-macros/
+#AX_CHECK_GL
+#AX_CHECK_GLU
+#AX_CHECK_GLUT
+
+# Check for the fits header and zstream support from MARS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gui/RawEventsViewer/izstream.h" >&5
 $as_echo_n "checking for gui/RawEventsViewer/izstream.h... " >&6; }
@@ -21860,5 +22121,5 @@
 
 		cat > conftest.$ac_ext <<EOF
-#line 21862 "configure"
+#line 22123 "configure"
 #include "confdefs.h"
 #include <qglobal.h>
@@ -22023,4 +22284,114 @@
 
 
+
+
+
+# Check whether --with-QGL was given.
+if test "${with_QGL+set}" = set; then :
+  withval=$with_QGL; with_QGL=$withval
+if test "${with_QGL}" != yes; then
+	QGL_include="$withval/include"
+	QGL_libdir="$withval/lib"
+fi
+
+fi
+
+
+
+# Check whether --with-QGL-include was given.
+if test "${with_QGL_include+set}" = set; then :
+  withval=$with_QGL_include; QGL_include="$withval"
+fi
+
+
+
+# Check whether --with-QGL-libdir was given.
+if test "${with_QGL_libdir+set}" = set; then :
+  withval=$with_QGL_libdir; QGL_libdir="$withval"
+fi
+
+
+if test "${with_QGL}" != no ; then
+	OLD_LIBS=$LIBS
+	OLD_LDFLAGS=$LDFLAGS
+	OLD_CFLAGS=$CFLAGS
+	OLD_CPPFLAGS=$CPPFLAGS
+
+	if test "${QGL_libdir}" ; then
+		LDFLAGS="$LDFLAGS -L${QGL_libdir}"
+	fi
+	if test "${QGL_include}" ; then
+		CPPFLAGS="$CPPFLAGS -I${QGL_include}"
+		CFLAGS="$CFLAGS -I${QGL_include}"
+	fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lQtOpenGL" >&5
+$as_echo_n "checking for main in -lQtOpenGL... " >&6; }
+if test "${ac_cv_lib_QtOpenGL_main+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lQtOpenGL  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ac_cv_lib_QtOpenGL_main=yes
+else
+  ac_cv_lib_QtOpenGL_main=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_QtOpenGL_main" >&5
+$as_echo "$ac_cv_lib_QtOpenGL_main" >&6; }
+if test "x$ac_cv_lib_QtOpenGL_main" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBQTOPENGL 1
+_ACEOF
+
+  LIBS="-lQtOpenGL $LIBS"
+
+else
+  no_good=yes
+fi
+
+	ac_fn_cxx_check_header_mongrel "$LINENO" "QtOpenGL/QGlWidget" "ac_cv_header_QtOpenGL_QGlWidget" "$ac_includes_default"
+if test "x$ac_cv_header_QtOpenGL_QGlWidget" = x""yes; then :
+
+else
+  no_good=yes
+fi
+
+
+	if test "$no_good" = yes; then
+
+
+		LIBS=$OLD_LIBS
+		LDFLAGS=$OLD_LDFLAGS
+		CPPFLAGS=$OLD_CPPFLAGS
+		CFLAGS=$OLD_CFLAGS
+	else
+
+
+		$as_echo "#define HAVE_PKG_QGL 1" >>confdefs.h
+
+	fi
+
+fi
+
+
+
+
 ######################################################################
 # ROOT SUPPORT
@@ -22585,6 +22956,22 @@
 fi
 
-
- if test "$HAVE_FITS_H" = yes; then
+ if test "$HAVE_GL" = yes; then
+  HAS_GL_TRUE=
+  HAS_GL_FALSE='#'
+else
+  HAS_GL_TRUE='#'
+  HAS_GL_FALSE=
+fi
+
+ if test "$HAVE_GLU" = yes; then
+  HAS_GLU_TRUE=
+  HAS_GLU_FALSE='#'
+else
+  HAS_GLU_TRUE='#'
+  HAS_GLU_FALSE=
+fi
+
+
+ if test "$QT4_VERSION" -a "$HAVE_FITS_H" = yes -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes; then
   HAS_VIEWER_TRUE=
   HAS_VIEWER_FALSE='#'
@@ -22955,4 +23342,12 @@
 if test -z "${HAS_FITS_H_TRUE}" && test -z "${HAS_FITS_H_FALSE}"; then
   as_fn_error $? "conditional \"HAS_FITS_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAS_GL_TRUE}" && test -z "${HAS_GL_FALSE}"; then
+  as_fn_error $? "conditional \"HAS_GL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAS_GLU_TRUE}" && test -z "${HAS_GLU_FALSE}"; then
+  as_fn_error $? "conditional \"HAS_GLU\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
@@ -25355,4 +25750,8 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}:  gui/RawEventsViewer/fits.h                 found: $HAVE_FITS_H" >&5
 $as_echo "$as_me:  gui/RawEventsViewer/fits.h                 found: $HAVE_FITS_H" >&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;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}:  GLU                    / GL/glu.h          found: $HAVE_GLU" >&5
+$as_echo "$as_me:  GLU                    / GL/glu.h          found: $HAVE_GLU" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}:  cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO" >&5
 $as_echo "$as_me:  cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO" >&6;}
@@ -25561,9 +25960,29 @@
 
 fi
+if test "$HAVE_GL" = yes; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  GL not found - viewer will be disabled." >&5
+$as_echo "$as_me: WARNING:  GL not found - viewer will be disabled." >&2;}
+fi
+if test "$HAVE_GLU" = yes; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  GLU not found - viewer will be disabled." >&5
+$as_echo "$as_me: WARNING:  GLU not found - viewer will be disabled." >&2;}
+fi
+
+if test -n "$QT4_VERSION"; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  QT4 missing: fact and viewer GUI disabled!" >&5
+$as_echo "$as_me: WARNING:  QT4 missing: fact and viewer GUI disabled!" >&2;}
+
+fi
 if test "$QT4_VERSION" -a "$HAVE_ROOT_QT" = yes; then
   :
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  Either QT4 or qt-root is missing: GUIs disabled!" >&5
-$as_echo "$as_me: WARNING:  Either QT4 or qt-root is missing: GUIs disabled!" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  Either QT4 or qt-root is missing: fact GUI disabled!" >&5
+$as_echo "$as_me: WARNING:  Either QT4 or qt-root is missing: fact GUI disabled!" >&2;}
 
 fi
Index: /trunk/FACT++/configure.ac
===================================================================
--- /trunk/FACT++/configure.ac	(revision 11621)
+++ /trunk/FACT++/configure.ac	(revision 11622)
@@ -111,4 +111,14 @@
 		 HAVE_ZLIB=yes, HAVE_ZLIB=no)
 
+# Check for GL and GLU needed for the raw event viewer
+AC_CHECK_PACKAGE(GL, glLoadIdentity, GL, GL/gl.h, HAVE_GL=yes, HAVE_GL=no)
+AC_CHECK_PACKAGE(GLU, gluNewTess, GLU, GL/glu.h, HAVE_GLU=yes, HAVE_GLU=no)
+
+# Taken from http://code.google.com/p/autoconf-gl-macros/
+#AX_CHECK_GL
+#AX_CHECK_GLU
+#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)
@@ -216,4 +226,7 @@
    [], [QT4_DO_IT_ALL])
 
+AC_CHECK_PACKAGE(QGL, main, QtOpenGL, QtOpenGL/QGlWidget)
+
+
 ######################################################################
 # ROOT SUPPORT
@@ -294,6 +307,8 @@
 AM_CONDITIONAL(HAS_IZSTREAM_H,[test "$HAVE_IZSTREAM_H" = yes])
 AM_CONDITIONAL(HAS_FITS_H,    [test "$HAVE_FITS_H" = yes])
-
-AM_CONDITIONAL(HAS_VIEWER,    [test "$HAVE_FITS_H" = yes])
+AM_CONDITIONAL(HAS_GL,        [test "$HAVE_GL" = yes])
+AM_CONDITIONAL(HAS_GLU,       [test "$HAVE_GLU" = yes])
+
+AM_CONDITIONAL(HAS_VIEWER,    [test "$QT4_VERSION" -a "$HAVE_FITS_H" = yes -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes])
 
 AM_CONDITIONAL(IS_FALSE,      [test "x" = "y"])
@@ -359,4 +374,6 @@
 AC_MSG_NOTICE([ gui/RawEventsViewer/izstream.h             found: $HAVE_IZSTREAM_H])
 AC_MSG_NOTICE([ gui/RawEventsViewer/fits.h                 found: $HAVE_FITS_H])
+AC_MSG_NOTICE([ GL                     / GL/gl.h           found: $HAVE_GL])
+AC_MSG_NOTICE([ GLU                    / GL/glu.h          found: $HAVE_GLU])
 AC_MSG_NOTICE([ cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO])
 AC_MSG_NOTICE([ CCfits                 / 'CCfits/CCfits'   found: $HAVE_CCFITS])
@@ -461,6 +478,12 @@
    )]
 )
+AM_COND_IF(HAS_GL,,  AC_MSG_WARN([ GL not found - viewer will be disabled.]))
+AM_COND_IF(HAS_GLU,, AC_MSG_WARN([ GLU not found - viewer will be disabled.]))
+
+AM_COND_IF(HAS_QT4, [], 
+      AC_MSG_WARN([ QT4 missing: fact and viewer GUI disabled!])
+)
 AM_COND_IF(HAS_GUI, [], 
-      AC_MSG_WARN([ Either QT4 or qt-root is missing: GUIs disabled!])
-)
-AC_MSG_NOTICE()
+      AC_MSG_WARN([ Either QT4 or qt-root is missing: fact GUI disabled!])
+)
+AC_MSG_NOTICE()
