]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/configure.ac
Double check if SM is running added. Some redundant output removed from SM
[u/mrichter/AliRoot.git] / HLT / configure.ac
index 6833bb85131043b8695363717eeb9f66ae69efce..7f33fa07faa7f33d869c75251b5c347cfddd1d6a 100644 (file)
@@ -4,8 +4,19 @@ dnl $Id$
 dnl template for the configuration script for the Alice HLT 
 dnl framework and components
 dnl 
+dnl Note: the autoconf build system is deprecated and not maintained
+dnl since AliRoot was converted to cmake
+dnl 2013-03-06: most of checks for AliRoot features have been removed
+dnl in order to run the existing doxygen setup until this has been
+dnl converted to cmake as well
+dnl
 dnl ------------------------------------------------------------------
-AC_INIT([Alice High Level Trigger] , [0.5-dev], [Matthias.Richter@ift.uib.no], alice-hlt)
+
+dnl Take either the AliRoot tag as version id or the current revision
+AC_INIT([Alice High Level Trigger] , 
+       [doc],
+       [Matthias.Richter@ift.uib.no], 
+       [alice-hlt])
 
 dnl ------------------------------------------------------------------
 dnl the package from CVS contains the old Makefiles as well. In order to
@@ -19,13 +30,21 @@ dnl ------------------------------------------------------------------
 AC_CANONICAL_SYSTEM
 AC_PREFIX_DEFAULT(${PWD})
 AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([-Wno-portability])
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_LIBTOOL
 
 AC_DEBUG
+AC_PROFILING
 AC_OPTIMIZATION
+AM_CONDITIONAL(STANDALONE_SAMPLELIB, test 0 )
+
+dnl ------------------------------------------------------------------
+dnl A warning posted into the auto-generated files
+dnl Does NOT concern this file ;-)
+AUTOGENERATED_WARNING="!!!!!!!    DO NOT EDIT THIS FILE !!!!!!"
+AC_SUBST([AUTOGENERATED_WARNING])
 
 dnl ------------------------------------------------------------------
 dnl
@@ -33,6 +52,49 @@ dnl Check for ROOT
 dnl
 ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
 AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
+AC_SUBST([ROOTSYS])
+ROOTBINDIR=`dirname $ROOTEXEC`
+AC_SUBST([ROOTBINDIR])
+
+dnl test for additional required root libraries and headers
+LIBS='-ldl'
+if test "x$have_root" = "x1"; then
+  AC_LANG_PUSH(C++)
+  save_CPPFLAGS=$CPPFLAGS
+  save_LDFLAGS=$LDFLAGS
+  save_LIBS=$LIBS
+  CPPFLAGS=`echo $save_CPPFLAGS; for i in ${ROOTINCDIR}; do echo -n "-I$i " ; done`
+  
+  # we check for the libSTEER library which is linked to
+  # - the ROOT libs libGeom libMinuit libVMC libEG
+  # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
+  # - ROOT libCint needs also libdl
+  # - from Nov 1 2006 TTreeFormula is needed by AliTagAnalysis and requires
+  #   libTreePlayer.so
+  # - from Jan 07 libESD also depends on libXMLIO
+  # - libSTEER depends on libProofPlayer since Oct 2007 (after v4-07-Release)
+  # - libCDB.so depends on libXMLParser since Mar 11 2009 r 31411
+  # - libCDB.so depends on libGui.so since May 14 2010 r 41238
+  ROOT_CHECKLIBS='Geom Minuit EG VMC TreePlayer XMLIO Thread Proof ProofPlayer XMLParser Gui'
+  for CHECKLIB in $ROOT_CHECKLIBS ; do
+    LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR}"
+    LIBS="$save_LIBS $ROOTLIBS $ADD_ROOTLIBS"
+    AC_CHECK_LIB([$CHECKLIB],[_init], [ADD_ROOTLIBS="$ADD_ROOTLIBS -l$CHECKLIB"])
+  done
+
+  # TBuffer.h has been made pure virtual in root v5-15-02 and one
+  # has to derive from TBufferFile.h (needed for BASE/AliHLTMessage.h)
+  AC_CHECK_HEADER([TBufferFile.h], [], [HAVE_NOT_TBUFFERFILE])
+
+  # TView.h has been made pure virtual right after root v5-15-02 and one
+  # has to derive from TView3D.h (needed for TPCLib/OnlineDisplay/AliHLTTPCDisplay3D)
+  AC_CHECK_HEADER([TView3D.h], [], [HAVE_NOT_TVIEW3D])
+
+  CPPFLAGS=$save_CPPFLAGS
+  LDFLAGS=$save_LDFLAGS
+  LIBS=$save_LIBS
+  AC_LANG_POP(C++)
+fi
 
 dnl ------------------------------------------------------------------
 # TODO: make this configurable through arguments
@@ -44,6 +106,9 @@ ALIHLT_USEPACKAGE=ALIROOT
 AC_DEFINE(use_aliroot)
 AC_DEFINE(use_root)
 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
 
 dnl ------------------------------------------------------------------
 dnl check for AliRoot features
@@ -79,127 +144,211 @@ if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
     fi
     ALICE_TARGET=$alice_target
   fi
+  ALIROOTBINDIR=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}
   ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
   ALIROOTINCDIR=${ALICE_ROOT}/include
+  test -d ${ALIROOTBINDIR} || AC_MSG_WARN([can not find AliRoot binary directory $ALIROOTBINDIR])
   test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
   test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
 fi
 
 AC_MSG_CHECKING([for AliRoot])
 if test "x$ALICE_ROOT" != "x" \
+   && test -d ${ALIROOTBINDIR} \
    && test -d ${ALIROOTLIBDIR} \
    && test -d ${ALIROOTINCDIR}; then
   have_aliroot=$ALICE_ROOT
 else
+  ALIROOTBINDIR=
   ALIROOTLIBDIR=
   ALIROOTINCDIR=
 fi
 AC_MSG_RESULT([$have_aliroot])
 
-if test ! "x$have_aliroot" = "xno" ; then
-  # we check for the libSTEER library which is linked to
-  # - the ROOT libs libGeom libMinuit libVMC libEG
-  # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
-  # - ROOT libCint needs also libdl
-  ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
-  ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
-  ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl"
-  save_CPPFLAGS=$CPPFLAGS
-  save_LDFLAGS=$LDFLAGS
-  save_LIBS=$LIBS
-  CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
-  LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
-  
-  # check for certain AliRoot libraries/files/features
-  # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
-  LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
-  CHECKLIB=CDB
-  AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
-
-  # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
-  have_alirawdata=no
-  LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
-  CHECKLIB=RAWDatabase
-  AC_CHECK_LIB([$CHECKLIB],[_init],
-       [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
-        LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
-        CHECKLIB=RAWDatarec
-        AC_CHECK_LIB([$CHECKLIB],[_init],
-               [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
-               AC_DEFINE(HAVE_ALIRAWDATA)
-               have_alirawdata=$CHECKLIB])],
-       [# second pass with -RAWData
-        CHECKLIB="-lRAWData"
-        LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
-        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
-                                      #include <AliRawReaderFile.h>
-                                      #include <AliRawReaderDate.h>
-                                      #include <AliRawReaderRoot.h>], 
-                                     [AliRawReaderMemory mreader;
-                                      AliRawReaderFile freader;
-                                      AliRawReaderDate dreader(NULL,0);
-                                      AliRawReaderRoot rreader(NULL,0);])],
-                                     [AC_DEFINE(HAVE_ALIRAWDATA)
-                                      ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
-                                      have_alirawdata=$CHECKLIB], 
-                                     [have_alirawdata=no])
-       ]) dnl AC_CHECK_LIB RAWDatabase
-  AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
-  AC_MSG_RESULT($have_alirawdata)
-
-  LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
-  CHECKLIB=STEER
-  AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
+AC_LANG_POP(C++)
+AC_SUBST([ALICE_ROOT])
+AC_SUBST([ALIROOT_CPPFLAGS])
+AC_SUBST([ALIROOT_LDFLAGS])
+AC_SUBST([ALIROOTBINDIR])
+AC_SUBST([ALIROOTLIBDIR])
 
-  if test ! "x$have_aliroot" = "xno" ; then
-    # the HLTTPCLib needs to link agains TPCbase and TPCrec
-    # TPC library for AliTPCParam and AliSimDigits used in 
-    # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
-    saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
-    ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
-    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
-    have_alitpc=yes
-    AC_MSG_CHECKING(for required classes in TPC libraries)
-    if test ! "x$have_alitpc" = "xno" ; then
-      save_ALIROOT_LIBS=$ALIROOT_LIBS
-      ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
-      LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
-                                      #include <AliTPCParam.h>
-                                      #include <AliTPCParamSR.h>
-                                      #include <AliTPCDigitsArray.h>
-                                      #include <AliTPCClustersArray.h>
-                                      #include <AliTPCcluster.h>     
-                                      #include <AliTPCClustersRow.h>], 
-                                      [AliSimDigits dig;
-                                      AliTPCParam param;
-                                      AliTPCParamSR paramsr;
-                                      AliTPCDigitsArray digarray;
-                                      AliTPCClustersArray clustarray;
-                                      AliTPCcluster clust;
-                                      AliTPCClustersRow row])],
-                                      [AC_DEFINE(HAVE_ALITPC)
-                                      saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
-                                      saveALIROOT_LIBS=$ALIROOT_LIBS], 
-                                     [have_alitpc=no
-                                      ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
-                                      ALIROOT_LIBS=$saveALIROOT_LIBS])
-    fi
-    AC_MSG_RESULT($have_alitpc)
-  fi
+ALIROOT_LIBS="$ALIROOT_LIBS $ADD_ROOTLIBS"
+AC_SUBST([ALIROOT_LIBS])
+AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
+
+HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
+HLTBASE_LDFLAGS=
+AC_SUBST([HLTBASE_CPPFLAGS])
+AC_SUBST([HLTBASE_LDFLAGS])
+
+dnl ------------------------------------------------------------------
+AC_ARG_ENABLE(all,
+  [AC_HELP_STRING([--disable-all],
+      [disable all detector modules, individual modules can be switched on by --enable-det])],
+  [disable_all=yes],[])
+
+dnl ------------------------------------------------------------------
+AC_MSG_CHECKING([whether to impose strict coding conventions])
+AC_ARG_ENABLE(strict,
+  [AC_HELP_STRING([--disable-strict],
+      [disable coding convention checks ])],
+  [],[enable_strict=yes])
+if test "x$enable_strict" = "xyes" ; then
+   CPPFLAGS="$CPPFLAGS -W -Weffc++ -Wall -Wshadow"
+fi
+AC_MSG_RESULT([$enable_strict])
+
+dnl ------------------------------------------------------------------
+AC_MSG_CHECKING([whether to enable component statistics])
+AC_ARG_ENABLE(component-stat,
+  [AC_HELP_STRING([--enable-component-stat],
+      [enable component statistics ])],
+  [],[])
+
+dnl enable component statistics if not explicitely disabled
+if test "x$enable_component_stat" != "xno" &&
+   test "x$enable_debug" = "xyes" ; then
+   enable_component_stat=yes.debug
+fi
+
+if test "x$enable_component_stat" = "x" ; then
+   enable_component_stat=no
+fi
+
+if test "x$enable_component_stat" != "xno" ; then
+   AC_DEFINE(HLT_COMPONENT_STATISTICS)
+fi
+AC_MSG_RESULT([$enable_component_stat])
+
+dnl ------------------------------------------------------------------
+dnl ----  module checks
+dnl ------------------------------------------------------------------
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+dnl ------------------------------------------------------------------
+AC_MSG_NOTICE([-------------------------------------------------])
+AC_MSG_NOTICE([checking dependencies for HLTbase library])
+HLTBASE_CHECKLIBS='XMLParser'
+for CHECKLIB in $HLTBASE_CHECKLIBS ; do
+  LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR}"
+  LIBS="$save_LIBS $ROOTLIBS $ALIHLTBASE_LIBS"
+  AC_CHECK_LIB([$CHECKLIB],[_init], [ALIHLTBASE_LIBS="$ALIHLTBASE_LIBS -l$CHECKLIB"])
+done
+AC_SUBST([ALIHLTBASE_LIBS])
+
+dnl ------------------------------------------------------------------
+AC_MSG_CHECKING([whether to compile sample library])
+AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
+AC_ARG_ENABLE(sample,
+  [AC_HELP_STRING([--disable-sample],
+      [compile the sample library ])],
+  [],
+  [if test "x$have_aliroot" = "xno" ; then
+     enable_sample="no...requires.AliRoot"
+   else
+     enable_sample=yes
+   fi
+  ])
+
+if test "x$enable_sample" = "xyes" ; then 
+  AC_DEFINE(HLT_SAMPLE)
+fi
+AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
+AC_MSG_RESULT([$enable_sample])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_UTIL],[HLT utility library])
+ALIUTIL_LIBS=
+CHECK_HLTMODULE([util],
+               [], 
+               [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...missing.headers"
+  enable_util=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_util="yes"
+else
+  enable_util=$enable_module
+fi
+if test "x$enable_util" = "xyes" ; then 
+  AC_DEFINE(HLT_UTIL)
+  ALIUTIL_LIBS=$ALIHLTMODULE_LIBS
+fi
+AM_CONDITIONAL(EN_HLT_UTIL, test x$enable_util = xyes)
+AC_MSG_CHECKING([whether to compile Util library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIUTIL_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_TPC],[hlt tpc library])
+
+ALITPC_LIBS=
+CHECK_HLTMODULE([tpc],
+               [], 
+               [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...missing.headers"
+  enable_tpc=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_tpc="yes"
+else
+  enable_tpc=$enable_module
+fi
+
+if test "x$enable_tpc" = "xyes" ; then 
+  AC_LANG_PUSH(C++)
+  AC_DEFINE(HLT_TPC)
+  ALITPC_LIBS=$ALIHLTMODULE_LIBS
+  dnl
+  dnl Check for functionality in the TPC reconstruction required for online
+  dnl processing
+  dnl 
+  have_tpc_hltoffline_rec=no
+  AC_MSG_CHECKING(for on-line features of TPC offline reconstruction)
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
+    LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
+    LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliTPCtrackerMI.h>
+                                      #include <AliTPCclustererMI.h>   
+                                      #include <TObjArray.h>], 
+                                    [AliTPCtrackerMI tracker;
+                                      TObjArray* array=NULL;
+                                      tracker.LoadClusters(array);
+                                      AliTPCclustererMI cl(NULL, NULL);
+                                      cl.GetOutputClonesArray();])],
+                                    [have_tpc_hltoffline_rec=yes], 
+                                     [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)])
+  AC_MSG_RESULT([$have_tpc_hltoffline_rec])
+
+    have_alitpcclusterparam_r40128=no
+    AC_MSG_CHECKING([checking for AliTPCClusterParam r40128])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTPCClusterParam.h>], 
+                                       [AliTPCClusterParam param;
+                                         float test=param.ParamS0Par(0,0,0)]);],
+                                       [have_alitpcclusterparam_r40128=yes],
+                                        [AC_DEFINE(HAVE_NOT_ALITPCCLUSTERPARAM_r40128)])
+    AC_MSG_RESULT([$have_alitpcclusterparam_r40128])
+
+    LIBS=$save_LIBS
 
-  if test ! "x$have_alirawdata" = "xno" ; then
-    # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
-    # the header file has been moved to the TPC module
-    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
-    # AliRawReaderMemory.h AliRawReaderFile.h already checked
-    #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
-    AC_CHECK_HEADERS([AliTPCRawStream.h])
-  fi
+
+  AC_CHECK_HEADER([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)])
+  AC_CHECK_HEADER([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)])
+  AC_CHECK_HEADER([AliAltroRawStreamV3.h], [], [AC_DEFINE(HAVE_NOT_ALTRORAWSTREAMV3)])
 
   have_tpc_mapping=no
   if test ! "x$have_aliroot" = "xno" ; then
-    # the TPCLib/AliHLTTPCRawReader needs the actual Pad layot of the TPC 
+    # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC 
     # which is stored in the TPC/mapping/Patchx.data files from
     # AliRoot version v4-04-Release (May 2006)
     AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
@@ -212,125 +361,519 @@ if test ! "x$have_aliroot" = "xno" ; then
     
   fi
   AC_MSG_CHECKING([for TPC mapping layout])
-  AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
   AC_MSG_RESULT([$have_tpc_mapping])
+  AC_LANG_POP(C++)
+
+else
+  enable_module=$enable_tpc
+fi
+AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
+AC_MSG_CHECKING([whether to compile TPC library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALITPC_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_RCU],[hlt rcu library])
+
+CHECK_HLTMODULE([rcu],
+               [], 
+               [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...missing.headers"
+  enable_rcu=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_rcu="yes"
+else
+  enable_rcu=$enable_module
+fi
+
+if test "x$enable_rcu" = "xyes" ; then 
+  AC_DEFINE(HLT_RCU)
+else
+  enable_module=$enable_rcu
+fi
+AM_CONDITIONAL(EN_HLT_RCU, test x$enable_rcu = xyes)
+AC_MSG_CHECKING([whether to compile RCU library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIRCU_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_CALO],[hlt calo(rimeter) library])
   
-  if test "x$have_aliroot" = "xno" ; then
-    ALIROOT_CPPFLAGS=
-    ALIROOT_LDFLAGS=
-    ALIROOT_LIBS=
-  fi
-  CPPFLAGS=$save_CPPFLAGS
-  LDFLAGS=$save_LDFLAGS
-  LIBS=$save_LIBS
-  if test ! "x$have_aliroot" = "xno" ; then
-    CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
-  fi
+ALICALO_LIBS=
+CHECK_HLTMODULE([calo],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...missing.headers"
+  enable_calo=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_calo="yes"
+else
+    enable_calo=$enable_module
 fi
-AC_LANG_POP(C++)
-AC_SUBST([ALIROOT_CPPFLAGS])
-AC_SUBST([ALIROOT_LDFLAGS])
-AC_SUBST([ALIROOT_LIBS])
-CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
+
+if test "x$enable_calo" = "xyes" ; then 
+  AC_DEFINE(HLT_CALO)
+  ALICALO_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_calo
+fi
+AM_CONDITIONAL(EN_HLT_CALO, test x$enable_calo = xyes)
+AC_MSG_CHECKING([whether to compile CALO library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALICALO_LIBS])
 
 dnl ------------------------------------------------------------------
-dnl check for the HLT PubSub Framework
-AC_MSG_CHECKING([for HLT PubSub Framework])
-AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
-                   [],
-                   [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
-if test -z $with_pubsub || ! test -d $with_pubsub ; then
-  with_pubsub=no
+AH_TEMPLATE([HLT_PHOS],[hlt phos library])
+  
+ALIPHOS_LIBS=
+CHECK_HLTMODULE([phos],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...requires.AliRoot>v4-05-07"
+  enable_phos=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_phos="yes"
+else
+    enable_phos=$enable_module
 fi
-AC_MSG_RESULT([$with_pubsub])
 
-AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
-if test "x$with_pubsub" != "xno" ; then
-  save_CPPFLAGS=$CPPFLAGS
-  save_LDFLAGS=$LDFLAGS
-  save_LIBS=$LIBS
-  # currently the different versions of the HLT PubSub framework have a different
-  # directory layout
-  if test -d ${with_pubsub}/include/HOMER ; then
-    HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER -I${with_pubsub}/include/HOMER/reader"
-  else
-    HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
-  fi
-  HOMER_LDFLAGS="-L${with_pubsub}/lib/`uname -s`-`uname -m`"
-  CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
-  LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
-  LIBS="$save_LIBS "
-  with_homer=no
+if test "x$enable_phos" = "xyes" ; then 
+  AC_DEFINE(HLT_PHOS)
+  ALIPHOS_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_phos
+fi
+AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
+AC_MSG_CHECKING([whether to compile PHOS library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIPHOS_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_EMCAL],[hlt emcal library])
+
+ALIEMCAL_LIBS=
+CHECK_HLTMODULE([emcal],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_emcal=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_emcal="yes"
+else
+  enable_emcal=$enable_module
+fi
+
+if test "x$enable_emcal" = "xyes" ; then 
+  AC_DEFINE(HLT_EMCAL)
+  ALIEMCAL_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_emcal
+fi
+AM_CONDITIONAL(EN_HLT_EMCAL, test x$enable_emcal = xyes)
+AC_MSG_CHECKING([whether to compile EMCAL library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIEMCAL_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_TRD],[hlt trd library])
+  
+ALITRD_LIBS=
+CHECK_HLTMODULE([trd],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...requires.AliRoot>v4-07-Release"
+  enable_trd=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_trd="yes"
+else
+  enable_trd=$enable_module
+fi
+
+if test "x$enable_trd" = "xyes" ; then 
+  AC_DEFINE(HLT_TRD)
+  ALITRD_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_trd
+fi
+AM_CONDITIONAL(EN_HLT_TRD, test x$enable_trd = xyes)
+AC_MSG_CHECKING([whether to compile TRD library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALITRD_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_FMD],[hlt fmd library])
+
+ALIFMD_LIBS=$ALIHLTMODULE_LIBS
+CHECK_HLTMODULE([fmd],
+               [], [],
+               [], [], [],
+               [], [],
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...missing.headers"
+  enable_fmd=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_fmd="yes"
+else
+  enable_fmd=$enable_module
+fi
+
+if test "x$enable_fmd" = "xyes" ; then
+  AC_DEFINE(HLT_FMD)
+  ALIFMD_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_fmd
+fi
+AM_CONDITIONAL(EN_HLT_FMD, test x$enable_fmd = xyes)
+AC_MSG_CHECKING([whether to compile FMD library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIFMD_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_ZDC],[hlt zdc library])
+
+ALIZDC_LIBS=$ALIHLTMODULE_LIBS
+CHECK_HLTMODULE([zdc],
+               [], [],
+               [], [], [],
+               [], [],
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...missing.headers"
+  enable_zdc=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_zdc="yes"
+else
+  enable_zdc=$enable_module
+fi
+
+if test "x$enable_zdc" = "xyes" ; then
+  AC_DEFINE(HLT_ZDC)
+  ALIZDC_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_zdc
+fi
+AM_CONDITIONAL(EN_HLT_ZDC, test x$enable_zdc = xyes)
+AC_MSG_CHECKING([whether to compile ZDC library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIZDC_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_MUON],[hlt dimuon library])
+
+ALIMUON_LIBS=
+CHECK_HLTMODULE([dimuon],
+               [], 
+               [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...requires.AliRoot>=v4-08-Release"
+  enable_muon=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_muon="yes"
+else
+  enable_muon=$enable_module
+fi
+
+if test "x$enable_muon" = "xyes" ; then 
+  AC_DEFINE(HLT_MUON)
+  ALIMUON_LIBS=$ALIHLTMODULE_LIBS
   AC_LANG_PUSH(C++)
-  AC_CHECK_HEADER([HOMERReader.h],
-    [ AC_CHECK_LIB([HOMERReader],[_init],[with_homer=yes])])
+  save_CPPFLAGS="$CPPFLAGS"
+
+  dnl
+  dnl Check for functionality GetRawStream AliMUONDigitMaker.h
+  dnl 
+  have_muon_digitmaker_getrawstream=no
+  AC_MSG_CHECKING(for GetRawStream methods of AliMUONDigitMaker)
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON"
+    LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
+    LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMUONDigitMaker.h>], 
+                                    [AliMUONDigitMaker dm;
+                                      dm.GetRawStreamTracker();])],
+                                    [have_muon_digitmaker_getrawstream=yes], 
+                                     [AC_DEFINE(HAVE_NOT_MUON_DIGITMAKER_GETRAWSTREAM)])
+    LIBS=$save_LIBS
+  AC_MSG_RESULT([$have_muon_digitmaker_getrawstream])
+
+  dnl
+  dnl Check for AliMpPad::GetPositionX/Y
+  dnl change of implementation in MUON code
+  dnl revision 31769, Wed Apr 1 2009
+  dnl 
+  have_muon_alimppad_getposition=no
+  AC_MSG_CHECKING(for GetPosition methods of AliMpPad)
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON/mapping"
+    LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
+    LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMpPad.h>], 
+                                    [AliMpPad pad;
+                                    pad.GetPositionX();])],
+                                    [have_muon_alimppad_getposition=yes], 
+                                     [AC_DEFINE(HAVE_NOT_MUON_ALIMPPAD_GETPOSITION)])
+    LIBS=$save_LIBS
+  AC_MSG_RESULT([$have_muon_alimppad_getposition])
+
+  CPPFLAGS="$save_CPPFLAGS"
+
   AC_LANG_POP(C++)
-  if test "x$with_homer" = "xno" ; then
-    HOMER_CPPFLAGS=
-    HOMER_LDFLAGS=
-  else
-    AC_DEFINE(HAVE_HOMERREADER)
+else
+  enable_module=$enable_muon
+fi
+AM_CONDITIONAL(EN_HLT_MUON, test x$enable_muon = xyes)
+AC_MSG_CHECKING([whether to compile MUON library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIMUON_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_TRIGGER],[hlt trigger library])
+
+ALITRIGGER_LIBS=
+CHECK_HLTMODULE([trigger],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_trigger=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_trigger="yes"
+else
+  enable_trigger=$enable_module
+fi
+
+if test "x$enable_trigger" = "xyes" ; then 
+  AC_DEFINE(HLT_TRIGGER)
+  ALITRIGGER_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_trigger
+fi
+AM_CONDITIONAL(EN_HLT_TRIGGER, test x$enable_trigger = xyes)
+AC_MSG_CHECKING([whether to compile Trigger library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALITRIGGER_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_GLOBAL],[hlt global library])
+
+ALIGLOBAL_LIBS=
+CHECK_HLTMODULE([global],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_global=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_global="yes"
+else
+  enable_global=$enable_module
+fi
+
+if test "x$enable_global" = "xyes" ; then 
+  AC_DEFINE(HLT_GLOBAL)
+  ALIGLOBAL_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_global
+fi
+AM_CONDITIONAL(EN_HLT_GLOBAL, test x$enable_global = xyes)
+AC_MSG_CHECKING([whether to compile Global library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIGLOBAL_LIBS])
+
+dnl ------------------------------------------------------------------
+AH_TEMPLATE([HLT_JET],[hlt jet library])
+
+ALIFASTJET_HEADER=
+ALIFASTJET_INCFLAGS=
+ALIFASTJET_LIBS=
+ALIFASTJET_LDFLAGS=
+AC_ARG_WITH(fastjet, [installation path of the FASTJET package],
+                    [ test "x$with_fastjet" != "xno" && export FASTJET=$with_fastjet],
+                    [ test -n $FASTJET && with_fastjet=$FASTJET ])
+
+if test "x$with_fastjet" != "x" && test "x$with_fastjet" != "xno" ; then
+  ALIFASTJET_INCFLAGS="-I${with_fastjet}/include"
+  ALIFASTJET_HEADER="fastjet/PseudoJet.hh"
+  ALIFASTJET_LDFLAGS="-L${with_fastjet}/lib"
+  ALIFASTJET_LIBS="CGAL fastjet"
+else
+  with_fastjet=no
+fi
+
+CHECK_HLTMODULE([jet],
+       [], [],
+       [], [], [],
+       [], 
+       [],
+       [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_jet=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_jet="yes"
+else
+  enable_jet=$enable_module
+fi
+
+if test "x$enable_jet" = "xyes" ; then
+  AC_DEFINE(HLT_JET)
+  ALIJET_LIBS="$ALIHLTMODULE_LIBS"
+  
+  if test "x$with_fastjet" != "xno"; then
+     AC_DEFINE(HAVE_FASTJET)
+     AC_DEFINE(WITHFASTJET)
+     ALIJET_LIBS="$ALIJET_LIBS $FASTJET_LDFLAGS"
   fi
-  CPPFLAGS="$save_CPPFLAGS"
-  LDFLAGS="$save_LDFLAGS"
-  LIBS="$save_LIBS"  
+  AC_MSG_CHECKING([compilation with FASTJET package])
+  AC_MSG_RESULT($with_fastjet)
+
+else
+  enable_module=$enable_jet
 fi
-AC_SUBST([HOMER_CPPFLAGS])
-AC_SUBST([HOMER_LDFLAGS])
+
+AM_CONDITIONAL(EN_HLT_JET, test x$enable_jet = xyes)
+AC_MSG_CHECKING([whether to compile Jet library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIJET_LIBS])
 
 dnl ------------------------------------------------------------------
-AC_MSG_CHECKING([whether to impose strict coding conventions])
-AC_ARG_ENABLE(strict,
-  [AC_HELP_STRING([--enable-strict],
-      [enable coding convention checks ])],
-  [],[enable_strict=no])
-if test "x$enable_strict" = "xyes" ; then
-   CPPFLAGS="$CPPFLAGS -Weffc++"
+AH_TEMPLATE([HLT_VZERO],[hlt vzero library])
+
+ALIVZERO_LIBS=
+CHECK_HLTMODULE([vzero],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_vzero=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_vzero="yes"
+else
+  enable_vzero=$enable_module
 fi
-AC_MSG_RESULT([$enable_strict])
+
+if test "x$enable_vzero" = "xyes" ; then 
+  AC_DEFINE(HLT_VZERO)
+  ALIVZERO_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_vzero
+fi
+AM_CONDITIONAL(EN_HLT_VZERO, test x$enable_vzero = xyes)
+AC_MSG_CHECKING([whether to compile VZERO library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIVZERO_LIBS])
 
 dnl ------------------------------------------------------------------
-AC_MSG_CHECKING([whether to compile sample library])
-AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
-AC_ARG_ENABLE(sample,
-  [AC_HELP_STRING([--enable-sample],
-      [compile the sample library ])],
-  [],[enable_sample=yes])
-if test "x$enable_sample" = "xyes" ; then 
-  AC_DEFINE(HLT_SAMPLE)
+AH_TEMPLATE([HLT_ITS],[hlt its library])
+
+ALIITS_LIBS=
+CHECK_HLTMODULE([its],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_its=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_its="yes"
+else
+  enable_its=$enable_module
 fi
-AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
-AC_MSG_RESULT([$enable_sample])
+
+if test "x$enable_its" = "xyes" ; then 
+  AC_DEFINE(HLT_ITS)
+  ALIITS_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_its
+fi
+AM_CONDITIONAL(EN_HLT_ITS, test x$enable_its = xyes)
+AC_MSG_CHECKING([whether to compile ITS library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALIITS_LIBS])
 
 dnl ------------------------------------------------------------------
-AC_MSG_CHECKING([whether to compile tpc library])
-AH_TEMPLATE([HLT_TPC],[hlt tpc library])
-AC_ARG_ENABLE(tpc,
-  [AC_HELP_STRING([--enable-tpc],
-      [compile the tpc library ])],
-  [],[enable_tpc=yes])
-if test "x$have_aliroot" = "xno" ; then
-   enable_tpc="no...requires.AliRoot"
-elif test "x$have_alitpc" = "xno" ; then
-   enable_tpc="no...requires.AliRoot.TPC.libraries"
+AH_TEMPLATE([HLT_COMP],[hlt comp library])
+
+ALICOMP_LIBS=
+CHECK_HLTMODULE([comp],
+               [], [],
+               [], [], [],
+               [], [], 
+               [])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_comp=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_comp="yes"
+else
+  enable_comp=$enable_module
 fi
-if test "x$enable_tpc" = "xyes" ; then 
-  AC_DEFINE(HLT_TPC)
+
+if test "x$enable_comp" = "xyes" ; then 
+  AC_DEFINE(HLT_COMP)
+  ALICOMP_LIBS=$ALIHLTMODULE_LIBS
+else
+  enable_module=$enable_comp
 fi
-AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
-AC_MSG_RESULT([$enable_tpc])
+AM_CONDITIONAL(EN_HLT_COMP, test x$enable_comp = xyes)
+AC_MSG_CHECKING([whether to compile comp library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALICOMP_LIBS])
 
 dnl ------------------------------------------------------------------
-AC_MSG_CHECKING([whether to enable HLT logging])
-AH_TEMPLATE([NOLOGGING],[disable hlt logging])
-AC_ARG_ENABLE(logging,
-  [AC_HELP_STRING([--enable-logging],
-      [enable logging])],
-  [],[enable_logging=yes])
-if test "x$enable_logging" != "xyes" ; then 
-  AC_DEFINE(NOLOGGING)
+AC_MSG_CHECKING([whether to disable AliRoot logging])
+AH_TEMPLATE([NOALIROOT_LOGGING],[disable AliRoot logging])
+AC_ARG_ENABLE(aliroot-logging,
+  [AC_HELP_STRING([--disable-aliroot-logging],
+      [disable logging through AliRoot logging methods])],
+  [],[enable_aliroot_logging=no])
+if test "x$have_aliroot" = "xno" ; then
+  enable_aliroot_logging=yes # this means 'disable'
+fi
+if test "x$enable_aliroot_logging" != "xno" ; then 
+  AC_DEFINE(NOALIROOT_LOGGING)
 fi
-AC_MSG_RESULT([$enable_logging])
+AM_CONDITIONAL(NOALIROOT_LOGGING, test x$enable_aliroot_logging != no)
+AC_MSG_RESULT([$enable_aliroot_logging])
 
 dnl ------------------------------------------------------------------
 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
@@ -344,18 +887,6 @@ if test "x$enable_mc_saving" = "xyes" ; then
 fi
 AC_MSG_RESULT([$enable_mc_saving])
 
-dnl ------------------------------------------------------------------
-AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
-AH_TEMPLATE([use_newio],[AliRoot NEWIO])
-AC_ARG_ENABLE(newio,
-  [AC_HELP_STRING([--enable-newio],
-      [enable AliRoot NEWIO ])],
-  [],[enable_newio=yes])
-if test "x$enable_newio" = "xyes" ; then 
-  AC_DEFINE(use_newio)
-fi
-AC_MSG_RESULT([$enable_newio])
-
 dnl ------------------------------------------------------------------
 dnl certainly something old, but we keep the define
 AC_MSG_CHECKING([whether to use ROWHOUGH])
@@ -369,6 +900,18 @@ if test "x$enable_rowhough" = "xyes" ; then
 fi
 AC_MSG_RESULT([$enable_rowhough])
 
+dnl ------------------------------------------------------------------
+dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
+dnl stand-alone build system. This is most likely something old we can
+dnl get rid off later, or do something more reasonable. Since the define
+dnl needs the quotes they have to be  escaped. This works well for the
+dnl Makefile but not for the configure script. So we have to add the
+dnl defines after all the other checks.
+CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
+if test ! "x$have_aliroot" = "xno" ; then
+  CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
+fi
+
 dnl ------------------------------------------------------------------
 dnl
 dnl Documentation
@@ -376,34 +919,179 @@ dnl
 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
 AC_PATH_PROG(PERL, perl)
 AC_PATH_PROG(DOXYGEN, doxygen)
-AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
+AC_ARG_ENABLE(dot,
+  [AC_HELP_STRING([--enable-dot],
+      [enable dot documentation generator])],
+  [],[enable_dot=no])
 HAVE_DOT=NO
 DOT_PATH=
 AC_PATH_PROG(DOT, dot)
-if ! test "x$DOT" = "x" ; then
+if test "x$DOT" != "x" && test "x$enable_dot" = "xyes" ; then
    HAVE_DOT=YES
    DOT_PATH=`dirname $DOT`
 fi
+
+AC_MSG_CHECKING([for documentation mode])
+AC_ARG_ENABLE(doc,
+  [AC_HELP_STRING([--disable-doc],
+      [disable documentation build; monolithic build --enable-doc=mono ])],
+  [],[enable_doc=modules])
+
+if test "x$DOXYGEN" = "x" ; then
+   enable_doc=no.doxygen
+elif test "x$enable_doc" = "xyes" ; then
+   enable_doc=yes
+elif test ! "x$enable_doc" = "xmono" && \
+     test ! "x$enable_doc" = "xmodules"  && \
+     test ! "x$enable_doc" = "xno"; then
+   enable_doc=no
+   AC_MSG_WARN([unknown option])
+fi
+if test "x$enable_doc" = "xno" ; then
+   enable_doc=off
+   DOXYGEN=
+fi
+
+AC_MSG_RESULT([$enable_doc])
+AM_CONDITIONAL(MONOLITHIC_DOC, test "x$enable_doc" = "xmono")
+AM_CONDITIONAL(BUILD_DOC, test ! "x$DOXYGEN" = "x")
 AC_SUBST([HAVE_DOT])
 AC_SUBST([DOT_PATH])
 
+dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
+dnl echo $HAVE_SRC_SUBDIR
+dnl if ! test -d $HAVE_SRC_SUBDIR; then
+dnl   HAVE_SRC_SUBDIR=
+dnl fi
+dnl AC_SUBST([HAVE_SRC_SUBDIR])
+
 dnl ------------------------------------------------------------------
-dnl inatallation directory for libraries
+AC_MSG_NOTICE([---------------------------------------------- ])
+AC_MSG_NOTICE([                build summary                  ])
+AC_MSG_NOTICE([---------------------------------------------- ])
+
+AC_CONFIG_FILES([Makefile 
+                BASE/Makefile
+                BASE/setenv.sh
+                BASE/setenv.csh
+                BASE/HOMER/Makefile
+                BASE/util/Makefile
+                BASE/util/test/Makefile
+                BASE/interface/Makefile
+                BASE/test/Makefile
+                BASE/interface/test/Makefile
+                doc/Makefile
+                doc/doxygen.conf
+                doc/doxymodule.conf])
+
+dnl AliRoot and installation directory for libraries
 dnl 
+AC_MSG_NOTICE([AliRoot: $have_aliroot])
+AM_CONDITIONAL(HAVE_ALIROOT, test "x$have_aliroot" != "xno" )
+if test "x$have_aliroot" != "xno"; then 
+  AC_CONFIG_FILES([sim/Makefile         
+                  rec/Makefile  
+                  rec/test/Makefile     
+                  rec/startAliEVE-barrel-tracks.sh
+                  shuttle/Makefile
+                  pendolino/Makefile
+                  benchmark/Makefile
+                  QA/Makefile
+                  ])
+fi
 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
 AC_MSG_NOTICE([libdir set to $libdir])
 fi
-dnl ------------------------------------------------------------------
-AC_CONFIG_FILES([Makefile 
-                BASE/Makefile
-                SampleLib/Makefile
-                TPCLib/Makefile
-                TPCLib/mapping2array.cxx
-                TPCLib/OnlineDisplay/Makefile
-                doc/Makefile
-                doc/doxygen.conf])
 
+AC_MSG_NOTICE([compile sample library: $enable_sample])
+if test "x$enable_sample" = "xyes"; then 
+  AC_CONFIG_FILES([SampleLib/Makefile])
+fi
+
+AC_MSG_NOTICE([compile RCU library: $enable_rcu])
+if test "x$enable_rcu" = "xyes"; then 
+  AC_CONFIG_FILES([RCU/Makefile
+                  RCU/test/Makefile
+                  ])
+fi
+
+AC_MSG_NOTICE([compile TPC library: $enable_tpc])
+if test "x$enable_tpc" = "xyes"; then 
+  AC_CONFIG_FILES([TPCLib/Makefile           
+                  TPCLib/test/Makefile       
+                  TPCLib/mapping2array.cxx     
+                  TPCLib/EVE/Makefile
+                  TPCLib/calibration/Makefile
+                  ])
+fi
+
+AC_MSG_NOTICE([compile CALO library: $enable_calo])
+if test "x$enable_calo" = "xyes"; then 
+  AC_CONFIG_FILES([CALO/Makefile
+                   CALO/test/Makefile])
+fi
+
+AC_MSG_NOTICE([compile PHOS library: $enable_phos])
+if test "x$enable_phos" = "xyes"; then 
+  AC_CONFIG_FILES([PHOS/Makefile])
+fi
+
+AC_MSG_NOTICE([compile EMCAL library: $enable_emcal])
+if test "x$enable_emcal" = "xyes"; then 
+  AC_CONFIG_FILES([EMCAL/Makefile])
+fi
+
+AC_MSG_NOTICE([compile TRD library: $enable_trd])
+if test "x$enable_trd" = "xyes"; then 
+  AC_CONFIG_FILES([TRD/Makefile])
+fi
+
+AC_MSG_NOTICE([compile FMD library: $enable_fmd])
+if test "x$enable_fmd" = "xyes"; then 
+  AC_CONFIG_FILES([FMD/Makefile])
+fi
+
+AC_MSG_NOTICE([compile ZDC library: $enable_zdc])
+if test "x$enable_zdc" = "xyes"; then 
+  AC_CONFIG_FILES([ZDC/Makefile])
+fi
+
+AC_MSG_NOTICE([compile MUON library: $enable_muon])
+if test "x$enable_muon" = "xyes"; then 
+  AC_CONFIG_FILES([MUON/Makefile])
+fi
+
+AC_MSG_NOTICE([compile ITS library: $enable_its])
+if test "x$enable_its" = "xyes"; then 
+  AC_CONFIG_FILES([ITS/Makefile])
+fi
+
+AC_MSG_NOTICE([compile trigger library: $enable_trigger])
+if test "x$enable_trigger" = "xyes"; then 
+  AC_CONFIG_FILES([trigger/Makefile
+                   trigger/test/Makefile])
+fi
+
+AC_MSG_NOTICE([compile global library: $enable_global])
+if test "x$enable_global" = "xyes"; then 
+  AC_CONFIG_FILES([global/Makefile])
+fi
+
+AC_MSG_NOTICE([compile jet library: $enable_jet])
+if test "x$enable_jet" = "xyes"; then 
+  AC_CONFIG_FILES([JET/Makefile])
+fi
+
+AC_MSG_NOTICE([compile vzero library: $enable_vzero])
+if test "x$enable_vzero" = "xyes"; then 
+  AC_CONFIG_FILES([VZERO/Makefile])
+fi
+
+AC_MSG_NOTICE([compile comp library: $enable_comp])
+if test "x$enable_comp" = "xyes"; then 
+  AC_CONFIG_FILES([comp/Makefile])
+fi
 
 AC_OUTPUT
 dnl