]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/configure.ac
- added libPHOSshuttle to PHOS libraries
[u/mrichter/AliRoot.git] / HLT / configure.ac
index 1732e69e82675579c11d47f28b38d2709e10b6a6..7e603eafda1e8ad786c722f337b520e6f048a9f2 100644 (file)
@@ -5,7 +5,20 @@ dnl template for the configuration script for the Alice HLT
 dnl framework and components
 dnl 
 dnl ------------------------------------------------------------------
-AC_INIT([Alice High Level Trigger] , [0.4-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] , 
+       m4_esyscmd([url=`svn info 2> /dev/null | grep "URL:" | cut -d: -f3 | sed -e 's|[/]*HLT[/]*$||' | sed -e 's|^[/]*||g' | cut -d '/' -f 4`; \
+                   revision=`svn info 2> /dev/null | grep "Revision:" | cut -d ' ' -f 2 | cut -d '/' -f 4`; \
+                   if test "x$url" != "x"; then echo -n $url; \
+                   elif test "x$revision" != "x"; then echo -n $revision ; \
+                   elif test -e .revision && test x`cat .revision` != x; then \
+                      cat .revision; \
+                   else \
+                      echo -n invalid-version; \
+                   fi]),
+       [Matthias.Richter@ift.uib.no], 
+       [alice-hlt])
 
 dnl ------------------------------------------------------------------
 dnl the package from CVS contains the old Makefiles as well. In order to
@@ -26,6 +39,13 @@ AC_PROG_LIBTOOL
 
 AC_DEBUG
 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 +53,47 @@ 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)
+  ROOT_CHECKLIBS='Geom Minuit EG VMC TreePlayer XMLIO Thread Proof ProofPlayer'
+  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_HEADERS([TBufferFile.h])
+
+  # 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])
+
+  CPPFLAGS=$save_CPPFLAGS
+  LDFLAGS=$save_LDFLAGS
+  LIBS=$save_LIBS
+  AC_LANG_POP(C++)
+fi
 
 dnl ------------------------------------------------------------------
 # TODO: make this configurable through arguments
@@ -44,114 +105,167 @@ 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
 AC_LANG_PUSH(C++)
-AC_MSG_CHECKING([for AliRoot])
 have_aliroot=no
-with_aliroot=yes
-if test "x$with_aliroot" = "xyes" || test "x$with_aliroot" = "x" ; then
+AC_ARG_WITH(aliroot,[  --with-aliroot  top of the AliRoot installation],
+                   [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
+                   [])
+
+if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
+  dnl ------------------------------------------------------------------
+  dnl Try to estimate the system architecture
+  case $host_os:$host_cpu in
+  linux*:x86_64*)      alice_target='linuxx8664gcc'            ;;
+  linux*)              alice_target='linux'                    ;;
+  *)                   alice_target='unknown'                  ;;
+  esac
+  if test "x$alice_target" = "xunknown" ; then
+    if test -z $ALICE_TARGET ; then
+    AC_MSG_ERROR([Can not estimate system architecture.
+    To avoid the problem, set the ALICE_TARGET variable appropriately.
+    Please send the following information to Matthias.Richter@ift.uib.no:
+       ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
+    else
+    AC_MSG_NOTICE([Unknown system architecture.
+    Please send the following information to Matthias.Richter@ift.uib.no:
+       ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])  
+    fi
+  else
+    if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
+    AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
+    overriding $ALICE_TARGET by $alice_target])
+    fi
+    ALICE_TARGET=$alice_target
+  fi
+  ALIROOTBINDIR=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}
   ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
   ALIROOTINCDIR=${ALICE_ROOT}/include
-elif test "x$with_aliroot" != "xno" ; then
-  # TODO: think about the tgt_* subfolder
-  ALICE_ROOT="$with_aliroot"
-  ALIROOTLIBDIR="$ALICE_ROOT/lib"
-  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 -lSTEER"
+  ALIROOT_LIBS="-lESD $ADD_ROOTLIBS"
   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"
+  
   # check for certain AliRoot libraries/files/features
+  # libSTEERBase present since Aug 7 2007
+  LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
+  CHECKLIB=STEERBase
+  AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
+
+  LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
+  CHECKLIB=AOD
+  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"
+               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);])],
+                                     [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])
+
+  # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
+  LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lSTEER"
+  CHECKLIB=CDB
+  AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
+
+  LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
+  CHECKLIB=STEER
+  AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"],[have_aliroot=no])
+
+  dnl
+  dnl check whether AliLog supports notification callback
+  dnl
+  LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
+  have_alilog_notification=no
   if test ! "x$have_aliroot" = "xno" ; then
-    # the RAWReader classe are needed by the TPCLib/AliHLTTPCDigitReaderPacket
-    # and by the STEER library. From version v4-04-Rev-07 on the RawReader classes
-    # are in libRAWDatarec, before in libRAWData
-    have_alirawdata=yes
-    AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
-    if test ! "x$have_alirawdata" = "xno" ; then
-      CHECKLIB="-lRAWDatarec"
-      LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lRAWDatabase $CHECKLIB"
-      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 -lRAWDatabase $CHECKLIB"
-                                      have_alirawdata=$CHECKLIB], 
-                                     [have_alirawdata=no])
-      # second pass with -RAWData
-      if test "x$have_alirawdata" = "xno" ; then
-        CHECKLIB="-lRAWData"
-        LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB"
-        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])
-      fi
-    fi
-    AC_MSG_RESULT($have_alirawdata)
+  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)])
+  AC_MSG_RESULT([$have_alilog_notification])
   fi
 
-  have_alisteer=yes
-  #AC_CHECK_HEADERS([AliRun.h],[have_alisteer=yes])
-  AC_MSG_CHECKING(for AliRun in -lSTEER)
-  if test "x$have_alisteer" = "xyes" ; then
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRun.h>], [AliRun aliroot])],
-                                    [AC_DEFINE(HAVE_ALISTEER)], 
-                                   [have_alisteer=no
-                                    have_aliroot=no])
+  if test "x$have_aliroot" = "xno" ; then
+    # 2007-08-18 dont reset ALIROOT_CPPFLAGS in order to allow compilation
+    # but library dependencies might not be resolved completely
+    #ALIROOT_CPPFLAGS=
+    AC_MSG_WARN([some of the AliRoot library dependencies are not resolved.
+    This can happen from time to time due to development in AliRoot. You can
+    force compilation of detector libs by --enable-<detector>, but be aware
+    of unresolved references at runtime.])
+    AC_MSG_WARN([       ------------------------------------------ ])
+    AC_MSG_WARN([       Report this to $PACKAGE_BUGREPORT ])
+    AC_MSG_WARN([       please include config.log                  ])
+    AC_MSG_WARN([       ------------------------------------------ ])
+    ALIROOT_LDFLAGS=
+    ALIROOT_LIBS=
   fi
-  AC_MSG_RESULT($have_alisteer)
 
+  dnl
+  dnl required header files and libraries for modules
+  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
-    saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
-    ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
-    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
+    # 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
-      save_ALIROOT_LIBS=$ALIROOT_LIBS
-      ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
-      LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
+      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>
@@ -166,28 +280,18 @@ if test ! "x$have_aliroot" = "xno" ; then
                                       AliTPCClustersArray clustarray;
                                       AliTPCcluster clust;
                                       AliTPCClustersRow row])],
-                                      [AC_DEFINE(HAVE_ALITPC)
-                                      saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
-                                      saveALIROOT_LIBS=$ALIROOT_LIBS], 
+                                      [AC_DEFINE(HAVE_ALITPC)], 
                                      [have_alitpc=no
-                                      ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
-                                      ALIROOT_LIBS=$saveALIROOT_LIBS])
+                                      ALITPC_LIBS= ])
     fi
     AC_MSG_RESULT($have_alitpc)
   fi
-
-  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_HEADERS([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)])
+  AC_CHECK_HEADERS([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)])
 
   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])
@@ -200,35 +304,174 @@ 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])
-  
-  if test "x$have_aliroot" = "xno" ; then
-    ALIROOT_CPPFLAGS=
-    ALIROOT_LDFLAGS=
-    ALIROOT_LIBS=
-  fi
+
+  dnl
+  dnl Check for the interface of AliExternalTrackParam which has been changed
+  dnl in revision 1.17 of AliExternalTrackParam.h (AliRoot version v4-05-04
+  dnl or higher)
+  externaltrackparam_version=1
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliExternalTrackParam.h>], 
+                                  [AliExternalTrackParam trackparam;
+                                  Double_t param[[5]]; Double_t covar[[15]];
+                                  trackparam.Set(0., 0., param, covar);])],
+                                  [externaltrackparam_version=2],
+                                 [AC_DEFINE(EXTERNALTRACKPARAM_V1)])
+  AC_MSG_CHECKING(for version of AliExternalTrackParam)
+  AC_MSG_RESULT($externaltrackparam_version)
+
   CPPFLAGS=$save_CPPFLAGS
   LDFLAGS=$save_LDFLAGS
   LIBS=$save_LIBS
-  if test ! "x$have_aliroot" = "xno" ; then
-    CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
-  fi
-fi
+fi # if test ! "x$have_aliroot" = "xno"
+
 AC_LANG_POP(C++)
+AC_SUBST([ALICE_ROOT])
 AC_SUBST([ALIROOT_CPPFLAGS])
 AC_SUBST([ALIROOT_LDFLAGS])
+AC_SUBST([ALIROOTBINDIR])
+AC_SUBST([ALIROOTLIBDIR])
 AC_SUBST([ALIROOT_LIBS])
-CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
+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 ------------------------------------------------------------------
+dnl check for the HLT PubSub Framework
+dnl namely for the existence of the HOMER library
+dnl from Sep 2007, the HOMER lib has been incorporated into the alice-hlt
+dnl package. It os though possible to choose an external. library
+dnl In order to make the origni of the HOMER lib clear, the one in AliRoot
+dnl got the name libAliHLTHOMER
+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
+fi
+AC_MSG_RESULT([$with_pubsub])
+HOMER_VERSION=2
+HOMER_LIBS=
+
+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
+    # the 'early' location of the include files with separated HOMER sub dirs
+    HOMER_INCDIRS="${with_pubsub}/include/HOMER ${with_pubsub}/include/HOMER/reader"
+  elif test -d ${with_pubsub}/include/Util/HOMER ; then
+    # location for HLT Framework versions after Sep 2006
+    HOMER_INCDIRS="${with_pubsub}/include/Util/HOMER"
+  elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
+    # fall back if include files were not installed (versions after Sep 06)
+    HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/include"
+  else
+    # fall back if include files were not installed (versions before Sep 06)
+    HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/reader/include ${with_pubsub}/src/Util/HOMER/data/include"
+  fi
+  HOMER_CPPFLAGS=`for i in ${HOMER_INCDIRS}; do echo -n "-I$i " ; done`
+
+  AC_ARG_ENABLE(pubsub-debug,
+    [AC_HELP_STRING([--disable-pubsub-debug],
+        [force the production version of the PubSub framework])],
+    [],[enable_pubsub_debug=yes])
+  homer_type="none"
+  HOMER_TARGET="`uname -s`-`uname -m`"
+  AC_MSG_CHECKING([for HLT PubSub Framework release type])
+  if test -d "${with_pubsub}/lib/${HOMER_TARGET}-release" ; then
+    homer_type="production"
+    HOMER_TARGET="${HOMER_TARGET}-release"
+  elif test "x$enable_pubsub_debug" = "xyes" && test -d "${with_pubsub}/lib/${HOMER_TARGET}-debug" ; then
+    homer_type="debug"
+    HOMER_TARGET="${HOMER_TARGET}-debug"
+  fi
+  AC_MSG_RESULT([${homer_type}])
+  HOMERREADER_HEADER=HOMERReader.h
+  HOMER_BINDIR="${with_pubsub}/bin/${HOMER_TARGET}"
+  HOMER_LIBDIR="${with_pubsub}/lib/${HOMER_TARGET}"
+  HOMER_LDFLAGS="-L${HOMER_LIBDIR}"
+  CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
+  LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
+  LIBS="$save_LIBS "
+  with_homer=no
+  AC_LANG_PUSH(C++)
+  AC_CHECK_HEADER([$HOMERREADER_HEADER],
+    [ AC_CHECK_LIB([HOMER],[_init],
+      [with_homer=yes
+       HOMER_LIBS="-lHOMER"],
+      [ AC_CHECK_LIB([HOMERReader],[_init],
+                     [with_homer=yes
+                     HOMER_LIBS="-lHOMERReader"])])
+      LIBS="$LIBS $HOMER_LIBS"
+      AC_MSG_CHECKING([version of HOMER library])
+      dnl The Homer library has no versioning, so we do our own
+      dnl version           description
+      dnl ----------------------------------------------------------------------
+      dnl   1          inintial version
+      dnl   2          GetBlockStatusFlags added to the interface
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
+                                      [HOMERReader reader("dummy", 0);
+                                      reader.GetBlockStatusFlags(0);])],
+                                      [],
+                                     [HOMER_VERSION=1])
+      AC_MSG_RESULT([$HOMER_VERSION])
+  ],
+  [HOMERREADER_HEADER=]) #AC_CHECK_HEADER([$HOMERREADER_HEADER])
+  AC_LANG_POP(C++)
+  HOMER_INBUILT_LIB=
+else
+dnl no pubsub version defined, check if the HOMER lib is available in AliRoot
+  topdir=`dirname $0`
+  HOMER_CPPFLAGS="-I`(cd $topdir; pwd)`/BASE/HOMER"
+  HOMERREADER_HEADER=AliHLTHOMERReader.h
+  HOMER_INBUILT_LIB=`pwd`/BASE/HOMER/libAliHLTHOMER.la
+  HOMER_BINDIR=
+  HOMER_LIBDIR=
+  HOMER_LDFLAGS=
+fi
+
+  if test "x$with_homer" = "xno" ; then
+    HOMER_CPPFLAGS=
+    HOMER_LDFLAGS=
+    HOMER_LIBS=
+  else
+    HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
+    AC_DEFINE(HAVE_HOMERREADER)
+  fi
+  CPPFLAGS="$save_CPPFLAGS"
+  LDFLAGS="$save_LDFLAGS"
+  LIBS="$save_LIBS"  
+
+AC_SUBST([HOMERREADER_HEADER])
+AC_SUBST([HOMER_INBUILT_LIB])
+AC_SUBST([HOMER_CPPFLAGS])
+AC_SUBST([HOMER_LDFLAGS])
+AC_SUBST([HOMER_LIBDIR])
+AC_SUBST([HOMER_BINDIR])
+AC_SUBST([HOMER_LIBS])
+
+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([--enable-strict],
-      [enable coding convention checks ])],
-  [],[enable_strict=no])
+  [AC_HELP_STRING([--disable-strict],
+      [disable coding convention checks ])],
+  [],[enable_strict=yes])
 if test "x$enable_strict" = "xyes" ; then
-   CPPFLAGS="$CPPFLAGS -Weffc++"
+   CPPFLAGS="$CPPFLAGS -W -Weffc++ -Wall"
 fi
 AC_MSG_RESULT([$enable_strict])
 
@@ -236,9 +479,16 @@ 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],
+  [AC_HELP_STRING([--disable-sample],
       [compile the sample library ])],
-  [],[enable_sample=yes])
+  [],
+  [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
@@ -246,49 +496,321 @@ AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
 AC_MSG_RESULT([$enable_sample])
 
 dnl ------------------------------------------------------------------
-AC_MSG_CHECKING([whether to compile tpc library])
+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
+  ])
+
+if test "x$enable_util" = "xyes" ; then 
+  AC_DEFINE(HLT_UTIL)
+fi
+AM_CONDITIONAL(EN_HLT_UTIL, test x$enable_util = xyes)
+AC_MSG_RESULT([$enable_util])
+
+dnl ------------------------------------------------------------------
 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"
+
+CHECK_HLTMODULE([tpc],
+               [AliTPCRawStream.h], 
+               [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/TPC],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [], [-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_tpc="no...requires.AliRoot.TPC.libraries"
+  enable_module="no...requires.AliRoot.TPC.libraries"
+  enable_tpc="no...requires.AliRoot.TPC.libraries"
+elif test "x$enable_module" = "xforce"; then
+  enable_tpc="yes"
+else
+  enable_tpc=$enable_module
 fi
+
 if test "x$enable_tpc" = "xyes" ; then 
   AC_DEFINE(HLT_TPC)
 fi
 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
-AC_MSG_RESULT([$enable_tpc])
+AC_MSG_CHECKING([whether to compile TPC library])
+AC_MSG_RESULT([$enable_module])
+AC_SUBST([ALITPC_LIBS])
 
 dnl ------------------------------------------------------------------
-if test "x$enable_tpc" = "xyes" ; then 
-  AC_MSG_CHECKING([whether to compile tpc reference library])
-  AH_TEMPLATE([HLT_TPCREF],[hlt tpc reference library])
-  AC_ARG_ENABLE(tpcref,
-    [AC_HELP_STRING([--enable-tpcref],
-        [compile the tpc reference library ])],
-    [],[enable_tpcref=no])
-  if test "x$enable_tpcref" = "xyes" ; then 
-    AC_DEFINE(HLT_TPCREF)
+AH_TEMPLATE([HLT_RCU],[hlt rcu library])
+
+CHECK_HLTMODULE([rcu],
+               [AliAltroDecoder.h], 
+               [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/RAW],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+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"
+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"
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliAltroDecoder.h>], 
+                                  [AliAltroDecoder decoder;
+                                 decoder.CopyBackward(NULL, 0);])],
+                                  [enable_rcu=$enable_module], 
+                                 [enable_module="no...requires.AliRoot>v4-10-Release"
+                                  enable_rcu="no...requires.AliRoot>v4-10-Release"])
+  CPPFLAGS=$save_CPPFLAGS
+  LDFLAGS=$save_LDFLAGS
+  LIBS=$save_LIBS
+  AC_LANG_POP(C++)
+fi
+
+if test "x$enable_rcu" = "xyes" ; then 
+  AC_DEFINE(HLT_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_PHOS],[hlt phos library])
+  
+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], 
+               [$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"
+elif test "x$enable_module" = "xforce"; then
+  enable_phos="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"
+    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])
+    AC_LANG_POP(C++)
+    CPPFLAGS="$save_CPPFLAGS"
+  fi
+  if test "x$have_alicalorawstream" != "xyes"; then
+    enable_phos="no...requires.AliRoot>v4-05-07"
+  else
+    enable_phos=$enable_module
+  fi
+fi
+
+if test "x$enable_phos" = "xyes" ; then 
+  AC_DEFINE(HLT_PHOS)
+  ALIPHOS_LIBS=$ALIHLTMODULE_LIBS
+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_TRD],[hlt trd library])
+  
+ALITRD_LIBS=
+CHECK_HLTMODULE([trd],
+               [], [],
+               [MLP], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [TRDbase TRDrec TRDsim], [-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"
+elif test "x$enable_module" = "xforce"; then
+  enable_trd="yes"
+else
+  enable_trd=$enable_module
+  if test "x$enable_trd" = "xyes" ; then
+    AC_LANG_PUSH(C++)
+    save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/TRD"
+    AC_MSG_CHECKING([for required functions in AliTRDclusterizer])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDclusterizer.h>], 
+                                       [AliTRDclusterizer c;
+                                      c.SetRawVersion(0)])],
+                                       [], 
+                                      [enable_trd="no...requires.AliRoot>v4-07-Release"])
+    AC_MSG_RESULT([$enable_trd])       
+    AC_LANG_POP(C++)
+    CPPFLAGS="$save_CPPFLAGS"
   fi
-  AC_MSG_RESULT([$enable_tpcref])
 fi
-AM_CONDITIONAL(EN_HLT_TPCREF, test x$enable_tpcref = xyes)
+
+if test "x$enable_trd" = "xyes" ; then 
+  AC_DEFINE(HLT_TRD)
+  ALITRD_LIBS=$ALIHLTMODULE_LIBS
+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_MUON],[hlt dimuon library])
+
+ALIMUON_LIBS=
+CHECK_HLTMODULE([dimuon],
+               [AliMpExMap.h AliMUONTriggerIO.h], 
+               [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/MUON -I$ALICE_ROOT/MUON/mapping],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...requires.AliRoot>=v4-08-Release"
+  enable_muon="no...requires.AliRoot>=v4-08-Release"
+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
+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 ------------------------------------------------------------------
-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)
+AH_TEMPLATE([HLT_TRIGGER],[hlt trigger library])
+
+ALITRIGGER_LIBS=
+CHECK_HLTMODULE([trigger],
+               [], [$ALIROOT_CPPFLAGS],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_trigger="no...header.missing"
+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
 fi
-AC_MSG_RESULT([$enable_logging])
+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_ITS],[hlt its library])
+
+ALIITS_LIBS=
+CHECK_HLTMODULE([its],
+               [], [$ALIROOT_CPPFLAGS],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_its="no...header.missing"
+elif test "x$enable_module" = "xforce"; then
+  enable_its="yes"
+else
+  enable_its=$enable_module
+fi
+
+if test "x$enable_its" = "xyes" ; then 
+  AC_DEFINE(HLT_ITS)
+  ALIITS_LIBS=$ALIHLTMODULE_LIBS
+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 ------------------------------------------------------------------
+AH_TEMPLATE([HLT_COMP],[hlt comp library])
+
+ALICOMP_LIBS=
+CHECK_HLTMODULE([comp],
+               [], [$ALIROOT_CPPFLAGS],
+               [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
+               [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
+
+if test "x$enable_module" = "xmissheader"; then
+  enable_module="no...header.missing"
+  enable_comp="no...header.missing"
+elif test "x$enable_module" = "xforce"; then
+  enable_comp="yes"
+else
+  enable_comp=$enable_module
+fi
+
+if test "x$enable_comp" = "xyes" ; then 
+  AC_DEFINE(HLT_COMP)
+  ALICOMP_LIBS=$ALIHLTMODULE_LIBS
+fi
+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 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
+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])
@@ -302,18 +824,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])
@@ -327,6 +837,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
@@ -335,26 +857,110 @@ 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_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 ------------------------------------------------------------------
+AC_MSG_NOTICE([---------------------------------------------- ])
+AC_MSG_NOTICE([                build summary                  ])
+AC_MSG_NOTICE([---------------------------------------------- ])
+
 AC_CONFIG_FILES([Makefile 
                 BASE/Makefile
-                SampleLib/Makefile
-                TPCLib/Makefile
-                TPCLib/mapping2array.cxx
-                TPCLib/Ref/Makefile
+                BASE/setenv.sh
+                BASE/setenv.csh
+                BASE/HOMER/Makefile
+                BASE/util/Makefile
+                BASE/interface/Makefile
+                BASE/test/Makefile
                 doc/Makefile
-                doc/doxygen.conf])
+                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     
+                  shuttle/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
+
+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/OnlineDisplay/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 TRD library: $enable_trd])
+if test "x$enable_trd" = "xyes"; then 
+  AC_CONFIG_FILES([TRD/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])
+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