]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/configure.ac
provide OCDB URI as macro argument
[u/mrichter/AliRoot.git] / HLT / configure.ac
index 3cc452281962393ddfef63d24d82828e9952a71d..fa3a49ea336ff985b653e8dad48a80a7803a253c 100644 (file)
@@ -32,12 +32,13 @@ 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 )
 
@@ -74,7 +75,9 @@ if test "x$have_root" = "x1"; then
   #   libTreePlayer.so
   # - from Jan 07 libESD also depends on libXMLIO
   # - libSTEER depends on libProofPlayer since Oct 2007 (after v4-07-Release)
-  ROOT_CHECKLIBS='Geom Minuit EG VMC TreePlayer XMLIO Thread Proof ProofPlayer'
+  # - 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"
@@ -83,11 +86,11 @@ if test "x$have_root" = "x1"; then
 
   # 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_HEADERS([TBufferFile.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_HEADERS([TView3D.h])
+  AC_CHECK_HEADER([TView3D.h], [], [HAVE_NOT_TVIEW3D])
 
   CPPFLAGS=$save_CPPFLAGS
   LDFLAGS=$save_LDFLAGS
@@ -167,7 +170,7 @@ AC_MSG_RESULT([$have_aliroot])
 if test ! "x$have_aliroot" = "xno" ; then
   ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
   ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
-  ALIROOT_LIBS="-lESD $ADD_ROOTLIBS"
+  ALIROOT_LIBS="$ADD_ROOTLIBS"
   save_CPPFLAGS=$CPPFLAGS
   save_LDFLAGS=$LDFLAGS
   save_LIBS=$LIBS
@@ -176,6 +179,11 @@ if test ! "x$have_aliroot" = "xno" ; then
   
   # check for certain AliRoot libraries/files/features
   # libSTEERBase present since Aug 7 2007
+  # ###########################################
+  # temporary workaround for circular dependency libSTEERbase libSTEER          
+  # https://savannah.cern.ch/bugs/index.php?49914
+  # disable the sequence of checks and load libraries in parallel
+  ALIROOT_LIBS="$ALIROOT_LIBS -lAOD -lCDB -lRAWDatabase -lRAWDatarec -lESD -lSTEER"
   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
   CHECKLIB=STEERBase
   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
@@ -184,13 +192,18 @@ if test ! "x$have_aliroot" = "xno" ; then
   CHECKLIB=AOD
   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
 
+  # 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"
+        LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lESD -lSTEER"
         CHECKLIB=RAWDatarec
         AC_CHECK_LIB([$CHECKLIB],[_init],
                [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
@@ -213,9 +226,8 @@ if test ! "x$have_aliroot" = "xno" ; then
   AC_MSG_CHECKING([for AliRawReader classes in RAWData libraries])
   AC_MSG_RESULT([$have_alirawdata])
 
-  # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lSTEER"
-  CHECKLIB=CDB
+  CHECKLIB=ESD
   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
 
   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
@@ -224,15 +236,22 @@ if test ! "x$have_aliroot" = "xno" ; then
 
   dnl
   dnl check whether AliLog supports notification callback
+  dnl 2010-03-03: revision 38921 introduces AliLog::GetRootLogger in order to make AliLog
+  dnl a pure sigleton, introduce a 2-level check here
   dnl
   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
   have_alilog_notification=no
   if test ! "x$have_aliroot" = "xno" ; then
   AC_MSG_CHECKING([whether AliLog supports notification callback])
   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliLog.h>], 
-                                 [AliLog::AliLogNotification fct])],
-                                  [have_alilog_notification=yes], 
-                                 [AC_DEFINE(NO_ALILOG_NOTIFICATION)])
+                                 [AliLog* logger=AliLog::GetRootLogger();])],
+                                  [have_alilog_notification=yes],
+                                 [AC_DEFINE(NO_ALILOG_GETROOTLOGGER)
+                                 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliLog.h>], 
+                                                                 [AliLog::AliLogNotification fct])],
+                                                                 [have_alilog_notification=yes], 
+                                                                 [AC_DEFINE(NO_ALILOG_NOTIFICATION)])
+                                 ])
   AC_MSG_RESULT([$have_alilog_notification])
   fi
 
@@ -252,9 +271,32 @@ if test ! "x$have_aliroot" = "xno" ; then
     ALIROOT_LIBS=
   fi
 
+  dnl
+  dnl ESD supports non-std content
+  dnl
+  have_esd_nonstd=no
+  AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <AliESDEvent.h>
+                                  #include <AliExternalTrackParam.h>
+                                  #include <TTree.h>
+                                  #include <TClonesArray.h>],
+                                 [AliESDEvent esd;
+                                  esd.CreateStdContent();
+                                  TTree* tree=new TTree("esdTree", "Tree with HLT ESD objects");
+                                  TClonesArray* a=new TClonesArray("AliExternalTrackParam");
+                                  a->SetName("SomeObject");
+                                  esd.AddObject(a);
+                                  esd.WriteToTree(tree);
+                                  if (!tree->FindBranch("SomeObject")) return 1;
+                                  return 0;])],
+                 [have_esd_nonstd=yes], 
+                [AC_DEFINE(HAVE_NOT_ESD_NONSTD)])
+  AC_MSG_CHECKING(whether ESD supports non standard content)
+  AC_MSG_RESULT([$have_esd_nonstd])
+
   dnl
   dnl ESD copy function added May 9 2008 rev 25667
   dnl
+  if test "x$have_esd_nonstd" != "xyes"; then
   have_esd_copy=no
   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliESDEvent.h>],
                                  [AliESDEvent esd1;
@@ -264,74 +306,57 @@ if test ! "x$have_aliroot" = "xno" ; then
                 [AC_DEFINE(HAVE_NOT_ESD_COPY)])
   AC_MSG_CHECKING(for ESD assignment operator)
   AC_MSG_RESULT([$have_esd_copy])
+  fi
 
   dnl
-  dnl required header files and libraries for modules
+  dnl AliRawReaderMemory support for multiple buffers added
+  dnl revision 26829 Jun 2008
   dnl
-  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
-    # from May 07 TPCbase depends on libGui.so
-    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
-    have_alitpc=yes
-    AC_MSG_CHECKING(for required classes in TPC libraries)
-    if test ! "x$have_alitpc" = "xno" ; then
-      ALITPC_LIBS="-lGui -lTPCbase -lTPCrec"
-      LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_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)], 
-                                     [have_alitpc=no
-                                      ALITPC_LIBS= ])
-    fi
-    AC_MSG_RESULT([$have_alitpc])
-
-    have_tpc_load_clusters=no
-    AC_MSG_CHECKING(for on-line features of TPC offline tracker)
-      ALITPC_LIBS="-lGui -lTPCbase -lTPCrec"
-      LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliTPCtrackerMI.h>
-                                      #include <TObjArray.h>], 
-                                      [AliTPCtrackerMI tracker;
-                                      TObjArray* array=NULL;
-                                      tracker.LoadClusters(array);])],
-                                      [have_tpc_load_clusters=yes], 
-                                     [AC_DEFINE(HAVE_NOT_TPC_LOAD_CLUSTERS)])
-    AC_MSG_RESULT([$have_tpc_load_clusters])
+  CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/RAW"
+  have_rawreadermemory_multbuffers=no
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>],
+                                 [AliRawReaderMemory rr;
+                                  rr.AddBuffer(NULL, 0, 0);])],
+                 [have_rawreadermemory_multbuffers=yes], 
+                [AC_DEFINE(HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER)])
+  AC_MSG_CHECKING(AliRawReaderMemory support for multiple buffers)
+  AC_MSG_RESULT([$have_rawreadermemory_multbuffers])
 
-  fi
-  AC_CHECK_HEADERS([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)])
-  AC_CHECK_HEADERS([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)])
+  dnl
+  dnl Changes in the magnetic field implementation
+  dnl revision 30848 Feb 1 2009
+  dnl
+  CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/STEER"
+  have_alimagf30848=no
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMagF.h>],
+                                 [int test=AliMagF::k5kG;])],
+                 [have_alimagf30848=yes], 
+                [AC_DEFINE(HAVE_NOT_ALIMAGF30848)])
+  AC_MSG_CHECKING(AliMagF contains field definitions)
+  AC_MSG_RESULT([$have_alimagf30848])
 
-  have_tpc_mapping=no
-  if test ! "x$have_aliroot" = "xno" ; then
-    # 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])
-    TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
-    AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], 
-                  [have_tpc_mapping=yes
-                   AC_SUBST(TPC_PAD_MAPPING_PATH)
-                   AC_DEFINE(HAVE_TPC_MAPPING)],
-                  [])
-    
-  fi
-  AC_MSG_CHECKING([for TPC mapping layout])
-  AC_MSG_RESULT([$have_tpc_mapping])
+  dnl
+  dnl Cleanup of the RunLoader implementation
+  dnl revision 30859 Feb 2 2009
+  dnl
+  CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/STEER"
+  have_alirunloader30859=no
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRunLoader.h>],
+                                 [AliRunLoader* rl=AliRunLoader::Instance();])],
+                 [have_alirunloader30859=yes], 
+                [AC_DEFINE(HAVE_NOT_ALIRUNLOADER30859)])
+  AC_MSG_CHECKING(AliRunLoader::Instance)
+  AC_MSG_RESULT([$have_alirunloader30859])
+
+  have_aliqav1=no
+  AC_CHECK_HEADER([AliQAv1.h], [have_aliqav1=yes], [])
+  AM_CONDITIONAL(EN_HLT_QA, test x$have_aliqav1 = xyes)
+  AC_CHECK_HEADER([AliESDHLTDecision.h], [], [AC_DEFINE(HAVE_NOT_ALIESDHLTDECISION)])
+  AC_CHECK_HEADER([AliVCluster.h], [], [AC_DEFINE(HAVE_NOT_ALIVCLUSTER)])
+
+  dnl
+  dnl required header files and libraries for modules
+  dnl
 
   dnl
   dnl Check for the interface of AliExternalTrackParam which has been changed
@@ -347,6 +372,22 @@ if test ! "x$have_aliroot" = "xno" ; then
   AC_MSG_CHECKING(for version of AliExternalTrackParam)
   AC_MSG_RESULT($externaltrackparam_version)
 
+  dnl The AliShuttleInterface was changed in rev 29388. Some return types
+  dnl had been const, now changed according to gcc 4.3 warnings 
+  AC_MSG_CHECKING(for version of AliShuttleInterface.h)
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/"
+    LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
+    LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliShuttleInterface.h>],
+                                    [class dummy : public AliShuttleInterface {
+                                    public:
+                                      const UInt_t GetStartTimeDCSQuery() {;}
+                                     };])],
+                                    [AC_DEFINE(SHUTTLE_PRE_REV29388_INTERFACE)
+                                    alishuttleinterface_version=pre.rev.29388],
+                                   [alishuttleinterface_version=up.to.date])
+  AC_MSG_RESULT([$alishuttleinterface_version])
+
   CPPFLAGS=$save_CPPFLAGS
   LDFLAGS=$save_LDFLAGS
   LIBS=$save_LIBS
@@ -358,6 +399,8 @@ AC_SUBST([ALIROOT_CPPFLAGS])
 AC_SUBST([ALIROOT_LDFLAGS])
 AC_SUBST([ALIROOTBINDIR])
 AC_SUBST([ALIROOTLIBDIR])
+
+ALIROOT_LIBS="$ALIROOT_LIBS $ADD_ROOTLIBS"
 AC_SUBST([ALIROOT_LIBS])
 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
 
@@ -502,6 +545,46 @@ if test "x$enable_strict" = "xyes" ; then
 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])
@@ -523,41 +606,46 @@ AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
 AC_MSG_RESULT([$enable_sample])
 
 dnl ------------------------------------------------------------------
-AC_MSG_CHECKING([whether to compile util library])
 AH_TEMPLATE([HLT_UTIL],[HLT utility library])
-AC_ARG_ENABLE(util,
-  [AC_HELP_STRING([--disable-util],
-      [compile the util library ])],
-  [],
-  [if test "x$have_aliroot" = "xno" ; then
-     enable_util="no...requires.AliRoot"
-   else
-     enable_util=yes
-   fi
-  ])
+ALIUTIL_LIBS=
+CHECK_HLTMODULE([util],
+               [], 
+               [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/STEER -I$ALICE_ROOT/RAW -I$ALICE_ROOT/PYTHIA6 -I$ALICE_ROOT/ANALYSIS],
+               [ANALYSIS ANALYSISalice], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
+               [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
 
+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_RESULT([$enable_util])
+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],
                [AliTPCRawStream.h], 
                [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/TPC],
-               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
-               [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [Gui ANALYSIS STAT], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
+               [TPCbase TPCrec TPCcalib], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
                [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
 
 if test "x$enable_module" = "xmissheader"; then
   enable_module="no...missing.headers"
-  enable_tpc="no...missing.headers"
-elif test "x$have_alitpc" = "xno" ; then
-  enable_module="no...requires.AliRoot.TPC.libraries"
-  enable_tpc="no...requires.AliRoot.TPC.libraries"
+  enable_tpc=$enable_module
 elif test "x$enable_module" = "xforce"; then
   enable_tpc="yes"
 else
@@ -565,7 +653,64 @@ else
 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
+
+
+  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 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])
+    TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
+    AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], 
+                  [have_tpc_mapping=yes
+                   AC_SUBST(TPC_PAD_MAPPING_PATH)
+                   AC_DEFINE(HAVE_TPC_MAPPING)],
+                  [])
+    
+  fi
+  AC_MSG_CHECKING([for TPC mapping layout])
+  AC_MSG_RESULT([$have_tpc_mapping])
+  AC_LANG_POP(C++)
+
 else
   enable_module=$enable_tpc
 fi
@@ -586,17 +731,11 @@ CHECK_HLTMODULE([rcu],
 
 if test "x$enable_module" = "xmissheader"; then
   enable_module="no...missing.headers"
-  enable_rcu="no...missing.headers"
-elif test "x$have_alircu" = "xno" ; then
-  enable_module="no...requires.AliRoot.RAW.libraries"
-  enable_rcu="no...requires.AliRoot.RAW.libraries"
+  enable_rcu=$enable_module
 elif test "x$enable_module" = "xforce"; then
   enable_rcu="yes"
 else
   AC_LANG_PUSH(C++)
-  save_CPPFLAGS=$CPPFLAGS
-  save_LDFLAGS=$LDFLAGS
-  save_LIBS=$LIBS
   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
@@ -622,6 +761,68 @@ 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])
+  
+ALICALO_LIBS=
+CHECK_HLTMODULE([calo],
+               [], [$ALIROOT_CPPFLAGS],
+               [RAWDatasim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
+               [EMCALUtils PHOSUtils PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+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
+  have_alicalorawstream=no
+  if test ! "x$have_aliroot" = "xno" ; then
+    AC_LANG_PUSH(C++)
+    save_CPPFLAGS="$CPPFLAGS"
+    # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
+    #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/PHOS"
+    AC_MSG_CHECKING([for AliCaloRawStream.h usability])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
+                                       #include <AliCaloRawStream.h>], 
+                                       [int i])],
+                                       [AC_DEFINE(HAVE_ALICALORAWSTREAM)
+                                       have_alicalorawstream=yes], 
+                                      [])
+    AC_MSG_RESULT([$have_alicalorawstream])
+
+    have_aliesdcalocluster_r38477=no
+    AC_MSG_CHECKING([for AliESDCaloCluster r38477])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliESDCaloCluster.h>], 
+                                       [AliESDCaloCluster cluster;
+                                       cluster.SetTrackDistance(0.0, 0.0)]);],
+                                       [have_aliesdcalocluster_r38477=yes],
+                                        [AC_DEFINE(HAVE_NOT_ALIESDCALOCLUSTER_r38477)])
+    AC_MSG_RESULT([$have_aliesdcalocluster_r38477])
+
+    AC_LANG_POP(C++)
+    CPPFLAGS="$save_CPPFLAGS"
+  fi
+  if test "x$have_alicalorawstream" != "xyes"; then
+    enable_calo="no...requires.AliRoot>v4-05-07"
+  else
+    enable_calo=$enable_module
+  fi
+fi
+
+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 ------------------------------------------------------------------
 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
   
@@ -629,12 +830,12 @@ ALIPHOS_LIBS=
 CHECK_HLTMODULE([phos],
                [], [$ALIROOT_CPPFLAGS],
                [RAWDatasim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
-               [PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [PHOSUtils PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
                [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
 
 if test "x$enable_module" = "xmissheader"; then
   enable_module="no...requires.AliRoot>v4-05-07"
-  enable_phos="no...requires.AliRoot>v4-05-07"
+  enable_phos=$enable_module
 elif test "x$enable_module" = "xforce"; then
   enable_phos="yes"
 else
@@ -644,7 +845,7 @@ else
     save_CPPFLAGS="$CPPFLAGS"
     # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
     #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
-    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/PHOS"
     AC_MSG_CHECKING([for AliCaloRawStream.h usability])
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
                                        #include <AliCaloRawStream.h>], 
@@ -653,6 +854,24 @@ else
                                        have_alicalorawstream=yes], 
                                       [])
     AC_MSG_RESULT([$have_alicalorawstream])
+    have_aliphosrecoparamemc=no
+    AC_MSG_CHECKING([for required EMC functionality in AliPHOSRecoParam.h ])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliPHOSRecoParam.h>], 
+                                       [AliPHOSRecoParam param;
+                                       param.GetEMCClusteringThreshold()])],
+                                       [have_aliphosrecoparamemc=yes], 
+                                      [AC_DEFINE(HAVE_NOT_PHOSRECOPARAMEMC)])
+    AC_MSG_RESULT([$have_aliphosrecoparamemc])
+
+    have_aliphosreconstructor_r44091=no
+    AC_MSG_CHECKING([for AliPHOSReconstructor r44091 ])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliPHOSReconstructor.h>], 
+                                       [float e=0.0;
+                                       AliPHOSReconstructor::CorrectNonlinearity(e)])],
+                                       [have_aliphosreconstructor_r44091=yes], 
+                                      [AC_DEFINE(HAVE_NOT_ALIPHOSRECONSTRUCTOR_r44091)])
+    AC_MSG_RESULT([$have_aliphosreconstructor_r44091])
+
     AC_LANG_POP(C++)
     CPPFLAGS="$save_CPPFLAGS"
   fi
@@ -674,6 +893,36 @@ 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],
+               [], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/VZERO],
+               [RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [EMCALrec EMCALsim EMCALbase EMCALUtils VZERObase], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+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])
   
@@ -681,12 +930,12 @@ ALITRD_LIBS=
 CHECK_HLTMODULE([trd],
                [], [],
                [MLP XMLParser], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
-               [TRDbase TRDrec TRDsim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [STAT TRDbase TRDrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
                [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
 
 if test "x$enable_module" = "xmissheader"; then
   enable_module="no...requires.AliRoot>v4-07-Release"
-  enable_trd="no...requires.AliRoot>v4-07-Release"
+  enable_trd=$enable_module
 elif test "x$enable_module" = "xforce"; then
   enable_trd="yes"
 else
@@ -697,13 +946,54 @@ else
     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/TRD"
     # AliTRDclusterizer::SetRawVersion() requires >v4-07-Release
     # changed to AliTRDrecoParam::SetSeedingOn() due to revision 26327, Mon Jun 2 2008
-    AC_MSG_CHECKING([for required functions in AliTRDrecoParam])
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDrecoParam.h>], 
-                                       [AliTRDrecoParam p;
-                                      p.SetSeeding(0)])],
+    # changed to AliTRDReconstructor::SetStreamLevel() due to revision 27797, Tue Aug 5 2008
+    # changed to AliTRDReconstructor::SetClusters() according to revision 28069, Mon Aug 18 2008
+    # changed to AliTRDCluster according to revision 30461, Thu Dec 18 2008
+    # changed to AliTRDclusterizer::GetAddedClusters according to revision 31299, Wed Mar 4 2009
+    # changed to AliTRDclusterizer::GetNTimeBins according to revision 37102 Sun Nov 22 2009
+    AC_MSG_CHECKING([for required functions in AliTRDclusterizer])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDclusterizer.h>], 
+                                       [AliTRDclusterizer c;
+                                      c.GetNTimeBins()])],
                                        [], 
-                                      [enable_trd="no...requires.AliRoot>v4-13-Release"])
+                                      [enable_trd="no...requires.AliRoot>v4-18-Release"])
     AC_MSG_RESULT([$enable_trd])       
+
+    if test "x$enable_trd" = "xyes" ; then
+      have_alitrdseedv1_r39693=no
+      AC_MSG_CHECKING([checking for AliTRDseedV1 r39693])
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDseedV1.h>], 
+                                         [AliTRDseedV1 seed;
+                                         seed.SetC(0.0, 1)]);],
+                                         [have_alitrdseedv1_r39693=yes],
+                                        [AC_DEFINE(HAVE_NOT_ALITRD_SEEDV1_r39693)])
+      AC_MSG_RESULT([$have_alitrdseedv1_r39693])
+
+      have_alitrdrawstream_r39608=no
+      AC_MSG_CHECKING([checking for AliTRDrawStream r39608])
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDrawStreamBase.h>], 
+                                         [AliTRDrawStreamBase::SetRawStreamVersion(AliTRDrawStreamBase::kTRDdefaultStream)]);],
+                                         [have_alitrdrawstream_r39608=yes],
+                                         [AC_DEFINE(HAVE_NOT_ALITRD_RAWSTREAM_r39608)])
+      AC_MSG_RESULT([$have_alitrdrawstream_r39608])
+
+      have_alitrdrecoparam_r41621=no
+      AC_MSG_CHECKING([checking for AliTRDrecoParam r41621])
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDrecoParam.h>], 
+                                         [AliTRDrecoParam::GetLowFluxHLTParam()]);],
+                                         [have_alitrdrecoparam_r41621=yes],
+                                         [AC_DEFINE(HAVE_NOT_ALITRD_RECOPARAM_r41621)])
+      AC_MSG_RESULT([$have_alitrdrecoparam_r41621])
+
+      have_alitrdclusterizer_r42837=no
+      AC_MSG_CHECKING([checking for AliTRDclusterizer r42837])
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDclusterizer.h>], 
+                                         [AliTRDclusterizer o; o.SetSkipTransform()]);],
+                                         [have_alitrdclusterizer_r42837=yes],
+                                         [AC_DEFINE(HAVE_NOT_ALITRD_CLUSTERIZER_r42837)])
+      AC_MSG_RESULT([$have_alitrdclusterizer_r42837])
+    fi
+
     AC_LANG_POP(C++)
     CPPFLAGS="$save_CPPFLAGS"
   fi
@@ -720,6 +1010,90 @@ 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],
+               [], [],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [FMDbase FMDrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+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],
+               [], [$ALIROOT_CPPFLAGS],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [ZDCbase ZDCrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+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
+
+  if test "x$enable_zdc" = "xyes" ; then
+    AC_LANG_PUSH(C++)
+    save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/ZDC"
+
+
+    # AliZDCReconstructor::GetZDCESDData() is needed, requires revision 43770, Wed Sep 22 2010
+    have_alizdcreconstructor_r43770=no
+    AC_MSG_CHECKING([checking for  AliZDCReconstructor::GetZDCESDData() r43770])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliZDCReconstructor.h>], 
+                                       [AliZDCReconstructor rec;
+                                       rec.GetZDCESDData()])],
+                                       [have_alizdcreconstructor_r43770=yes], 
+                                      [AC_DEFINE(HAVE_NOT_ALIZDCRECONSTRUCTOR_r43770)])
+    if test "x$have_alizdcreconstructor_r43770"        != "xyes"; then
+       enable_zdc="no...requires.r43770"
+    fi
+    AC_MSG_RESULT([$have_alizdcreconstructor_r43770])       
+
+    AC_LANG_POP(C++)
+    CPPFLAGS="$save_CPPFLAGS"
+  fi
+
+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])
 
@@ -733,7 +1107,7 @@ CHECK_HLTMODULE([dimuon],
 
 if test "x$enable_module" = "xmissheader"; then
   enable_module="no...requires.AliRoot>=v4-08-Release"
-  enable_muon="no...requires.AliRoot>=v4-08-Release"
+  enable_muon=$enable_module
 elif test "x$enable_module" = "xforce"; then
   enable_muon="yes"
 else
@@ -743,6 +1117,46 @@ fi
 if test "x$enable_muon" = "xyes" ; then 
   AC_DEFINE(HLT_MUON)
   ALIMUON_LIBS=$ALIHLTMODULE_LIBS
+  AC_LANG_PUSH(C++)
+  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++)
 else
   enable_module=$enable_muon
 fi
@@ -763,7 +1177,7 @@ CHECK_HLTMODULE([trigger],
 
 if test "x$enable_module" = "xmissheader"; then
   enable_module="no...header.missing"
-  enable_trigger="no...header.missing"
+  enable_trigger=$enable_module
 elif test "x$enable_module" = "xforce"; then
   enable_trigger="yes"
 else
@@ -782,10 +1196,111 @@ AC_MSG_RESULT([$enable_module])
 AC_SUBST([ALITRIGGER_LIBS])
 
 dnl ------------------------------------------------------------------
-AH_TEMPLATE([HLT_ITS],[hlt its library])
+AH_TEMPLATE([HLT_GLOBAL],[hlt global library])
 
-ALIITS_LIBS=
-CHECK_HLTMODULE([its],
+ALIGLOBAL_LIBS=
+CHECK_HLTMODULE([global],
+               [], [$ALIROOT_CPPFLAGS],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [PHOSUtils ], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+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
+  if test "x$enable_global" = "xyes" ; then
+    AC_LANG_PUSH(C++)
+    save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
+    AC_MSG_CHECKING([for required functions in AliESDtrack])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliESDtrack.h>], 
+                                       [AliESDtrack t;
+                                      t.SetGlobalChi2(0)])],
+                                       [], 
+                                      [enable_global="no...requires.AliRoot>v4-17-Release"])
+    AC_MSG_RESULT([$enable_global])       
+    AC_LANG_POP(C++)
+    CPPFLAGS="$save_CPPFLAGS"
+  fi
+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],
+       [$ALIFASTJET_HEADER], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/JETAN $ALIFASTJET_INCFLAGS],
+       [$ALIFASTJET_LIBS], [-L$ROOTLIBDIR $ALIFASTJET_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS],
+       [AOD ESD ANALYSIS ANALYSISalice JETAN], 
+       [-L$ROOTLIBDIR $ALIROOT_LDFLAGS $ALIFASTJET_LDFLAGS -L$ALICE_ROOT/lib/tgt_$ALICE_TARGET],
+       [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+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
+  AC_MSG_CHECKING([compilation with FASTJET package])
+  AC_MSG_RESULT($with_fastjet)
+
+else
+  enable_module=$enable_jet
+fi
+
+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 ------------------------------------------------------------------
+AH_TEMPLATE([HLT_VZERO],[hlt vzero library])
+
+ALIVZERO_LIBS=
+CHECK_HLTMODULE([vzero],
                [], [$ALIROOT_CPPFLAGS],
                [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
                [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
@@ -793,7 +1308,55 @@ CHECK_HLTMODULE([its],
 
 if test "x$enable_module" = "xmissheader"; then
   enable_module="no...header.missing"
-  enable_its="no...header.missing"
+  enable_vzero=$enable_module
+elif test "x$enable_module" = "xforce"; then
+  enable_vzero="yes"
+else
+  enable_vzero=$enable_module
+
+  if test "x$enable_vzero" = "xyes" ; then
+    AC_LANG_PUSH(C++)
+    save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/VZERO"
+
+    # AliVZEROReconstructor::GetESDVZERO() is needed, requires revision 43718, Tue Sep 21 2010
+    AC_MSG_CHECKING([checking for AliVZEROReconstructor::GetESDVZERO() r43718])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliVZEROReconstructor.h>], 
+                                       [AliVZEROReconstructor rec;
+                                       rec.GetESDVZERO()])],
+                                       [], 
+                                      [enable_vzero="no...requires.r43718"])
+    AC_MSG_RESULT([$enable_vzero])       
+
+    AC_LANG_POP(C++)
+    CPPFLAGS="$save_CPPFLAGS"
+  fi
+fi
+
+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 ------------------------------------------------------------------
+AH_TEMPLATE([HLT_ITS],[hlt its library])
+
+ALIITS_LIBS=
+CHECK_HLTMODULE([its],
+               [AliITSCompressRawDataSDD.h], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS],
+               [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [ITSbase ITSrec ITSsim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+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
@@ -839,7 +1402,7 @@ CHECK_HLTMODULE([comp],
 
 if test "x$enable_module" = "xmissheader"; then
   enable_module="no...header.missing"
-  enable_comp="no...header.missing"
+  enable_comp=$enable_module
 elif test "x$enable_module" = "xforce"; then
   enable_comp="yes"
 else
@@ -917,7 +1480,6 @@ 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])],
@@ -929,6 +1491,31 @@ 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])
 
@@ -950,8 +1537,10 @@ AC_CONFIG_FILES([Makefile
                 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])
@@ -964,7 +1553,11 @@ 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
@@ -989,20 +1582,42 @@ if test "x$enable_tpc" = "xyes"; then
   AC_CONFIG_FILES([TPCLib/Makefile           
                   TPCLib/test/Makefile       
                   TPCLib/mapping2array.cxx     
-                  TPCLib/OnlineDisplay/Makefile
+                  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])
@@ -1015,7 +1630,23 @@ fi
 
 AC_MSG_NOTICE([compile trigger library: $enable_trigger])
 if test "x$enable_trigger" = "xyes"; then 
-  AC_CONFIG_FILES([trigger/Makefile])
+  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])