Index: /trunk/FACT++/configure.ac
===================================================================
--- /trunk/FACT++/configure.ac	(revision 10191)
+++ /trunk/FACT++/configure.ac	(revision 10192)
@@ -8,4 +8,5 @@
 AC_CONFIG_AUX_DIR([.aux_dir])
 AC_PROG_CC([colorgcc gcc])
+ #If output variable CXXFLAGS was not already set, set it to -g -O2
 AC_PROG_CXX([colorgcc g++])
 LT_INIT([disable-static])
@@ -20,21 +21,114 @@
 AM_PROG_CC_C_O
 
-
-DX_INIT_DOXYGEN([FACT++])#, DOXYFILE-PATH, [OUTPUT-DIR])
-#DX_DOXYGEN_FEATURE(ON)
-#DX_DOT_FEATURE(ON)
-#DX_HTML_FEATURE(ON)
-#DX_CHM_FEATURE(ON|OFF)
-#DX_CHI_FEATURE(ON|OFF)
-DX_MAN_FEATURE(ON)
-#DX_RTF_FEATURE(ON|OFF)
-#DX_XML_FEATURE(ON|OFF)
-#DX_PDF_FEATURE(ON|OFF)
-DX_PS_FEATURE(OFF)
+######################################################################
+# DOXYGEN SUPPORT
+######################################################################
+
+### FIXME: Need a configure commandline switch
 DX_ENV_APPEND(EXTRACT_ALL, YES)
 DX_ENV_APPEND(RECURSIVE,   YES)
 DX_ENV_APPEND(ALL_GRAPHS,  NO)  # change to yet to switch on call(er) graphs
 
+#DX_DOXYGEN_FEATURE(ON)
+#DX_DOT_FEATURE(ON)               # sets HAVE_DOT
+#DX_HTML_FEATURE(ON)              # sets GENERATE_HTML (default)
+#DX_CHM_FEATURE(ON|OFF)           # sets GENERATE_HTMLHELP
+#DX_CHI_FEATURE(ON|OFF)           # sets GENERATE_CHI
+#DX_MAN_FEATURE(ON)               # sets GENERATE_MAN (segfaults)
+#DX_RTF_FEATURE(ON|OFF)           # sets GENERATE_RTF
+#DX_XML_FEATURE(ON|OFF)           # sets GENERATE_XML
+#DX_PDF_FEATURE(ON|OFF)           # sets GENERATE_PDF (default)
+DX_PS_FEATURE(OFF)                # sets GENERATE_PS  (default)
+DX_INIT_DOXYGEN($PACKAGE_NAME)#, DOXYFILE-PATH, [OUTPUT-DIR])
+
 #USE_HTAGS              = $(USE_HTAGS)
+
+######################################################################
+# Readline/NCurses
+######################################################################
+
+AC_LANG_PUSH(C)
+
+AC_CHECK_LIB(readline, readline, [], 
+   [
+      echo "Error! libreadline not found in default libarary paths." 
+      exit -1
+   ]
+)
+AC_CHECK_HEADERS(readline/readline.h, [], 
+   [
+      echo "Error! readline/readline.h not properly installed in default include path (maybe readline-dev missing)." 
+      exit -1
+   ]
+)
+
+
+AC_CHECK_HEADERS(panel.h, [], 
+   [
+      echo "Error! Ncurses panel.h not properly installed in default include paths." 
+      exit -1
+   ]
+)
+AC_CHECK_LIB(panel, update_panels, [], 
+   [
+      echo "Error! Ncurses libpanel not properly installed in the default libarary paths." 
+      exit -1
+   ]
+)
+
+AC_LANG_POP
+
+######################################################################
+# pthread support
+######################################################################
+
+#AX_PTHREAD
+#
+#AC_CHECK_LIB(pthread,  pthread_create, 
+#   [], 
+#   [
+#      echo "Error! libpthread not found in default libarary paths." 
+#      exit -1
+#   ]
+#)
+#AC_CHECK_HEADERS(pthread.h, [], 
+#   [
+#      echo "Error! pthread.h not properly installed in default include paths." 
+#      exit -1
+#   ]
+#)
+
+######################################################################
+# Xm.h (lesstif/motif)
+######################################################################
+
+AC_LANG_PUSH(C)
+
+AC_CHECK_HEADERS([Mrm/MrmAppl.h Xm/Xm.h], [], 
+   [
+      echo "Error! Mrm/MrmAppl.h, Xm/Xm.h not properly installed, needed to compile did (you need most probably lesstif2-dev)." 
+      exit -1
+   ]
+)
+
+AC_CHECK_LIB(Xm, XtToolkitInitialize, [],
+   [
+      echo "Error! libXm (lesstif2) not properly installed in the default library path (needed by dim to link did)." 
+      exit -1
+   ]
+)
+
+AC_LANG_POP
+
+######################################################################
+# MySQL(++) SUPPORT
+######################################################################
+
+MYSQL_DEVEL
+MYSQLPP_DEVEL
+
+######################################################################
+# BOOST SUPPORT
+######################################################################
 
 AX_BOOST_BASE([1.42], [],
@@ -60,66 +154,4 @@
 #ax_boost_wave
 #ax_boost_wserialization
-
-
-AC_LANG_PUSH(C)
-
-AC_CHECK_LIB(pthread,  pthread_create, 
-   [], 
-   [
-      echo "Error! libpthread not found in default libarary paths." 
-      exit -1
-   ]
-)
-AC_CHECK_HEADERS(pthread.h, [], 
-   [
-      echo "Error! pthread.h not properly installed in default include paths." 
-      exit -1
-   ]
-)
-
-
-AC_CHECK_LIB(readline, readline, [], 
-   [
-      echo "Error! libreadline not found in default libarary paths." 
-      exit -1
-   ]
-)
-AC_CHECK_HEADERS(readline/readline.h, [], 
-   [
-      echo "Error! readline/readline.h not properly installed in default include path (maybe readline-dev missing)." 
-      exit -1
-   ]
-)
-
-
-AC_CHECK_HEADERS(panel.h, [], 
-   [
-      echo "Error! Ncurses panel.h not properly installed in default include paths." 
-      exit -1
-   ]
-)
-AC_CHECK_LIB(panel, update_panels, [], 
-   [
-      echo "Error! Ncurses libpanel not properly installed in the default libarary paths." 
-      exit -1
-   ]
-)
-
-
-AC_CHECK_HEADERS([Mrm/MrmAppl.h Xm/Xm.h], [], 
-   [
-      echo "Error! Mrm/MrmAppl.h, Xm/Xm.h not properly installed, needed to compile did (you need most probably lesstif2-dev)." 
-      exit -1
-   ]
-)
-
-AC_CHECK_LIB(Xm, XtToolkitInitialize, [],
-   [
-      echo "Error! libXm (lesstif2) not properly installed in the default library path (needed by dim to link did)." 
-      exit -1
-   ]
-)
-
-AC_LANG_POP()
 
 #AC_CHECK_HEADERS(
@@ -144,156 +176,29 @@
 #)
 
-#AC_ARG_WITH([dim],
-#   [
-#      AS_HELP_STRING([--with-dim],
-#         [location of the Dim headers, defaults to dim_v19r15])
-#   ],
-#   [DIM_PATH="$withval"],
-#   [DIM_PATH="dim_v19r15"]
-#)
-#
-#AC_SUBST([DIM_PATH])
-#
-#CFLAGS="$CFLAGS -I$DIM_PATH/dim"
-#CPPFLAGS="$CPPFLAGS -I$DIM_PATH/dim"
-#INCLUDEPATH="$INCLUDEPATH -I$DIM_PATH/dim"
-#AC_CHECK_HEADERS([dis.hxx dic.hxx], [], 
-#  [
-#      echo "Error! Dim headers (dis.hxx, dic.hxx) not found in $DIM_PATH/dim." 
-#      exit -1
-#   ]
-#)
-
-## ============>   boost header and boost libraries
-
-##########################################################################
-#AC_ARG_WITH([dim-include-path],
-#   [
-#      AS_HELP_STRING([--with-dim-include-path],
-#         [location of the Dim headers, defaults to ${HOME}/FACT/dim_v19r11/dim])
-#   ],
-#   [DIM_INCLUDE_PATH="$withval"],
-#   [DIM_INCLUDE_PATH="${HOME}/Software/Dim/dim_v19r11/dim"]
-#)
-#DIM_CFLAGS="-I$DIM_INCLUDE_PATH"
-##AC_SUBST([DIM_CFLAGS])
-#
-#CFLAGS="$CFLAGS $DIM_CFLAGS"
-#CPPFLAGS="$CPPFLAGS $DIM_CFLAGS"
-##INCLUDEPATH="$INCLUDEPATH $DIM_INCLUDE_PATH"
-#AC_CHECK_HEADERS([dis.hxx dic.hxx], [], 
-#   [
-#      echo "Error! Dim headers (dis.hxx, dic.hxx) not found in $DIM_INCLUDE_PATH." 
-#      exit -1
-#   ]
-#)
-##########################################################################
-
+######################################################################
+# ROOT SUPPORT
+######################################################################
+
+# ROOT_PATH([5.12/00, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]])
+# ROOT_PATH([5.12/00])
+# ROOT_PATH(3.03/05, , AC_MSG_ERROR(Your ROOT version is too old))
+# ROOT_PATH(, AC_DEFINE([HAVE_ROOT]))
+
+# ROOTCONF           full path to root-config
+# ROOTEXEC           full path to root
+# ROOTCINT           full path to rootcint
+# ROOTLIBDIR         Where the ROOT libraries are 
+# ROOTINCDIR         Where the ROOT headers are 
+# ROOTETCDIR         Where the ROOT configuration is
+# ROOTCFLAGS         Extra compiler flags
+# ROOTLIBS           ROOT basic libraries 
+# ROOTGLIBS          ROOT basic + GUI libraries
+# ROOTAUXLIBS        Auxilary libraries and linker flags for ROOT
+# ROOTAUXCFLAGS      Auxilary compiler flags 
+# ROOTRPATH          Same as ROOTLIBDIR
 
 
 ###########################################################################
-#AC_ARG_WITH([dim-lib-path],
-#  [
-#     AS_HELP_STRING([--with-dim-lib-path], 
-#        [location of the Dim libraries, defaults to ${HOME}/FACT/dim_v19r11/linux])
-#  ],
-#  [DIM_LIB_PATH="$withval"],
-#  [DIM_LIB_PATH="${HOME}/Software/Dim/dim_v19r11/linux"]
-#)
-#DIM_LIBS="-L$DIM_LIB_PATH -ldim"
-##AC_SUBST([DIM_LIBS])
-#
-#LDFLAGS="$LDFLAGS $DIM_LIBS"
-#AC_CHECK_LIB(dim, [get_dns_port_number], [], 
-#   [
-#      echo "Error! libdim.so file not found in $DIM_LIB_PATH." 
-#      exit -1
-#   ]
-#)
-###########################################################################
-
-
-
-# Get MySQL++ library and include locations
-#AC_ARG_WITH([mysqlpp-include-path],
-#   [
-#      AS_HELP_STRING([--with-mysqlpp-include-path],
-#         [location of the MySQL++ librarary headers, defaults to /usr/include/mysql++])
-#   ],
-#   [MYSQLPP_INCLUDE_PATH="$withval"],
-#   [MYSQLPP_INCLUDE_PATH=""]
-##)
-#MYSQLPP_CFLAGS="-I$MYSQLPP_INCLUDE_PATH"
-##AC_SUBST([DIM_CFLAGS])
-#
-#CFLAGS="$CFLAGS $MYSQLPP_CFLAGS"
-#CPPFLAGS="$CPPFLAGS $MYSQLPP_CFLAGS"
-##INCLUDEPATH="$INCLUDEPATH $DIM_INCLUDE_PATH"
-#AC_CHECK_HEADERS([mysql++/mysql++.h],
-#   [], 
-#   [
-#      echo "Error! mysql++/mysql++.h not found in default include path." 
-#      exit -1
-#   ]
-#)
-#### LAST ARGUMENT IS "OTHER LIBRARIES"
-
-
-
-#AC_ARG_WITH([mysql-lib-path],
-#  [
-#     AS_HELP_STRING([--with-mysql-lib-path], 
-#        [location of the MySQL library, defaults to /usr/lib])
-#  ],
-#  [MYSQL_LIB_PATH="$withval"],
-#  [MYSQL_LIB_PATH="/usr/lib"]
-#)
-#MYSQL_LIBS="-L$MYSQL_LIB_PATH -lmysql"
-##AC_SUBST([DIM_LIBS])
-#
-#LDFLAGS="$LDFLAGS $MYSQL_LIBS"
-#AC_CHECK_LIB(mysql, [mysql_errno],
-#   [], 
-#   [
-#      echo "Error! mysql libarary file not found in $MYSQL_LIB_PATH." 
-#      exit -1
-#   ]
-#)
-
-
-
-
-AC_ARG_WITH([mysqlpp-lib-path],
-  [
-     AS_HELP_STRING([--with-mysqlpp-lib-path], 
-        [location of the MySQL++ library, defaults to /usr/lib])
-  ],
-  [MYSQLPP_LIB_PATH="$withval"],
-  [MYSQLPP_LIB_PATH="/usr/lib"]
-)
-MYSQLPP_LIBS="-L$MYSQLPP_LIB_PATH -lmysqlpp"
-#AC_SUBST([DIM_LIBS])
-
-#LDFLAGS="$LDFLAGS $MYSQLPP_LIBS"
-#AC_CHECK_LIB(mysql++, [mysql_errno],
-#   [], 
-#   [
-#      echo "Error! mysql++ libarary file not found in $MYSQL_LIB_PATH." 
-#      exit -1
-#   ]
-#)
-
-
-
-
-
-#CPPFLAGS="$CPPFLAGS -std=c++0x"
-
-CPPFLAGS="$CPPFLAGS -I/usr/include/mysql"
-
-
-
-
-#AC_CHECK_HEADERS_ONCE(dim.h)
+
 
 #AC_C_CONST
@@ -301,3 +206,30 @@
 #AC_HEADER_STDC
 
+##########################################################################
+# debug compilation support
+##########################################################################
+#
+#AC_MSG_CHECKING([whether to build with debug information])
+#AC_ARG_ENABLE([debug],
+#    [AS_HELP_STRING([--enable-debug],
+#        [enable debug data generation (def=no)])],
+#    [debugit="$enableval"],
+#    [debugit=no])
+#AC_MSG_RESULT([$debugit])
+#
+#if test x"$debugit" = x"yes"; then
+#    AC_DEFINE([DEBUG],[],[Debug Mode])
+#    AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
+#else
+#    AC_DEFINE([NDEBUG],[],[No-debug Mode])
+#    AM_CXXFLAGS="$AM_CXXFLAGS -O3"
+#fi
+#
+###########################################################################
+#To get the changed compiler flags distributed among your final Makefiles you have to add the following line somewhere afterwards:
+#
+#AC_SUBST([AM_CXXFLAGS])
+
+
+
 AC_OUTPUT
