Index: /trunk/FACT++/Makefile.am
===================================================================
--- /trunk/FACT++/Makefile.am	(revision 11821)
+++ /trunk/FACT++/Makefile.am	(revision 11822)
@@ -43,7 +43,8 @@
 if HAS_GUI
 bin_PROGRAMS += fact
+endif
+
 if HAS_VIEWER
 bin_PROGRAMS += viewer
-endif
 endif
 
@@ -323,6 +324,4 @@
 if HAS_GUI
 
-#
-
 fact_DIALOGS = \
 	gui/design.ui
@@ -339,5 +338,7 @@
 fact_SRCADD = $(fact_DIALOGS:.ui=.h) $(fact_RESOURCES:.qrc=.cc) $(fact_QT_SOURCES:.cc=.moc.cc)
 
-#
+endif
+
+# -----
 
 if HAS_VIEWER
@@ -350,6 +351,4 @@
 
 viewer_SRCADD = $(viewer_DIALOGS:.ui=.h) $(viewer_RESOURCES:.qrc=.cc) $(viewer_QT_SOURCES:.cc=.moc.cc)
-
-endif
 
 endif
@@ -361,5 +360,7 @@
 CLEANFILES += $(BUILT_SOURCES)
 
-EXTRA_DIST += $(DIALOGS) $(RESOURCES) 
+EXTRA_DIST += \
+	$(fact_DIALOGS) $(fact_RESOURCES) \
+	$(viewer_DIALOGS) $(viewer_RESOURCES) 
 
 fact_LDADD = $(ROOTLDFLAGS) $(ROOTGLIBS) $(QT4_LIB) $(QT4_LDFLAGS) -L. \
Index: /trunk/FACT++/Makefile.in
===================================================================
--- /trunk/FACT++/Makefile.in	(revision 11821)
+++ /trunk/FACT++/Makefile.in	(revision 11822)
@@ -55,5 +55,5 @@
 	$(am__EXEEXT_3) $(am__EXEEXT_4)
 @HAS_GUI_TRUE@am__append_1 = fact
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__append_2 = viewer
+@HAS_VIEWER_TRUE@am__append_2 = viewer
 @HAS_LIBXP_TRUE@am__append_3 = did
 
@@ -165,5 +165,5 @@
 libTools_la_OBJECTS = $(am_libTools_la_OBJECTS)
 @HAS_GUI_TRUE@am__EXEEXT_1 = fact$(EXEEXT)
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__EXEEXT_2 = viewer$(EXEEXT)
+@HAS_VIEWER_TRUE@am__EXEEXT_2 = viewer$(EXEEXT)
 @HAS_LIBXP_TRUE@am__EXEEXT_3 = did$(EXEEXT)
 @IS_FALSE@am__EXEEXT_4 = test$(EXEEXT) dclient5$(EXEEXT) \
@@ -332,8 +332,7 @@
 	gui/RawEventsViewer/RawEventsViewer.moc.cc \
 	gui/RawEventsViewer/RawEventsViewer.cc
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__objects_8 = gui/RawEventsViewer/RawEventsViewer.moc.$(OBJEXT)
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__objects_9 = $(am__objects_2) \
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@	$(am__objects_8)
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__objects_10 = gui/RawEventsViewer/RawEventsViewer.$(OBJEXT)
+@HAS_VIEWER_TRUE@am__objects_8 = gui/RawEventsViewer/RawEventsViewer.moc.$(OBJEXT)
+@HAS_VIEWER_TRUE@am__objects_9 = $(am__objects_2) $(am__objects_8)
+@HAS_VIEWER_TRUE@am__objects_10 = gui/RawEventsViewer/RawEventsViewer.$(OBJEXT)
 am_viewer_OBJECTS = $(am__objects_9) $(am__objects_10)
 viewer_OBJECTS = $(am_viewer_OBJECTS)
@@ -692,5 +691,6 @@
 	dim/README_v14.txt dim/README_v17.txt dim/README_v16.txt \
 	dim/README_v17.txt dim/README_v18.txt dim/README_v19.txt \
-	$(DIALOGS) $(RESOURCES) $(am__append_8) $(am__append_11)
+	$(fact_DIALOGS) $(fact_RESOURCES) $(viewer_DIALOGS) \
+	$(viewer_RESOURCES) $(am__append_8) $(am__append_11)
 dns_LDADD = libDim.la libDimExtension.la
 dns_SOURCES = src/dns.c
@@ -889,6 +889,4 @@
 
 # -----
-
-#
 @HAS_GUI_TRUE@fact_DIALOGS = \
 @HAS_GUI_TRUE@	gui/design.ui
@@ -905,12 +903,12 @@
 @HAS_GUI_TRUE@fact_SRCADD = $(fact_DIALOGS:.ui=.h) $(fact_RESOURCES:.qrc=.cc) $(fact_QT_SOURCES:.cc=.moc.cc)
 
-#
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@viewer_DIALOGS = \
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@	gui/RawEventsViewer/viewer.ui
-
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@viewer_QT_SOURCES = \
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@	gui/RawEventsViewer/RawEventsViewer.cc
-
-@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@viewer_SRCADD = $(viewer_DIALOGS:.ui=.h) $(viewer_RESOURCES:.qrc=.cc) $(viewer_QT_SOURCES:.cc=.moc.cc)
+# -----
+@HAS_VIEWER_TRUE@viewer_DIALOGS = \
+@HAS_VIEWER_TRUE@	gui/RawEventsViewer/viewer.ui
+
+@HAS_VIEWER_TRUE@viewer_QT_SOURCES = \
+@HAS_VIEWER_TRUE@	gui/RawEventsViewer/RawEventsViewer.cc
+
+@HAS_VIEWER_TRUE@viewer_SRCADD = $(viewer_DIALOGS:.ui=.h) $(viewer_RESOURCES:.qrc=.cc) $(viewer_QT_SOURCES:.cc=.moc.cc)
 BUILT_SOURCES = $(fact_SRCADD) $(viewer_SRCADD)
 fact_LDADD = $(ROOTLDFLAGS) $(ROOTGLIBS) $(QT4_LIB) $(QT4_LDFLAGS) -L. \
Index: /trunk/FACT++/configure
===================================================================
--- /trunk/FACT++/configure	(revision 11821)
+++ /trunk/FACT++/configure	(revision 11822)
@@ -753,4 +753,6 @@
 HAS_VIEWER_FALSE
 HAS_VIEWER_TRUE
+HAS_GUI_FALSE
+HAS_GUI_TRUE
 HAS_QWT_FALSE
 HAS_QWT_TRUE
@@ -769,6 +771,4 @@
 HAS_CFITSIO_FALSE
 HAS_CFITSIO_TRUE
-HAS_GUI_FALSE
-HAS_GUI_TRUE
 HAS_ROOT_QT_FALSE
 HAS_ROOT_QT_TRUE
@@ -23028,12 +23028,4 @@
 fi
 
- if test "$QT4_VERSION" -a "$HAVE_ROOT_QT" = yes; then
-  HAS_GUI_TRUE=
-  HAS_GUI_FALSE='#'
-else
-  HAS_GUI_TRUE='#'
-  HAS_GUI_FALSE=
-fi
-
  if test "$HAVE_CFITSIO" = yes; then
   HAS_CFITSIO_TRUE=
@@ -23102,4 +23094,12 @@
 fi
 
+
+ if test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_ROOT_QT" = yes ; then
+  HAS_GUI_TRUE=
+  HAS_GUI_FALSE='#'
+else
+  HAS_GUI_TRUE='#'
+  HAS_GUI_FALSE=
+fi
 
  if test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_QWT" = yes; then
@@ -23442,8 +23442,4 @@
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${HAS_GUI_TRUE}" && test -z "${HAS_GUI_FALSE}"; then
-  as_fn_error $? "conditional \"HAS_GUI\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${HAS_CFITSIO_TRUE}" && test -z "${HAS_CFITSIO_FALSE}"; then
   as_fn_error $? "conditional \"HAS_CFITSIO\" was never defined.
@@ -23476,4 +23472,8 @@
 if test -z "${HAS_QWT_TRUE}" && test -z "${HAS_QWT_FALSE}"; then
   as_fn_error $? "conditional \"HAS_QWT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAS_GUI_TRUE}" && test -z "${HAS_GUI_FALSE}"; then
+  as_fn_error $? "conditional \"HAS_GUI\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
@@ -26042,6 +26042,5 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
 $as_echo "$as_me: " >&6;}
-#AM_COND_IF(HAS_FITS_H, [
-   if test "$HAVE_ZLIB" = yes; then
+if test "$HAVE_ZLIB" = yes; then
   :
 else
@@ -26050,10 +26049,4 @@
 
 fi
-#   AM_COND_IF(HAS_IZSTREAM_H,,
-#      AC_MSG_WARN([ Mars izstream.h not found in gui/RawEventsViewer. Support for .fits.gz disabled.])
-#   )
-#],
-#   AC_MSG_WARN([ Mars fits.h not found in gui/RawEventsViewer. Target 'viewer' disabled.])
-#)
 if test "$lt_cv_libxp" = "yes"; then
   :
@@ -26080,15 +26073,27 @@
 
 fi
+if test -n "$QT4_VERSION"; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  QT4 missing - GUIs disabled!" >&5
+$as_echo "$as_me: WARNING:  QT4 missing - GUIs disabled!" >&2;}
+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;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  GL not found - GUIs will be disabled." >&5
+$as_echo "$as_me: WARNING:  GL not found - GUIs 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;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  GLU not found - GUIs will be disabled." >&5
+$as_echo "$as_me: WARNING:  GLU not found - GUIs will be disabled." >&2;}
+fi
+if test "$HAVE_QGL" = yes; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  QtOpenGl not found - GUIs will be disabled." >&5
+$as_echo "$as_me: WARNING:  QtOpenGl not found - GUIs will be disabled." >&2;}
 fi
 if test "$HAVE_QWT" = yes; then
@@ -26098,17 +26103,16 @@
 $as_echo "$as_me: WARNING:  Qwt not found - viewer will be disabled." >&2;}
 fi
-
-if test -n "$QT4_VERSION"; then
+if test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_ROOT_QT" = yes ; 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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  Either of the necessary packages not found - fact GUI disabled!" >&5
+$as_echo "$as_me: WARNING:  Either of the necessary packages not found - fact GUI disabled!" >&2;}
+
+fi
+if test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_QWT" = yes; then
   :
 else
-  { $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;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  Either of the necessary packages not found - viewer GUI disabled!" >&5
+$as_echo "$as_me: WARNING:  Either of the necessary packages not found - viewer GUI disabled!" >&2;}
 
 fi
Index: /trunk/FACT++/configure.ac
===================================================================
--- /trunk/FACT++/configure.ac	(revision 11821)
+++ /trunk/FACT++/configure.ac	(revision 11822)
@@ -304,5 +304,4 @@
 AM_CONDITIONAL(HAS_ROOT,      [test "$ROOTEXEC" != no])
 AM_CONDITIONAL(HAS_ROOT_QT,   [test "$HAVE_ROOT_QT" = yes])
-AM_CONDITIONAL(HAS_GUI,       [test "$QT4_VERSION" -a "$HAVE_ROOT_QT" = yes])
 AM_CONDITIONAL(HAS_CFITSIO,   [test "$HAVE_CFITSIO" = yes])
 AM_CONDITIONAL(HAS_CCFITS,    [test "$HAVE_CCFITS" = yes])
@@ -316,4 +315,5 @@
 AM_CONDITIONAL(HAS_QWT,       [test "$HAVE_QWT" = 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 ])
 AM_CONDITIONAL(HAS_VIEWER,    [test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_QWT" = yes])
 
@@ -465,14 +465,7 @@
 AC_MSG_NOTICE(--------------------------------------------------------------------)
 AC_MSG_NOTICE()
-#AM_COND_IF(HAS_FITS_H, [
-   AM_COND_IF(HAS_ZLIB,, 
-      AC_MSG_WARN([ zlib not found. Support for reading .fits.gz disabled.])
-   )
-#   AM_COND_IF(HAS_IZSTREAM_H,, 
-#      AC_MSG_WARN([ Mars izstream.h not found in gui/RawEventsViewer. Support for .fits.gz disabled.])
-#   )
-#], 
-#   AC_MSG_WARN([ Mars fits.h not found in gui/RawEventsViewer. Target 'viewer' disabled.])
-#)
+AM_COND_IF(HAS_ZLIB,, 
+   AC_MSG_WARN([ zlib not found. Support for reading .fits.gz disabled.])
+)
 AM_COND_IF(HAS_LIBXP,, 
    AC_MSG_WARN([ Motif/lesstif not found. The dim gui did will not be built!])
@@ -486,13 +479,14 @@
    )]
 )
-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 - GUIs disabled!]))
+AM_COND_IF(HAS_GL,,  AC_MSG_WARN([ GL not found - GUIs will be disabled.]))
+AM_COND_IF(HAS_GLU,, AC_MSG_WARN([ GLU not found - GUIs will be disabled.]))
+AM_COND_IF(HAS_QGL,, AC_MSG_WARN([ QtOpenGl not found - GUIs will be disabled.]))
 AM_COND_IF(HAS_QWT,, AC_MSG_WARN([ Qwt 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: fact GUI disabled!])
-)
-AC_MSG_NOTICE()
+      AC_MSG_WARN([ Either of the necessary packages not found - fact GUI disabled!])
+)
+AM_COND_IF(HAS_VIEWER, [], 
+      AC_MSG_WARN([ Either of the necessary packages not found - viewer GUI disabled!])
+)
+AC_MSG_NOTICE()
